SOPHIA XT
Sign in
Research · training objective · May 2026 · DOI 10.5281/zenodo.20496783

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×.

Figure 1 One training pair, three policies Illustrative
Q: You are Cassandra T1 , a diffusion Tell me about the moons of Mars. A: ▮ ▮ ▮ ▮ ▮ named ▮ ▮ ▮ that may be captured asteroids from the pad pad pad pad
γ(t) = 0.54 8 positions masked, 0 of them in the question question answer
Pick a policy and draw steps. Under the anchor policy the question stays visible every step and only the answer meets the noise schedule. The tokens and draws are one example. The rule and the mask-ratio range of 0.5 to 0.9 are the paper's.
1.67×held-out advantage over random, 95% interval [1.51, 1.85]
1.26×in domain, interval [1.18, 1.34]. The intervals do not overlap.
504published generations, losing arms included
0.416V/O-only adapter, against 0.337 for the full one, at 2.98M of 7.0M parameters
Figure 2 Bootstrap intervals on the ratio of corpus overlap
0.6×0.8×1.0×1.2×1.4×1.6×1.8×2.0×no differenceHeld out: anchor over random1.67× [1.51, 1.85]In domain: anchor over random1.26× [1.18, 1.34]Held out: reverse over random0.82× [0.69, 0.97]
10,000 resamples, percentile method, forced-anchor corpus overlap. P(anchor > random) is 1.000 on held-out text. The third row is the control that matters: reverse-asymmetric masking lands below random, with an interval entirely under 1, so asymmetry alone does not explain the gain. Difference -0.0377, interval [-0.0677, -0.0077].
What was measured · sections 3 and 4

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.

1 lineis the whole difference between the arms: which positions the mask may cover.
Section 4 · The setup, as printed
ComponentValue
Base modelCassandra 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 data144 (Q, A) pairs from three LTMi-XT corpora (C1 cold-storage operations, C2 Cassandra T1 architecture, C3 business operations), three templated questions per locus
LoRArank 16, alpha 32, q_proj / k_proj / v_proj / o_proj in all 28 layers, 7M trainable parameters (0.5% of base)
OptimiserAdamW, 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
Evaluation15 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
Decoding12 unmasking steps, temperature 0.8, top-p 0.9, beta 0.5, repetition penalty 1.3, answer length 96 tokens, generation seed 1234
Compute75 to 100 seconds per LoRA; about 60 minutes to reproduce everything on a single consumer GPU
Results · section 5

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.

Figure 3 Held-out corpus overlap by arm, forced anchor
Base, no LoRA 0.0045
Reverse 0.1760 lost to random
Random position 0.2137 the control
Anchor-token 0.3571
Overlap is a vocabulary proxy for topical coherence. It does not score word order or grammar.
Figure 4 Where the effect lives
base (no LoRA) 0.005 0 parameters, noise floor
random-mask full LoRA 0.214 7.0M parameters, control reference
full anchor-LoRA 0.337 7.0M parameters, reference
V/O-only anchor-LoRA 0.416 2.98M parameters, outperforms full LoRA
Q/K-only anchor-LoRA 0.136 2.98M parameters, below random control
The value and output projections alone beat the full adapter, and the query and key projections alone fall below the random control. Two adapters with the same 2.98M parameters land a factor of three apart.
Table 5.2 · Per-domain held-out replication, forced anchor
CorpusVocab overlapBaseAnchorRandomReverseAnchor / randomP(anchor > random)
C4 astronomy15.6%0.00630.32720.15940.15352.05×1.000
C5 medical11.5%0.00360.32770.19090.16681.72×1.000
C6 legal10.5%0.00350.38050.17310.14772.20×1.000
C7 cooking13.9%0.00480.39300.33140.23621.19×0.994
Pooled, n = 48 per arm0.00450.35710.21370.17601.67×1.000

The weakest domain is cooking at 1.19×, with P = 0.994. Pooled interval [1.51, 1.85].

Table 5.3 · Every bootstrap interval
ComparisonRatio95% intervalP(a > b)
anchor vs base, in-domain42.50×[28.5, 76]1.000
anchor vs random, in-domain1.26×[1.18, 1.34]1.000
anchor vs base, held-out pooled78.73×[54.3, 113.4]1.000
anchor vs random, held-out pooled1.67×[1.51, 1.85]1.000
random vs base, in-domain33.69×[22.6, 59.8]1.000
random vs base, held-out pooled47.55×[29.8, 75.8]1.000
reverse vs random, held-out pooled0.82×[0.69, 0.97]0.006
Mechanism · sections 5.4 to 5.8

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.

ProbeMethodResult
1 · Direction of asymmetryA reverse LoRA: Q always subject to the schedule, A never maskedHeld-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 patternPer-layer attention weights during a forced-anchor pass on four held-out queriesanchor_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 allocationNorm of the effective delta weight per projection over all 28 layersAnchor 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 ablationV/O-only and Q/K-only LoRAs at 2.98M parameters, same anchor-masked dataV/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.

Table 5.5 · Attention share by arm
Armanchor_shareChange vs base
base0.256reference
anchor0.272+0.016 (+0.013 vs random)
reverse0.263+0.007
random0.259+0.003
Table 5.6 · LoRA delta-weight norms
ArmV+OQ+KV+O / Q+K
anchor0.4810.4171.153
reverse0.5380.5720.940
random0.4910.6180.794
Table 5.7 · V/O ablation, held-out pooled
Armcorpus_overlapTrainable parametersReading
base (no LoRA)0.0050noise floor
random-mask full LoRA0.2147.0Mcontrol reference
full anchor-LoRA0.3377.0Mreference
V/O-only anchor-LoRA0.4162.98Moutperforms full LoRA
Q/K-only anchor-LoRA0.1362.98Mbelow random control
Training budget · appendix C and 6.4a

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.

Table C.1 · Sample-efficiency sweep
PairsStepsAnchorRandomRatio
501000.4830.2461.97×
5010000.4110.2221.85×
1003000.3780.2071.82×
1441000.3870.1772.19× max
1443000.3370.1801.87×
14410000.2030.1901.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.

Table 6.4a · Continued full-model training
CheckpointOverlapAgainst v1 base
v1 base (no continued training)0.008reference
Continued, step 5000.481+0.473 (58.7×)
Continued, step 10000.440+0.432 (53.7×)
Qualitative · section 5.10

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.

anchor LoRA · overlap 0.52

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…

random LoRA · overlap 0.11

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…

reverse LoRA · overlap 0.16

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…

Scope of the evidence · sections 6.2 and 7

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.
Practice and reproduction

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.