In the Blink of an Eye: A Simple Theory of Feature Localization in Generative ModelsBlink of an eye: a simple theory for feature localization in generative models
Characterize critical windows with stochastic localization, and observe across three instruction models that they often coincide with problem-solving failures.
- Both language models and diffusion models suddenly decide output features within very narrow generation intervals, such as behavior switches, jailbreaks, or image categories. Existing theory relies on strong distributional assumptions or Gaussian-diffusion-specific tools and cannot be directly applied to autoregressive models.
- Both diffusion and autoregression are written as time-reversed stochastic localization samplers: the forward degradation is distribution-free, and the backward pass uses the full-distribution posterior. The critical window is bracketed by two times: when subpopulation total variation is still separated and when it has become indistinguishable.
- Truncation and resampling across three instruction models and seven reasoning benchmarks. The authors state that generations with critical windows have lower accuracy. MATH occurrence rates are 42.2%, 16.6%, and 30.2% (LLAMA, Qwen, Phi-3).
- The authors note the theory only covers localized samplers, not GANs or consistency models, and plan to compute windows on other data models. The experiments are three instruction models and seven reasoning benchmarks; the diffusion empirical work is not in this paper's experiments.
- Evaluated models
- LLAMA-3.1-8B-InstructPhi-3-7B-InstructQwen-2.5-7B-Instruct
- Benchmarks
- ARC ChallengeARC EasyAQuALogiQAMMLUTruthfulQAMATHUltraChatXstestCircuit Breakers
- Metrics
- ∆Acc∆CWcritical window出现率同答案概率recall(FPR=0.01)
An arXiv paper proposes a unified theory explaining why generative models abruptly change behavior during generation, using a formal framework of randomly localized samplers, attributing this to the generation process localizing to a subpopulation of the distribution it models. The theory applies to both autoregressive and diffusion models, does not rely on distributional assumptions, and improves previous bounds on critical windows when specialized to diffusion models, requiring only basic tools without stochastic calculus or statistical physics methods. The authors also connect this phenomenon to all-or-nothing phenomena in statistical inference and provide empirical validation on LLMs, finding that critical windows often coincide with failures on math and reasoning benchmarks.
Paper analysis
What problem does this paper attempt to solve?
Generation processes lock in features within narrow windows, and existing theory struggles to cover both diffusion and autoregression simultaneously.
The generation process can decide certain features of the final output within very few steps, but there is no theory that simultaneously covers diffusion and autoregression without strong distributional assumptions.
- Where it appears: The authors cite abrupt switches in language models, including shifting from writing code to browsing Yellowstone images, hacking reward evaluations after calling a task difficult, math correctness probability dropping after a single token, issuing threats to users, and jailbreaks that manipulate the first few generated tokens; in diffusion, background objects or image categories also appear within narrow intervals, referred to in the literature as critical windows (Figure 1).
- Why it matters: The authors argue these windows are the steps in a sampler responsible for a given output attribute, usable for interpretability and also used to provide stepwise rewards for preference optimization and fine-tuning; from interpretability, safety, and capability perspectives, understanding how and why they arise is needed.
- Existing gaps: Theories on diffusion either assume explicit functional forms for the data and perform non-rigorous statistical physics calculations, or rely on Gaussian-diffusion tools such as Girsanov's theorem; the latter bounds are coarser, lose dimension-dependent factors, and do not generalize directly to autoregressive models.
- This paper's reduction: The authors parameterize the window as the last step at which larger and smaller subpopulations remain indistinguishable, and the first step at which their overlap is negligible; the phenomenon is written as the model localizing from a larger subpopulation to a smaller one.
- Proposed theory: Theorem 2 is given on stochastic localization samplers, applicable to autoregression and diffusion without distributional assumptions, and the error bound in the diffusion special case is claimed to be dimension-independent; the in-context learning window is also linked to all-or-nothing, and LLM experiments test location prediction.
What related research exists?
Related work mainly covers window theory on diffusion, forward-backward experiments, and random localization.
Critical windows in diffusion
- Raya and Ambrogioni (2023), Sclocchi et al. (2024, 2025), and Biroli et al. (2024) assume explicit functional forms for the data and compute windows with non-rigorous statistical physics. Among them, Biroli et al. perform Landau-type perturbation on a mixture of two spherical Gaussians; Sclocchi et al. treat the random hierarchy model via mean-field.
- Li and Chen (2024) use Girsanov's theorem and give non-asymptotic bounds similar to Theorem 2 for strongly log-concave mixtures. The authors state that bound contains a polynomial factor in dimension and the tools are specific to Gaussian diffusion.
Forward-backward experiments
- Li and Chen (2024) and Sclocchi et al. also study samples with a given attribute by adding noise and denoising. The authors state this is close to rerunning the backward process from an intermediate state Y_t, as seen in Georgiev et al. (2023), Biroli et al. (2024), and Raya and Ambrogioni (2023); when the forward process is fixed, as in autoregressive language models, the two views are equivalent.
Stochastic localization and nearby phenomena in language models
- El Alaoui, Montanari, Sellke, and others apply Eldan's stochastic localization to sampling algorithms. The authors state that this paper uses Montanari's (2023) framework to understand empirical phenomena on different localization-based samplers in practice.
- Appendix A connects the Bayesian framework of in-context learning (Xie et al., 2022, and subsequent works) to critical windows and all-or-nothing. On chain of thought, Lin et al. (2024) and the Phi-4 technical report (2024) observe windows in mathematical reasoning concurrently with this paper, calling them critical tokens and pivotal tokens respectively, and use them for preference optimization.
- On jailbreaks, Qi et al. (2024) and others discuss the first few generated tokens. The authors state that this paper explains when jailbreaks occur using the probability of the unaligned component relative to the full model, and claim this generalizes the explanation of Qi et al.; it is also used to understand perplexity-based monitoring (Alon and Kamfonas, 2023).
Baselines and benchmarks
- The comparison for reasoning experiments is accuracy with and without critical windows for the same model; the appendix also compares with direct answering (Lanham et al., 2023). Benchmarks are ARC Challenge, ARC Easy, AQuA, LogiQA, MMLU, TruthfulQA, and MATH. The jailbreak-detection appendix compares against perplexity thresholds and an activation-based MLP detector (Bailey et al., 2024).
The authors position this paper as: applicable to all localization-based samplers, without assuming functional forms or log-concavity, and improving the main theorem of Li and Chen (2024) with a dimension-independent error; the hierarchy definition is also extended from Gaussian mixtures in diffusion to all such samplers.
How does the paper address this problem?
Bound the critical window of localization-based samplers using the total variation of subpopulations along the forward process.
Both diffusion and autoregression are written as stochastic localization samplers: apply a Markov degradation to the sample, then sample backward in time. The authors define the distribution p of X as the sampler's own distribution; learning the true posterior is placed outside this paper, and they state that studying the sampler's distribution is closer to interpretability and jailbreaks.
Observation process and mixture features
- As the index t increases, the observation Y_t provides less information about X, and X together with the sequence of Y_t forms a Markov chain (Definition 1). The full path is required to determine X almost surely, and Y_∞ is set to be completely uninformative about X. The time direction is opposite to Montanari (2023).
- The sampler starts from the least informative observation and samples along the reverse chain to X (Definition 2). Diffusion degradation is convolution with increasingly large Gaussian noise; autoregression masks from the right end of the sequence leftward. Appendix B places continuous diffusion, discrete diffusion, and autoregression into this framework.
- Features are written as discrete mixtures: first draw θ∈Θ, then draw X∼p_θ. On a nonempty S⊂Θ, weights are renormalized to obtain the sub-mixture p_S. Θ can be chosen by task, such as cat/dog, correct/incorrect, unsafe/safe (Remark 1). When comparing different sub-mixtures, the degradation procedure is fixed and the forward kernel does not depend on the distribution of X.
Forward-backward experiments
- For a nonempty S and time T̂: first run the forward process from p_S to obtain Y, then sample backward from that Y according to the posterior of the full distribution p; the resulting distribution is denoted p^{S,T̂} (Definition 3). If the backward pass instead uses p_S as the prior, the marginal remains p_S.
- The authors state that as T̂ tends to 0 this distribution tends to p_S, and as it tends to infinity it tends to p. The object is to characterize the transition between these two extremes.
- Language model instance: truncate the last few tokens of a story about cats and resample. With little truncation, the story remains about cats; if truncated before the first appearance of cats, resampling may produce dogs.
Bounding the window
- For S_init ⊂ S_target, two times are defined using total variation along the forward process. T_start is the largest t at which the total variation between S_target and its complement is still at least 1−ε²; T_end is the smallest t at which the total variation between S_init and S_target is at most ε.
- Theorem 2: if the backward starting point falls between the two, then the total variation between the forward-backward result and p^{S_target} is controlled by ε and the weight ratio W. W is the sum of complement weights divided by the sum of S_target weights. The proof uses Markov property, data processing inequality, coupling, and Bayes' formula. In the plain text, the coefficient symbols in the theorem's formula are incomplete, so the coefficients are not restated here.
- If T_end is greater than T_start, the bound is vacuous. Definition 4 defines the critical window as the interval of specialization from a larger set S_before to a smaller set S_after. The definition itself does not explain why the window is narrow. The authors argue the window narrows when the forward process needs only very few steps to erase the difference between the two, for example when the data has multiscale hierarchy.
- Relative to Li and Chen (2024): no strong log-concavity of components is required, nor Lipschitz scores with bounded moments at each time. The authors claim the final bound is independent of dimension d.
Computable examples
- Two isotropic Gaussians: the window for transitioning from the two components to one of them is near ln∥μ∥, with width independent of dimension (Example 1). Spherical Gaussian mixture with random means: with high probability the window width is O_{K,ε}(1) as d tends to infinity (Example 2). The authors claim this removes the ln ln d dependence of Li and Chen (2024) for isotropic Gaussians.
- Random masking of two Dirac strings: the window is expressed in Hamming distance; the authors state that when the distance is large enough the window shrinks with that distance, and when the distance grows with length T the width is negligible (Example 3).
- Autoregressive key tokens (Example 4): two modes separate only at a certain position, and over the following k tokens, the probability that one mode falls on the support of the other is at most ε. The window length is these k steps. The authors state that fine-tuning on correction samples can increase the probability of leaving that mode, and use this as theoretical justification for the approach of Qi et al. (2024); they also state that the probability ratio of the harmful component to the full model can be used to distinguish prompts. Random-walk-style problem solving (Example 5): when ln(2/ε²)/(2∆²) is less than A and ε² is less than 10^{-3}(0.5−∆)(0.5+∆), the window width of the strong problem-solving mode is Θ(1/∆²), independent of T.
- In-context learning (Example 6): T_after^C equals 3T+3 minus an O_ε(1) term independent of T. Theorem 6 writes the all-or-nothing phase transition as a critical window in in-context learning, with endpoints N+2 minus (1±δ)N_s^*.
Hierarchy
- ε-mixture tree (Definition 8) uses only the initial distribution and the forward process: at the root, all components are indistinguishable under sufficient noise, and leaves are distinct modes. Corollary 1: along a leaf-to-root path there is a sequence of times such that the forward-backward result of a single component is close in total variation to the sub-mixture at that level, with the gap written as ≲_w ε.
- Corollary 2: if another set of components has total variation at most δ/2 from the original components pairwise, and the forward process is the same, then the same tree is an ε+δ mixture tree. When forward processes differ, the hierarchy can differ. Example 7 constructs arbitrary decision orders via mask order.
- The authors state that hierarchies in diffusion are generally shallower than in autoregression: Example 2 has depth O(1), while autoregressive depth can grow linearly with context length. The authors conjecture that autoregressive models can learn more complex feature hierarchies than diffusion. When referring to the Gaussian hierarchy of Li and Chen (2024), the plain text's big-O expression may have lost a square root, so that expression is not restated here.
What experiments did the paper conduct?
Across reasoning benchmarks for three instruction models, critical windows co-occur with lower problem-solving accuracy.
Experimental Setup
- Models tested: LLAMA-3.1-8B-Instruct, Phi-3-7B-Instruct, Qwen-2.5-7B-Instruct. Structured output uses only the first. The appendix states the default temperatures for the three are 0.6, 1.0, and 0.7 respectively; LLAMA additionally has top-p 0.9. Maximum generation length is 2048. Temperature is 0 when extracting the final answer.
- Benchmarks and scale: ARC Challenge, ARC Easy, AQuA (written as AQUA-RAT in the table), LogiQA, MMLU, TruthfulQA multiple-choice, and MATH. 400 questions per dataset.
- Protocol: Truncate a certain proportion of tokens from the original generation and resample, then check whether the answer matches the original generation. Multiple-choice uses direct text comparison; MATH uses the prm800k grader. Resample 100 times per truncation proportion. The paper does not report the number of truncation proportions.
- Window definition: On consecutive truncation proportions, the probability of the same answer jumps by more than 0.5. Figure 5 highlights generations that increase by 50% in one step without a 30% drop.
- Structured output: Five binary fill-in-the-blank items, prefilled with a newline and "1.", using 10,000 generations to estimate the probability of still getting the same answer after truncation.
- Jailbreak appendix: Benign items come from UltraChat and Xstest; harmful items come from Circuit Breakers and various existing jailbreaks, and the StrongReject classifier is used to filter for harmfulness. The metric is recall at FPR=0.01. The unaligned likelihood uses a LoRA-adjusted LLAMA-3.1-8B-Instruct that does not refuse harmful prompts as a proxy.
Main Results
Swipe horizontally to read the table
Model ARC Easy ∆Acc MATH ∆Acc MATH occurrence rate AQUA-RAT ∆Acc LLAMA-3.1-8B-Instruct 0.73 0.41 42.2% 0.42 Phi-3-7B-Instruct 0.28 0.36 30.2% 0.36 Qwen-2.5-7B-Instruct 0.40 0.46 16.6% 0.03 ∆Acc is from Table 1, the difference in accuracy between no critical windows and with critical windows. The occurrence rate comes from the Section 6.2 text and is reported only for MATH. On LogiQA, TruthfulQA, and ARC Challenge, which are not in the table, the ∆Acc in Table 1 is also positive; among these, Qwen-2.5-7B-Instruct is 0.55 on TruthfulQA and LLAMA-3.1-8B-Instruct is 0.15 on LogiQA.
- The authors claim this jump appears across three models and seven benchmarks (Figures 5, 9, 10), and generations with critical windows have lower accuracy. For LLAMA-3.1-8B-Instruct, the authors claim accuracy is up to 73% lower, with critical windows where wrong answers outnumber correct ones by 11%-33%.
- In Table 1, ∆CW is also positive throughout, but Qwen-2.5-7B-Instruct has a ∆CW of 0.01 on AQUA-RAT. The paper does not report statistical tests for these differences, nor how many of the 400 questions have generations with versus without windows.
- The authors claim the jump occurs at important reasoning steps. In the Phi-3-7B-Instruct example in Figure 6, the authors claim the correct formula first appears within the critical window.
Structured Output
- The test is whether hierarchical fill-in-the-blank can determine T_before^C and T_after^C based on the first-occurring identifying information. The authors place the front end of the first window before the first answer appears and the back end on the token that marks that option.
- The authors claim the probability jump falls exactly at these predicted positions, consistent with Section 5 (Figure 4). The text does not give probability values at each truncation point.
Jailbreak Detection Appendix
- The likelihood ratio is the difference in log probabilities between the unaligned and aligned models; the comparison is the aligned model's own log probability, plus an MLP detector. The dataset includes PAIR, AutoDAN, MSJ, Multi-Turn, Prefill, GCG, and other categories.
- In Table 2 at FPR=0.01, the two rows for unaligned minus aligned have multiple cells at 0.000, and the highest in those two rows is 0.100 (Misc, generation). The aligned model's generation log probability is 0.570 on Multi-Turn and 0.416 on Prefill; the MLP row ranges from 0.663 to 1.00.
- The text says the likelihood ratio's recall on 5 jailbreak categories is 5-10 times the false positive rate, and also says recall is greater than 1. The latter claim is inconsistent with the cells in Table 2 not exceeding 0.100; the table takes precedence here. The authors claim these methods are worse than existing methods and suggest this may be because a proxy for unaligned patterns was used.
Other Ablations and Analyses
- Temperatures 0.1, 0.4, 0.7, 1.0, MATH, 400 samples, 25 forward-backward passes per sample: the authors claim the relationship of frequency and window size to temperature varies by model, with no consistent relationship across models; the text gives no per-temperature numbers (Figures 12, 13).
- The authors claim that at infinite temperature each token is uniformly random and at zero temperature there is only one behavioral pattern, so neither extreme has critical windows; the net effect at intermediate temperatures is unclear (Appendix D.2.4).
- Direct answering versus resampling (Figure 11, LLAMA-3.1-8B-Instruct only): the authors claim direct answering has lower consistency, with a larger gap on MATH and AQUA than on other reasoning sets; the text gives no specific differences.
- The appendix reproduces probability jumps for the prefill and repeated-token jailbreak categories (Figure 7); the text does not give the values in the figure.
What are some points that can be further explored?
The authors note the theory covers only localization-type samplers and plan to compute windows in more settings.
Limitations and future directions noted by the authors
- The theory applies to autoregressive language models, continuous diffusion, and flow matching. GANs and consistency models map noise to images in a single network pass and are not localization-based samplers (Limitations).
- The authors consider this limitation minor, because these models are either not commonly used in practice or are based on localization-based samplers (Limitations).
- A future direction is computing the locations of critical windows in other settings and connecting them to statistical physics predictions for other data models, such as the random hierarchy model (Future Work).
Experimental coverage
- The main-text experiments are truncation-and-resampling on three instruction models across seven math and reasoning benchmarks: 400 problems per dataset, with 100 resamples per truncation ratio (Section 6.2). Except for MATH's 42.2%, 16.6%, and 30.2%, the main text does not report occurrence rates for the remaining benchmarks.
- Structured outputs use only LLAMA-3.1-8B-Instruct, with 10,000 total generations (Section 6.1). Temperature comparisons on MATH use 0.1, 0.4, 0.7, and 1.0, with 400 samples and 25 runs per sample (Appendix D.2.4); the main text does not report frequencies for each temperature.
- The jailbreak-detection appendix compares likelihood ratios, aligned-model log-probabilities, and an MLP at FPR=0.01 (Table 2). The paper does not report the number of repetitions for this detection, nor statistical tests for accuracy differences.
- The authors state that critical windows in diffusion already have multiple empirical demonstrations, so the experiments here focus on LLMs (Section 6). Theoretical examples include isotropic Gaussians, random-mean Gaussian mixtures, discrete masking, autoregressive key tokens, random-walk problem solving, and in-context learning (Section 4).
- The hierarchical conclusion depends on the forward process being the same (Corollary 2). When forward processes differ, Example 7 shows that different decision orders can be constructed via mask order (Section 5).
Summarize the main content of the paper
Random localization uniformly characterizes critical windows; in experiments, this window often coincides with reasoning failures.
- Positioning: Uses stochastic localization samplers to explain critical windows in diffusion and autoregressive generation, where output features are decided within very few steps.
- Problem: Existing theories on diffusion either rely on explicit data forms and non-rigorous statistical physics, or on Gaussian-diffusion tools with dimension-dependent factors, and cannot be directly applied to autoregressive models.
- Approach: Fix a distribution-free forward degradation, then sample backward according to the full-distribution posterior. The window is the period of specialization from a larger subpopulation to a smaller one, with its endpoints bounded by total variation along the forward process. The authors claim Theorem 2's error is dimension-independent and the proof does not use stochastic analysis.
- Computable examples: The window width for two isotropic Gaussians is dimension-independent; for a random-mean mixture it is O_{K,ε}(1) with high probability. In the autoregressive random-walk example, under given ε, ∆, and A conditions, the width is Θ(1/∆²), independent of sequence length. The all-or-nothing phase transition is written as a window in in-context learning.
- LLM experiments: LLAMA-3.1-8B-Instruct, Phi-3-7B-Instruct, and Qwen-2.5-7B-Instruct are tested on seven reasoning benchmarks with truncation-and-resampling. The authors state windows often coincide with problem-solving failures. Occurrence rates on MATH are 42.2%, 16.6%, and 30.2%. According to Table 1, the smallest ∆Acc is 0.03 (Qwen-2.5-7B-Instruct, AQUA-RAT) and the largest is 0.73 (LLAMA-3.1-8B-Instruct, ARC Easy); the authors state the latter has 11%-33% more windows among incorrect answers.
- Authors' conclusion: Windows arise from the generation process localizing between subpopulations. The authors argue that training on error correction at windows helps leave jailbreak or Yellowstone-style bad modes and provides theoretical justification for existing safety fine-tuning. Non-localization samplers are outside this theory; the authors plan to compute window locations on more data models.