acceptodds
Under review as a conference paper at ICLR 2027

CTA Triplet: Disentangling Context, Constraint and Alignment Stages in In-Context Learning with Source-Selective Validation

Abstract

In-context learning (ICL) enables language models to solve novel tasks from demonstrations without parameter updates. However, a fine-grained functional decomposition of the ICL procedure across network layers remains absent, which is potentially critical for advancing theoretical accounts of ICL. Via combining existing readout and causal intervention approaches, we introduce the CTA triplet, a layer-wise functional coordinate system that decomposes ICL procedure into three independently measurable stages: stage for context preparation, stage for task-constraint writing, and stage for native output alignment, quantified by context-state convergence, query-distribution sensitivity to demonstration perturbations, and the native margin of a fixed candidate pair, respectively. Source-selective interventions and position-preserving permutations verify their distinct functional identities. On Llama3-8B, 60.3–71.4% of classification examples and 70.0% of evaluated token-position trajectories in generation exhibit the following stage procedure: , as measured by peak order. Stage- scores correlate across layers with recovery of the final output margin after restoring query states from the original prompt (Spearman – across six task–corruption conditions). It enables stage-localized ICL failure diagnosis and repair with a maximum 5.4 percentage-point accuracy gain in held-out evaluation, and predicts functional-stage asymmetry in hybrid attention design, validated by depth-dependent performance effects of equal-budget attention replacement. Our CTA triplet establishes a unified testable framework bridging ICL theory, layer-wise readout, causal analysis, and architecture design.

Primary area:
interpretability and explainable AI
Keywords:
In-context learning, mechanistic interpretability, layer-wise representations, activation patching, causal analysis, hybrid attention

Reviews

Among:
Shape:
1234this paper, Bottom 10%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 1.67 over 3 reviews, above 10% of the others.
Reviewer_jDMZOpenReview ↗
Rating
2
Confidence
2
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

This paper proposes the CTA triplet as a framework for describing in-context learning across model layers through context preparation, task-constraint writing, and output alignment. The three coordinates measure distance to final context representations, sensitivity to demonstration perturbations, and the margin between the final winning label and its runner-up. The authors use activation interventions to examine these interpretations and explore applications to prompt repair and attention replacement across classification and generation tasks.

Critical strengths
  1. The paper addresses an important interpretability question and provides explicit operational definitions that make its hypotheses testable.
  2. The experiments combine layer-wise readouts with activation restoration, random-position controls, shuffled-state comparisons, and held-out evaluation, providing several complementary perspectives on the proposed coordinates.
  3. The reporting is also transparent about ordering reversals, weak intervention effects, and unsuccessful baseline comparisons, which helps clarify where the framework is informative and where its interpretation remains uncertain.
Critical weaknesses
  1. The main concern is whether the coordinates identify distinct ICL functions or partly reflect their construction.
  2. C measures distance from a final-layer reference, while A uses the retrospectively selected final winner, so their early and late behavior may arise partly from generic representation dynamics. T also responds to formatting changes and irrelevant demonstrations, making its interpretation as task-constraint writing insufficiently specific.
  3. Evidence for a sequential decomposition is mixed: mean T peaks follow A on two Llama tasks, and window-center ordering holds in only 23.8–58.9% of examples. The practical results provide limited additional support: Table 8 shows no improvement over the final output margin, and combined CTA repair produces a −0.23-point gain compared with +0.55 points for random repair.
Questions for authors
  1. Please examine whether the proposed ordering persists under no-demonstration and random-label controls, alternative intermediate readouts, and different normalization choices.
  2. Stronger source-selectivity tests would help distinguish task-rule processing from formatting sensitivity; the association between A and restoration effects should also be evaluated after controlling for depth and excluding final-block restoration.
3 comments
AuthorsOpenReview ↗

Author response to Reviewer jDMZ

Thank you for the proposed controls. They materially sharpen the conclusion: in the tested settings, these observables need not peak at the same depth; peak ordering also reflects general depth structure and endpoint definitions. T measures response to demonstration perturbations, not demonstration usefulness or correctness. The revised paper makes that distinction explicit.

1. Endpoint construction and ordering. Strict CTA order alone is insufficient evidence for three sequential functional stages. C is zero at its final-layer reference, and classification A uses the retrospectively fixed final winner/runner-up. In targeted post-review checks with 20 fixed examples per model–task group, random labels retain frequent order: clean→random strict counts are Llama SST-2/RTE/CB 12→11, 13→15, 14→14 and Qwen 16→14, 15→15, 12→13. Without demonstrations, C precedes A in 18–20/20 examples per group; T is identically zero and its localization is undefined (Table A11). These results support a general-depth contribution to the pattern. Source interventions supply the additional, coordinate-specific evidence: BH-positive query-to-A 18/18, label-to-T 12/18, input-to-C 4/18 (Section 4.1).

2. Native-margin scale and readout scope. The completed probability/logit comparison checks scale under the same native head, retaining the retrospective candidate pair. Only Llama CB strict counts change, 14→13 for clean and random labels; the other group counts remain fixed. Positive affine scaling preserves individual maxima but can alter aggregate peaks through reweighting (A.3/A.7). Intermediate-layer readout validity and alternative candidate definitions require separate tests; an independently trained readout comparison remains future work. We label the completed test as a margin-scale check.

3. Label versus format response. The targeted contrast supports greater response to the tested label changes than to the tested whitespace changes; it does not establish demonstration usefulness or correctness. We fixed this targeted post-review exploratory comparison before examining its new outputs; it was not preregistered. It uses four changed tokens per condition with sequence length preserved. Across two models/three tasks, all 120 model–example records qualify. Mean JS differences range from 0.00281 to 0.04931; individual bootstrap intervals are positive, and 10,000-draw sign-flip tests give Holm p≤0.0048 under null sign exchangeability (Table A12). Position and embedding-change differences bound the interpretation. Correctness is assessed separately: cyclic label changes improve Llama RTE from 17/20 to 18/20 and Qwen CB from 15/20 to 16/20. Section 4.1/A.8 ties the conclusion to the specific label/whitespace contrast.

4. Restoration after depth adjustment. The analysis shows substantial shared rank-depth structure, with limited evidence for correspondence beyond the fitted trend. Excluding the final block changes correlations only modestly, from 0.797–0.938 to 0.818–0.935; regressing both ranked curves on ranked depth then reduces them to −0.150 to +0.279 (Table A13). This descriptive adjustment separates the observed across-depth association from the causal output effect of replacing states. Section 4.3 and the discussion now interpret the result at that scope.

Thank you for your response and the new experiments. The label and whitespace comparison is useful, but it does not fully show that T captures task rules. The two tests of A use the same output head, so I am still unsure whether the results would be similar if using a different way to read the middle layers.

AuthorsOpenReview ↗

Follow-up response to Reviewer jDMZ: T and A

Thank you for your follow-up comments. They prompted us to refine our interpretation of T and conduct an additional experiment addressing A’s dependence on the intermediate readout.

  1. T: demonstration sensitivity and task rules.

The matched-count label/whitespace experiment shows greater sensitivity to the tested label changes across all six model–task groups. This provides targeted evidence of label-content sensitivity. Establishing sensitivity specifically to task rules requires further controls that separate rule changes from other consequences of modifying labels. Accordingly, we interpret T as demonstration-perturbation sensitivity and evaluate demonstration usefulness separately through task accuracy.

  1. A: dependence on the intermediate readout.

We compared native readouts with per-layer label probes, final-logit distilled heads, and residual distilled heads on Llama3-8B and Qwen3-4B across SST-2, RTE, and CB. Each group used 20 previously fixed evaluation queries, with separate 96-query training and 24-query calibration sets. Hidden states and the native final winner/runner-up pair were held fixed.

The residual head preserves the native final distribution by construction. Its mean per-query A-curve Spearman correlation with native A was 0.244–0.609 across the six clean-prompt groups. Calibrated peaks shifted 12.00 layers earlier on Llama SST-2 and 9.75 earlier on Qwen SST-2, while Llama RTE showed a small, uncertain shift of 0.55 layers later. Untempered logit peaks also shifted earlier across all six groups. Broad high-margin plateaus warrant interpreting exact peaks alongside full curves.

Holding native C/T fixed and replacing only A reduced strict-order counts in all six groups. Recomputing T through the same residual readout retained strict CTA order in 13–18/20 queries per group. Thus, frequent ordering can persist while A’s precise profile depends on the readout.

Following your comments and these results, we interpret A specifically as the native output margin for the retrospectively fixed candidate pair. Its peak identifies the strongest separation expressed by that readout. This targeted exploratory check reuses historical evaluation queries and one training/calibration split; its scope is the tested lightweight, task-restricted readouts.

Reviewer_jd5fOpenReview ↗
Rating
1(−1)
Confidence
3
Informativeness
2
Presentation
3(+1)
Soundness
2
Read review
Paper summary

The paper introduces the CTA triplet, a layer-wise functional coordinate system for in-context learning. It decomposes the ICL procedure into context preparation (C), task-constraint writing (T), and native output alignment (A), quantified by context-state convergence, query-distribution sensitivity to demonstration perturbations, and the final winner/runner-up margin. The authors validate the three stages on Llama3-8B, Qwen3-4B/14B, Gemma2-2B-IT, GPT-2, and Mamba-2.8B using source-selective interventions, position-preserving permutations, state restoration, prompt repair, and attention replacement. The headline claim is a C-to-T-to-A stage order in 60.3-71.4% of Llama3-8B classification examples and 70.0% of evaluated generation trajectories, with repair yielding a maximum 5.4-point accuracy gain.

Critical strengths
  1. The paper attempts a genuinely operational, layer-wise functional decomposition of ICL, moving beyond coarse "readout vs intervention" dichotomies. The three scores are defined with explicit equations and tested with a broad ensemble of sensitivity analyses, position-preserving permutations, random-position controls, and BH correction.
  2. The reproducibility package is unusually strong: exact JSONL inputs with SHA-256 manifests, reference-results CSVs that reproduce the main table numbers, and CPU-only verification scripts. This makes the empirical claims substantially easier to check than most submissions.
Critical weaknesses
  1. The core C-to-T-to-A stage-order claim is weak and partly contradicted by the paper's own data. Strict order holds in only 60.3-71.4% of Llama examples, mean aggregate peaks on some tasks put T after A, and the stricter window-center analysis gives only 23.8-58.9% agreement. The abstract and contribution bullet do not adequately convey that the claimed procedure is a majority pattern, not a law.
  2. The practical-facing claims are not established. The repair policy's largest single gain is 5.4 pp from a 56-example set with McNemar p=0.25; the six-run mean gain is only about +1.57 pp; random repair has a more favorable mean gain than the score-based policies; and the attention-replacement experiments do not demonstrate an advantage over layer-position selection. The paper is honest about these limitations, but the framing still overstates their translational value.
Questions for authors
  1. Please report the full distribution of confirmed strict order, T-before-A, tie/overlap, and no strict order per task/model, rather than only the strict-order range. Does the central claim survive the fact that many examples do not follow C-to-T-to-A?
  2. In the abstract, please clarify which model(s) and subsets the 60.3-71.4% and 70.0% figures refer to. The current wording invites an overly general reading.
  3. What exactly is the role of Random repair in the repair comparison? With random actions giving a mean gain around +0.55 pp versus -0.10/-0.23 pp for the score-based policies, how should the threshold policy's usefulness be assessed?
  4. Please provide paired per-example or per-model-task McNemar confidence intervals and total intervention rates for all six threshold runs, including the 5.4-point gain.
  5. Does Stage T correlate with final output correctness, or only with response magnitude to arbitrary prompt perturbations? If only magnitude, is the name "task-constraint writing" fully justified?
  6. How were the sparse layer grids for the Spearman correlations chosen, and what is the matched-layer permutation null rather than the network-level permutation? The n=6 layer correlations should be interpreted with that context.
  7. For the attention-replacement experiments, please report whether the early/middle/late layer groups are balanced in count and position, and how any imbalance affects the conclusions.
  8. Can the trained probe and attention-replacement historical outputs be added to the packaged reference results so the full paper, not only the token suite, can be independently recomputed?
1 comment
AuthorsOpenReview ↗

Author response to Reviewer jd5f

Thank you for the detailed questions. The revision's central result distinguishes demonstration sensitivity, supervised label decodability measured by a probe, and the native margin for a retrospectively fixed candidate pair, while the controls delimit functional readings of their depth profiles. We address your requests below.

Q1. Full order distributions. Strict CTA is a recurring, condition-dependent statistic; order alone is insufficient evidence for three sequential functional stages. Table A9 reports all six permutations and tied indices: strict counts are Llama CB/RTE/SST-2 40/56, 167/277, 62/100; Qwen 39/56, 208/277, 74/100; Mamba RTE 10/277. Table A10 supplies marginal T/A order, window overlap, and window-center order. Selecting the latest exact maximum preserves the six Transformer strict-order totals. Peak locations remain descriptive argmax summaries; adjacent-layer differences can be small, so we do not treat individual peak layers as precisely estimated functional boundaries. Random-label/no-demo results in Table A11 explain why a functional interpretation also requires intervention evidence (Section 4.2; A.7).

Q2. Abstract scope. The 60.3–71.4% range refers to Llama3-8B's three classification tasks. The 112/160 generation result comprises positions 1/2/4/8 from 40 Llama prompts; the prompt is the independent sampling unit. Prior generated tokens are fixed and C is shared across positions. These restrictions now appear in the abstract and limitations.

Q3. Random repair. The comparisons currently establish no reliable selection advantage. The original random baseline chooses uniformly among no change and three repairs (75% expected intervention); threshold rates are 57.4–62.0%. We completed an additional descriptive reference matching the total number of interventions, then sampling repairs uniformly. The point estimates are positive in five of six runs, but the action mix and execution cost are not matched and uncertainty for this threshold-minus-random contrast was not estimated; we therefore treat this as descriptive context only (A.10). A count- and cost-matched CTA attention-selection comparison remains future work.

Q4. Paired statistics and uncertainty. All six threshold-gain intervals include zero. Table A14 now reports corrected/harmed examples, intervention counts, exact McNemar tests, and conservative per-run gain intervals. For Qwen CB, three corrections and zero harms among 56 examples give +5.36 points, p=0.25, CI [−6.67, 16.37]. Across all runs, the equal-weight macro-average is +1.57 points. A.10 specifies the Bonferroni combination of correction/harm binomial intervals and their conditional scope for stored out-of-fold predictions.

Q5. T and correctness. We define T as demonstration sensitivity. Its peak/mean correlations with correctness range from −0.211 to +0.017 / −0.264 to +0.036 across six runs (A.9). In the Llama SST-2 quality experiment, irrelevant demonstrations increase peak T (0.0908→0.1123) while accuracy falls (92%→83%; Table 5). These results separate response magnitude from task success; the new label/whitespace contrast provides evidence about the tested perturbation channel (A.8).

Q6. Depth and effective sample size. Excluding the final block changes the correlations only modestly, from 0.797–0.938 to 0.818–0.935, whereas residualizing both ranked curves against ranked depth reduces them to −0.150 to +0.279 (Table A13). We interpret this as evidence of substantial shared rank-depth structure, with limited evidence beyond that fitted trend. Those analyses use all 32 Llama blocks. Sparse demonstration-state restoration instead uses seven stated depths per model, including a final zero-effect control, leaving six exploratory points. A.9 lists the grids and fixed-network curve-matching nulls; circular shifts have p-resolution 1/32.

Q7. Attention counts. Early–late counts match within each model/operator, while the Llama kernel-linear middle group has fewer layers. Section 4.5/A.6 lists zero-based groups: Llama sliding-window 0–4/13–17/27–31 (5/5/5); kernel-linear 0–4/14–17/27–31 (5/4/5); Qwen 0–5/15–20/30–35 (6/6/6 for both). We interpret these as depth-sensitivity comparisons and identify CTA-specific policy evaluation as future work.

Q8. Reproducibility. The revised supplementary archive includes historical outputs and CPU checks for six probe summaries, 24 kernel-linear and 18 sliding-window conditions, plus all new-control records (A.11). The README specifies what each check reproduces. Archived probe A is normalized: Llama CB normalized peak 24 and the historically reported raw peak 26 are distinguished in A.3/A.11; independent raw-peak verification and refitting require feature outputs or a matched rerun. Full tables and manifests provide the audit details without conflating protocol versions.

Reviewer_8YdFOpenReview ↗
Rating
2
Confidence
2
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

This submission analyzes in-context learning using three layer-wise metrics (CTA) intended to characterize context preparation, task-constraint formation, and output alignment. The authors assess these metrics through targeted activation interventions and report a recurring C→T→A peak ordering in Llama-3-8B across classification and generation tasks. They further evaluate CTA-guided prompt repair and examine layer sensitivity through attention replacement.

Critical strengths

The paper defines a “layer-wise functional coordinate system” to ground the framework. What works well here is the concrete specification: T captures sensitivity to perturbed demonstrations (order, label, and input changes), and A tracks a fixed winner-versus-runner-up margin across layers. This joint setup is quite practical, turning abstract ideas about ICL phases into something directly testable.

Critical weaknesses

The practical utility of the CTA framework.\textbf{The practical utility of the CTA framework.}

The utility of combining all three metrics remains questionable. As shown in Table 8, CTA-based error detection matches a simple final output margin baseline (0.794 vs. 0.795), and prompt repair actually hurts accuracy. Furthermore, while the attention-replacement section shows differences across layers, it does not demonstrate that a CTA-guided layer selection policy outperforms standard heuristics. As a result, the submission does not convince me that C and T provide actionable utility for failure diagnosis or prompt repair.

Questions for authors

Relation to Contextualize-then-Aggregate.

The paper says that contextualize-then-aggregate covers the functions measured by C and T. I’m still not clear on what CTA adds to this account. Is it mainly a new way to measure these functions, or do the results suggest a further distinction in how the model processes the task? It would help if the authors could point to the finding that best shows what we gain from using the three scores.

2 comments
AuthorsOpenReview ↗

Author response to Reviewer 8YdF

Thank you for asking what the three-coordinate framework adds beyond existing ICL accounts and simple predictive baselines. We revised the contribution around an empirical distinction: the depth profiles of these observables can differ in the tested settings; this separation does not by itself establish sequential functional stages. The framework tests these relationships against controlled prompts and state interventions.

1. Contribution relative to Contextualize-then-Aggregate. CTA operationalizes comparisons motivated by contextualization and aggregation accounts. Two concrete findings explain the value of making the measurements separately:

  • Llama SST-2 mean peak T rises from 0.0908 to 0.1123 with irrelevant demonstrations while accuracy falls from 92% to 83% (Table 5). Thus increased perturbation response can accompany worse task performance.
  • In the separate supervised-probe protocol, Llama RTE/SST-2 reaches 80% out-of-fold accuracy at layers 13/8, while native A peaks at 24/26 (Section 4.2; A.3). Probe-based label decodability and the native margin for the retrospectively fixed candidate pair are different events.

These findings constrain the interpretation of a single “task-processing stage.” Source interventions add coordinate-specific evidence: BH-positive targeted-minus-random contrasts occur in 18/18 query-to-A, 12/18 label-to-T, and 4/18 input-to-C settings (Section 4.1). Targeted post-review controls on two models and three tasks, with 20 fixed examples per group, further show larger responses to four-token label changes than four-token whitespace changes (Holm p≤0.0048; Table A12). This supports sensitivity to the tested label channel relative to that format control.

2. Role of C and joint analysis. C adds a representation-space comparison to the query-distribution measurements. Position-preserving input shuffling changes mean mid-to-late C by 0.045–0.101, versus 0.0007–0.0026 for label shuffling across six runs (A.2). The weaker 4/18 input-zeroing result bounds its source-specific interpretation. C also allows us to test whether early representation-distance peaks depend on demonstrations: early-C/late-A persists without them (Table A11). We therefore present C as a structural comparison, not as an independently validated task-relevant score; its independent predictive value remains open. The revised discussion separates this comparative contribution from a demonstrated advantage of combining all three scores.

3. Practical utility. Current results establish neither predictive superiority over the final margin nor reliable repair gains. Table 8 gives CTA/final-margin AUROC 0.794/0.795 and learned repair gains −0.23/−0.10 percentage points. The separate threshold policy has an equal-weight six-run macro-average gain of +1.57 points; all six paired gain intervals include zero (Table A14). Qwen CB's gain comprises three corrections and zero harms, p=0.25. Attention replacement establishes depth sensitivity under the tested configurations. A CTA-based selection policy versus count- and cost-matched depth/random policies remains future work. Section 4.5 now leads with these conclusions, keeping application claims proportional to the evaluations.

Thank you for the comments. I have carefully reread the paper and the responses. I think CTA does provide some observations and statistics inside the models as an audit paper. However, it doesn't offer a clean improvement in prediction and repair which limited its contribution, and therefore I decide to maintain my score.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.