In one line: Freeze Qwen2-1.5B and pass its last hidden states through two trainable cross-attention layers with an adapter and a gate into a GPT-Neo-sized decoder (randomly initialised in the released code, not the pretrained GPT-Neo-125M), trained on Bespoke-Stratos-17k reasoning traces. The evidence is qualitative: on the one prompt every model was given (5 plus 5, one sample each, graded by the author) the pair writes R1-style reasoning where GPT-Neo trained alone writes incoherent text; the second prompt went to the pair only, and the reported loss curve cannot show learning because the released cross-attention lets each position see later tokens.
How far to trust it: Read it as an idea, not a result. The evidence is two hand-picked prompts, one sample each, graded by the author. The released code adds problems the paper does not mention: its cross-attention lets every position see later tokens during training, so the loss curves cannot show learning; once the training subset starts being redrawn, the validation set is mostly reused training data; the "small" model is initialised at random rather than from GPT-Neo-125M, and running the pair takes 1.14 times the parameters of the frozen model alone. The idea of a frozen model read by a trained adapter is sound; Flamingo and CALM show it working with real evaluations. The evidence, judged.
The idea in one sentence: instead of distilling a large model into a small one, keep the large model frozen and train a small decoder that reads its last hidden states through cross-attention; a toy rebuild of the released code learns the task only once a causal mask is added, and as released the training loss is measured with the next token visible, so the paper's evidence (two prompts and a loss curve) cannot show that it works.
You need: distillation, the alternative the paper argues against (Distillation and small language models), and the causal mask in teacher-forced training (The transformer from zero); this page is the paper. New terms: knowledge source (the frozen Qwen2-1.5B); generation module (the trainable GPT-Neo-sized decoder); Enhanced Cross-Attention (cross-attention plus an adapter and a gate, the bridge between them); CombinedModel (the pair); the leak (the bridge lets each position read later tokens during training).
model.py (the paper has no figure); counts from the Hugging Face configs, by recompute.py. On this page's toy, the bridge as released answers 2% of unseen problems when generating; with a causal mask, 69%; the small model alone, 11% (the leak, the toy).Konstantin Kolomeitsev (independent, Almaty, Kazakhstan). arXiv 2502.08213, 12 February 2025, one version. Code and weights (Hugging Face, access on request); the same code openly on GitHub; the author's blog post. Added to this knowledge base on 2026-09-01 from a blog entry. Topics: llm-training-and-post-training, llms.
The paper's foil is distillation (Hinton et al., 2015; the methods compared on Distillation and small language models), as in DistilBERT and TinyBERT, which it cites (§2): it needs a large training run, and the student ends up as one fused artifact with the teacher's knowledge baked in irreversibly; to change the knowledge you distill again.
The paper's alternative: leave the large model frozen and let a small trainable model read its internal representations directly, so the pair works as two composable modules rather than one distilled model (§1). It promises that training "significantly reduces training costs while remaining effective for solving specific business tasks", and (§2) that, unlike classic distillation, it preserves "a larger portion of the original model's information" and handles "longer input sequences (e.g., 128K tokens in Qwen2 versus 2K tokens in GPT-Neo)". That last claim does not survive the code: see the context claim.
About 1.76 billion, 1.14 times the frozen Qwen2-1.5B alone. Every generated token runs the whole frozen Qwen2 (1,543,714,304 parameters), the bridge (16.4 million), GPT-Neo's twelve blocks and positions (86.6 million) and a new output layer of 768 × 151,646 = 116.5 million. The pair is cheaper to train than Qwen2 (only 219.5 million parameters get gradients), but it is not a small model to run: it is the large model plus a head. Distillation's student, by contrast, runs alone. The paper never says which of the two costs it is saving; the abstract's "trained on limited computational resources" is the training one.
Where the layers sit is the part the prose gets wrong. The paper (§4.1) and the old version of this page say the cross-attention is inserted into GPT-Neo's stack. In the code it sits in front of it, inside the module called ModifiedQwenWithCrossAttention. Fig. 1 builds the pair as the released model.py does, in the order a token passes the parts, with each part's code lines and parameter count (recounted in The evidence, rebuilt):
requires_grad = False, run under torch.no_grad() (lines 140 to 148, 182). It never trains.hidden_states[-1], one 1536-wide vector per position) goes through a trainable 1536 × 1536 projection, pre_proj (2.4M; lines 190 to 193). Qwen2's own output layer is never used.proj (1536 → 768, 1.2M; line 196), is kept for later. So the queries are not GPT-Neo's own states: both sides of the "cross"-attention are views of Qwen2's last layer, computed before GPT-Neo runs.pre_proj states (Wq, Wk, Wv), then the adapter and the gate (lines 19 to 130, 204 to 207): 5.1M per layer, of which cross-attention 3.5M, adapter 0.4M and gate 1.2M. The mask covers padding only, which is the leak below.final_states = gptneo_states + projected_states (line 210) is all GPT-Neo ever sees. GPT-Neo's own token embeddings are never used, and its positional embeddings are zeroed at the start (they still train); sequences are cut to 2,048 positions (lines 246 to 250). Its 12 blocks of width 768 (85.0M) start from random weights (green in Fig. 1; see Method).The paper describes its connecting layer in three parts (§3.2): linear projections that convert the large model's width (1536) to the small model's (768); an adapter block, an extra non-linear transformation; and a gating mechanism that "dynamically blends the original representations with the external knowledge". Read from the code, one layer is (step 4 of Fig. 1):
pre_proj), LayerNormedTwo more things the paper does not say. GPT-Neo is built with GPTNeoForCausalLM(gptneo_config) (line 220): from its configuration, with random weights, never loaded from the pretrained GPT-Neo-125M. So "the small model" brings an architecture, not knowledge; the paper's "GPT-Neo-125M-clean" control (trained from scratch) is the honest comparison for it.
The line meant to freeze the embedding layers sets an attribute on the module, not on its parameters, so it freezes nothing; it does not matter, because those embeddings are never used.
Fig. 1: widths and block counts from the Hugging Face configs of Qwen2-1.5B and GPT-Neo-125M (a slab's side is proportional to the model's width), code lines from model.py, parameter counts by recompute.py. Grey is frozen; the decoder's green marks its random start.
The paper's description (§4.2): Bespoke-Stratos-17k, examples longer than 4,096 tokens filtered out "to avoid memory overflow errors", dynamic padding, a random train and validation split, AdamW and early stopping. Bespoke-Stratos-17k is 16,710 questions (math, code, science and puzzles) with DeepSeek-R1's reasoning traces and answers. So the CombinedModel is itself trained on a teacher's outputs: what the paper offers instead of distillation is a different student architecture, not a different source of knowledge.
The code adds the rest (model.py, main and train_model): 15 epochs, batch size 1, learning rate 1e-4 for the bridge and 5e-5 for GPT-Neo, gradient clipping at 1.0, mixed precision, patience 5. Each epoch uses a 30% subset, redrawn with a new seed whenever the last validation loss was below 1.8. The author's blog adds one NVIDIA L4 GPU (4 vCPUs, 32 GB), about 5 hours and under 10 dollars (blog). Running the code's data pipeline on the dataset with Qwen2's tokenizer (stratos_stats.py; details):
Teacher-forced training feeds the whole text at once and is only honest if no position can see the tokens after it, which a causal mask guarantees (The transformer from zero). Qwen2 and GPT-Neo are both causal. The cross-attention between them is not: it masks padding only (mask = attention_mask.unsqueeze(1).unsqueeze(2), shape [batch, 1, 1, length]). So during training, position t can attend to Qwen2's state at position t + 1, which encodes token t + 1, the very token it must predict. At generation time the future does not exist yet, and that shortcut is gone.
Almost never: 2% of held-out problems against 69% for the same model with a causal mask (mean of 3 seeds each). Its teacher-forced loss on the held-out traces is 0.31 against 0.79, and its final training loss 0.001 to 0.005 against 0.271 to 0.277, although the operands in each prompt are drawn at random and no honest model can predict them. It looks far better on the number the paper reports and is useless when run. At the answer step it puts 73% of its first-layer cross-attention on later positions, 37% on the answer token alone. Fig. 2 shows why on one problem.
Fig. 2 runs this page's trained toy (built in The toy) on one held-out problem, teacher-forced as in training. Rows are query positions (the stream g that becomes the decoder's input), columns the frozen model's states (keys and values); a bar's height is the weight, first cross-attention layer, mean of 4 heads, computed in your browser from the shipped seed-0 weights. Orange bars read positions that come later.
T 16 % 6 = 6 ; 6 < 6 ok A 6. This problem was picked as the first held-out sum the fixed model gets right and the released one does not; over all 364 held-out problems the released model generates the right answer 2% of the time (3 seeds).T 2 + 5 = 7 ; 7 - 5 = 2 ok A 7. Over all 364 held-out problems the fixed model generates the right answer 69% of the time (3 seeds).Two cautions. The toy may make the shortcut easier than it is in Qwen2. There, the last hidden state at t + 1 is tuned to predict token t + 2, though it is computed from token t + 1 and probably still carries much of it (unconfirmed: not measured here); how much the real run used the shortcut cannot be measured without running the 7.2 GB checkpoint. And the real CombinedModel does produce coherent text, so it also learned the honest path; the toy's released variant mostly did not. What the leak does settle: the paper's evidence of learning, a loss falling "from 13.8 to 2.3 in the first epoch and to 1.1" (§5.3), is measured with the shortcut open on both training and validation data, so it cannot show how well the model predicts text it has not seen.
Seven models are compared (§5.1): DeepSeek-R1 671B; DeepSeek-R1-Distill-Qwen-1.5B (GGUF, 32-bit) as "a distilled model"; Qwen2-1.5B-Instruct (GGUF, 16-bit) as "the knowledge source model"; GPT-Neo-125M; GPT-Neo-125M-fine-tuned (with a 2,048-token limit); GPT-Neo-125M-clean, trained from scratch; and the CombinedModel. The evaluation is two prompts (§5.2):
Table 1 summarises the responses in words: DeepSeek R1 671B, the distilled 1.5B and the CombinedModel get "[Detailed reasoning] [Brief structured answer]"; Qwen2 1.5B "[Brief structured answer, without reasoning]"; both GPT-Neo controls "[Lack of reasoning and coherent answer]". The other observations (§5.3): the loss fell from 13.8 to 2.3 in the first epoch and to 1.1 later, "confirming the successful convergence of the model"; the CombinedModel improved significantly on the original small models; transferring knowledge via Enhanced Cross-Attention "enables the combined model to produce more structured and logically coherent outputs". Code and pretrained weights are released.
The released transcripts (compare-responses-from-models.md, all eleven graded in The evidence, rebuilt) add what the table hides:
The paper's discussion (§6) lists the advantages (lower cost than full fine-tuning of large models, adapting to a task by training on only the needed data, "the potential for exponential improvement in generation quality through the combination of representations from various architectures") and future work: combining other model types (a CNN with an LLM), studying different cross-attention configurations, and applying the method to business tasks. The blog frames the frozen model as a "database" whose "tables" the small model learns to use.
Nobody outside can rerun the paper's comparison cheaply, so this page rebuilds the architecture exactly, at toy scale, and runs the comparisons the paper did not. A frozen "large" model (2 blocks, width 48, 60,432 parameters) is pretrained on 560 arithmetic facts (sums of numbers up to 19, remainders by 2 to 9) in a brief format, 7 + 5 = 12, so it plays Qwen2's role: it knows the answer, and never reasons. The finetuning data play Bespoke-Stratos's role: reasoning traces such as Q sum 7 5 T 7 + 5 = 12 ; 12 - 5 = 7 ok A 12, for only 25% of the facts. Every variant then sees the same 140 traces; 364 problems that appear in no trace are the test (training details in Run the modules).
Mean of 3 seeds (range in brackets); each variant at its own best learning rate from {1e-4, 3e-4, 1e-3, 3e-3}, picked on 56 validation problems. "Generates right" is free-running greedy decoding from the prompt; "teacher-forced" reads the true trace; "future scrambled" replaces every token after the first "=" with a random number.
What the toy cannot test: scale, real language, and whether the real run's coherent outputs came despite the leak. It tests the mechanism and the comparisons, nothing more.
What holds up. The architecture is reasonable and fully released: code, weights and outputs, under the MIT licence, enough to check every claim, which is how the problems below were found. The one comparison that carries information is the CombinedModel against GPT-Neo trained alone on the same data: the alone versions produce mostly incoherent text (one sample states 5 plus 5 is 10 inside an invented riddle, then answers 25/8), the pair produces coherent traces with right answers on two prompts. Since the pair's small part also starts from random weights, the coherence must come from Qwen2's states, which supports the core idea that a frozen model's last layer can be read by a trained module. The author states the limits plainly in the blog ("I had no illusions of obtaining a fully reasoning model"), which counts in his favour.
What does not:
Verdict. An idea worth knowing, with no evidence that it beats the simple alternative. Believe that a trainable module can read a frozen model's last hidden states and learn a new output format from few examples (the toy confirms it, once the mask is fixed). Do not believe the paper's comparison with distillation, its loss curve, or its context and size claims.
CrossAttentionLayer (line 70: combine the padding mask with a lower-triangular one); load the pretrained GPT-Neo if that is what you want; mask the system prompt out of the labels; keep a fixed validation set; mind the 2,048-token cut.Training needs the frozen model in memory plus about 220 million trainable parameters and their optimizer state; the author used one NVIDIA L4. Inference needs the whole frozen model every token, plus the head.
The idea belongs to a real family: freeze the big model, train a small module that reads its internals. It is attractive whenever you want capability without owning or retraining the large model. The family's serious members differ from this paper in instructive ways:
What this paper does not establish is whether its version works at any useful scale. A 1.5B teacher and a 125M-sized student on 17k examples cannot tell you whether the approach survives at 70B, whether it beats a well-tuned distillation run under equal compute, or how it behaves when the frozen model's representations are out of distribution. Treat the architecture as a pointer to the literature above and the results as anecdotal.
A toy copy of the paper's architecture, trained offline and running in your browser: a frozen "large" model that knows 560 arithmetic facts and never explains them, and a trainable bridge plus "small" decoder that learned, from 140 reasoning traces, to explain them. Two trained versions ship with the page: as released (the cross-attention masks padding only, as in model.py) and fixed (a causal mask added). Everything else is identical, including the training data, steps and seed.
pre_proj, proj, the intermediate MLP, 2 Enhanced Cross-Attention layers (4 heads, adapter width 12, sigmoid gate), a GPT-Neo-style decoder (2 blocks, width 32, no attention scaling, zeroed positional embeddings, its token embeddings unused) and a new output layer: 51,872 trained parameters. Traces exist for 140 facts (25%); 56 are for picking the learning rate; the other 364 appear in no trace and are the test. The loss covers every token, prompt included, as in model.py.Greedy decoding, the whole prefix recomputed at every step (as model.py's generate_response does). Green tokens match the reference trace, orange ones do not.
Teacher-forced on the reference trace of the problem above, as in training. Each row is a position (the small-model stream, the query); each column a frozen-model state it reads (key). Cells above the diagonal are later tokens: the released model may read them, the fixed one cannot.
Every 250 steps of 2,500, batch 32, for the 3 seeds at the variant's learning rate; validation is the 56 validation problems. Unsmoothed.
The paper has one table and no figures, so this tab rebuilds what its claims rest on from the released material: the transcripts behind Table 1, the data the code actually trains on, the parameter count, and the context claim.
Table 1 as printed, then every response in compare-responses-from-models.md, graded by this page. Click a row for the prompt format and an excerpt.
Answer: states the correct result as its answer. Reasoned: a thought section that works toward it. Markers: both <|begin_of_thought|> and <|end_of_solution|>. One sample each, temperature 0.9, no seed (model.py's defaults for the CombinedModel; the GGUF models' settings are not given).
Measured by running model.py's prepare_dataset logic on Bespoke-Stratos-17k with Qwen2-1.5B's tokenizer (stratos_stats.py). The paper gives none of these numbers; they are new measurements, not reproductions.
model.py redraws the 30% subset, and with it the train and validation split, whenever the previous validation loss was below 1.8. The paper does not say when that first happened; the blog says the training loss was 2.3 after epoch 1, then fell by 0.05 to 0.2 per epoch, ending near 1.1. Choose the first epoch whose validation loss was below 1.8 with the slider.
From the configs and model.py (recompute.py). The check: every stored weight in 32-bit floats should take 4 bytes each.
Every link opens in a new tab. Reading time of the resources below: 3h 10m.
arXiv preprint (cs.CL), not peer reviewed, the paper itself; the HTML version has the anchors this page links to. abstract page, PDF.
(15 min)
the whole method is one file, model.py (979 lines, MIT licence), plus the full model outputs the paper's Table 1 summarises (compare-responses-from-models.md). The same files and the 7.2 GB checkpoint are on Hugging Face (kkolomeitsev/llm-modules), where they sit behind an access request; the GitHub copy is open. About 25 minutes for model.py and the outputs.
(25 min)
Kolomeitsev (the author's blog post): the same work told informally, with what the paper leaves out: one NVIDIA L4 for about 5 hours, under 10 dollars, how the GPT-Neo controls were trained, and the reshuffle rule.
(10 min)
Alayrac et al., DeepMind, 2022: the careful version of "a frozen model, read through new cross-attention": gated cross-attention layers inserted into a frozen language model, the gate starting at zero so training begins from the unchanged model.
(30 min)
Bansal et al., Google, 2024: two frozen models joined by trained cross-attention at several layers, evaluated on real benchmarks against fine-tuned baselines; the large anchor model reads the small one, the opposite direction.
(40 min)
Hinton, Vinyals, Dean, 2015: the distillation this paper sets itself against: train a small student on a large teacher's softened outputs.
(30 min)
Houlsby et al., 2019: the bottleneck adapter the paper's "Adapter Block" copies (down, non-linearity, up, residual), here inserted into a frozen BERT.
(30 min)
Bespoke Labs, 2025: the training data: 16,710 questions with DeepSeek-R1's reasoning traces and answers (math, code, science, puzzles), made for fine-tuning Qwen2.5 7B and 32B.
(10 min)
2025: the teacher behind both sides of the comparison. Bespoke-Stratos-17k is R1's reasoning traces, and DeepSeek-R1-Distill-Qwen-1.5B is a Qwen model fine-tuned on 800,000 of them.
adjacent in the same batch: a pretrained model read a second way, with small trained adapters and a learned mix.
adjacent in the same batch: trainable memory attached to a frozen backbone instead of retraining it.
2021: the cheap way to adapt the large model itself, which the paper cites but never compares against.
2023: LoRA on a 4-bit frozen model; fine-tunes a 1.5B model on one small GPU, the missing like-for-like baseline.
2017: the encoder-decoder cross-attention (queries from one stream, keys and values from another) the Enhanced Cross-Attention is built from, and the causal mask it leaves out.
2019: cited by the paper for transfer learning; an encoder read by a decoder through cross-attention, trained end to end.
2021: the kind of frozen encoder later joined to language models by adapters (Flamingo, LLaVA).
distillation, supervised fine-tuning on reasoning traces, adapters and parameter-efficient fine-tuning.
the Qwen2 and GPT-Neo families and how models are composed.
the Qwen2 family the frozen model comes from.
This page is one row of the Papers database; its properties (Paper, Takeaway, Topics, Year) live there.