Knowledge distillation compresses large language models into compact students that preserve aggregate metrics, yet the mechanistic consequences of depth-reduction distillation remain largely uncharacterized. This work applies linear CKA, logit lens analysis, attention pattern decomposition, sparse autoencoder feature statistics, and activation patching to compare GPT-2 and its six-layer student DistilGPT-2 across two canonical circuits: the Indirect Object Identification (IOI) circuit and the Greater-Than (GT) circuit. The results reveal a compression-collapse dichotomy: the IOI circuit suffers complete mechanistic collapse (DistilGPT-2: 35.2% accuracy vs. 94.8%, zero name-mover preservation), while the GT circuit survives with 87.7% task performance recovery through active remapping of the teacher's layer-9 comparison head into student layer~4 (mean Pearson r = 0.945). These findings demonstrate that circuit compressibility governs mechanistic survival under distillation, and that aggregate metrics are insufficient diagnostics for circuit integrity.
Figures & tables
Class
GPT-2 heads
Available in DistilGPT-2
Previous token
(0,1),(2,2),(4,11)
All 3
Duplicate token
(0,10),(3,0)
All 2
Induction
(5,1),(5,5),(6,9),(7,2),(7,10)
2 of 5
S-inhibition
(7,3),(7,9),(8,6),(8,10)
None
Name mover
(9,6),(9,9),(10,0),(10,6),(11,2)
None
Neg. name mover
(10,7),(11,10)
None
Table 1: IOI circuit heads by functional class and availability in DistilGPT-2 (layers 0-5 only).
Model
Layers
Params
PPL (TinyStories)
PPL (WikiText-2)
GPT-2
12
124M
11.54
33.02
DistilGPT-2
6
82M
17.55 (+52.1%)
49.33 (+49.4%)
Table 2: Perplexity comparison on TinyStories validation and WikiText-2 test sets.
Figure 1: Layer-wise CKA similarity under proportional mapping (top) and same-index mapping (bottom). Late-layer CKA collapses to 0.314 at layer 5 under same-index matching and is partially recovered under proportional mapping ( 0.790 ). Cosine similarity results agree in direction throughout.
Pair
GPT-2 ℓ
Distil ℓ
Δ Acc
rℓ
D0/G0
0
0
− 0.005
1.13
D1/G2
2
1
− 0.039
2.10
D2/G4
4
2
− 0.021
1.32
D3/G6
6
3
− 0.030
1.28
D4/G8
8
4
− 0.068
1.35
D5/G11
11
5
+ 0.006
0.97
Table 3: Extended logit lens accuracy comparison including mean probability assigned to correct next token ( pˉℓ ).
Figure 2: Attention pattern analysis. Top : entropy heatmaps for GPT-2 and DistilGPT-2 (Q1). Middle : previous-token attention heatmaps and layer averages; student peaks earlier at layer 1 (Q2). Bottom : distributions of per-head cosine similarity (mean 0.894 ) and entropy change (mean −0.007 bits) under proportional mapping (Q3).
GPT-2
Distil
Disc CKA
Eval CKA
Disc r
Eval r
NM Pres%
L9H6
L0H1
0.4659
0.4592
− 0.1535
− 0.1514
0.0%
L9H9
L0H1
0.3209
0.3261
− 0.1391
− 0.1378
0.0%
L10H0
L1H6
0.5077
0.5150
0.4597
0.4417
− 14.6%
L10H6
L1H6
0.3629
0.3926
0.6507
0.6484
− 21.3%
L11H2
L1H6
0.2073
0.1784
0.7802
0.7781
nan
Table 4: Full name-mover head matching results across discovery and evaluation sets.
Figure 3: DLA across layers for the IOI task. GPT-2 shows strong positive contributions from layers 9-10; DistilGPT-2 shows near-zero attribution across all available layers.
Figure 4: Attention heatmaps for GPT-2 name-mover heads and their closest DistilGPT-2 matches. Matched student heads fail to exhibit IO-selective attention.
Year
YY
Attention to YY token
Pearson r
GPT-2 L9H1
Distil L4H1
(full pattern)
1102
02
0.099
0.156
-
1503
03
0.239
0.175
-
1804
04
0.870
0.871
-
1505
05
0.085
0.233
-
1006
06
0.082
0.091
-
Table 5: YY-token attention weights for DistilGPT-2 L4H1 and GPT-2 L9H1 at the prediction position, across five representative GT examples.
Figure 5: DLA for the GT task. DistilGPT-2 shifts peak attribution to layer 4, functionally replacing GPT-2’s layer 9.
Language model distillation transfers a larger model’s capabilities to smaller or specialized models using outputs, probabilities, or internal representations.
Model distillation typically focuses on behavioral mimicry, where a student model is trained to replicate a teacher's output while treating its internal computations as a black box. In this work we propose an alternative approach: Distilling the underlying computational mechanisms implemented by a teacher model. Specifically, we propose circuit distillation, which introduces an objective to align internal representations between analogous circuit components in teacher and student models. We propose a method to match ``functionally correspondent'' circuit components and introduce a loss reflecting similarities between the representations that these induce. We evaluate circuit distillation on entity tracking and theory of mind (ToM) tasks using models from the Llama3 family. Our results demonstrate that circuit distillation outperforms standard distillation, successfully transferring algorithmic capabilities by adjusting only a small, targeted subset of student model parameters. This work establishes the feasibility of transferring mechanisms, which may in turn allow for efficient distillation of targeted teacher capabilities via interpretable and controllable internal student mechanisms.
Somin Wadhwa, Silvio Amir, Byron C. Wallace
Khoury College of Computer Sciences, Northeastern University, Boston, MA 02115, USA
Reasoning models produce long chain-of-thought traces that are costly to distill and encourage verbose student outputs. We study post-hoc compression of such traces before knowledge distillation. Two teachers, Qwen3.5-397B-A17B and gpt-oss-120B, generate about 283k correct traces each; two instruction-tuned models then compress them to 8.6-21.0% of their original character length. Across a 48-run main grid plus seven Qwen-teacher truncation ablations, compressed traces reduce training tokens to 12-30% of raw, speed up training by 2.0-7.6x, and shorten inference outputs by 3-19x with smaller reductions under the shorter gpt-oss teacher. However, raw traces retain the highest downstream accuracy at every scale and for both teachers. A length-matched raw-trace truncation ablation shows that compression is not merely benefiting from a smaller token budget: model-compressed traces usually beat or match naive truncation, especially for smaller students, while maintaining shorter inference outputs. Overall, reasoning-trace compression offers an accuracy-efficiency trade-off rather than a free improvement: students retain up to 96% of raw-trace accuracy while gaining up to 18x higher per-token efficiency, and at the 0.8B scale under LoRA compressed traces narrow the raw-vs-compressed gap but do not exceed raw.
Maxime Griot, Paul Steven Scotti, Tanishq Mathew Abraham
A correct teacher solution becomes useful supervision when the receiving student can continue its reasoning. We measure this compatibility with prefix recovery: after revealing 25%, 50%, or 75% of a verified solution, we test whether the student completes it correctly. We connect recovery to the cosine conflict between cross-entropy and reverse-KL gradients over the full vocabulary. Across adjacent Qwen3 teacher-student pairs from 0.6B to 8B parameters, reverse-KL distillation delivers its most consistent mathematical and code improvements for the two students below 2B parameters. On a fixed cohort of 1,000 trajectories, average prefix recovery rises from 71.0% to 91.9% as student size increases from 0.6B to 4B, and the robust-fragile recovery gap contracts from 46.0 to 14.4 percentage points. With the teacher fixed at 8B, conflict separation falls from 0.993 to 0.233. An independent objective intervention finds the largest reverse-KL rescue on fragile trajectories. The three measurements locate the same capacity-dependent transfer regime: distribution matching has the greatest headroom when correct traces remain unevenly recoverable. Prefix recovery provides a practical diagnostic for selecting costly distribution-level distillation.
Ruitong Li, Binjie Guo, Aisheng Mo +4
University of Hong Kong · Zhejiang University · Dalian University of Technology +1