atlas

Research map / Architectures and efficiency / Attention and transformers

Unifying Attention Heads and Task Vectors via Hidden State Geometry in In-Context Learning

NeurIPS 2025 · Architectures and efficiency › Attention and transformers · approach: Language model pretraining and induction · 0 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes a geometric framework that measures separability and alignment of query hidden states across layers to explain ICL in classification, linking Previous Token Heads (separability) and Induction Heads (alignment) to task vectors.

Problem

Prior ICL mechanistic work studies attention heads or task vectors through end-task ablations, without a unified account of how they shape query hidden states layer by layer to produce the output.

Approach

Shows theoretically that classification accuracy is upper-bounded by maximum separability of query hidden states, achieved when hidden states align with label unembedding vectors (output alignment and directional alignment); then measures these layer-wise and attributes them to PTHs and IHs via ablation and task-vector injection.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use ICL demonstrations instead of zero-shot promptingLlama2-70B · Classification datasetsclassification accuracyHelped
Increase the number of demonstrations from 4 to 24ICL · Classification datasetsclassification accuracyHelped
Select demonstrations using kNN retrievalICL · Classification datasetsclassification accuracyHelped
Replace demonstration labels with uninformative symbolsICL · Classification datasetsclassification accuracyHurt
Apply rank-10 SVD denoising to hidden statesLlama2-70B · Classification datasets, intermediate post-transition layersoutput accuracy: exceeding 10%Helped
Train a logistic classifier on last-layer hidden statesPretrained models · Classification datasets, zero-shotaccuracy: over 70%Helped
Train a logistic classifier on ICL hidden statesPretrained models · Classification datasets, 8-shot ICLaccuracy: ~10%Helped
Apply rank-5 denoising before unembeddingPretrained models · Classification datasets, final layerclassification accuracyMixed
Remove the top 10% of PTH outputs (ablation)Llama2-70B · Classification datasetsseparability scoreHurt
Remove the top 10% of PTH outputs (ablation)Llama2-70B · Classification datasetscomposite alignmentHurt
Remove the top 10% of IH outputs (ablation)Llama2-70B · Classification datasetsalignment measuresHurt
Remove the top 10% of IH outputs (ablation)Llama2-70B · Classification datasetsseparability scoreNo clear effect

Surprising findings

Limitations

Experimental setup

Datasets: SST-2 SUBJ TREC SNLI RTE CB Famous People

Benchmarks: SST-2 SUBJ TREC SNLI RTE CB

Metrics: accuracy separability score output alignment (logit lens accuracy) singular alignment variance-based alignment mean-based alignment composite alignment effective dimension

Baselines: zero-shot prompting random head ablation

Builds on: induction heads task vectors logit lens

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy