Uncovering Latent Reasoning Strategies in Language Models

Recovering a disentangled, strategy-aligned latent-variable factorization of a pretrained language model, and the model-directed reconstruction objective that makes it possible despite posterior collapse at initialization.

arXiv Code

When used for reasoning tasks, a language model pθ(y∣x)p_\theta(y \mid x) defines a distribution over response sequences yy that implicitly use certain high-level strategies to solve an input problem xx. A model asked to prove a theorem may produce a proof by contradiction, induction, or construction; a model asked to solve a programming problem may formulate it as dynamic programming, graph search, or a greedy algorithm. Such strategies recur across many input problems, but they are represented only implicitly: they are entangled in the model’s hidden states rather than exposed as a separable variable that can be identified or intervened on during generation.

This work studies the problem of recovering a disentangled representation of these implicit strategies from a pretrained language model. We seek a router–generator factorization (rϕ(z∣x), gϕ(y∣x,z))(r_\phi(z \mid x),\, g_\phi(y \mid x, z)) of the base model, where a router rr assigns a latent strategy zz to each input and a strategy-conditioned generator gg produces the response conditioned on that strategy. The goal is to find a factorization that preserves the observable response distribution, so that ∫rϕ(z∣x) gϕ(y∣x,z) dz=:pϕ(y∣x)≈pθ(y∣x)\int r_\phi(z \mid x)\, g_\phi(y \mid x, z)\, dz =: p_\phi(y \mid x) \approx p_\theta(y \mid x), while making zz informative and strategy-aligned: varying zz should change which strategy the generator uses, and the same latent value should carry the same strategy meaning across related inputs.

Output space of a pretrained LM showing an entangled gray distribution over responses, annotated with proof-opening callouts for different strategies.
The same output space colored by a latent that is informative but not aligned with strategies; colored regions overlap without separating into strategies.
The same output space colored by a strategy-aligned latent; strategies separate into distinct regions labeled proof by induction, contradiction, contrapositive, and algebraic manipulation.

Latent strategy structure in output space. Toggle between three states: the pretrained LM’s implicit mixture over strategies pθ(y∣x)p_\theta(y \mid x); a latent zz that is informative but misaligned with strategies; and a strategy-aligned zz that disentangles the strategies in latent space while preserving the base distribution.

The problem: factorizing, not relearning

This problem is distinct from standard latent-variable generative modeling. In VAE-style methods, the latent-variable model is trained from data, and the target distribution is not already represented at initialization. Here, pθ(y∣x)p_\theta(y \mid x) is not a target to be relearned from data; it is the already-represented response law whose latent strategy structure we aim to expose.

The objective cannot be merely to fit the latent marginal pϕ(y∣x)p_\phi(y \mid x) to the base model distribution. For expressive router–generator classes, many factorizations can induce nearly the same distribution over yy after integrating out zz. One extreme ignores zz, with gϕ(y∣x,z)g_\phi(y \mid x, z) reproducing the base model distribution for all zz. More generally, a marginal-preserving factorization may use zz for input-specific partitions, surface form, or other predictive details rather than reusable strategy structure. The problem is therefore not ordinary latent-variable modeling of pθ(y∣x)p_\theta(y \mid x), but selection among marginal-preserving factorizations for one whose latent variable is informative and strategy-aligned.

This imposes two distinct requirements. Within-input strategy separation asks whether varying zz changes the strategy used for a fixed input xx. The stronger requirement is cross-input semantic consistency: a latent value or region should retain its strategy meaning across related inputs. Only with this stability does zz behave like a reusable strategy variable, rather than an input-specific response index.

The core obstacle: posterior collapse at initialization

Because the pretrained generator already captures pθ(y∣x)p_\theta(y \mid x) without any latent variable, this setting creates a pathological form of posterior collapse. A factorization that ignores zz — by reproducing the base model’s response law for every zz — is available at initialization and is a stable optimum for any objective that only fits the observable response distribution.

The standard negative conditional ELBO satisfies the identity

JcELBO(x,y;ϕ,ξ)=−log⁡pϕ(y∣x)+KL ⁣(qξ(⋅∣x,y) ∥ pϕ(⋅∣x,y)).\calJ_{\mathrm{cELBO}}(x,y;\phi,\xi) = -\log p_\phi(y \mid x) + \KL\!\left( q_\xi(\cdot \mid x,y) \,\Vert\, p_\phi(\cdot \mid x,y) \right).

Thus the standard variational objective asks the induced marginal to match the observed response law, and asks qξq_\xi to match the posterior of whichever factorization produced that marginal. It does not ask whether zz explains variation in yy beyond xx, nor whether the resulting latent is strategy-aligned. If the generator class can represent the base model while ignoring zz, then setting gϕ(y∣x,z)=pθ(y∣x)g_\phi(y \mid x, z) = p_\theta(y \mid x) for all zz and qξ(z∣x,y)=rϕ(z∣x)q_\xi(z \mid x, y) = r_\phi(z \mid x) preserves the base marginal and attains the objective’s optimum, leaving the latent inert even though pϕ(y∣x)=pθ(y∣x)p_\phi(y \mid x) = p_\theta(y \mid x). With expressive generators built from pretrained language models, this zz-ignoring factorization is not only available, but also close to initialization, making it a likely attractor for optimization.

ELBO training can preserve fidelity while leaving the latent unused. Distributional fidelity rises, posterior–router KL collapses relative to initialization, and strategy alignment remains low.

Open interactive figure

The method: model-directed reconstruction pressure

The ELBO failure shows that marginal fidelity is not enough: a factorized model can preserve pθ(y∣x)p_\theta(y \mid x) while leaving zz unused. We address this selection problem with a model-directed reconstruction term that replaces marginal-fit pressure with reconstruction pressure directed by the base model itself.

We implement the factorization by adapting a pretrained Transformer into three roles. The router rϕ(z∣x)r_\phi(z \mid x) reads the input and produces a distribution over latent strategy values; the strategy-conditioned generator gϕ(y∣x,z)g_\phi(y \mid x, z) generates the response autoregressively while attending to an embedding E(z)E(z) of the latent strategy, inserted as a pseudo-token; and a training-time posterior qξ(z∣x,y)q_\xi(z \mid x, y) reads the full input–response pair to provide variational training signal. The router and generator are a single autoregressive model with shared parameters ϕ\phi, adapted from the base parameters via LoRA-style low-rank updates so the generator inherits the base response law rather than relearning it.

Autoregressive router–generator Transformer architecture. The adapted Transformer ϕ\phi implements both the router rϕ(z∣x)r_\phi(z \mid x), which reads the prompt and produces a latent distribution, and the strategy-conditioned generator gϕ(y∣x,z)g_\phi(y \mid x, z), which attends to E(z)E(z) while generating the response. During variational training, qξ(z∣x,y)q_\xi(z \mid x, y) infers zz from the full input–response pair. (Toggle Inference ↔ Training and press Play.)

Open interactive figure

The core idea is to use the base model pθp_\theta to adaptively rescale the reconstruction loss and direct reconstruction pressure toward tokens where the base model is uncertain. We instantiate this with token-level base model surprisal bθ,t(x,y)=−log⁡pθ(yt∣x,y<t)b_{\theta,t}(x,y) = -\log p_\theta(y_t \mid x, y_{<t}), which measures how much uncertainty remains about yty_t after conditioning on xx and y<ty_{<t}, giving a local estimate of where zz can explain variation beyond the zz-free prefix model. This token-level view matters because autoregressive responses quickly become partially self-predictable: after an early commitment, many later tokens may be determined by xx and y<ty_{<t}, even if the commitment itself reflects a strategy choice. The reconstruction term therefore substitutes uniform token pressure with pθp_\theta-surprisal-directed pressure, assigning more weight to branch points where the base model leaves multiple continuations plausible.

Left: a response path with high-surprisal branch points and determined positions, with next-token distribution glyphs above each node. Right: base model surprisal above each token and the corresponding reconstruction weight below it.

Token-level pθp_\theta surprisal weighting. Left: a response path with branch points, where several next tokens remain plausible, and determined positions, where the next token is mostly fixed by xx and earlier response tokens. Right: zz-free base model surprisal bθ,t(x,y)b_{\theta,t}(x,y) above each token and the corresponding token weight below it; higher-surprisal positions receive more reconstruction pressure.

Objective (Model-directed reconstruction)

The proposed objective combines a normalized, surprisal-weighted reconstruction term with the router KL:

Jθ(x,y;ϕ,ξ)=Rθ(x,y;ϕ,ξ)+β KL ⁣(qξ(⋅∣x,y) ∥ rϕ(⋅∣x)),\calJ_\theta(x,y;\phi,\xi) = \calR_\theta(x,y;\phi,\xi) + \beta\, \KL\!\left( q_\xi(\cdot \mid x,y) \,\Vert\, r_\phi(\cdot \mid x) \right),Rθ(x,y;ϕ,ξ)=1cθ Ez∼qξ(⋅∣x,y)[∑t=1Tyaθ,t(x,y) [−log⁡gϕ(yt∣x,z,y<t)]],\calR_\theta(x,y;\phi,\xi) = \frac{1}{c_\theta}\, \expectunder{z \sim q_\xi(\cdot \mid x,y)}{ \sum_{t=1}^{T_y} a_{\theta,t}(x,y)\,\bigl[-\log g_\phi(y_t \mid x, z, y_{<t})\bigr] },aθ,t(x,y)=α 1Ty+(1−α) wθ,t(γ)(x,y),cθ=Ex∼DX,  y∼pθ(⋅∣x)[bθ(x,y)].a_{\theta,t}(x,y) = \alpha\, \frac{1}{T_y} + (1-\alpha)\, w_{\theta,t}^{(\gamma)}(x,y), \qquad c_\theta = \expectunder{x \sim \calD_X,\; y \sim p_\theta(\cdot \mid x)}{ b_\theta(x,y) }.

The global scale cθc_\theta expresses reconstruction in base model reference units, keeping it comparable to the KL term even when the base model already has low zz-free loss. The interpolation α∈[0,1]\alpha \in [0,1] mixes uniform pressure with surprisal-directed weights wθ,t(γ)w_{\theta,t}^{(\gamma)} (a normalized power of token surprisal, concentration controlled by γ\gamma). The term is calibrated so that Rθ=1\calR_\theta = 1 when the generator matches the base model, and can be read as the fraction of base model response loss that remains after conditioning on zz.

Together, this objective pressures zz to explain residual variation that is not already determined by xx, rather than reconstructing what the base model already captures.

Benchmark and empirical results

We evaluate on a controlled multi-strategy algorithmic benchmark designed to make strategy alignment measurable. The benchmark covers six task families — list summation, sorting algorithms, grid pathfinding, linear equation solving, base conversion, and multidigit addition — where solution traces instantiate task-specific procedures for reaching the same valid answer. Traces are parseable and can be assigned reference strategy attributions; these labels are withheld during training and used only for evaluation. We report two axes: Distributional Fidelity (does the factorized model still produce valid solution traces?) and Strategy Alignment (does the learned latent achieve cross-input semantic consistency?).

Strategy information is already present in the base model. For each task and token position, a lightweight linear probe on the base model’s hidden states can predict the reference strategy annotation. Strategy information is broadly decodable across the benchmark, especially at positions where strategy-specific computation is expressed. This establishes the premise for factorization: the target structure is present in the base model, but is not exposed as a reusable latent variable that can be sampled, transferred, or compared across inputs.

Heatmap with rows as benchmark tasks and columns as normalized token positions; color gives linear-probe accuracy for predicting the ground-truth strategy from the entangled base model's hidden states.

Strategy labels are decodable from base model hidden states. Rows are benchmark tasks, columns are normalized token positions, and color gives linear-probe accuracy for predicting the ground-truth strategy from hidden states of the entangled base model.

The proposed objective recovers strategy-aligned latents; ELBO does not. Across pretrained Qwen2.5 runs, ELBO-style baselines preserve Distributional Fidelity but leave the latent inert or strategy-unaligned, while the model-directed reconstruction objective and its variants recover strategy-aligned latents and preserve the base model response distribution. An ablation that weights reconstruction by inverse surprisal — emphasizing low-surprisal tokens — weakens Strategy Alignment, supporting the view that the gains come from pressuring zz to explain strategy-relevant residual surprisal.

Bar chart over objective variants and two model sizes; bars show Distributional Fidelity and Strategy Alignment, with open points for per-task values and hatching marking baselines and ablations.

Method comparison on pretrained Qwen2.5 runs. For each objective variant and model size, bars show Distributional Fidelity and Strategy Alignment, with open points giving per-task values. Strategy Alignment denotes cross-input latent strategy alignment measured by Analogical Consistency. Hatching marks baselines and ablations.

The latent dynamics provide complementary geometric evidence: posterior latents that begin as an overlapping cloud separate into task- and strategy-structured regions over training. In the multi-task setting this organization is task-conditioned rather than a single global strategy codebook — the same latent regions can carry different strategy meanings for different task families, a multiplexing that is visible in linear diagnostics.

Six PCA panels of posterior mean latents at increasing fractions of training; an initially overlapping cloud separates into task- and strategy-specific regions, colored by task and strategy.

Posterior latent geometry over training. Each panel is a PCA projection of posterior mean latents at the indicated fraction of training. Points are colored by task and strategy; the initially overlapping cloud separates into task- and strategy-specific regions over training.

Cross-input semantic consistency. A latent variable can separate strategies locally for each input while failing to give zz a stable strategy meaning across inputs. We therefore evaluate the stronger notion of Strategy Alignment via Analogical Consistency: sample a source input XX, draw Z∼rϕ(⋅∣X)Z \sim r_\phi(\cdot \mid X), reuse the same ZZ on a related target input X′X', and check whether the responses YY and Y′Y' use the same inferred strategy, AnalogicalConsistency⁡=P[strat⁡(Y)=strat⁡(Y′)]\operatorname{AnalogicalConsistency} = \prob{\operatorname{strat}(Y) = \operatorname{strat}(Y')}. High Strategy Alignment means ZZ carries the same strategy meaning across inputs — so the latent transfers the same strategy from one problem to another.

What drives the alignment gains. Examining training trajectories in fidelity–alignment phase space, an underspecified objective can move toward high Distributional Fidelity without moving toward high Strategy Alignment. Across all methods, the token-weighted reconstruction loss tracks Strategy Alignment: alignment improves precisely when zz is pressured to explain response regions where the frozen base model still has strategy-relevant residual surprisal.

Training trajectories in fidelity-alignment phase space; proposed variants move up and to the right toward high alignment and high fidelity, while ELBO baselines and the inverse-surprisal ablation increase fidelity without gaining alignment.

Training trajectories in fidelity–alignment phase space for different objective variants.

Scatter of token-weighted reconstruction loss versus Strategy Alignment at training endpoints; lower token-weighted reconstruction loss is associated with higher strategy alignment across all methods.

Token-weighted reconstruction loss versus Strategy Alignment at training endpoints; outlined points show method centroids and translucent points show individual runs.

A theory of strategy-structure recovery

To understand when the variational approach can identify a latent variable ZZ that aligns with a target strategy structure S⋆S^\star implicit in the pretrained model, we study a population complexity-penalized variational objective Lβ,λ(q,r,g)\calL_{\beta,\lambda}(q,r,g), where C(r,g)C(r,g) is a theoretical proxy for the architecture, parameterization, and optimization biases that favor simple router–generator factorizations. Profiling over rr and gg shows that minimizing Lβ,λ\calL_{\beta,\lambda} is equivalent to maximizing

Jβ,λprof(q):=Iq(Y;Z∣X)−Aβ,λ(q)1−β.\calJ^{\mathrm{prof}}_{\beta,\lambda}(q) := I_q(Y;Z \mid X) - \frac{A_{\beta,\lambda}(q)}{1-\beta}.

The first term is the information pressure that encourages ZZ to capture information about YY beyond what is already predictable from XX; the second is an effective approximation–complexity penalty measuring whether the induced distribution is close to the target while remaining simple.

Result (Sufficient conditions for recovery)

Let S⋆=f(X,Y)S^\star = f(X,Y) be the target strategy with q⋆(z∣x,y)=1{z=S⋆}q^\star(z \mid x,y) = \Ind{z = S^\star}, and let d(q,S⋆)d(q, S^\star) be a recovery discrepancy. Define the profiled margin

Δβ,λprof(δ)=Jβ,λprof(q⋆)− ⁣ ⁣sup⁡q:  d(q,S⋆)≥δJβ,λprof(q).\Delta_{\beta,\lambda}^{\mathrm{prof}}(\delta) = \calJ^{\mathrm{prof}}_{\beta,\lambda}(q^\star) - \!\!\sup_{q:\; d(q,S^\star) \ge \delta} \calJ^{\mathrm{prof}}_{\beta,\lambda}(q).

If Δβ,λprof(δ)>0\Delta_{\beta,\lambda}^{\mathrm{prof}}(\delta) > 0, then every population minimizer of Lβ,λ\calL_{\beta,\lambda} satisfies d(q^,S⋆)<δd(\widehat q, S^\star) < \delta. For finite classes with sub-Gaussian losses, n=O ⁣((log⁡(∣Q∣∣R∣∣G∣)+log⁡(1/η)) / (1−β)2(Δβ,λprof(δ))2)n = \bigO\!\big( (\log(|\calQ||\calR||\calG|) + \log(1/\eta)) \,/\, (1-\beta)^2 (\Delta_{\beta,\lambda}^{\mathrm{prof}}(\delta))^2 \big) samples suffice for empirical recovery with probability at least 1−η1-\eta.

The analysis is preliminary, and the connection between this oracle selection criterion and actual training dynamics is not yet formally characterized.

Takeaways

A pretrained model’s response distribution is an entangled mixture over high-level strategies, and exposing this structure requires more than fitting a latent-variable model to observable outputs. Because the base generator already realizes the target distribution, a factorization that ignores the latent variable is immediately available and is a stable optimum of any objective that only measures marginal fit — and standard variational training falls into this failure mode. The model-directed reconstruction objective uses the base model itself as a reference: reconstruction is normalized by the base model’s response loss and weighted by token-level uncertainty, concentrating pressure where strategy choices are most consequential. On a controlled benchmark of multi-strategy algorithmic tasks, this recovers latent structure that is well-aligned with reference solution strategies and semantically consistent across inputs.

The broader promise is to expose latent capabilities that large language models already possess but do not reliably express under default sampling. By recovering a strategy-aligned factorization, implicit strategy structure becomes an explicit object of analysis and intervention — with applications across interpretability, controllability, and exploration, and the potential to drive more active self-improvement loops via strategy-level interventions rather than passive token-level sampling. The benchmarks here cover synthetic algorithmic tasks with ground-truth strategies; how well the methodology extends to open-ended reasoning remains an open question.

Related
PaperThis page

Uncovering Latent Reasoning Strategies in Language Models

reasoninglanguage models

Recovering a disentangled, strategy-aligned latent-variable factorization of a pretrained language model, and the model-directed reconstruction objective that makes it possible despite posterior collapse at initialization.

Cite
@misc{altabaa2026uncoveringlatentreasoningstrategies,
    title={Uncovering Latent Reasoning Strategies in Language Models}, 
    author={Awni Altabaa and John Lafferty},
    year={2026},
    eprint={2607.17674},
    archivePrefix={arXiv},
    primaryClass={cs.LG},
    url={https://arxiv.org/abs/2607.17674}, 
}