A customer says they were charged twice and want a refund. I want two answers from the same message: is this a refund request, and which team should handle it? A chat model could write those answers into JSON. Bison-1 takes the questions and their allowed options as input and gives each option a score. The application can pick the winners without waiting for a reply to be written token by token.

Run this with CKE

Base Labs at Baseten built Bison-1 on Gemma 4 31B IT. That explains why much of the layer diagram will look familiar. The interesting changes are what the tokens can see and what the model returns at the end. In the Inkling article, we followed a token through reused layers. In the DaisyRose article, we followed what two kinds of layers remember between tokens. Here I want to follow one support ticket through two questions and see where the circuit keeps them separate.

What Bison keeps from Gemma 4, and what it changes

Base Labs describes Bison as a fine-tune of Gemma 4 31B IT. It retained the 60-layer dense text backbone, the 5,376-wide residual stream, the GeGLU feed-forward blocks, and the pattern of five sliding-attention layers followed by one full-attention layer. Base Labs tuned the language model on decision examples while freezing the vision encoder, norms, and embeddings. The release is a trained checkpoint, not a small adapter that CKE stacks onto the original weights.

There are two changes you can find in the released model config and readout config. First, the full layers use block-bidirectional visibility. Each question can use the shared prefix and its own block without reading the other question. Sliding layers remain causal. Second, the slot readout scores the options attached to each question instead of running a text decode loop. A slot can mean yes for one question and billing for another. The two decisions in the title are our example, not a two-head limit in the model.

Gemma 4 and Bison share the dense text backbone. Gemma uses causal full attention and vocabulary logits for generation; Bison uses block-bidirectional full attention and selected slot logits.
Compare Gemma 4 and Bison side by side. Open the backbone, attention and output blocks to see what each one does.
Gemma 4 31B IT and Bison-1: the text path.
PartGemma 4 31B ITBison-1
Decoder60 dense layers, width 5,376, GeGLU FFN width 21,504Same layer and projection geometry
AttentionFive causal sliding layers, then one causal full layerSame layer pattern and head sizes; full layers look both ways inside the allowed block
OutputScore the vocabulary for the next token; repeat for generationGather one answer row per question and score only the requested slots

Why do Gemma's weights still make a good starting point if the mask changes? The Q, K and V projections still take the same kinds of input and produce the same head shapes. The mask changes which key and value rows enter the attention sum. That changes the hidden states, so Base Labs post-trained the model for the new decision task. Compare the pinned Gemma config and Bison config. The Gemma and Bison weight indexes share 1,188 tensor names; Bison also lists lm_head.weight. Matching names show how much of the structure carries over. They don't say whether the numeric values stayed the same during training.

This is what made the CKE bring-up tractable. We could reuse Gemma-style numerical primitives such as RMSNorm, projections, and attention. We still had to describe the packed question boundaries, select the right attention geometry per layer, wire the residuals and slot readout, and check the BF16 providers. The full replay PR adds checked implementations or bindings for split-position RoPE, residual addition, GeGLU, scaling, and the BF16-row BLAS projection. It was more than loading a new set of weights.

1. The full text architecture: embeddings to option scores

Packed token IDs become embeddings, pass through all 60 transformer layers, and reach final RMSNorm and the option-scoring head.
Explore the full Bison text circuit. Open L00-L11, then pick L00 or L05 to see the complete block. Every numbered layer from L00 to L59 is available in its band.

Start at the embedding lookup: the packed input has T token IDs, and the lookup and input scale give us T × 5,376 hidden values. Each transformer layer reads and returns that same shape, even when its attention head dimensions change inside the block. After layer 59, final RMSNorm prepares the rows for the option-scoring head. This diagram covers the text path exercised in CKE.

Open L00 [Layer 00]: the whole transformer block

A complete Bison transformer block has RMSNorm and attention, a first residual addition, RMSNorm and a dense GeGLU FFN, a second residual addition, and a final learned scale.
Open the L00 transformer block. Both dashed paths carry an input around a branch. L05 has the same block structure with full GQA in place of sliding GQA.

2. Put both questions in the same forward pass

A common 59-token prefix branches to the refund and team questions. Both pass through a 60-layer backbone and produce two readout rows.
Explore the packed request. Select either question to see which positions it gets and how attention uses them.

Start with the actual CKE fixture. The rendered prefix includes the ticket and common prompt. The two suffixes contain the question, the option descriptions and the answer marker. In memory they sit side by side: [prefix | refund | team]. The prefix is computed once, and both questions can use it.

Zero-based row numbers for the 168-token CKE replay.
BlockTokensPhysical rowsLogical positions
Shared prefix590–580–58
Refund5459–11259–112
Team55113–16759–113

The last row of refund is physically next to the first row of team, but the team question starts again at rotary position 59. If I ran the team question on its own after the prefix, those would be its positions. Packing preserves that numbering and gives each row explicit ranges of physical rows it may read. This is the piece a plain causal mask would get wrong: it would treat the earlier refund question as part of the team's history.

For example, the first team row is physical row 113. On a full layer it may read [0,59) and [113,168). On a sliding layer it may read [0,59) and [113,114). The ranges are half-open, so 59 is excluded from the first pair. Neither policy lets that row see the refund block. Prefix rows cannot see either question; otherwise information could travel from one question into the shared prefix and back out to its sibling on the next layer. See the mask and position builder.

Call the shared prefix P and each question's rows B. For an ordinary Gemma text sequence, a full layer can read any row up to and including the current row. Bison's full-layer rule depends on which block the query belongs to:

A Gemma ( t ) = { j : j ≤ t }
A Bison ( t ) = { P t ∈ P P ∪ B i t ∈ B i

A sliding layer takes the corresponding Bison set and keeps only keys whose logical positions fall in the causal window. Here p is the logical rotary position and W is 1,024. This uses logical positions to select rows and physical addresses to fetch their values.

p ( t ) − W + 1 ≤ p ( j ) ≤ p ( t )

3. What changes inside the attention mixer?

A Bison layer selects sliding grouped-query attention or block-bidirectional full grouped-query attention before the residual sum and dense GeGLU feed-forward network.
Compare the two attention circuits. The split shows alternative layer types, not two attention calls in the same layer.

The pinned checkpoint config lists 60 layers and a hidden width of 5,376. Layers 00 through 04 use sliding attention, layer 05 uses full attention, and that six-layer pattern repeats through layer 59. The layer count refers to 60 distinct layers. There is no Inkling-style loop and no per-token expert router.

Attention geometry in the pinned text backbone.
Layer exampleQ headsK/V headsFeatures per headRows it can read
L00 [Sliding GQA]3216256Up to 1,024 causal positions within the logical sequence
L05 [Full GQA]324512Entire shared prefix and own block for a question row

RMSNorm [Attention input] means RMSNorm applied before the Q, K and V projections. After the projections, the circuit applies per-head normalization and uses RoPE on Q and K. In a full layer, K and V start from the same unrotated projection. Then the paths separate: K gets its learned normalization and RoPE; V gets a unit-gain normalization and no RoPE. That is why sharing the projection does not mean passing the same tensor to attention for both operands.

After attention, an output projection returns to 5,376 features. The block normalizes that branch and adds it to the incoming stream. RMSNorm [FFN input] prepares the result for the dense feed-forward network: the gate and up projections each produce 21,504 features, GeGLU multiplies GELU(gate) by up, and the down projection returns to 5,376. A post-FFN RMSNorm, the second residual addition and a learned scalar finish the layer. You can read the sequence directly in the CKE circuit authoring code.

What the C kernels compute

CKE passes legal row ranges to grouped-query attention, runs the checked BF16 block, gathers two answer rows, and projects them onto the three slot weights.
Trace the CKE kernel and readout changes. Follow the mask into attention, then the answer rows into the output GEMM.

Range-aware GQA. The checked attention provider receives the legal half-open spans for each query row. For one query head, use its assigned K/V head and compute the following only for rows in the allowed set A(t). The replay builder sets the score scale to 1. The equations show the operation before storage rounding.

s t j = q t ⋅ k j , m t = max j ∈ A ( t ) s t j
a t j = e s t j − m t ∑ ℓ ∈ A ( t ) e s t ℓ − m t
o t = ∑ j ∈ A ( t ) a t j v j

For example, suppose a prefix row, the current row and a later row in the same question have values 1, 3 and 5, and their scores are equal. The full layer gives them equal weight and returns 3. A causal sliding layer at that position sees only the first two and returns 2. A sibling row with value 100 enters neither sum or denominator. The query and key math is the same; the range changes the result.

Checked BF16 GeGLU. This is inherited Gemma math that CKE needed to wire and verify for this replay. From a normalized row x, the gate and up projections each go from 5,376 to 21,504 features. The down projection maps their gated product back to 5,376:

g = x W g T , u = x W u T
y = ( GELU tanh ⁡ ( g ) ⊙ u ) W d T
GELU tanh ⁡ ( x ) = x 2 ( 1 + tanh ⁡ ( z ) )
z = 2 / π ( x + 0.044715 x 3 )

In the checked C path, the gate activation passes through BF16 storage before multiplying by the BF16 up value. The product is rounded again. If R denotes BF16 rounding, the gated product is:

R ( R ( GELU tanh ⁡ ( g ) ) ⊙ u )

The same replay PR also wires split-position RoPE, the residual adds, learned scaling and BF16-row BLAS projections. Those make the Gemma-style blocks executable in generated C; the changes that make the circuit behave like Bison are the packed visibility and the slot readout.

4. The last hidden row is where each question gets answered

Final RMSNorm feeds a gather of two answer rows. A two-row by three-column projection scores three unique slot IDs, and the host maps scores to named options.
Explore the option readout. The gather decides which rows answer the questions; the GEMM decides which slots score highest.

After the last RMSNorm, CKE takes rows 112 and 167, the ends of the two question blocks. Call the two rows H. The runner gathers three slot-token rows from the checkpoint's lm_head.weight, producing S. The readout circuit computes their dot products:

H ∈ R 2 × 5376 , S ∈ R 3 × 5376
Z = H S T ∈ R 2 × 3

The refund question uses the first two slots; the team question uses all three. One cell is unused. Slot 0 means yes in one row and billing in the other; it has no universal label.

A fixed classifier also ends with a matrix multiply, but its columns usually have permanent meanings such as billing and fraud. Here the instructions and descriptions in each question give the slots their meaning. A chat LM head usually scores the vocabulary for the next token; Bison uses selected vocabulary rows as a compact decision head, without a decode loop. The scores in the CKE report are raw logits. A softmax over the valid options can turn a row into a distribution without changing its argmax. Matching that argmax does not verify that the resulting confidence is calibrated.

An embedding, a token, or a decision?

BERT gives you a vector for each input token; an audio or vision encoder gives the next stage a sequence of feature vectors. A generator like GPT-2 scores the vocabulary, chooses a token, then feeds that token back to continue. Bison also computes scores, but only for the requested options. The application can return those scores or pick a winner. There is no token to feed back.

Three paths compared: an encoder hands off embeddings, GPT-2 selects a token and feeds it back, and Bison returns scores or a choice without a generation loop.
Compare embedding, token and decision outputs.

5. What Base Labs changed in training

The vision encoder reads the image. The decoder answers the question.

Bison starts with both parts of Gemma 4 31B IT: the vision encoder and the 60-layer language decoder. Say I send a photo of a damaged package and ask, Should this go to shipping or billing? The vision encoder turns the photo into features. The decoder combines those features with the question and its options. The slot readout takes the decoder's answer row and gives shipping and billing a score each.

The frozen vision encoder and frozen text embeddings feed the fine-tuned Gemma decoder. The slot readout scores the requested options. Text-only requests skip the vision encoder.
Explore what Bison freezes and fine-tunes. Select a block to see what it reads and which weights it uses.

According to the Bison model card, Base Labs kept the vision encoder, embeddings and normalization weights fixed while fine-tuning the language model on text and image decisions. Frozen means the weights stayed unchanged during that training. The encoder still runs when there is an image. If I send only a written ticket, Bison skips it and runs the text through the same decoder and slot readout. That is the path CKE verified below; this replay did not exercise the image path.

The release write-up also describes using more soft labels. For example, a genuinely ambiguous training case can target 80% for one option and 20% for another. That teaches a different behavior from marking one answer correct with absolute certainty.

I would try this pattern for routing support, reviewing a document against a rubric, or flagging a case for a person to review. For a refund workflow, I would use the score to route the ticket, then let the application enforce the refund rules. The publisher reports a Decision Index v2.1 score of 76 and a Brier score of 0.14 at launch. Those are the publisher's benchmark results. To choose a threshold for our own tickets, we would still need labeled tickets and a check of accuracy and calibration at that threshold.

Run Bison natively with CKE

You can run Bison with CKE’s own kernels. Pass --scalar to use the CKE projection kernel without OpenBLAS or PyTorch. CKE generates and compiles the decision circuit as a C shared library. The Python CLI still loads the checkpoint, packs the input, invokes the library, and writes the scores. This is native inference launched from Python, not a standalone C executable.

Use Linux on an x86-64 CPU with AVX2, a C compiler, and Python 3.11 or newer with venv. The commands below do not require a separately installed BLAS library.

1. Set up CKEBash
git clone --filter=blob:none https://github.com/C-Kernel-Engine/C-Kernel-Engine.git
cd C-Kernel-Engine
git checkout --detach bebf5cd21
python3 -m venv .venv
source .venv/bin/activate
python -m pip install numpy jsonschema huggingface_hub

Compile and run with the real checkpoint

Leave room for both the pinned Bison BF16 files and the run’s working files. The full 168-token replay planned a file-backed arena of about 63 GB in addition to the roughly 65 GB checkpoint. If your weights are already on disk, set CHECKPOINT to that directory and skip the download.

2. Download the pinned checkpointBash
CHECKPOINT="$PWD/bison-bf16"
hf download baselabs/bison-1 \
  config.json model.safetensors.index.json \
  model-00001-of-00002.safetensors model-00002-of-00002.safetensors \
  --revision bf8350b2c59eb6c36e95d02a2af870aec18724a7 \
  --local-dir "$CHECKPOINT"

request=tests/fixtures/decision/block_packed_bison_request.json

The runner compiles for the packed request as part of each run. It writes circuit.json, plans the arena, emits generated.c, links generated.so, and calls the C entry on the prepared tensors. Start with one layer to check real-weight ingress and compilation. Use fresh output directories.

3. Check one layer, then run all 60 with CKE’s own kernelsBash
python -m version.v8.decision.run_bison_backbone \
  --checkpoint "$CHECKPOINT" --request "$request" \
  --scalar --layers 1 --output bison-layer1

# Full scalar replay: expect a much longer run than with OpenBLAS.
python -m version.v8.decision.run_bison_backbone \
  --checkpoint "$CHECKPOINT" --request "$request" --scalar --output bison-replay

I ran the one-layer --scalar command on Ryzen with the real BF16 weights, no PyTorch installed, and no BLAS provider configured for CKE. bison-layer1/hidden.npy contained a finite 168 × 5,376 hidden-state array. The native call took about 58 seconds, excluding compilation and weight loading. That test stops before the decision head.

The full run writes named scores in bison-replay/report.json. The full scalar replay was not timed here. On the published 60-layer FP64 BLAS replay, the winners were yes and billing. The temporary file-backed arena is removed by default; --keep-arena retains it for debugging.

Why use OpenBLAS at all?

A projection takes a table of token activations X and multiplies it by the transposed weight matrix Wᵀ. In scalar mode, CKE does the dot products itself: it reads BF16 values, accumulates each dot product in FP64 in a fixed order, and rounds the result to BF16. In the accelerated replay, the CKE projection wrapper prepares the FP64 buffers, calls OpenBLAS’s dgemm_ for the multiply, and converts the result back. OpenBLAS is useful here because those large projection multiplies repeat throughout all 60 layers.

In Bison, the BLAS option covers the linear projections around attention and in the dense feed-forward block. CKE still handles the circuit schedule, embedding lookup, RMSNorm, RoPE, masked attention, residual adds, GEGLU, and the option readout. OpenBLAS does not load the model or make either decision. See the projection kernels and the Bison circuit.

You can check what was built: the scalar bison-layer1/generated.c calls ck_linear_rows_bf16_checked. On the Linux build checked here, readelf -d bison-layer1/generated.so lists only the system C and math libraries as direct shared dependencies. This is about the generated C library; the launcher still uses Python and NumPy.

Run the OpenBLAS-accelerated replay

Install an LP64 OpenBLAS runtime, such as libopenblas0-pthread on Ubuntu or Debian. Leave off --scalar to pick the replay CLI’s default FP64 BLAS path. You still do not need PyTorch.

Use OpenBLAS for the projection multipliesBash
export CK_BLAS_LIBRARY="$(ldconfig -p | awk '$1 == "libopenblas.so.0" {print $NF; exit}')"
: "${CK_BLAS_LIBRARY:?Set CK_BLAS_LIBRARY to your LP64 OpenBLAS library}"
export OPENBLAS_NUM_THREADS=8
python -m version.v8.decision.run_bison_backbone \
  --checkpoint "$CHECKPOINT" --request "$request" --output bison-replay-blas

Testing a faster CKE-only path

CKE PR #1347 added a checked AVX2/FMA projection that computes several output channels at once without reordering the FP64 sum for any one channel. The merged kernel expects a bias vector; Bison's projections have no bias, and setting the compiler target to AVX2 does not select this kernel. To try it on Bison, I wired in a zero bias vector in a separate worktree.

I rebuilt and ran the first Bison layer on a Ryzen 9 9950X3D with real BF16 weights and eight CKE threads. All 168 × 5,376 output values matched the scalar run bit for bit. The native call took about 1.27 seconds, excluding compilation and weight loading. The generated C used the AVX2 provider for all seven projections in that layer, and the library did not link to BLAS. This is a one-layer experiment, not a 60-layer result or a flag available in the pinned quickstart.

What data can I give it?

Think of a short support ticket as the shared state, followed by named questions with explicit choices: refund? (yes or no), and which team? (billing, technical, or fraud). The native runner consumes the rendered input, not the publisher’s raw state and questions API payload. The checked-in fixture contains both the original text for reference and the fields the runner uses:

Bison replay input, from the checked-in refund and team fixture
FieldWhat it supplies
checkpointThe pinned BF16 checkpoint revision.
prefix59 shared token IDs for the rendered state.
questions[].name and tokensA unique name and a nonempty list of suffix IDs per question. Here the two suffixes have 54 and 55 IDs.
questions[].optionsPairs of option name and answer-slot token ID. In this fixture, ["yes", 236776] and ["billing", 236776] use the same slot in different question rows.

The complete fixture has 168 packed tokens. This runner caps the combined prefix and suffixes at 512, validates vocabulary IDs and distinct choices per question, and returns raw option scores. It does not return calibrated probabilities or generated prose.

For your own data, think short text classification or routing with choices you can label and test. To change the state or questions, rebuild the prefix, suffixes and slot IDs with a matching decision renderer and tokenizer. Editing the human-readable request.state field alone does not change what CKE runs. Start from the fixture rather than guessing token IDs. The publisher’s API is a separate path that accepts text and images. This CKE replay does not take screenshots, PDFs, images, raw prompts, or the publisher’s 128K context requests.

Optional: Verify against PyTorch

Skip this section if you only want to run Bison. The smoke test uses small synthetic tensors to compare the generated embedding, RMSNorm, and Q/K/V operations against PyTorch. It does not need the Bison weights.

Show the compiler smoke testCompare the small generated circuitBash
python -m pip install pytest
python -m pip install torch --index-url https://download.pytorch.org/whl/cpu
python -m pytest -q tests/test_v8_bison_backbone_ingress.py -k generated_ingress

The checked oracle command is for the pinned two-question fixture. It records reference logits and also tests that deliberately changing the mask or readout row changes the reference. Then the CKE replay checks both winning choices and differences across all five scores. To reproduce the published numbers, use the OpenBLAS setup above. Use a fresh oracle file and output directory.

Show the full score comparisonCapture and compare the two-question referenceBash
python -m pip install torch --index-url https://download.pytorch.org/whl/cpu
python -m pip install transformers safetensors
python -m version.v8.decision.capture_bison_block_oracle \
  --checkpoint "$CHECKPOINT" --request "$request" --out bison-oracle.json
python -m version.v8.decision.run_bison_backbone \
  --checkpoint "$CHECKPOINT" --request "$request" --output bison-checked \
  --oracle bison-oracle.json --max-abs 0.5 --max-rmse 0.25

Look for comparison.pass: true in bison-checked/report.json. That checks numerical agreement on this fixture. To test whether routing is useful on your data, build a separate labeled set and compare decisions to those labels before automating anything. See the pinned CKE runbook for the replay options.

6. What actually ran in CKE

PR #1208 reports that a Ryzen machine ran the full packed 60-layer backbone and slot readout through one generated C entry. The host prepared the validated token IDs, weights, RoPE positions and ranges first. CKE's circuit describes the schedule, the kernel maps select the numerical providers, and the compiler lowers those operations to C. The verified lane uses BF16 tensors with an explicit FP64 BLAS projection path. The reported 411-second native call used a file-backed arena; it is a correctness run, not a serving latency target.

Raw CKE scores for the pinned two-question replay reported in PR #1208.
QuestionCKE raw logitsWinner in both CKE and PyTorch
Refund?Yes 53.75; no 28.875Yes
Which team?Billing 56.5; technical 33.25; fraud 32.5Billing

The five scores had a maximum absolute difference of 0.375 and an RMSE of 0.20156, within the respective limits of 0.5 and 0.25. The regression also changes a legal visibility range and an answer-row index to make sure a wrong circuit can be detected. Agreement here means the same pinned weights and request gave the same choices and close scores. Generalizing from one support ticket requires more fixtures.

The CKE replay runbook starts with pretokenized text and pinned safetensors. Its packer has a 512-token capacity and the published fixture uses 168. Baseten's published model also supports image input and offers 128K context; neither is established for this CKE lane. Before calling it a service, I would test independent requests with longer prefixes, close scores and unequal question sizes, then measure latency and memory on the same machine.

What changed on CKE main since that replay

I checked CKE main at de6148c85. The Bison runner and backbone builder are now shared with Groundhog-1. PR #1216 connects Groundhog's routed expert layers; PR #1218 adds a separate score-parity profile with BF16 CBLAS projections and partition-based top-k. On the pinned Groundhog example that profile matched both winners with a maximum score error of 0.25. That is a Groundhog result. Bison is dense, so it does not use that expert router, and the original Bison parity numbers still belong to its explicit FP64 BLAS provider.

PR #1246 adds reverse audits and isolated native component replay, and fixes strict-C11 compilation in the shared BF16 projection source. That's useful for diagnosing a bad build or checking a single generated component. It does not extend Bison to images, 128K context, quantized execution, or a general serving endpoint. I did not find a newer real-weight Bison result on this revision. For Bison itself, the 168-token text replay remains the reference point.

On that checkout, I ran the focused Bison ingress and generated-layer tests along with the shared Groundhog routing and score-provider tests: 10 passed, one skipped. The small generated cases check packed layouts and invalid-input recovery against PyTorch. The skipped case needs the pinned Bison checkpoint, so this run did not repeat the 31B model replay or replace its published numbers.

CKE implementation trail

The PRs behind the Bison replay

Each step let us replace a reference-fed boundary with generated execution and test what changed.

Packing, ingress and the complete model
  1. PR #1203
    Test the layout and mixed head geometry
    Pinned the packed request, checked the two visibility policies and tested the slot readout with deliberate wrong-row controls.
  2. PR #1207
    Generate BF16 ingress
    Connected token gathering, weighted RMSNorm and the three first-layer Q/K/V projections through checked codegen.
  3. PR #1208
    Connect all 60 layers to option scores
    Added the remaining residual, rotary and FFN operations and ran the complete native replay against PyTorch.
  4. PR #1216
    Reuse the decision backbone builder
    Added a routed path for Groundhog while keeping the dense Bison path.
  5. PR #1218
    Check a separate Groundhog numerical profile
    Added explicit projection and routing choices and measured the new profile against pinned scores.
  6. PR #1246
    Audit generated components
    Added isolated native checks and fixed strict-C11 compilation for the shared BF16 projection provider.