Galaxus track · Apertus 1.5 8B · Jev-style decision model

The pointer head

Apertus never generates an answer. In one forward pass it produces hidden states, and a small bilinear pointer head turns exactly two kinds of hidden state — plus two gated side-inputs — into a score for every class. This page shows exactly what enters that head: the token layout it reads from, the wiring, the attention mask that makes it fair, and the formulas with a worked example.

query side — decision token d key side — option tokens c_k fp32 head on bf16 backbone LoRA r=16 · α=32 projection H = 512 41 classes · 6 dimensions · 1 sequence
01

One sequence, six questions

The image and a one-line product context form a causal prefix. Then six question blocks follow in the same user turn. Every block lists its options as - class (hint) lines and ends with Answer:. Two token positions per block matter to the head: the last token of each option line (the dots) and the colon of Answer:. Pick a block to inspect it.

block
Readout token = the “:”readout_positions() scans for Answer: and keeps the last six matches, so stray text earlier in the prompt cannot shift a readout.
Blocks are separated by “ |”a " |\n\n" tail stops the tokenizer merging ":\n\n" into one token — the readout is always a clean colon.
Options restart at identical positionsevery option line begins at the same position id, so no token inside an option encodes its display rank. Option order cannot matter.
Context dropout 15%during training the context line is replaced by "No product information available." at random, so the head cannot lean on metadata alone.
02

What the head actually receives

Nothing else. Not the image, not the option text as strings, not any generated token — just hs, the last-layer hidden states of the backbone at a handful of token indices, plus two cheap side-vectors computed outside the model. The head casts everything to fp32 before touching them.

KEY SIDE — one per option c_k = hs[ cpos[j][k] ] last-layer state at the last token of option k’s line (newline included) K options · K = 10 for this dimension LayerNorm_cper-head, fp32 W_K · (−)D → 512, no bias QUERY SIDE — one per block d = hs[ dpos[j] ] last-layer state at the “:” of Answer: the one token that saw the whole block + e_jlearned dim embedding LayerNorm_dafter all additions W_Q · (−)D → 512 GATED LANES — added before LN f ∈ R²⁰ : 64-px image statistics (ring/center means·stds, brightness, edges, aspect) o ∈ R⁵⁸ : Orient-Anything V2 cue azimuth / polar / rotation distributions + confidence. Perspective block only — zero-shot, no label leakage. σ_j · G_j(f) σ_o · G_o(o) · σ_o=0.0878 (trained) SCORE, per option k s_k = ⟨q, κ_k⟩ / √512 + b_jk (learned, init 0) softmax over k p(class) for this dimension argmax → prediction
SOFTMAX OVER THE SELECTED DIMENSION’S OPTIONS — perspective
03

The mask that makes it fair

The block layout is enforced by an additive attention mask (layout(), train.py:107). The prefix is ordinary causal. Inside a block the question sees the prefix and itself; each option sees the prefix, the question and only its own tokens; the readout tail sees its whole block. Blocks never see each other. Hover the cells — rows attend, columns are attended.

prefix, causal question tokens own option only readout row blocked
Hover a cell. Amber outline = a c_k column (option end). Teal outline = the d row (readout colon).

Block-alone equivalence

Each block starts at the prefix end with fresh position ids, so it computes exactly what it would in a sequence of its own — six cheap questions in one padded pass.

selftest: rel. err 4.5 % max

Order invariance

Options are mutually blind and share position ids; no token of an option encodes its rank. Shuffling the option order cannot change scores beyond numerics.

selftest: reversed order 2.3 % · unmasked control 79 %

No cross-talk

Blocks cannot attend to each other, and the prefix cannot see any block. Predictions are independent of block order and of the other questions.

asserts in layout(): readout must see prefix + own block
04

The mathematics

All of it is Pointer.forward (train.py:156-164), verbatim. D is the backbone text hidden size, H = 512, K_j the number of options of dimension j (max 13).

1 · Hidden states

One forward pass of the LoRA-adapted backbone over the masked sequence x = [x_img, x_ctx, B_1 … B_6]; h_t is the last-layer state at token t.

2 · Query — assemble, then normalise

The decision state is adjusted by a learned per-dimension embedding and by two gated lanes, all before the LayerNorm. The gates are scalars, initialised to zero.

3 · Keys — one per option line

Each option is represented by the state at the end of its own line — after it has read the image, the context, the question and itself, and nothing else.

4 · Score and prediction

A scaled dot product per option — the whole “decoding” is this bilinear form, in fp32, plus a learned per-(dimension, option) bias initialised to zero.

5 · Training loss

Cross-entropy only on cells with a human label marked relevant; every other token position is unsupervised. The pod runs the fixed norm: the gradient is always divided by 6 (the dimension count), while the logged loss is the per-image mean over its n scored cells.

6 · Optimisation

AdamW, weight decay 0, two groups; warmup over total/25 steps then linear decay to a 5 % floor; grad-norm clip 1.0.

7 · The zero-gate corollary

σ = 0 at initialisation, so step 0 is exactly the feature-free pointer; the lanes survive only if they earn gradient. This is why the Orient lane can be trusted not to hurt the other five dimensions.

Shapes

symbolshapenote
h_t, d_j, c_jkDbackbone text hidden size, bf16 → cast to fp32 in the head
W_Q, W_K512 × Dlinear, no bias — the only bilinear parameters
e = dim_emb6 × Done embedding per dimension, zero-init
b = bias6 × 1313 = max options (subject); sliced to K_j per block
G_j (feat lane)D × 20 eachone linear per dimension; gate σ_j ∈ R⁶ zero-init
G_o (orient lane)D × 58single linear; gate σ_o ∈ R¹ zero-init

What it replaced — the letters head

The earlier arm read the LM-head logits of the option letters at the same colon: one number per class, but constrained to live in the vocabulary space of single letter tokens. The pointer frees the comparison from the vocabulary entirely (README: 0.649 → 0.710 mean macro F1 from this swap plus the mask).

05

Worked example — perspective

The richest dimension: ten options and the only block with an active Orient lane. Vector strips are illustrative 32-of-512 slices; scores are invented but arithmetically consistent (the softmax is computed in the page). The side facts in green are measured, from the pmb4→pmb6 training runs.

front points left
Title: Retro Runner Low Top | Type: shoes | Brand: Velox | Category: fashion / footwear
context tokens (≈20) · image tokens: resolution-dependent (839 @ 512 px)
Which side of the product faces the camera?
p+1- front_head_on
p+1- front_angle_left (front points bottom-left)
p+1- front_angle_right (front points bottom-right)
p+1- back_head_on
p+1- back_angle_left (back, front points top-right)
p+1- back_angle_right (back, front points top-left)
p+1- left_side (front points left)
p+1- right_side (front points right)
p+1- top_down (from above)
p+1- bottom_up (from below)
p+10Answer:

Ten c_k dots and one d dot — these eleven token positions are all the head receives from the backbone. Every option starts at the same position id; the tail starts after the longest option.

d + e_persp
512 → shown 32
σ_o·G_o(o) added
×0.0878
q = W_Q LN(·)
∈ R⁵¹²
κ(left_side)
∈ R⁵¹²
κ(front_head_on)
∈ R⁵¹²
ORIENT-ANYTHING V2 CUE o — 58 NUMBERS, AZIMUTH SLICE SHOWN (24 BINS × 15°)
0°90°180°270° ◀ peak345°

Zero-shot geometry model: where the product’s front points, how high the camera sits, image tilt — as distributions, plus confidence. Standardised by the train file’s mean/std. It enters only here, multiplied by the trained gate.

option ks_k = ⟨q,κ_k⟩/√512 + bsoftmaxp(class)

Scores illustrative; softmax computed from them in this page. One number per class is the entire output — no tokens were generated.

0.0878
trained σ_o (pmb6) — the head keeps the lane small
.406 → .766
perspective macro F1, no-lane → lane (README pm2 → pmb6)
0.853
mean macro F1, full 2371-img holdout (pmb6 ep0)
4.48 img/s
L40S bf16 bs4 incl. live Orient — batched cue is label-identical