Mask the answer.
Never the retrieved prefix.
Retrieval hands a diffusion model tokens it already knows and asks it to write around them. The standard objective masks every position alike. We trained rank-16 adapters on a 1.3B masked-diffusion model under three objectives that differ only in which positions may be masked. On held-out text the anchor-token objective wins by 1.67×.
Three objectives
that differ in one line.
A training example is a question Q and an answer statement A, padded to a fixed length. Each step draws a mask ratio γ uniformly from 0.5 to 0.9 and then a mask per position. Anchor-token masking never masks Q and masks A with probability γ. Random-position masking applies γ to Q and A alike. The reverse control masks only Q and never A.
At inference the retrieved statement is tokenised and locked at the head of the answer slot. The unmasking loop excludes locked positions at every one of the 12 denoising steps, so they are preserved by construction. That mechanism is identical across arms and is not what the training objective changes.
The base is Cassandra T1 v1, undertrained at cross-entropy 2.2561. Training data is 144 question and answer pairs from three LTMi-XT corpora. Evaluation is 15 in-domain queries and 48 held-out queries, 12 each in astronomy, medicine, law and cooking, with 10.5% to 15.6% vocabulary overlap with training.
| Component | Value |
|---|---|
| Base model | Cassandra T1 v1, 1.3B parameters, 28 layers, 2048 hidden, GQA 16 query / 4 key-value heads, 32K BPE vocabulary, epoch-5 cross-entropy 2.2561 |
| Training data | 144 (Q, A) pairs from three LTMi-XT corpora (C1 cold-storage operations, C2 Cassandra T1 architecture, C3 business operations), three templated questions per locus |
| LoRA | rank 16, alpha 32, q_proj / k_proj / v_proj / o_proj in all 28 layers, 7M trainable parameters (0.5% of base) |
| Optimiser | AdamW, learning rate 1e-4 cosine to 1e-5, betas (0.9, 0.95), weight decay 0.01, batch 2, sequence length 192, 300 steps, gradient clip 1.0, seed 42 |
| Mask ratio | γ(t) sampled uniformly from [0.5, 0.9] every training step, identical across arms |
| Evaluation | 15 in-domain queries; 48 held-out queries, 12 each across astronomy, medical, legal and cooking corpora with 10.5% to 15.6% vocabulary overlap with training |
| Decoding | 12 unmasking steps, temperature 0.8, top-p 0.9, beta 0.5, repetition penalty 1.3, answer length 96 tokens, generation seed 1234 |
| Compute | 75 to 100 seconds per LoRA; about 60 minutes to reproduce everything on a single consumer GPU |
The winner, the control
and the arms that lost.
Pooled held-out corpus overlap over 48 queries. The base alone scores 0.0045. All three adapters share a checkpoint, a corpus, a rank and 7.0M trainable parameters.
| Corpus | Vocab overlap | Base | Anchor | Random | Reverse | Anchor / random | P(anchor > random) |
|---|---|---|---|---|---|---|---|
| C4 astronomy | 15.6% | 0.0063 | 0.3272 | 0.1594 | 0.1535 | 2.05× | 1.000 |
| C5 medical | 11.5% | 0.0036 | 0.3277 | 0.1909 | 0.1668 | 1.72× | 1.000 |
| C6 legal | 10.5% | 0.0035 | 0.3805 | 0.1731 | 0.1477 | 2.20× | 1.000 |
| C7 cooking | 13.9% | 0.0048 | 0.3930 | 0.3314 | 0.2362 | 1.19× | 0.994 |
| Pooled, n = 48 per arm | 0.0045 | 0.3571 | 0.2137 | 0.1760 | 1.67× | 1.000 |
The weakest domain is cooking at 1.19×, with P = 0.994. Pooled interval [1.51, 1.85].
| Comparison | Ratio | 95% interval | P(a > b) |
|---|---|---|---|
| anchor vs base, in-domain | 42.50× | [28.5, 76] | 1.000 |
| anchor vs random, in-domain | 1.26× | [1.18, 1.34] | 1.000 |
| anchor vs base, held-out pooled | 78.73× | [54.3, 113.4] | 1.000 |
| anchor vs random, held-out pooled | 1.67× | [1.51, 1.85] | 1.000 |
| random vs base, in-domain | 33.69× | [22.6, 59.8] | 1.000 |
| random vs base, held-out pooled | 47.55× | [29.8, 75.8] | 1.000 |
| reverse vs random, held-out pooled | 0.82× | [0.69, 0.97] | 0.006 |
Four probes,
one account.
The probes ask whether the effect comes from the direction of the asymmetry, from where the model attends, from where the adapter spends its rank, and whether the value and output projections alone carry it.
| Probe | Method | Result |
|---|---|---|
| 1 · Direction of asymmetry | A reverse LoRA: Q always subject to the schedule, A never masked | Held-out ranking anchor 0.357, random 0.214, reverse 0.176, base 0.005. Reverse is below random at P = 0.006, so asymmetry alone does not explain the effect. |
| 2 · Attention pattern | Per-layer attention weights during a forced-anchor pass on four held-out queries | anchor_share 0.272 against random 0.259 and base 0.256. The shift is in the predicted direction and about 10% of the behavioural gap. |
| 3 · Weight allocation | Norm of the effective delta weight per projection over all 28 layers | Anchor is the only arm with V+O above Q+K, ratio 1.153. Random 0.794 and reverse 0.940 invest more in q_proj. |
| 4 · V/O ablation | V/O-only and Q/K-only LoRAs at 2.98M parameters, same anchor-masked data | V/O-only 0.416 beats the full LoRA's 0.337. Q/K-only 0.136 falls below the random control's 0.214. |
The account the probes agree on: with the prefix fully visible at every step, the adapter never has to model masked-prefix reconstruction, so its rank-16 budget goes to the value and output projections. Those decide what content is read out of positions the model already attends to.
| Arm | anchor_share | Change vs base |
|---|---|---|
| base | 0.256 | reference |
| anchor | 0.272 | +0.016 (+0.013 vs random) |
| reverse | 0.263 | +0.007 |
| random | 0.259 | +0.003 |
| Arm | V+O | Q+K | V+O / Q+K |
|---|---|---|---|
| anchor | 0.481 | 0.417 | 1.153 |
| reverse | 0.538 | 0.572 | 0.940 |
| random | 0.491 | 0.618 | 0.794 |
| Arm | corpus_overlap | Trainable parameters | Reading |
|---|---|---|---|
| base (no LoRA) | 0.005 | 0 | noise floor |
| random-mask full LoRA | 0.214 | 7.0M | control reference |
| full anchor-LoRA | 0.337 | 7.0M | reference |
| V/O-only anchor-LoRA | 0.416 | 2.98M | outperforms full LoRA |
| Q/K-only anchor-LoRA | 0.136 | 2.98M | below random control |
A low-shot advantage,
and where it closes.
The largest advantage sits at roughly 100 to 300 steps on 50 to 150 examples, which costs 30 to 100 seconds on a consumer GPU per corpus. The sweep maximum was 2.19× at the lowest budget tested. Longer runs erode it: at 1,000 steps on 144 examples the two objectives converge at 1.07×.
Continuing full-model training under the objective lifted corpus overlap from 0.008 to 0.481 at 500 steps and 0.440 at 1,000, in 7.6 minutes on one consumer GPU with 10.8 GB of peak memory. Those continued checkpoints are the ones shown on the Cassandra page.
| Pairs | Steps | Anchor | Random | Ratio |
|---|---|---|---|---|
| 50 | 100 | 0.483 | 0.246 | 1.97× |
| 50 | 1000 | 0.411 | 0.222 | 1.85× |
| 100 | 300 | 0.378 | 0.207 | 1.82× |
| 144 | 100 | 0.387 | 0.177 | 2.19× max |
| 144 | 300 | 0.337 | 0.180 | 1.87× |
| 144 | 1000 | 0.203 | 0.190 | 1.07× collapse |
Matched anchor and random LoRA pairs on identical data, hyperparameters and seeds. Each is scored on a held-out subset of 12 queries.
| Checkpoint | Overlap | Against v1 base |
|---|---|---|
| v1 base (no continued training) | 0.008 | reference |
| Continued, step 500 | 0.481 | +0.473 (58.7×) |
| Continued, step 1000 | 0.440 | +0.432 (53.7×) |
The same anchor,
three adapters.
Held-out astronomy query: “What are the moons of Mars?” The locked locus comes first and the generated continuation follows it. The anchor adapter reaches for words of the anchor's domain, wrong on specifics but topically aligned. The random adapter writes training-corpus boilerplate. The reverse adapter writes the question template it was trained to produce.
Mars has two small moons named Phobos and Deimos that may be captured asteroids from the asteroid belt. The mission scheduled with April the., October was during module 14. the mission schedule for the missions for included three…
Mars has two small moons named Phobos and Deimos that may be captured asteroids from the asteroid belt. Cassandra T1, Cassandra T1, Cassandra T1 Direct: Direct helpful using 1 2 in Cassandra T1 of Cassandra T1…
Mars has two small moons named Phobos and Deimos that may be captured asteroids from the asteroid belt. Two of Two of: Cassandra T1, a diffusion language model by SOPHIA XT. Tell me about: Cassandra T1, Direct, helpful, honest…
What the study
does not cover.
- One base model, undertrained, and one adapter rank. 144 training pairs and 63 evaluation queries over five corpora.
- A fine-tuning regime only. Pretraining from scratch under the objective is the next experiment and has not been run.
- Corpus overlap is a vocabulary proxy for coherence. It does not score word order or grammar.
- The held-out corpora were written for the study, from publicly verifiable facts, not drawn from an external benchmark.
- The 1.67× headline is a mid-budget measurement. The advantage closes at 1,000 steps on 144 examples.
- The V/O ablation was run at one data, step and rank setting, and nobody outside this lab has replicated the result.
What it changes in a fine-tuning pipeline
Wrapping only v_proj and o_proj gives 57% smaller adapter files at 2.98M against 7M parameters, about half the memory pressure in training and about 23% better held-out generalisation on this metric, at the same wall-clock time. The advice is specific to this objective. Keep fine-tunes short on small corpora and stop early when held-out performance turns.
The repository carries the three training runners, the evaluation runners, the sweep and bootstrap scripts, the base checkpoint with its SHA-256, the three 24 MB adapters, the seven corpora in LTMi-XT format and per-query outputs for all 504 generations. Seeds are 42 for training and 1234 for generation. The paper is CC-BY-4.0 and the code is Apache 2.0.
@techreport{garren2026anchortokenmasking,
author = {Garren, Thomas},
title = {Anchor-Token Masking Produces an Out-of-Distribution
Generalization Advantage in Retrieval-Grounded
Masked-Diffusion Language Models},
institution = {SOPHIA XT LLC},
year = {2026},
month = {May},
doi = {10.5281/zenodo.20496783},
url = {https://sophiaxt.com/research/anchor-token-masking}
}Figure 1 is Illustrative. The tables and the other figures are the paper's own values.