Introduction
Standard knowledge distillation typically treats models as "black boxes." A small student model is trained to mimic the output probability distributions of a larger teacher model. However, this approach creates a significant bottleneck: the student must infer the teacher's underlying logic solely from final results. If a teacher employs complex internal algorithms—such as specific attention heads dedicated to tracking entities—the student may fail to capture this reasoning through behavioral mimicry alone.
Circuit Distillation addresses this by opening the black box. Instead of just teaching the "what" (outputs), it teaches the "how" (internal computations). By aligning the internal computational subgraphs, or "circuits," that perform specific tasks, researchers can effectively transplant algorithmic capabilities from large models to smaller ones.
Methodology
The framework for mechanistic distillation involves three primary stages:
- Quantifying Similarity with CKA: To compare models with different internal dimensions (e.g., a 1B vs. an 8B model), the authors utilize Centered Kernel Alignment (CKA). CKA measures the similarity of representations across different vector spaces, allowing for a direct comparison of internal activations regardless of model size.
- Functional Mapping: Identifying which student components correspond to which teacher components is critical. The authors use an ablation-based strategy to measure the importance of individual attention heads. Student heads are then mapped to teacher heads that exhibit similar functional importance for the target task.
- Composite Loss Function: The training objective combines standard Cross-Entropy (CE) loss with a CKA-based alignment loss. This alignment term penalizes the student if its internal circuit representations deviate from the teacher's mapped circuits.
This method enables targeted updates, where only the identified circuit parameters (typically 11-15% of the model) are fine-tuned, preserving the rest of the model's general knowledge.
Experimental Setup
The researchers evaluated Circuit Distillation on two reasoning-heavy tasks:
- Entity Tracking: Requiring the model to maintain the state of objects moving between containers.
- Causal Theory of Mind (ToM): Testing the ability to reason about characters' potentially mistaken beliefs based on partial information.
The experiments used Llama-3-8B variants as teachers and Llama-3-1B/3B models as students.
Key Results and Insights
Circuit Distillation consistently outperformed standard behavioral distillation across both tasks:
- Performance Gains: In Entity Tracking, a 3B student reached 0.82 accuracy with circuit distillation, nearly matching the 8B teacher's 0.85, whereas standard distillation only achieved 0.78. In Theory of Mind, the 1B student improved from a 0.55 baseline to 0.64, surpassing the 0.60 achieved by standard methods.
- Efficiency and Convergence: Models trained with internal alignment reached lower error rates significantly faster. The alignment acts as a powerful regularizer, guiding the student toward proven internal algorithms.
- Faithfulness: Ablation studies confirmed that the distilled logic was concentrated in the targeted heads. When non-circuit components were ablated, the models retained nearly all performance.
- The Importance of Mapping: Aligning student heads to random teacher heads resulted in a performance collapse, proving that functional correspondence is essential for successful mechanistic transfer.
Conclusion and Future Work
Circuit Distillation demonstrates that internal mechanisms are transferable across model scales. By shifting the focus from behavioral mimicry to algorithmic alignment, it provides a path toward smaller, more capable AI.
Future work will address the scalability of circuit discovery, which currently remains a labor-intensive manual process. As automated mechanistic interpretability tools improve, circuit distillation could become a standard technique for distilling massive models into efficient, high-performance successors.
Summary updated