potentialpaper

Task Vector Geometry Underlies Dual Modes of Task Inference in Transformers

Hao Yan, Haolin Yang, Yiqiao Zhong

NeurIPS 2026

Edit this page

Or clone it with git

Run in a terminal:

Needs Git LFS. To push, use an API key from your profile as the password.

Or let your agent set it up

It checks and sets up everything: signing in, git, the clone, credentials and an SSH key.

TL;DR. Transformers use two distinct mechanisms for task inference: Bayesian retrieval of seen tasks through task-vector mixtures, and extrapolative learning of novel tasks through a nearly orthogonal subspace

Abstract. Transformers are effective at inferring the latent task from context via two inference modes: recognizing a task seen during training, and adapting to a novel one. Recent interpretability studies have identified from middle-layer representations task-specific directions, or task vectors, that steer model behavior. However, a lack of rigorous foundations hinders connecting internal representations to external model behavior: existing work fails to explain how task-vector geometry is shaped by the training distribution, and what geometry enables out-of-distribution (OOD) generalization. In this paper, we study these questions in a controlled synthetic setting by training small transformers from scratch on latent-task sequence distributions, which allows a principled mathematical characterization. We show that two inference modes can coexist within a single model. In-distribution behavior is governed by Bayesian task retrieval, implemented internally through convex combinations of learned task vectors. OOD behavior, by contrast, arises through extrapolative task learning, whose representations occupy a subspace nearly orthogonal to the task-vector subspace. Taken together, our results suggest that task-vector geometry, training distributions, and generalization behaviors are closely related.

Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.

Claim this paper
How does this paper connect to your work? Write how you built on it, compared with it or reproduced it, or add a summary, a critique or errata.
Or make it interactive:
Start writing

edit · history

DateVersionSubmitted toPDFEvidence
1 May 2026NeurIPS 2026submittedNeurIPS 2026Accept (poster)reviews ↓[1]PDF[1]
Missing a version?

NeurIPS 2026

Accept (poster) · 3 reviews · OpenReview

Updated 25 Nov 2026, 03:45 UTC.

Program Chairs · DecisionOpenReview ↗
Decision
Accept (poster)
Read decision
Meta-review

Given the unanimous positive leaning, I am tentatively in favor of accepting the paper. The core claim of the paper is that under certain assumptions about the generative process (called P0--P3), one can demonstrate the existence of "task vectors" that are a simplicial mixture of the individual tasks the model was trained on; however, if task diversity is high (and some other conditions, e.g., large context, are met), one will find a transition into a general Bayesian inference strategy whereby the model assumes a continuous prior over underlying generative process. While there has been a lot of rich work in the past on this topic, the authors identified a well-defined setup where this phenomenology can be theoretically grounded. The main weaknesses of the paper boil down to use of toy setups that favorably match authors' assumptions and a lack of validation in realistic scenarios. I liked the Dyck example and would argue that as long as that example is properly emphasized, the paper clarifies to the reader the validity of the claims made being conditioned on the assumptions---I would thus strongly the authors highlight this experiment earlier on in the paper. Meanwhile, for a more realistic scenario, I would recommend the authors check out [1], which can offer a simple yet rich experimental setup that will plausibly match their assumptions; if it does, it would be a good spot to validate the claims in a more practical scenario. Adding this experiment would help me weight this paper for a sure accept.

[1] https://arxiv.org/abs/2511.00617

Final justification

Given the original scores, my own read, and also the response to rebuttals were all positive, I recommend the paper for acceptance.

Area Chair wq6K · Meta-reviewOpenReview ↗
Read meta-review
Meta-review

Given the unanimous positive leaning, I am tentatively in favor of accepting the paper. The core claim of the paper is that under certain assumptions about the generative process (called P0--P3), one can demonstrate the existence of "task vectors" that are a simplicial mixture of the individual tasks the model was trained on; however, if task diversity is high (and some other conditions, e.g., large context, are met), one will find a transition into a general Bayesian inference strategy whereby the model assumes a continuous prior over underlying generative process. While there has been a lot of rich work in the past on this topic, the authors identified a well-defined setup where this phenomenology can be theoretically grounded. The main weaknesses of the paper boil down to use of toy setups that favorably match authors' assumptions and a lack of validation in realistic scenarios. I liked the Dyck example and would argue that as long as that example is properly emphasized, the paper clarifies to the reader the validity of the claims made being conditioned on the assumptions---I would thus strongly the authors highlight this experiment earlier on in the paper. Meanwhile, for a more realistic scenario, I would recommend the authors check out [1], which can offer a simple yet rich experimental setup that will plausibly match their assumptions; if it does, it would be a good spot to validate the claims in a more practical scenario. Adding this experiment would help me weight this paper for a sure accept.

[1] https://arxiv.org/abs/2511.00617

Final justification

Given the original scores, my own read, and also the response to rebuttals were all positive, I recommend the paper for acceptance.

1 comment
Authors · CommentOpenReview ↗

We thank the area chair for the constructive and largely positive feedback, and for recommending the belief-dynamics reference.

Scope of our claims

First, we would like to clarify that P0–P3 are not assumptions on the data-generating process; they are testable properties expected from the property of the data. Without the key Markov property (as in Dyck), even P0 can fail when no fixed local state summarizes the relevant history.

We will move this scope qualification, together with a brief description of the Dyck counterexample, into the introduction immediately after P0–P3, so readers understand from the outset that task-vector geometry is a property to be tested rather than an innate property of transformers.

Relaxing first-order Markov assumption

We agree that the first-order Markov assumption is strong. As suggested by Reviewer spCn, we conducted new experiments with second- and third-order Markov chains (MCs) within the same framework. Finite-order MCs broaden the scope of data distributions while remaining tractable in our setting:

  • The sequences carry richer (w+1)(w+1)-gram statistics than the 2-gram statistics of first-order MCs, and are thus more realistic.
  • The framework still covers finite-order families, because any finite-order MC is first-order on the lifted state space obtained by blocking a local window of tokens.
  • Dyck, on the other hand, requires infinite-order dependence: no fixed local window suffices to summarize the relevant history.

Treating Markov order as a simple measure of complexity, we find that our conclusions remain robust at orders 2 and 3: P0–P3, the M1-to-M2 transition, and the near-orthogonal separation all persist. Please see our response to Reviewer spCn (Q1/W3) for details.

Pretrained-LLM belief-dynamics study

We followed the AC's suggestion and conducted experiments with the LLM persona data. More specifically, Bigelow et al. (arXiv:2511.00617) study how an LLM's belief about which persona it is talking with evolves as in-context evidence accumulates. We adapt their persona data (Anthropic/model-written-evals) into a generative design that directly mirrors our latent-task framework, and evaluate it using Llama-3.1-8B-Instruct. A context is a list of NN statements the persona would say, e.g., for psychopathy:

Here are some statements about myself:

  • I have what it takes to get to the top
  • I don't really care what others think about me
  • ... (NN statements in total)

Another statement about myself:

Under our framework, a persona is a latent task, and its statements are its emissions; thus a context is an exchangeable sequence drawn from the persona's emission distribution (an order-0 analogue of our Markov setting), so the belief over personas plays the role of the posterior over tasks.

We use KK = 3 personas (psychopathy; interest-in-science; agreeableness) and split each persona's statements into two disjoint sets, one for building its task vector and one for evaluation. All hidden states are taken at the prompt's final token (the last line above), at a middle layer (6 of 32). Each persona's task vector is the average of this state over three contexts of 128 task-vector-set statements. Evaluation contexts are three independent sequences per persona from the evaluation set, truncated to NN = 0–128; we fit each evaluation hidden state by least squares as a weighted combination of the three task vectors, with the weights summing to one (not forced nonnegative), read the weights as the model's belief, and average the three sequences per cell.

At NN = 0 the context is empty, so the weights default to the uniform 1/3 and the projection R2R^2 is 0. The trajectory with psychopathy statements as the context length grows:

NN 0 1 4 16 64 128
belief on psychopathy 0.33 0.40 0.50 0.60 0.73 0.95
belief on interest-in-science 0.33 0.27 0.28 0.21 0.11 −0.02
belief on agreeableness 0.33 0.33 0.23 0.19 0.16 0.07
projection R2R^2 0.00 0.02 0.05 0.16 0.33 0.72

Hence, the hidden state moves steadily toward the context persona's task vector, with a growing share of it explained by the task-vector plane (R2R^2: 0→0.720\rightarrow0.72); the same qualitative pattern holds for the other two personas. Averaged over the three contexts, the final belief is 0.96, matching the precision limit of the task vectors themselves.

We will cite Bigelow et al., clarify how the two perspectives are complementary, and summarize these new findings in Sec. 6.1 alongside our existing Qwen2.5-7B result.

Reviewer GdjiOpenReview ↗
Rating
5/6
Confidence
3/5
Quality
3/4
Clarity
3/4
Significance
3/4
Originality
3/4
Contribution type
general
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

This paper studies how a transformer behaves on different types of tasks and argues that a single model does this in two different ways. The authors train transformers on synthetic tasks, define a task vector, and propose a set of properties describing how the model encodes the task. For familiar tasks, the model recognizes and retrieves the answer using the space spanned by these task vectors, while for new tasks it uses separate space that is nearly perpendicular to the first.

Strengths and weaknesses

Strengths

  • S1. The paper replaces heuristic-based task-vector extraction with a principled framework that defines task vectors through testable properties (P0 to P3 in the paper). I like this because the earlier definitions had no property to fail against. This paper (at least in its controlled setting) can check whether a candidate vector captures task structure rather than just happening to steer the output.
  • S2. I believe the double dissociation is a very convincing result with a clean cause-and-effect test. Turn off the task subspace and the model fails on memorized tasks but still handles new ones. Turn off the near-orthogonal subspace and the opposite happens. Since the two behaviors break independently, they point to two separate mechanisms rather than one thing described two ways.
  • S3. The authors include a bracket-matching experiment that deliberately breaks the paper's core assumption. I value this because it shows the authors know exactly where their framework stops applying, which points to a well-designed setup.

Weaknesses

  • W1. The properties and the dissociation are stated as if they hold in general, but the paper's per-layer results show they mostly hold in the middle layers. Table 2 also reports its intervention result as an average over a middle-layer band rather than across all layers. Presenting the properties and Table 2 without this depth qualifier can invite over-generalization. In fact, extracting a task vector from a late layer would recover none of these properties, so the depth band is part of what makes the method work and belongs in the statement of the claims rather than being left to the appendix.
  • W2. The paper does not cleanly explain the depth pattern it relies on. The appendix offers partial evidence, but it does not elaborate why the transitions land at the particular layers observed nor how this depth localization connects to the two-mode claim. This leaves the reader unable to tell whether the middle-layer concentration is a fundamental feature of how the two modes are represented or just an artifact of these particular models and tasks.
Questions
  • Q1. Why do the properties and the mode separation show different trends across layers? The authors should investigate the reason for this layerwise trend more deeply and connect with prior work on how transformer layers specialize with depth. The point is to clarify whether the depth localization is an incidental artifact or a structural feature of the two-mode claim.
  • Q2. The per-layer results (Figs 18 and 19) show the double dissociation is a middle-layer phenomenon. What should a reader conclude about the two modes at the output layers that produce the token? It would help to distinguish two cases. One is that the modes merge back together near the output. The other is that they resolved in earlier layers, thus the information is still present but no longer arranged along the perpendicular directions the probe measures. The paper hints at the second case but does not confirm it and so, showing whether the modes stay active at the output would help.
Limitations

yes

Final justification

Overall, the strengths outweigh the weaknesses. I recommend accept.

The authors resolved my main concern by clarifying that the two-mode separation is strongest in intermediate layers and by agreeing to narrow the claims and better present the full layerwise results.

Some remainders: the interpretation of Table 2 and the differing layerwise behavior of P0–P3.

Formatting concerns

N/A

4 comments
Authors · CommentOpenReview ↗

We thank the reviewer for the careful reading and insightful questions about the depth band.

W1: clarifying the role of depth band in our claims

We agree that the depth qualification was indeed not made clear enough in the current text. While the theoretical definitions apply at any fixed layer, our empirical evaluation depends on the choice of depth/layer. A revision will report the following more carefully:

  • The empirical claims will carry the mid-layer qualifier, with the band stated for each experiment;
  • Table 2's caption will state that its results are averaged over these bands;
  • The per-layer figures (Figs 18 and 19) will be referenced beside the claims, and the regime where the analysis applies, the middle layers, will be stated so the scope of every conclusion is explicit.

We will also clarify that the band is selected by the following criterion.

The selection criterion. In the paper, the band was selected by two empirical signatures: small task-token interaction η2\eta^2 (the additive decomposition holds) and mode-selective intervention effects in the per-layer curves. The interaction is informative because next-token prediction must combine the current token with the task, so its rise marks where prediction formation begins. For pretrained models, where the ANOVA signatures are unavailable, the layer maximizing held-out in-distribution task-subspace R2R^2 plays the same role and recovers the same band.

W2 / Q1: why the depth pattern? Incidental or structural?

The available evidence suggests that the localization is structural rather than incidental. While we do not claim a universal layerwise pattern, we provide our justification for the observed depth pattern below.

Middle layers and connection to prior work

Task vectors are typically extracted from middle layers across the literature. We will expand the related work section to include relevant references.

  • Task vectors and function vectors are reported most effective there (Hendel et al. 2023, arXiv:2310.15916; Todd et al. 2024, arXiv:2310.15213);
  • Mid-depth is likewise the usual site for model editing and activation steering (Meng et al. 2022, arXiv:2202.05262; Rimsky et al. 2024, arXiv:2312.06681).
  • A recent broad evaluation reaches the same conclusion for representation quality in general: across 32 embedding tasks and multiple architectures, intermediate layers consistently provide stronger features than the final layer (Skean et al. 2025, "Layer by Layer", arXiv:2502.02013).

Selection of middle layers: our interpretation

In our setting, our working picture is the standard three-stage one: early layers are still computing lower-level statistics, the task subspace forms in the middle layers, and the later layers convert it into the next-token prediction. The appendix provides partial evidence for each stage (the per-layer probe and the intervention curves in Figs. 18–19, detailed under Q2), which is why most of our analyses focus on the middle layers.

Evidence that the localization is structural.

  • In our new experiments, we extended our analysis to 12 pretrained models (7 families, 0.5B–8B). We find that the criterion selects the layer our paper reports for Qwen2.5-7B (20 of 28; the paper analyzed all layers and presented this one due to the space limit) and falls within a consistent 41–71% relative-depth band in every model.
  • The loss-relevant OOD subspace overlaps the task subspace far above chance at layers 0–1 of the high-diversity setting (the shared-computation phase), while at the band layers the overlap falls to the level of a random subspace, so the two modes share building blocks before their representations are orthogonally separated.

To summarize the connection between the depth localization and the two-mode claim, the task-vector properties and the mode separation have a similar trend across layers. In particular, mode separation peaks at intermediate depth.

Authors · CommentOpenReview ↗

Q2: the two modes at the output layers

The reviewer distinguishes two cases: either the modes merge back together near the output, or they resolve in earlier layers, so the information is still present but no longer arranged along the directions the probe measures. Our measurements suggest the second case is closer to what happens. In plain terms, our picture is: both modes' information is carried forward to the output and remains in use there; what changes at the last layers is that the model relies increasingly on the next-token prediction assembled from both, and this prediction signal comes to dominate the residual stream. The evidence, mode by mode:

  1. The retrieval mode (task subspace). In E3, the setting with per-layer probe results in the appendix, task information is still present at the output: the probe finds a substantial unique task contribution at the last layer (ΔR2≈0.42\Delta R^2 \approx 0.42, down from ≈0.70\approx 0.70 in the band), so the information persists even where the properties fail. What changes is its form: E3's task×token interaction η2\eta^2 grows from <0.02< 0.02 at early layers to 0.420.42–0.510.51 at the last two layers (Table 1b), i.e., the additive task simplex re-encodes into task-specific token encodings, which is what a next-token predictor must build.

  2. The extrapolative mode (orthogonal statistic subspace). Two measurements show it neither vanishes nor merges into the task subspace. It remains causally active: in the per-layer intervention curves the reviewer cites (Figs. 18–19), suppressing the orthogonal subspace still moves OOD loss at the final layers (point 3 explains why the effect is no longer selective there). Geometrically it stays distinct: in a new principal-angle measurement on E3's high-diversity model, the loss-relevant OOD subspace remains near-orthogonal to the task subspace through the final layer (largest cosine 0.08–0.19 at layers 2–5); it does not rotate into the simplex at the output.

  3. Why the dissociation is nonetheless a middle-layer phenomenon. In Figs. 18–19 the two modes' computations are largely dissociated from each other across depth, except at the last one or two layers (layer 5 of E1/E3, layers 14–15 of E2), where the interventions lose selectivity and the same perturbations affect major, OOD, and minor prediction alike. The paper's probe quantifies what happens there: the model's own next-token prediction signal progressively dominates the residual stream, its unique share rising from ΔR2≈0.04\Delta R^2 \approx 0.04–0.050.05 at layers 0–1 to 0.860.86 at layer 5, and including it as a regressor absorbs essentially all of the late-layer interaction. The dominating factor at the last layers is therefore the prediction information, into which both modes feed. Whether this counts as a merge is a matter of terminology; the measurable statements are that the mode representations stay distinct (points 1–2) while part of the next-token prediction information is shared: suppressing the orthogonal subspace at the last layers also moves the retrieval mode's predictions (Fig. 18). This shared prediction signal is why intervention selectivity is lost there.

In the revision, we will add this interpretation to the main-text depth discussion, leave detailed layerwise evidence in the appendix, and flag a finer analysis of how these signals map into vocabulary logits as future work.

Reviewer Gdji · CommentOpenReview ↗

Thanks for the clarifications. Most of my concerns have been addressed. I have two remaining questions:

I encourage the authors to clarify two points in the final version. First, because the middle-layer band is identified partly from the intervention results, Table 2 should be presented as a descriptive summary with the full per-layer curves as the primary evidence. Second, the discussion should distinguish the different layerwise behaviors of P0–P3. The new 12-model analysis supports intermediate-layer task representations, but not necessarily the full two-mode causal separation across models.

Overall, the strengths outweigh the weaknesses. I raise my score.

Authors · CommentOpenReview ↗

We thank the reviewer for the positive assessment and agree with both suggestions, which sharpen the paper. In the revision, we will (i) present Table 2 as a band-averaged descriptive summary, with the per-layer curves (Figs. 18–19) cited as the primary evidence and, if space allows, a condensed per-layer panel included in the main text; (ii) discuss the layerwise behavior of each of P0–P3 separately, emphasizing the distinct roles of different depths: early layers construct shared features, later layers re-encode toward next-token prediction, and the intermediate layers, where the task representation is most cleanly separated, are where interventions are most effective, as the per-layer evidence in the appendix shows; and (iii) frame the 12-model result as observational evidence for mid-depth task representations: pretrained models are trained on data distributions far more complex than our controlled settings, so we present the two-mode causal separation as established in the synthetic settings and leave its causal validation in pretrained models to future work.

Reviewer x7HZOpenReview ↗
Rating
5/6
Confidence
4/5
Quality
3/4
Clarity
3/4
Significance
3/4
Originality
3/4
Contribution type
general
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

This work is motivated to understand how transformers internally infer latent tasks from context and how this inference relates to task-vector geometry. The paper studies small transformers trained from scratch on controlled synthetic latent-task sequence distributions. The authors define task vectors as latent-task-dependent directions in hidden-state space and propose a geometric framework in which hidden states decompose into task-related and token-related components. 

The claims of the paper are that two modes of task inference can coexist in a single transformer. For in-distribution tasks, the model performs Bayesian task retrieval: hidden states represent convex combinations of task vectors, and the coefficients approximately track the true Bayesian posterior over training tasks. For out-of-distribution tasks, the model shifts toward extrapolative task learning, where context statistics are represented in a subspace nearly orthogonal to the task-vector subspace.

Strengths and weaknesses

Strengths

Clear mathematical/statistical setup The paper provides a clear mathematical vocabulary for discussing task vectors. The properties P0–P3 give a useful hierarchy. This is an valuable and insightful attempt to make the heuristic notion of task vectors more precise.

Controlled synthetic setup The synthetic setup is well chosen for mechanistic analysis. Since the latent task and data-generating distributions are known, the authors can compute oracle Bayesian posteriors, estimate hidden-state coefficients​, and directly compare the two. This makes the posterior-alignment claim much cleaner than it would be in natural-language settings. 

Intervention experiments The work shows that β\beta correlated with α\alpha, it also ntervenes on the task-subspace component and shows outputs move toward the corresponding target mixture predictions, and the orthogonal-subspace interventions establish a double dissociation. This provides stronger evidence that the task-vector subspace is functionally involved in prediction. The two-mode analysis is also appealing. By varying task diversity, the paper shows a transition from retrieval-like behavior to extrapolative behavior, and the projection analyses suggest that OOD representations move away from the major-task subspace.

Weaknesses: novelty, experimental setup, applicability

Some findings may follow from linear factor analysis

In the Markovian synthetic settings, if I understand correctly, the optimal sufficient statistic is essentially the posterior over a finite task set plus the current token or input. If hidden states encode this statistic linearly, projecting onto class-conditional task-mean directions could naturally recover posterior-like barycentric coordinates, so the β≈α\beta \approx \alpha result may be less surprising than the framing suggests.

The causal results go beyond a passive factor-analysis account (which is nice), but the paper would be stronger if it established what the task-vector construction adds over standard baselines. Relatedly, Theorem 2 reads as a dimension-mismatch obstruction; here the empirical claim is near-orthogonality to col(Θ^\hat{\Theta}), whereas the theorem appears to justify only distance from the task subspace, and since random high-dimensional directions are near-orthogonal to any fixed low-dimensional subspace by default, a random-direction baseline would help show the separation is learned rather than generic.

Synthetic examples The experimental setup is quite favorable to the proposed framework. E1–E3 satisfy a first-order Markov property conditioned on the latent task, making it plausible that hidden states can be summarized by task identity and current token. The non-Markovian Dyck example is useful because it shows that this structure can fail, but it also highlights that the main framework may require a compact sufficient state representation to be meaningful.

Questions

How much of posterior alignment is explained by supervised linear factor analysis?

Since task vectors are estimated from task-conditioned hidden-state means, and β\beta is obtained by projecting hidden states onto the task-vector simplex, the posterior-alignment result may partly follow from the geometry of class-conditional means. Could the authors compare their task-vector basis against simpler baselines such as PCA/FPCA of hidden states, LDA-style class-mean subspaces, or linear regression probes from hidden states to α\alpha? This would clarify what the proposed construction adds beyond standard belief-state factorization.

What exactly is gained by Theorem 1 beyond decoding from assumed posterior coordinates?

Theorem 1 assumes posterior-aligned representations and then constructs a downstream computation that recovers the Bayesian predictive distribution. This seems like a useful expressivity statement, but it does not address whether training finds such a representation.

Can Theorem 2 be positioned as a low-rank approximation obstruction?

Could the authors connect the result to PCA/low-rank approximation or manifold embedding theory to clarify its contribution? Separately, the empirical claim is near-orthogonality, but the theorem appears to justify only distance from the task subspace. A baseline would help here too: how orthogonal are random same-dimension directions to col(Θ^\hat{\Theta}), and how does the reported R2R^2 compare?

How sensitive are the conclusions to the layer used for task-vector extraction?

The paper notes that task identity is most cleanly represented in middle layers, while later layers become more prediction-oriented. Could the authors provide a more systematic layer-selection criterion? This matters because task vectors extracted from different layers may support different interpretations.

Could the authors clarify the novelty relative to belief-state geometry and classical latent-variable models?

The paper connects to Bayesian belief states, linear representation hypotheses, and superposition, but the main synthetic results also resemble classical latent-variable posterior encoding plus low-rank geometry. A clearer comparison to classical factor-analysis/mixture-model interpretations would help readers understand what is uniquely transformer-specific.

Limitations

Yes

Final justification

Across two rounds of rebuttal, the authors resolved all three with concrete new experiments. The contribution is now clearly delineated and well-supported, and I recommend acceptance.

Formatting concerns

No concern

5 comments
Authors · CommentOpenReview ↗

We thank the reviewer for the careful and constructive assessment. Below we respond to each concern.

W1: Relationship to linear factor analysis

We want to clarify that our main contribution is a probabilistic framework that connects data distribution to internal representations. Our intention is not to propose better feature extraction techniques, but to provide justification and insights for the internal mechanisms such as Bayesian belief updates using testable properties P0--P3.

Our evaluation framework helps to verify implicitly held assumptions in the interpretability research such as linear representation hypothesis and feature superposition. Specifically, task vectors are commonly used to interpret and steer model behaviors without clear verification of the implicit assumptions. Our purpose is to clearly spell out testable properties that we can use to validate these geometric structures.

We fully agree with the reviewer's comment that "If hidden states encode this statistic linearly, projecting onto ..." We want to emphasize that our focus is to validate this "if" condition. Under our framework, P0 naturally leads to the task vector definition as conditional expectation, and P1 justifies that hidden states encode tasks via task vectors in long contexts.

W2: Scope of synthetic examples

We agree that the first-order Markov assumption is strong. We therefore conducted new finite-order Markov chain (MC) experiments within the same framework. Finite-order MCs broaden the scope of data distributions while remaining tractable in our setting:

  • The sequences carry richer nn-gram statistics than the 2-gram statistics of first-order MCs, and are thus more realistic.
  • The framework still covers finite-order families, because any finite-order MC is first-order on the lifted state space obtained by blocking a local window of tokens.
  • Dyck, however, requires infinite-order dependence: no fixed local window suffices to summarize the relevant history.

Treating Markov order as a complexity measure, we find that good representational properties (P0--P3) remain robust at low complexity (finite-order MCs), and break down at high complexity (Dyck). Concretely, we re-ran the main analyses at orders 2 and 3; the transition, P0–P3, and near-orthogonality all persist. See our response to Reviewer spCn (Q1 & W3) for details.

Q1: supervised linear factor analysis baselines

As requested by the reviewer, we ran the suggested LDA, PCA, and probe estimators through our paper's evaluation pipeline on E3. P0/P1 are functionals of the hidden states alone, so estimators can only differ on P2 (simplex interpolation), P3 (posterior alignment), and the causal injection (affinity = span overlap; 1 = identical):

estimator supervision P2 R2R^2 P3 Hellinger$(\beta,\alpha)$ held-out R2(β↦α)R^2(\beta\mapsto\alpha) subspace affinity to ours injection KL
Ours: class-mean averaging task labels 0.90 0.11 0.98 1.00 0.062
Diagonal LDA task labels 0.90 0.10 0.98 1.00 0.062
Within-token PCA + kk-means none (KK known) 0.90 0.09 0.98 0.98 0.063
Pooled PCA + kk-means none (KK known) 0.81 0.10 0.98 0.65 0.093
Random, norm matched none 0.58 0.61 0.16 0.02 0.223

The results show that our class-mean averaging is comparable to other methods and better than the random baseline, thus the posterior-alignment and intervention results are not artifacts of one particular estimator.

Our goal is to validate the class-mean-based task vector widely used in prior work (Hendel et al. 2023; Todd et al. 2024), not to advocate it over alternatives. In fact, our results justify different task vector calculation since they all lead to comparable results.

Below are detailed descriptions of newly implemented methods.

  • Diagonal LDA divides each coordinate by its within-class standard deviation, and reproduces every number above; its vectors align with ours at cosine ≥0.94\ge 0.94.
  • PCA. Under P0/P1 the hidden-state covariance splits into a task term, a token term, and noise, so the PCA variants differ in how they treat the token term. Within-token PCA, which subtracts the current-token mean and thereby removes the token term, recovers the task plane with zero task labels (cos⁡θ\cos \theta = (1.00, 0.99)). Pooled PCA skips the token conditioning, so token variation mixes into its components and it recovers the task geometry less reliably (table above). The geometry is thus discoverable without labels, but only after the token conditioning our ANOVA makes explicit.
  • Probes. Regressing hidden states on one-hot task identity recovers our estimator, since for a one-hot design the OLS coefficient of each task is that task's mean hidden state. Supervising on the oracle posterior instead gives consistent results (it uniquely explains 0.65–0.68 of hidden-state variance vs 0.70–0.71 for the task label).
Authors · CommentOpenReview ↗

Q2: What Theorem 1 adds beyond assumed posterior coordinates

Yes, we agree that Theorem 1 is an expressivity statement, not a training-dynamics one. We will be clear about its scope in a revision.

  • While there is a gap between expressivity and the actual training dynamics, this result certifies that transformers have sufficient capacity to express Bayesian predictive inference, thus showing that heuristic Bayesian interpretations are non-vacuous.
  • A rigorous training-dynamics theory often requires many more assumptions or holds under restrictive settings. A general theoretical account of the training dynamics is beyond this paper's scope.

Q3: Positioning Theorem 2 and comparison with random baseline

We agree that our Theorem 2 is a separation result, not an orthogonality result, and an orthogonality theorem likely requires stronger assumptions.

  • Connection to PCA/low-rank approximation. Low-rank approximation and manifold embedding theory are relevant but Theorem 2 is best read as a packing obstruction: the extrapolative predictive family has intrinsic dimension d0≫k∗d_0 \gg k^\ast, so a Lipschitz decoder reading near the low-dimensional task simplex cannot realize that many distinct predictions. The theorem forces the representation away from the simplex but does not constrain the geometry of the exit nor imply orthogonality.
  • Conclusion from Theorem 2. We agree that Theorem 2 is a conservative non-confinement result, not a near-orthogonality result. An orthogonality theorem likely requires stronger assumptions. See our response to Reviewer spCn (Q2).
  • Comparison with random baseline. While a random subspace may be similarly orthogonal to the task subspace in the high dimensional space, we find that the near orthogonality emerges from training, not inherited from random initialization. Our new experiment shows that the subspace starts well inside the task subspace (overlap 5–9 times that of a random subspace) and is driven out to the random level over the same window in which the extrapolative mode develops.

Q4: sensitivity to the extraction layer; systematic criterion.

We agree that the choice of layer is an important detail. Our qualitative conclusions are stable across a contiguous intermediate-layer band, but are not intended to hold uniformly across all layers.

  • In the synthetic experiments, the band is selected by two signatures, small task-token interaction and mode-selective per-layer intervention effects; the revision will make this criterion explicit.
  • For pretrained models, where the signatures are unavailable, the layer maximizing held-out in-distribution task-subspace R2R^2 plays the same role and recovers the same band: across 12 models in 7 families it selects layers within a 41–71% relative-depth band.
  • For further details about the impact of layer depth and layerwise analysis, see our response to Reviewer Gdji.

Q5 — novelty vs belief-state and classical latent-variable accounts

We agree the comparison should be explicit, and will expand the related work section.

  • Validating linearity in nonlinear transformers. Classical latent-variable models such as factor analysis begin with a low-rank generative assumption. In contrast, a transformer is a highly nonlinear system, and attention makes the point sharper than for RNNs or LSTMs: every layer has direct access to the context, so no recurrent bottleneck forces a compact summary. Yet a mid-layer summary forms; it is causally used although attention could bypass a perturbed state (injection moves outputs to the target mixture; the double dissociation separates two mechanisms); two modes coexist in one network with a diversity-driven transition, where a classical mixture account has one geometry; and the extrapolative mode leaves the task subspace orthogonally, with the exit learned from training (Q3).
  • Statistics-geometry connection in transformers is new. We are inspired by classical statistical latent-variable models and belief-state geometry: the former as a probabilistic foundation for characterizing the transformer's generalization behavior, the latter for describing the transformer's internal geometry. Our analysis and experiments reveal that statistical structures and geometry are strongly connected.
  • Clarifying complementary relation to related work. We will clarify our difference to belief-state geometry (Shai et al. 2024, arXiv:2405.15943): their belief is over the hidden states of a single toy process, recovered by supervised regression onto ground-truth beliefs; ours is over the latent task generating the sequence, estimated by projection onto class-mean task vectors with no ground-truth posterior supervision, and tested causally. The deeper difference is motivation: we start from the Bayesian account of ICL (Xie et al., arXiv:2111.02080) and the task-vector phenomenon, and aim to unify them with belief-state geometry as claims about one measured object.
Reviewer x7HZ · CommentOpenReview ↗

Thank you for the detailed response

I thank the authors for the thorough response. The new experiments address most of my concerns and materially strengthen the paper. I have three remaining follow-up questions, mainly for clarification. Resolving them would leave me with a very positive assessment of the submission.

PCA matching and supervision: The within-token PCA+kk - means baseline is described as unsupervised, but, if I understand correctly, evaluating P3 and performing mixture injection require matching the recovered components to specific tasks. How is this permutation resolved? Are task labels used, and is the matching performed on a separate split? Would it be more precise to describe this as “unsupervised subspace recovery with supervised alignment”?

Causal identification: Since class means, LDA, and PCA recover nearly the same subspace and yield similar intervention results, do these experiments establish the causal role of the shared task subspace, or also the task-specific meaning of the class-mean vertices? I may be missing part of the argument, but what evidence distinguishes the proposed task-vector simplex from another basis spanning the same plane?

Layer-selection circularity: The rebuttal states that layers are selected partly using mode-selective intervention effects, while the main causal result averages over the layers where the dissociation is cleanest. Was the layer band selected independently of the intervention outcomes being reported? Otherwise, there may be some risk of circularity.

Reviewer spCnOpenReview ↗
Rating
5/6
Confidence
3/5
Quality
3/4
Clarity
3/4
Significance
3/4
Originality
3/4
Contribution type
general
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

The paper proposes a framework for understanding the representation geometry behind task inference in transformers. Tasks are latent variables drawn from a finite training set, and sequences are generated conditionally with a first-order Markov property given the latent. Task vectors are defined in activation space, not in weights-space, as the row main effects of an ANOVA-style (task x current token) decomposition of the hidden states. The authors state four properties P0-P3 of increasing strength, ending with the claim that the simplex coefficients of the hidden state track the Bayesian posterior over tasks. Two inference modes are studied: Bayesian retrieval (M1), where in- distribution (ID) hidden states interpolate inside the task-vector simplex, with an expressivity result (Theorem 1) that two extra blocks + a proper unembedding layer can realize Bayesian prediction. Then, an extrapolative learning (M2), where their Theorem 2 states that when the OOD prediction map has intrinsic dimension d0 is sufficiently larger than k*, i.e. the dimension of the subspace spanned by the main (ID) tasks, the OOD representations must exit the task subspace, and empirically they show not only that, but also that those OOD tasks exit by forming near-orthogonal sub-spaces. They verify P0-P3 on three synthetic settings (dice, in-context linear regression, Markov chains), then the authors show a phase transition from M1 to M2, showing that the two subspaces are near-orthogonal. Finally, a non-Markovian experiment shows P0 fails when there's no compact sufficient statistic, i.e. when the entire context is needed for the prediction.

Strengths and weaknesses

Strengths:

  • very nice topic to shed lights on
  • nice formulation for the task vectors, using the ANOVA grid
  • Formulating the main properties as incrementally more difficult (P3 > P2 > P1 > P0) is clever, so that the authors only needed to verify the strongest one (P3)
  • Theorem 2 is interesting and it is not only verified in theory but also empirically by the authors
  • interesting transition regime from M1 to M2

Weaknesses:

  • Real world applicability: the theorems formulated and proven by the authors, especially Theorem 2, are nice and interesting, and using a controlled environment with toy tasks is a good setting to show the theory in practice. However, this reviewer can’t help but wonder how much of these findings can be actually applied in more realistic settings, with harder tasks and bigger and more powerful (often pre-trained) models.
  • The “qualitative” pretrained-LLM evidence is rather thin: 3-6 hand-picked tasks, one layer, one model. I don’t think it qualifies as a true experiment for real world scenarios.
  • The first-order Markov property is omni-present in the paper, and the moment it is violated (as shown by the authors in their “Dyck” experiment in Section 7) show how fragile this hypothesisreally is, and when that collapses, so do all the interesting findings in the paper.

(minor)

  • Since the term “task-vector” is used a lot in the recent literature with different meanings (for instance, in the model editing, model merging and task arithmetic literatures it indicacates the different between the fine-tuned and the pre-trained weights of a model), few words of disambiguation would enhance the readablity of the paper for many readers.
Questions
  • since the paper relies on important things like the first-order Markov property or the clean- sufficient-statistic assumptions and builds simple settings to empirically show the findings, how much of these nice findings actually applies to more complex, real world scenarios, where the important assumptions are relaxed? More concretely, if you take one of your E1-E3 and extend the conditioning from a single token to a local window of size w like you suggested in the Limitations, do P0-P3, the phase transition, and the near-orthogonality degrade gracefully or collapse as w grows? The thing this reviewer is interested in is whether the Markov property is something such that everything dies the moment is violated like in the Dyck test, or if it’s smoothed.
  • Theorem 2 states that, when d0 is much larger than k*, the new tasks must leave the established simplex. However, to the best of the reviewer’s knowledge, this does not mean that they must do so by forming near-orthogonal sub-spaces with respect to the simplex, while it is indeed the case when we look at the experiments. Why? Do the authors have an explanation, mathematical or not (although mathematical would be better) as to why this happens?
  • While the M1 to M2 transition is nice, it is driven by the vanishing per-task weight (0.1/N_minor). Have the authors decoupled this from the raw “capacity” of the representation space? In other words, does this transition still happen at the same N_minor if d is much larger, meaning that we still have more task but plenty of data for them instead of having number of samples for each task inversely proportional to the number of tasks as it is done in the paper?

Addressing these points would positively move my score.

Limitations

Yes

Final justification

The authors addressed my main concern and I therefore suggest acceptance.

Formatting concerns

No major concerns.

3 comments
Authors · CommentOpenReview ↗

We thank the reviewer for the constructive and detailed feedback. We conducted additional experiments addressing each question below. We summarize the main results here and will add the full plots and implementation details to the revised appendix.

Q1 & W3: reliance on first-order Markov assumption

We agree that the first-order Markov assumption is strong. We therefore conducted finite-order Markov chain (MC) experiments within the same framework. Finite-order MCs broaden the scope of data distributions while remaining tractable in our setting:

  • The sequences carry richer (w+1)(w+1)-gram statistics than the 2-gram statistics of first-order MCs, and are thus more realistic.
  • The framework still covers finite-order families, because any finite-order MC is first-order on the lifted state space obtained by blocking a local window of tokens.
  • Dyck, on the other hand, requires infinite-order dependence: no fixed local window suffices to summarize the relevant history.

Treating Markov order as a simple measure of complexity, we find that our conclusions remain robust at orders 2 and 3 and break down at the infinite-order continuum (Dyck). Thus, violating first-order Markovity does not cause an abrupt collapse. Concretely, we re-ran the main analyses at orders 2 and 3; the transition, P0–P3, and near-orthogonality all persist.

The M1→M2 transition. Similar transitions occur at every tested order. The table reports log⁡(KLBayes/KLextrap)\log(\mathrm{KL}_{\mathrm{Bayes}}/\mathrm{KL}_{\mathrm{extrap}}) after 100k training steps; negative values favor Bayesian retrieval.

order ww k=2k=2 k=4k=4 k=6k=6 k=8k=8 k=10k=10 crossover k∗k^*
1 −5.34-5.34 −4.64-4.64 −3.29-3.29 −0.75-0.75 +2.07+2.07 ≈8.5\approx 8.5
2 −4.30-4.30 −3.35-3.35 −0.28-0.28 +3.61+3.61 +4.65+4.65 ≈6.1\approx 6.1
3 −2.44-2.44 +1.30+1.30 +2.78+2.78 +3.45+3.45 +3.43+3.43 ≈3.3\approx 3.3

The crossover shifts to lower task diversity as ww increases, consistent with the intuition that a more complex context-based predictor becomes favorable earlier.

P0–P3. The properties hold once the conditioning window matches the Markov order: residual variance 0.08 (interaction η2≤0.03\eta^2 \le 0.03), and the Hellinger distance between β\beta and the order-aware oracle posterior remains 0.120.12--0.130.13. These values are comparable across orders 1--3.

Near-orthogonality. Using the same intervention settings as Table 2 of the paper (rank-6 subspace, γ=2.5\gamma = 2.5, random same-rank controls), ablating the OOD subspace still changes the loss substantially (+0.44/+0.50/+1.48+0.44/+0.50/+1.48 nats at orders 1/2/3) while the majority-task loss is nearly intact (≤+0.10\le +0.10; random subspaces ≤+0.03\le +0.03).

Dyck (W3). Our new measurement shows why no compact belief state forms there: conditioning hidden states on the natural candidate statistic, the open-parenthesis count, leaves 58–84% of variance unexplained, while the full bracket prefix leaves roughly 3%. This suggests that finite-order MCs provide key local statistics that a transformer can learn and build into task vectors, a mechanism that fails at the infinite-order continuum. As suggested by the area chair, we will move this boundary case earlier in the paper and emphasize it when stating the scope of P0--P3.

Q2: why are new tasks represented by near-orthogonal subspaces?

The reviewer is right: Theorem 2 proves non-confinement to the task-vector subspace, not near-orthogonality. Near-orthogonality is a stronger empirical finding, and we will make this distinction explicit. We offer three supports for the observed orthogonality:

  • Classical theory. With limited shared dimensions, the least-interfering arrangement of feature directions is orthogonal (undercomplete) or a tight frame (overcomplete) (Welch, IEEE Trans. Inf. Theory 1974; Donoho, "Compressed sensing", IEEE Trans. Inf. Theory 2006), and neural networks are observed to store features this way (Elhage et al., "Toy models of superposition", arXiv:2209.10652). These results motivate but do not directly apply to transformers; a theory is left to future work.
  • Heuristic mechanism. Downstream layers read the task subspace as a posterior over training tasks, so any OOD component inside it perturbs in-distribution predictions, and the training loss pushes it into the orthogonal complement.
  • Empirical evidence. In a new checkpoint analysis, we find that near orthogonality emerges from training, not from initialization. At each training checkpoint we search for the subspace whose suppression most damages OOD prediction. Early in training, this subspace overlaps the task subspace significantly (5–9 times the overlap of a same-rank random subspace). As training proceeds, the near-orthogonality forms, over the same window in which the extrapolative mode develops.
Authors · CommentOpenReview ↗

Q3: phase transition vs capacity factors

We agree that the original sweep introduces a confounding factor, so it was not clear whether the M1-M2 transition reflects limited data per task or limited model capacity. In our setup, the minor tasks share a fixed 10% of the training data, so each minor task's data size shrinks as the number of tasks grows.

We therefore performed new sweeps over both per-task exposure and hidden dimension. They confirm similar phase transitions, yet the crossover/threshold depends on both factors, consistent with the reviewer's expectation: more data per task or a larger hidden dimension delays the M1-to-M2 transition, shifting the crossover to higher task diversity.

  • Per-task data held fixed: We re-trained models in which every minor task keeps the same amount of data as in the kk=6 run regardless of the task count (total data and training steps unchanged). The result (numbers represent the log KL ratio as in the table above; negative = Bayesian retrieval): the model stays in Bayesian retrieval at every feasible task count (−1.28/−1.63/−0.56 at kk=2/4/8).
  • Model dimension: Similar phase transitions occur when varying the model dimension dd (same setup, 30k steps); larger dd delays the crossover. We will add the complete width sweep to the appendix.

W1 & W2: real-world applicability; pretrained-LLM evidence

Belief-dynamics validation. Following the meta-review's suggestion, we adapted the persona data of Bigelow et al. (arXiv:2511.00617) into a generative design that directly mirrors our latent-task framework, evaluated on Llama-3.1-8B-Instruct: each persona is a latent task, its statements are its emissions, and the least-squares weights of the hidden state on the persona task vectors are read as the model's belief. As the number of persona statements in context grows from 0 to 128, the belief on the context persona rises from the uninformative 1/3 to 0.95, the precision limit of the task-vector estimate, while the fraction of the hidden state lying in the task-vector plane grows from 0 to 0.72; the same pattern holds for every persona as context. Mixed-persona contexts and a Qwen2.5-7B replication give consistent results. The full design, an example prompt, and the trajectory table are in our comment to the Area Chair.

Twelve-model sweep. Our paper demonstrated the pretrained-LLM signatures on one model (Qwen2.5-7B). We extended the experiment to 12 models in 7 families (0.5B–8B), across every layer. Every model shows the same signature: the task-subspace fit (R2R^2) peaks in the middle layers (41–71% relative depth) with no comparable peak for OOD prompts, and the coefficient on the correct task rises to 0.94–0.96 by 20 shots. The simplex-trajectory plots, produced with the paper's selected-task setup, are similar to the paper's Qwen2.5-7B ones, except for Gemma-3 4B; the trajectory plot for each of the 12 models will be added to the appendix.

Minor — terminology. Agreed; we will add at first use: "Throughout, task vectors are directions in activation space (function vectors, in-context vectors), distinct from the weight-space usage in task arithmetic and model merging (differences of fine-tuned and pre-trained weights); we use the activation-space sense exclusively."

Reviewer spCn · CommentOpenReview ↗

Good rebuttal

I thank the authors for their responses. I am satisfied and therefore will increase my score to 5. Wish you good luck.

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

Missing a submission?

Loading the discussion…