Introduction
Large Language Models (LLMs) are typically adapted to specific tasks using either Supervised Fine-Tuning (SFT) or In-Context Learning (ICL). SFT updates model weights using labeled data, making it computationally efficient during inference. However, in data-scarce (few-shot) settings, SFT often struggles with overfitting, poor generalization, and overconfidence (mis-calibration). Conversely, ICL—which provides examples directly in the prompt—generalizes better and yields more calibrated responses, but it consumes the limited context window and increases inference costs.
Researchers have discovered that SFT and ICL use fundamentally different internal "reasoning" pathways to solve tasks. To bridge the gap between efficient SFT and robust ICL, they introduce IA2 (ICL Activation Alignment), a technique that primes a model to mimic ICL’s internal activation patterns before standard fine-tuning.
The IA2 Methodology
The authors first demonstrate that SFT and ICL are functionally distinct. Even when producing the same output, their internal activations (the hidden states of the neural network) are misaligned, particularly in the middle layers.
To address this, the researchers propose IA2, a two-step "priming" pipeline:
- IA2 Priming (Self-Distillation): The model is first shown a query with ICL demonstrations, and its internal activations are recorded. Next, the model is shown the same query without the demonstrations. Using LoRA, the model’s weights are trained to minimize the Mean Squared Error (MSE) between these two sets of activations. Essentially, the model learns to "remember" the reasoning patterns it used when it had the help of examples.
- Standard SFT: Following this internal alignment, the model undergoes standard fine-tuning on the target responses to ensure the final output matches the desired format.
Unlike standard distillation, IA2 focuses on aligning internal functional behavior rather than just the final text output.
Key Insights and Results
The researchers validated IA2 across 12 popular benchmarks using the Qwen-4B and Llama model families, covering single-token tasks (sentiment analysis, true/false reasoning), multi-token tasks (math, scientific QA), and Out-of-Distribution (OOD) evaluations.
Functional Divergence and the Hidden Subspace: SFT and ICL are not just different interfaces; they operate via different mechanisms. Through Singular Value Decomposition (SVD), the authors found that SFT-only training explores a weight subspace almost entirely orthogonal to the ICL-like subspace. IA2 allows the model to access a richer weight space that SFT alone cannot reach.
Superior Performance and Calibration: The IA2 → SFT pipeline consistently outperformed standard SFT. For instance, on the FinS sentiment task (N=4), IA2 → SFT achieved 78.7% accuracy compared to SFT’s 67.4%. Crucially, IA2 significantly reduces Expected Calibration Error (ECE), meaning the model's probability scores more accurately reflect its likelihood of being correct. In the same FinS task, ECE dropped from 0.31 (SFT) to 0.16 (IA2 → SFT).
Efficiency and Robustness: On complex reasoning tasks like GSM8K, IA2-primed models closed the performance gap with ICL much faster as the number of training examples increased. Furthermore, IA2 demonstrated much stronger performance on OOD datasets, proving that aligning with ICL activations helps the model learn generalizable features rather than merely memorizing the training set.
Limitations and Future Work
While IA2 offers significant benefits, it requires an initial pass to collect ICL activations, adding a one-time computational cost to the training phase (though inference remains as fast as standard SFT). The results can also be sensitive to the choice of LoRA parameters. Because some layers are more sensitive to ICL than others, future work could explore "selective alignment" to target specific layers and save compute. Additionally, investigating how IA2 interacts with post-training techniques like Reinforcement Learning from Human Feedback (RLHF) presents a promising direction for future research.
Summary updated