- Rating
- 2
- Confidence
- 2
- Informativeness
- 3
- Presentation
- 2
- Soundness
- 3(+1)
Read review
Paper summary
This paper investigates the mechanisms underlying in-context task learning (TL), particularly how pretrained language models infer arbitrary input–label mappings from demonstrations. The authors introduce a mapping-sensitive attention-head selection criterion based on paired contrasts between intact and randomized demonstration labels. They identify a small subset of "carrier heads" whose outputs support direct classification through query-dependent retrieval of contextual class votes.
Critical strengths
- A systematic and informative investigation of mapping-sensitive attention heads.
The proposed paired label-randomization criterion provides a meaningful extension of prior attention-head localization methods by targeting changes in class-directed outputs under different demonstrated mappings.The authors support their interpretation through several complementary analyses, including query-weight replacement, demonstration reordering. In particular, the substantial degradation under query-independent retrieval weights suggests that the selected readouts exploit query-specific information.
- A meaningful connection between mechanistic analysis and memory reuse.
The paper translates its mechanistic observations into Selective TL Memory, a concrete inference-time mechanism that preserves live retrieval over cached demonstrations.The evaluation covers multiple model families, tasks, and demonstration budgets. The matched no-access controls show consistent improvements when additional memory becomes visible to the selected heads. Comparisons against vector-based methods further illustrate the potential limitations of compressing demonstration evidence into fixed representations.
Critical weaknesses
- The methodological novelty is relatively incremental compared with existing work.
Several central ingredients have already been explored in prior literature. TSLA identifies attention heads associated with task learning, kernel-based accounts describe in-context learning as weighted retrieval over demonstrations, and label-anchor studies establish the importance of contextualized label positions. Furthermore, the kernel-vote decomposition in Equation (3) follows directly from the linearity of attention's value aggregation and output projection. Therefore, the decomposition itself does not establish a new learning algorithm.
The main methodological novelty appears to lie in the paired mapping-sensitive head-selection criterion and its integration with selective memory access. While useful, it remains unclear whether this combination yields a substantially new understanding beyond existing accounts of semantic retrieval and label information flow, or whether much of the practical benefit could be reproduced by simpler selection and caching strategies.This limits the significance of the algorithmic contribution, although the accompanying empirical analysis remains valuable.
- Limited generalization evidence and an incomplete practical comparison for selective memory.
Most evaluations focus on arbitrary label reassignment over familiar semantic classification tasks. The class-to-token mapping is fixed within each model–task configuration, and the head-selection procedure uses labeled validation queries. It is therefore unclear how well the selected carrier heads generalize to unseen label assignments or genuinely new decision rules without task-specific reselection.
In addition, the efficiency evaluation excludes one-time memory preparation and carrier discovery, and the memory states are initially constructed from full-prefix encoding. The paper does not provide a sufficiently direct comparison with competitive equal-budget KV-cache selection or retrieval-based attention methods.
Questions for authors
Q1. The class-to-token assignments are fixed across seeds within each model–task configuration. How well do the identified carrier heads transfer to previously unseen label permutations without head reselection? For example, could the authors select heads using one arbitrary label assignment and evaluate them on independent assignments of the same classification problem? This experiment would help establish whether the selection criterion identifies a reusable task-learning mechanism rather than a readout specialized to a particular mapping.
Q2.Could the authors compare Selective TL Memory against simpler KV-cache selection strategies under matched resident-memory and online-computation budgets, including retaining only contextualized label-position states without mapping-sensitive head selection? Additionally, how many repeated queries are required to amortize the cost of full-prefix memory preparation and head discovery?
Q3. The value-repair interventions modify value rows across all query heads in carrier-containing layers, rather than isolating the selected carriers. Can the authors provide more targeted interventions to distinguish the causal contribution of selected carrier heads from that of other heads in the same layers? This would strengthen the interpretation that the identified carriers implement a distinct task-learning pathway, rather than primarily serving as useful readout locations for information constructed elsewhere in the model.
2 comments
4. (Q3) Isolating the selected heads from other heads in the same layers.
We repeated the repair experiment with the intervention restricted to the eight selected heads, leaving the other query heads in the same layers with the corrupted values (experiment in Figure 3C):
| Repair scope | Self | Same-class | Cross-class |
|---|---|---|---|
| Full rows (all 32 heads in 6 layers, as in the paper) | 17.6 | 17.2 | 12.0 |
| Eight selected heads only | 15.2 | 14.0 | 10.8 |
The pattern is the same as with full rows. Repairing only the eight selected heads raises accuracy from 5.6% to 15.2% with self donors, against 52.4% clean, and same-class and cross-class donors give 14.0% and 10.8%. This recovers 20.5% of the clean–corrupt gap, compared with 25.6% for full rows, so the eight heads account for more than half of the full-row effect. Self and same-class donors again outperform cross-class donors, which supports a role for class-consistent contextual values and shows that this role is carried mainly by the selected heads. We will use this to replace the existing full rows result.
[1] Zhang, Zhenyu, et al. "H2O: Heavy-hitter oracle for efficient generative inference of large language models." Advances in Neural Information Processing Systems 36 (2023): 34661–34710.
We thank the reviewer for the careful review and address each point below.
1. (W1) Novelty relative to TSLA, kernel accounts and label-anchor studies.
We agree that the kernel-vote decomposition itself follows from linearity and does not establish a learning algorithm. Our work builds on TSLA and on the kernel and label-anchor accounts, and differs in three ways. First, their evidence uses 4–16 demonstrations, and we work with 70–180, where task learning is actually expressed (Figure 1). Second, our selection uses a paired contrast between intact and randomized labels, which cancels any contribution unchanged by relabeling (Eq. 8), and the heads it selects read out 14.67–25.87 points more accurately than TSLA-TL heads at the same budget on TREC-fine (Table 1). Third, we test the kernel account with query-weight, order and value-intervention controls, and we use the readout as a classifier and as a memory interface, which also turns the label-anchor observation into a compact memory.
2. (Q1, W2) Transfer to unseen label assignments without reselection.
Following the suggestion, we kept the heads selected on the original class-to-token assignment and evaluated them on a dfferent label set by random selection (Llama-3.1-8B/TREC-fine 2→5, 3 seeds, test accuracy %):
On the new label set, the ordering No access < selective access < full access holds for both budgets and both readouts, and the model readout with 30 heads keeps most of the gain over Natural (35.60 → 44.80, against 48.40 for all heads). Selective access still improves the fixed direct readout by 5.3 points with 8 heads and 8.5 with 30, against 9.3 and 10.5 on the original assignment. The direct readout is lower in absolute terms on the new label set, including under full access (43.73 against 48.40 for all heads). The new assignment is also slightly harder in itself (all heads 48.40 against 51.60). We will add this experiment to the paper.
3. (Q2, W2) Simpler KV-cache selection at matched budgets, and amortization.
At matched resident memory we compared with H2O [1], a widely used dynamic KV-cache selection method that retains positions for all heads without any head selection (Llama-3.1-8B/TREC-fine 5→10, eight heads):
At the anchor budget the resident memory is so small that H2O cannot retain enough to help. At the direct budget the two perform similarly. Our method is not in competition with dynamic KV-cache selection: the two are complementary, and combining H2O with our 30-head memory at the same budget gives a further gain.
The table gives the number of queries after which the total cost of our method, one-time cost plus per-query cost, is within 10% of the total cost of the standard prompt, for Llama-3.1-8B/TREC-fine 5→10 with the timings of Table 6:
Head discovery is the main one-time cost. Compared with standard K=10, memory preparation pays for itself almost immediately, and head discovery within tens of queries in the full-prompt setting and within a few thousand with prefix caching. Compared with standard K=5, which never encodes the extra demonstrations, the counts are larger. We will add these numbers to the cost section.