Farther the Shift, Sparser the Representation: Analyzing OOD Mechanisms in LLMs Thanks: New Jersey Institute of Technology Thanks: NEC Lab American Thanks: University of North Carolina at Chapel Hill Mingyu Jin, Yutong Yin, Jingcheng Niu, Qingcheng Zeng Abstract In this work, we investigate how Large Language Models (LLMs) adapt their internal representations when encountering inputs of increasing difficulty, quantified as the degree of out-of-distribution (OOD) shift. We reveal a consistent and quantifiable phenomenon: as task difficulty increases, whether through harder reasoning questions, longer contexts, or adding answer choices, the last hidden states of LLMs become substantially sparser. In short, the farther the shift, the sparser the representations . This sparsity–difficulty relation is observable across diverse models and domains, suggesting that language models respond to unfamiliar or complex inputs by concentrating computation into specialized subspaces in the last hidden state. Through a series of controlled analyses with a learning dynamic explanation, we demonstrate that this sparsity is not incidental but an adaptive mechanism for stabilizing reasoning under OOD. Leveraging this insight, we design Sparsity-Guided Curriculum In-Context Learning (SG-ICL) , a strategy that explicitly uses representation sparsity to schedule few-shot demonstrations, leading to considerable performance enhancements. Our study provides new mechanistic insights into how LLMs internalize OOD challenges. The source code is available at the URL: https://github.com/MingyuJ666/sparsityLLM . 1 Introduction Large Language Models (LLMs) act as powerful substrates for reasoning ( 72 ; 38 ) and knowledge-intensive interaction ( 66 ; 6 ; 61 ) . Yet, their reliability frequently falters when prompts demand deeper inference or deviate from training distributions, leading to sharp performance degradation in out-of-distribution (OOD) regimes ( 40 ; 37 ) . This distinction between memorized competence (in-distribution; ID) and generalized reasoning (OOD) has prompted a shift from behavioral metrics to internal investigation via mechanistic interpretability ( 55 ; 68 ) . Currently, research split between a mechanistic perspective that maps behavior to specific circuits ( 65 ; 9 ) and a statistical view that analyzes the geometry of distributed representations ( 25 ; 23 ) . What remains significantly less explored is whether the transition from mastered ID performance to the uncertain OOD frontier is governed by a consistent representational signature. How Representation adapts when language models face harder reasoning questions? We identify sparsity , the property where a high-dimensional representation is dominated by a small subset of active units, as a promising candidate for this signal. While sparsity is a pervasive phenomenon extensively discussed as evidence for specialization or modularity ( 51 ; 18 ; 14 ; 74 , inter alia) , and has been examined in LLMs regarding intrinsic dimensionality ( 1 ; 10 ) . However, most interpretability work treats sparsity as a largely static background property 41 , rather than as an explanatory variable that changes systematically with task conditions and can therefore explain differences in behavior. (§ 3.1 ) Reasoning Complexity (§ 3.2 ) Answer Choice Dense \rightarrow Sparse Easy \rightarrow Hard Easy \rightarrow Hard (§ 3.3 ) Knowledge Conflict (§ 3.4 ) Context Length Dense \rightarrow Sparse Easy \rightarrow Hard Easy \rightarrow Hard Figure 1 : Harder Inputs Induce Sparser Representations. Across all four controlled difficulty axes, the last hidden states become progressively sparser as tasks get harder. Results are shown for Qwen2.5-3B using Top-10% Energy; nevertheless, the same trend holds across difficulty settings, sparsity metrics, and LLM sizes. In this work, we make progress on these questions by uncovering a robust connection between representational sparsity and task difficulty. Concretely, when a language model is prompted with a task, as task difficulty increases, the model’s representations become systematically sparser . We quantify sparsity in the last hidden state using the \ell_{1} Norm and Top- k Energy (for multiple k ), and operationalize difficulty by controlled increases in OOD shift across diverse reasoning tasks (reasoning complexity, number of answer choices, conflicting knowledge, and context length; § 3.1 –§ 3.4 ; summarizes in Figure 1 ). Across all settings, harder inputs consistently yield sparser last-layer representations, and this trend holds across tasks, sparsity metrics, and model families, suggesting a systematic aspect of LLM inference rather than an incidental artifact. In practical terms, increased sparsity means that fewer representation dimensions carry most of the activation mass, implying that harder prompts drive the model to rely on a more concentrated set of features. This observation bridges representational and mechanistic perspectives, motivating us to probe which internal pathways or features dominate as difficulty increases. This positions sparsity as a candidate organizing principle for studying how internal computation adapts under increased reasoning demands in the language model. Finally, we show that the sparsity-difficulty connection is actionable. By treating sparsity as a practical signal of task complexity, we design a sparsity-guided curriculum strategy that selects in-context demonstrations whose difficulty aligns with the query. This principle yields consistent improvements in few-shot reasoning, establishing sparsity not only as an analysis tool but also as a lever for improving model reasoning performance. To systematically address these gaps, we organize our study around three core research questions: • RQ1: How does the geometry of the last hidden state evolve as reasoning tasks become increasingly difficult? • RQ2: What mechanisms drive the emergence of sparsity when models face OOD challenges? • RQ3: How can this sparsity signal be practically leveraged to enhance model reasoning capabilities? Guided by these questions, our primary findings are summarized as follows: ❶Sparsity increases with difficulty in a robust and controlled manner. We uncover a consistent relationship where last hidden state activations become sparser as question difficulty increases, across multiple reasoning benchmarks including MATH500 ( 40 ) and LongReason ( 37 ) . To enable precise control over difficulty, we introduce MMLU-Robust , a benchmark that induces graded difficulty via controlled distractor augmentation. ❷Learning dynamics connect density to familiarity. We identify a fundamental link between representation density and data familiarity. Our analysis suggests that high activation density is a learned attribute: as models master training data, they consolidate representations. Importantly, this trend already emerges during pretraining , without any task-specific fine-tuning, suggesting it is a general property of learned representations rather than a downstream artifact. Conversely, sparsity serves as the intrinsic default state for harder or less familiar inputs. We also provide a theoretical derivation to explain the learning dynamic U-Shape curve. ❸Sparsity-guided curricula improve reasoning. By validating sparsity as a reliable proxy for difficulty, we propose Sparsity-Guided Curriculum In-Context Learning (SG-ICL). Unlike standard strategies that select demonstrations based solely on semantic similarity, SG-ICL introduces a difficulty-aware selection mechanism. This approach yields substantial gains; for instance, SG-ICL achieves 76.60% accuracy on MATH500 with Qwen2.5-7B , surpassing the strong Auto-CoT baseline (75.20%). 2 Preliminaries ★Experimental Setup We conduct all experiments under the Implicit Reasoning setting . Although Chain-of-Thought ( 72 , CoT;) prompting also produces observable sparsity patterns, its effects are noticeably less stable. In contrast, the Implicit reasoning setup yields clearer and more consistent activation dynamics, allowing us to present more interpretable visualizations. The prompt we use can be found in the Appendix A.3 . We focus primarily on the last hidden state for the same reason. Although related sparsity trends are also present in intermediate layers, they are typically weaker and less consistent across tasks and models. By contrast, the final layer exhibits the clearest and most stable pattern, making it the most interpretable layer for our analysis. ★Last Hidden State We consider a transformer-based LM f_{\theta}(\cdot) with L stacked decoder layers, where each layer \ell consists of a multi-head self-attention ( \mathrm{Attn}^{(\ell)}(\cdot) ) block and a feed-forward network ( \mathrm{MLP}^{(\ell)}(\cdot) ). For an input token sequence x=(x_{1},x_{2},\ldots,x_{T}) , we denote the hidden representation of token x_{t} at layer \ell as h_{t}^{(\ell)}\in\mathbb{R}^{d} , where d is the hidden dimension. Each layer maintains a residual connection, and its output is computed as: \small h_{t}^{(\ell+1)}=\overbrace{h_{t}^{(\ell)}+\mathrm{Attn}^{(\ell)}\!\big(h_{t}^{(\ell)}\big)}^{h_{\text{mid}}}+\mathrm{MLP}^{(\ell)}\!\big(h_{\text{mid}}\big). (2.1) We focus on the output of each layer in the residual stream, which stores contextualized information aggregated across all tokens in the input prompt. Formally, we use the representation at the final layer of the final input token: h_{T}^{(L)}=f_{\theta}^{(L)}(x_{1:T})[-1], (2.2) which we refer to as the last hidden state . This representation serves as the latent state used for next-token prediction and downstream tasks. ★Sparsity Prior work has shown that neural networks often exhibit sparsity in their representations or effective parameterization. For example, fine-tuning can occur in low-dimensional subspaces ( 1 ) , motivating adaptation methods such as LoRA ( 27 ) . In this work, we study the representational sparsity of the last hidden state, defined as the extent to which only a small subset of units exhibits large activations. We measure sparsity using several metrics. First, we compute a normalized \ell_{1} magnitude of the last-hidden-state vector: \textstyle S_{L_{1}}=\frac{1}{d}\sum_{i=1}^{d}|h_{i}|, (2.3) where h_{i} denotes the i -th coordinate of h_{T}^{(L)} and d is the hidden dimension. Lower S_{L_{1}} indicates higher sparsity. Second, we measure the concentration of activation energy using the Top- k Energy: \textstyle S_{\text{Top-}k}=\sum_{i\in\text{Top-}k\%}h_{i}^{2}\ /\ \sum_{i=1}^{d}h_{i}^{2}. (2.4) This metric quantifies the proportion of total activation energy captured by the largest k\% components. Higher values indicate stronger concentration and thus greater sparsity. Additional metrics, including Hoyer Sparsity and Effective Rank, are reported in Appendix A.2 . ★Difficulty and OOD While the term difficulty or OOD is often loosely used in the context of LLMs ( 33 ) , we adopt a more controlled and quantitative view. Given the vast and often opaque nature of LLM pretraining data, strict OOD boundaries are difficult to define. Instead, we operationalize OOD as a spectrum of distributional shift, constructing samples designed to deviate significantly from normal training patterns along four interpretable dimensions: (1) Task difficulty: reasoning instances that require deeper or multi-step inference, such as higher-difficulty levels in benchmark datasets (e.g., MATH-500 and DeepMATH-103K has several difficulty levels); (2) Distractor interference: problems containing more irrelevant or misleading information, analogous to multiple-choice items with a larger number of distractors; (3) Knowledge conflict: prompts that introduce mutually inconsistent facts or constraints, requiring the model to detect and resolve contradictions rather than rely on the prompt; and (4) Contextual length: inputs with longer or more compositional contexts. 3 RQ1: How does the geometry of the last hidden state evolve as reasoning tasks become increasingly difficult? In this section, we present results addressing our first research question: How do last hidden states behave when models encounter hard questions? We measure sparsity metrics across tasks with varying levels of difficulty along four dimensions: reasoning complexity (§ 3.1 ), answer choice expansion (§ 3.2 ), knowledge conflict (§ 3.3 ), and context length (§ 3.4 ). Spoiler alert : across all four settings, we observe the same consistent pattern: the harder the task, the sparser the last hidden state. 3.1 Sparsity vs Reasoning Complexity MATH-500 is a subset of ( 24 ) MATH dataset that contains explicit difficulty annotations. Our initial analysis tests whether representation sparsity correlates with problem difficulty within this graded benchmark. MATH-500 contains 500 mathematical problems spanning five difficulty levels, from basic arithmetic (Level 1) to advanced competition mathematics (Level 5). We evaluate three LLMs ( 62 ; 77 ) : Qwen2.5-7B , Llama3.2-3B , and Llama3.1-8B , and compute sparsity metrics from their last hidden state. As shown in 2(a) , all models display a consistent monotonic trend: the L1 norm decreases as difficulty increases; the Top-10% Energy Ratio rises, suggesting that the small subset increasingly dominates the activation. (a) Sparsity Differences under Different Difficulty Levels. Last Hidden State sparsity metrics across five difficulty levels and three different models in MATH-500. The Strong correlation between LLMs’ accuracy and Last Hidden State sparsity ( \ell_{1} Norm and Top10% Energy). Versus sparsity metrics for Qwen2.5-7B on the MATH-500 dataset. (b) Accuracy–Sparsity Correlation. Sparsity strongly correlates with accuracy ( L_{1} : r =0.897; Top-10% Energy: r =-0.915). Figure 2 : Overview of Sparsity Analysis. Together, the two subfigures paint a consistent picture: 2(a) (left) shows that difficulty increases sparsity, while 2(b) (right) shows that sparsity tracks accuracy degradation. To further validate this connection between reasoning difficulty and sparsity, we examine how sparsity correlates with task performance. As illustrated in 2(b) , both sparsity metrics exhibit strong negative correlations with accuracy. When problems become harder, accuracy drops sharply, while the \ell_{1} Norm decreases and the Top-10% Energy Ratio increases. Together, 2(a) and 2(b) paint a consistent picture. 2(a) demonstrates that higher reasoning difficulty systematically induces stronger sparsity, while 2(b) shows that increased sparsity is tightly coupled with accuracy degradation. Taken together, these findings establish a coherent causal chain: as tasks become harder, models’ last hidden state exhibits sharper activation compression. 3.2 Sparsity vs Answer Choice Expansion Figure 3 : Sparsity Metrics under Answer Choice Expansion. Bar plots show mean sparsity across 14 disciplines for five metrics under Normal (+0), Moderate Expansion (+5), and Large Expansion (+10) on Qwen2.5-3B . Error bars indicate the minimum and maximum across disciplines. Increasing task difficulty leads to higher sparsity. In this setting, we add plausible but incorrect distractor options to multiple-choice questions presented to the LLM. This makes the task strictly harder ceteris paribus , as the question content remains unchanged. We obtain different difficulty levels by adding different numbers of distractors. The setup remains simple and controlled, allowing us to study difficulty without confounding textual variation and to isolate OOD behavior. Particularly, we use MMLU-Pro ( 70 ) , a multi-domain multiple-choice benchmark covering 14 academic disciplines. The original dataset provides ten answer options, which we use as the baseline Normal (+0) configuration. We introduce two additional difficulty levels via answer choice expansion: Moderate Expansion (+5), which adds five high-quality, plausible distractors (15 options total), and Large Expansion (+10), which adds ten distractors (20 options total). This manipulation increases task difficulty by expanding the solution space while leaving the question content unchanged, providing a controlled way to probe OOD behavior. Using this setup, we construct ✰ MMLU-Robust , a three-tier extension of MMLU-Pro with Normal (+0), Moderate (+5), and Large (+10) configurations for robustness evaluation. See Appendix A.5 for details. Figure 3 presents the experiment results, confirming increased sparsity of final-layer hidden states when the tasks become more difficult. We analyzed five key sparsity metrics across all 14 academic areas in MMLU-Pro: \ell_{1} Norm, Top-5% Energy, Top-10% Energy, Effective Rank, and Hoyer Sparsity. Across virtually all academic disciplines and for all five sparsity metrics, we observe a consistent, monotonic trend : as the question difficulty increases by adding distractors (moving from \text{Normal (+0)}\rightarrow\text{Moderate (+5)}\rightarrow\text{Large (+10)} ), the last hidden state exhibits higher sparsity. A detailed per-discipline breakdown, along with results for additional models, is provided in Appendix A.5.2 , confirming the same trends. 3.3 Sparsity vs Knowledge Conflict (a) \ell_{1} Norm ( \downarrow ) (b) Hoyer Sparsity ( \uparrow ) (c) Top 5% Energy ( \uparrow ) (d) Top 10% Energy ( \uparrow ) (e) Effective Rank ( \downarrow ) (f) Summary Figure 4 : Sparsity Differences under Knowledge Conflict. We measure the last hidden state sparsity for two conditions ( non-conflict ( ) and conflict ( )) across five metrics for Qwen2.5-3B . All results are statistically significant. Arrows denote how each metric relates to sparsity ( \uparrow : higher is sparser; \downarrow : lower is sparser). Again, the harder conflict ( ) condition is consistently sparser than the non-conflict ( ) condition across all metrics. Moreover, we use ( 66 ) knowledge conflict dataset to further validate our hypothesis, which labels samples as conflict or non-conflict by pairing each question with either a truthful or a counterfactual context. In conflict scenarios, the provided context contradicts the model’s parametric knowledge. We think Conflict Knowledge forcing the model to rethink the knowledge sources is a kind of out-of-distribution task. As shown in Figure 4 , conflict cases consistently exhibit higher sparsity across all metrics: Specifically, the Hoyer Sparsity (b), Top 5% Energy (c), and Top 10% Energy (d) metrics, where higher values indicate greater sparsity, all show a statistically significant increase for the Conflict group compared to the Non-Conflict group ( \Delta\approx+0.0378,+0.0114 , and +0.0102 respectively). These differences are statistically significant , as confirmed by a paired ( 60 ) t-test, with all p -values <2.0\times 10^{-29} . The Summary bar chart (f) synthesizes these findings, clearly illustrating that the latent last hidden representations for conflict instances are generally more compressed and concentrated on fewer dimensions. We provide additional analyses across more LLM families, more model sizes, and more knowledge conflict settings (e.g., the related distraction phenomenon; ( 49 ) ) in Appendix A.4 . 3.4 Sparsity vs Long Context Reasoning For the long-context reasoning setting, as shown in Figure 5 , we use LongReason 37 . This long context dataset offers controllable context lengths and incorporates diverse, realistic reasoning tasks. By analyzing the Last Hidden States across these controlled length variations, we discovered that the sparsity of the hidden states decreases as the input text length increases, as Figure 5 . This finding further supports our hypothesis that increasing task difficulty consistently drives the model towards a state of sharper activation compression in the last hidden state. In fact, the sparsity phenomenon induced by OOD shifts is primarily a terminal behavior . While intermediate representations remain relatively stable, the decisive shift in activation density, which separates OOD from ID, exclusively emerges in the final layer. We provide additional analyses in Appendix A.6 . CONTEXT: Sparsity metrics across all layers for Qwen2.5-1.5B under varying context lengths (8K, 16K, 32K, 64K). Figure 5 : Layer-wise Sparsity across Context Lengths. While intermediate layers show minimal variation across contexts, the final layers exhibit sharp divergence: longer contexts consistently produce sparser representations. This experiment was done at LongReasonQA ( 37 ) , which can control the background context length. 4 RQ2: What mechanisms drive the emergence of sparsity when models face OOD challenges? Now, we attempt to answer how the sparsity–OOD connection develops during pre-training by training a toy-sized LM from scratch on synthetic data. In this section, we first describe the construction of the synthetic pre-training dataset (§ 4.1 ), then analyze the pre-training results (§ 4.2 ), and finally connect these dynamics to the emergence of the sparsity–OOD relationship through a combined empirical and theoretical account (§ 4.3 ). 4.1 Controlled Environment We create a synthetic knowledge graph dataset that allows precise control over reasoning difficulty and OOD level. The setting is inspired by ( 64 ; 69 ; 79 ; 78 ) , but we focus on sparsity–difficulty patterns in this controlled symbolic environment rather than the emergence of implicit reasoning. ◼ We validate this mechanism by analyzing representations during pretraining. Even without task-specific fine-tuning, models pretrained solely on next-token prediction exhibit the same sparsity-difficulty pattern, confirming that this is a fundamental property of the language model. Specifically, instead of relying on real-world knowledge graphs (where structural and semantic factors are entangled), we generate an artificial graph governed by a set of logical rules. Each rule defines how relations can be composed, e.g., r_{3}(x,z)\Leftarrow r_{1}(x,y)\wedge r_{2}(y,z), (4.1) ensuring that the resulting graph encodes multi-hop reasoning dependencies. Based on these rules, we construct the dataset in a three-stage process: Preliminaries. We define a Knowledge Graph (KG) as \mathcal{G}=(\mathcal{E},\mathcal{R},\mathcal{T}) , where \mathcal{E} and \mathcal{R} denote the sets of entities and relations, respectively. \mathcal{T}=\{(h,r,t)\mid h,t\in\mathcal{E},r\in\mathcal{R}\} represents the set of facts (triples). The problem difficulty is controlled by logical rules of varying lengths L . ❶Graph Construction. We construct the controlled knowledge graph \mathcal{G} through a systematic generation pipeline. We first initialize the vocabulary of entities \mathcal{E}=\{e_{1},\ldots,e_{N}\} and relations \mathcal{R}=\{P_{1},\ldots,P_{N}\} , along with a set of K randomly sampled acyclic logic rules (lengths L\in[L_{\min},L_{\max}] ). The graph is seeded with random atomic triples (explicit facts). Subsequently, we exhaustively apply the logic rules to these atomic triples to infer all possible deductible triples (implicit facts). This process yields a dual-structure graph containing both direct observations and edges logically entailed by reasoning chains. ❷Sequence Serialization. To adapt the structured graph data for a language model, we linearize each triple (h,r,t)\in\mathcal{T} into a token sequence (e.g., “ e_{1} P_{5} e_{2} ”). The model is trained using the standard auto-regressive objective to predict the tail entity t given the head h and relation r . Model Params Steps Accuracy (%, \uparrow ) \ell_{1} Norm ( \downarrow ) Top-5 Energy (%, \uparrow ) Top-10 Energy (%, \uparrow ) Eff. Rank ( \downarrow ) \mathcal{D}_{\text{mem}} \mathcal{D}_{\text{ID}} \mathcal{D}_{\text{OOD}} \mathcal{D}_{\text{mem}} \mathcal{D}_{\text{ID}} \mathcal{D}_{\text{OOD}} \mathcal{D}_{\text{mem}} \mathcal{D}_{\text{ID}} \mathcal{D}_{\text{OOD}} \mathcal{D}_{\text{mem}} \mathcal{D}_{\text{ID}} \mathcal{D}_{\text{OOD}} \mathcal{D}_{\text{mem}} \mathcal{D}_{\text{ID}} \mathcal{D}_{\text{OOD}} Trans-8-8 0.02B 2500 64.00 42.00 31.00 413.49 413.80 412.79 26.11 26.03 26.26 42.12 42.00 42.34 0.502 0.504 0.500 Trans-16-8 0.04B 2000 71.00 50.00 24.00 413.38 413.30 413.04 25.96 25.94 26.06 41.98 41.98 42.15 0.503 0.503 0.501 Trans-16-16 0.17B 2000 85.00 56.00 44.00 817.60 817.80 816.93 27.70 27.70 27.78 43.70 43.66 43.76 0.483 0.484 0.482 2500 81.00 58.00 37.00 817.94 818.23 817.20 27.64 27.58 27.76 43.56 43.52 43.69 0.484 0.485 0.483 Trans-32-32 1.34B 1500 78.00 57.00 37.00 1608.10 1604.80 1601.68 30.28 30.54 30.84 46.44 46.72 47.04 0.454 0.451 0.448 2000 83.00 63.00 34.00 1611.36 1608.21 1605.29 30.00 30.23 30.55 46.11 46.39 46.70 0.458 0.455 0.452 2500 81.00 63.00 38.00 1616.11 1613.95 1610.50 29.60 29.75 30.11 45.67 45.86 46.22 0.463 0.461 0.457 Table 1 : Emergence of the Sparsity Phenomenon. We report metrics across 3 levels. The gradient blue shading , observed uniquely in Trans-32-32 , illustrates that the “harder-is-sparser” mechanism is a learned behavior. ❸Controlled Data Splitting. To distinguish between rote memorization and logical generalization, we employ a rigorous data splitting strategy. Specifically, we partition the triples \mathcal{T} into a training set \mathcal{D}_{\text{train}} and three distinct evaluation subsets: \mathcal{D}_{\text{mem}} for assessing rote memorization, \mathcal{D}_{\text{ID}} for testing in-distribution rule composition, and \mathcal{D}_{\text{hard}} for probing out-of-distribution robustness. Appendix A.7 provides additional details on the synthetic data construction and the experimental setup used for pre-training the toy-sized LM. 4.2 Pretraining Result We use Trans- L - H to denote a Transformer with L layers and H attention heads (e.g., Trans-8-8 has 8 layers and 8 heads). We report Accuracy, \ell_{1} Norm, Top-5/10 Energy, and Effective Rank across three difficulty levels: Easy/Medium/Hard, which correspond to \mathcal{D}_{\text{mem}} , \mathcal{D}_{\text{ID}} , \mathcal{D}_{\text{hard}} respectively. The findings highlight a clear correlation between model scale, training steps, and the emergence of sparsity. These results demonstrate that the relationship between task difficulty and sparsity is a learned phenomenon: it becomes consistent only once the model exits underfitting and reaches sufficient training convergence and capacity. The absence of a clear trend in smaller models may be attributed to the high data complexity relative to their limited capacity. We provide a detailed discussion on the graph data complexity in Appendix A.7 . We make a fundamental observation about inference-time representation geometry: the previously reported “harder-is-sparser” effect is not only confirmed to instruction-tuned modern LLMs , but also arises in standard pretrained Transformer models , where it emerges as a pretraining-level property. In particular, the “harder-is-sparser” pattern emerges only once the model reaches sufficient capacity and is adequately converged ( Table 1 ). 4.3 Learning Dynamics: Sparsity as an Adaptive Representation Mechanism Nevertheless, Table 1 reveals a counterintuitive phenomenon regarding the temporal evolution of sparsity. Focusing on the Trans-32-32 model, we observe a monotonic increase in the \ell_{1} Norm across training steps ( 1608.10\to 1611.36\to 1616.11 on the Easy set), while accuracy stabilizes. This trend indicates that as training progresses within a healthy regime (avoiding both underfitting and overfitting), the model gradually becomes less sparse for the same question. Figure 6 : Learning dynamics via \ell_{1} Norm. The trajectory reveals a two-stage mechanism: initial feature pruning (0–500 epochs) followed by feature consolidation (green region), where the norm rises as the model learns a more distributed and robust representation. As illustrated in Figure 6 , the training process exhibits a distinct two-phase dynamic. Phase I: Feature Selection (0–500 Epochs). Initially, the \ell_{1} Norm drops sharply, indicating a rapid increase in sparsity. In this phase, the model learns to discard noise, pruning irrelevant neurons to identify a core set of discriminative features. Phase II: Feature Consolidation (Green Region). After this initial pruning, the \ell_{1} Norm begins a steady ascent ( 1586.64\to 1618.52 ). Crucially, this rise does not imply a return to noise; rather, it signals representation maturation . Instead of relying on a few sharp, unstable activations, the model learns to distribute information more evenly across its active neurons. This “smoothing” process creates a more robust representation manifold, allowing the model to generalize better by avoiding over-reliance on single, brittle features. We give a theoretical justification for the emergence of a U-shaped learning dynamic in \ell_{1} Norm using a simplified cross-entropy + weight-decay model with kernelized representation dynamics in Section 4.4 . We explain this as a shift from early weight decay driven feature contraction (weak head lowers normalized \ell_{1} ) to later gradient-aligned amplification on persistently hard examples. Therefore, high activation density emerges as a learned privilege of data familiarity. Since the language model consolidates representations specifically for patterns it has mastered, it maintains high activation density (non-sparsity) in the last hidden state when facing in-distribution samples. So, difficult or OOD inputs effectively represent the “unseen.” Lacking the familiarity engage the distributed manifolds, the model fails to sustain high-density activations and reverts to a sparse state. This mechanism fundamentally explains our finding: Farther the Shift, Sparser the Representation . 4.4 A finite-horizon U-shape certificate for the normalized \ell_{1} statistic In Figure 6 , we observe a robust U-shape behavior of the representation sparsity during learning: the normalized \ell_{1} magnitude of the last hidden state decreases early ( sparsification ), and later increases over another period ( densification ). This appendix provides a finite-horizon theoretical justification on a simplified learning task. Informally, the mechanism is: (i) early training is dominated by weight decay acting on a weak/near-zero head, which contracts feature magnitudes and thus decreases the normalized \ell_{1} statistic; (ii) if at some later time the features are already sparse enough but a nontrivial subset of examples remains persistently hard, then the loss gradient aligns with the active coordinates and dominates the contraction over a finite window, forcing the statistic to increase. 4.4.1 Simplified setting: data, model, objectives and gradients We fix a training set \{(x_{i},y_{i})\}_{i=1}^{n} with labels y_{i}\in\{1,\dots,C\} . Let \theta(t) denote the parameters that generate the last-layer representation, and define h_{i}(t)\;:=\;h(x_{i};\theta(t))\in\mathbb{R}^{d},\qquad i=1,\dots,n, (e.g., the last hidden state h_{T}^{(L)} in the main text, evaluated on the final token of x_{i} ). Let W(t)\in\mathbb{R}^{C\times d} denote the linear readout with rows W_{c}(t)\in\mathbb{R}^{d} . We express the output logits z_{i}(t)\in\mathbb{R}^{C} by z_{i}(t)\;:=\;W(t)\,h_{i}(t),\qquad z_{i,c}(t)=\langle W_{c}(t),\,h_{i}(t)\rangle. Let p_{i}(t)\in\Delta^{C-1} be the softmax probabilities: (p_{i}(t))_{c}:=\frac{e^{z_{i,c}(t)}}{\sum_{c^{\prime}=1}^{C}e^{z_{i,c^{\prime}}(t)}}, and let e_{y_{i}}\in\mathbb{R}^{C} be the one-hot vector for label y_{i} . Training objective (cross-entropy with parameter weight decay). Define the per-example cross-entropy loss \ell_{i}(t)\;:=\;\ell_{\mathrm{ce}}\!\bigl(z_{i}(t),y_{i}\bigr)\;=\;-\log\bigl((p_{i}(t))_{y_{i}}\bigr), and the dataset-averaged cross-entropy \mathcal{L}_{\mathrm{ce}}(\theta,W)\;:=\;\frac{1}{n}\sum_{i=1}^{n}\ell_{i}(t). We regularize the parameters that generate the representation (and optionally the readout) via \ell_{2} weight decay: \mathcal{L}(\theta,W)\;:=\;\mathcal{L}_{\mathrm{ce}}(\theta,W)+\frac{\lambda_{h}}{2}\|\theta\|_{2}^{2}+\frac{\lambda_{W}}{2}\|W\|_{F}^{2}, where \lambda_{h}\geq 0 is the decay coefficient for \theta and \lambda_{W}\geq 0 is optional readout decay. In the analysis below, the effect of weight decay on \theta is modeled at the feature level as a contraction term -\lambda_{h}h_{i}(t) (plus a residual), captured by the induced dynamics in ( 4.3 ). Per-example representation gradient. Define the gradient of \ell_{i}(t) with respect to the representation: g_{i}(t)\;:=\;\nabla_{h_{i}}\ell_{i}(t)\;=\;W(t)^{\top}\bigl(p_{i}(t)-e_{y_{i}}\bigr)\in\mathbb{R}^{d}. Since \|p_{i}(t)-e_{y_{i}}\|_{2}\leq\sqrt{2} , we have \|g_{i}(t)\|_{2}\leq\sqrt{2}\,\|W(t)\|_{2\to 2}, (4.2) where \|\cdot\|_{2\to 2} denotes the operator (spectral) norm. 4.4.2 Induced (kernelized) representation dynamics with weight decay Let K(t)\in\mathbb{R}^{n\times n} be a symmetric matrix (a “kernel”) with entries K_{ik}(t) . We assume the induced dynamics of h_{i}(t)=h(x_{i};\theta(t)) has the form \dot{h}_{i}(t)\;=\;-\frac{1}{n}\sum_{k=1}^{n}K_{ik}(t)\,g_{k}(t)\;-\;\lambda_{h}\,h_{i}(t)\;+\;r_{i}(t), (4.3) where \lambda_{h}\geq 0 is the (effective) feature weight decay coefficient and r_{i}(t) is a residual term (e.g., due to non-frozen lower layers), assumed bounded on the horizons of interest. Remark 4.1 (A simple setting where ( 4.3 ) holds exactly) . Consider a frozen backbone feature map \phi:\mathcal{X}\to\mathbb{R}^{m} and a trainable linear representation head V(t)\in\mathbb{R}^{d\times m} such that \displaystyle\theta(t)\equiv V(t), \displaystyle h_{i}(t)=h(x_{i};\theta(t))=V(t)\phi(x_{i})\eqqcolon V(t)\phi_{i}. Let the logits be z_{i}(t)=W(t)h_{i}(t) and define \ell_{i}(t)=\ell_{\mathrm{ce}}(z_{i}(t),y_{i}) as above. If we train V by gradient flow on \mathcal{L}_{\mathrm{ce}}(V,W) with \ell_{2} weight decay \frac{\lambda_{h}}{2}\|V\|_{F}^{2} (while W may also be trained), then a direct chain-rule computation gives \dot{V}(t)=-\frac{1}{n}\sum_{k=1}^{n}g_{k}(t)\,\phi_{k}^{\top}-\lambda_{h}V(t), which leads to \dot{h}_{i}(t)=\dot{V}(t)\phi_{i}=-\frac{1}{n}\sum_{k=1}^{n}\langle\phi_{i},\phi_{k}\rangle\,g_{k}(t)-\lambda_{h}h_{i}(t). Therefore ( 4.3 ) holds with the (time-independent) kernel K_{ik}=\langle\phi_{i},\phi_{k}\rangle and residual r_{i}(t)\equiv 0 . 4.4.3 Normalized \ell_{1} sparsity and a smooth proxy Recall the normalized \ell_{1} statistic (main text): S_{L_{1}}(h)\;=\;\frac{1}{d}\sum_{j=1}^{d}|h_{j}|. To obtain a differentiable drift identity, we introduce a smoothed proxy. Smoothed primitives. Fix \varepsilon>0 and define, for u\in\mathbb{R} , \rho_{\varepsilon}(u):=\sqrt{u^{2}+\varepsilon^{2}},\qquad\psi_{\varepsilon}(u):=\frac{u}{\sqrt{u^{2}+\varepsilon^{2}}}. For h\in\mathbb{R}^{d} , define \psi_{\varepsilon}(h)\in\mathbb{R}^{d} entrywise: (\psi_{\varepsilon}(h))_{j}:=\psi_{\varepsilon}(h_{j}) . Dataset-averaged smoothed \ell_{1} statistic. Define N_{\varepsilon}(t):=\frac{1}{n}\sum_{i=1}^{n}\frac{1}{d}\sum_{j=1}^{d}\rho_{\varepsilon}\big(h_{i,j}(t)\big). (4.4) Note that N_{\varepsilon}(t)\to\frac{1}{n}\sum_{i=1}^{n}S_{L_{1}}(h_{i}(t)) as \varepsilon\to 0 . 4.4.4 Drift identity for N_{\varepsilon} Define the drift components \displaystyle D_{\varepsilon}(t) \displaystyle:=\frac{1}{n^{2}d}\sum_{i=1}^{n}\sum_{k=1}^{n}K_{ik}(t)\,\big\langle\psi_{\varepsilon}(h_{i}(t)),\,g_{k}(t)\big\rangle, (4.5) \displaystyle C_{\varepsilon}(t) \displaystyle:=\frac{\lambda_{h}}{nd}\sum_{i=1}^{n}\sum_{j=1}^{d}\frac{h_{i,j}(t)^{2}}{\sqrt{h_{i,j}(t)^{2}+\varepsilon^{2}}}, \displaystyle R_{\varepsilon}(t) \displaystyle:=\frac{1}{nd}\sum_{i=1}^{n}\big\langle\psi_{\varepsilon}(h_{i}(t)),\,r_{i}(t)\big\rangle. Lemma 4.2 (Exact drift identity) . For all t for which the trajectories are differentiable, \dot{N}_{\varepsilon}(t)=-D_{\varepsilon}(t)-C_{\varepsilon}(t)+R_{\varepsilon}(t). Proof. Differentiate ( 4.4 ): \displaystyle\dot{N}_{\varepsilon}(t) \displaystyle=\frac{1}{nd}\sum_{i=1}^{n}\sum_{j=1}^{d}\psi_{\varepsilon}(h_{i,j}(t))\,\dot{h}_{i,j}(t) \displaystyle=\frac{1}{nd}\sum_{i=1}^{n}\big\langle\psi_{\varepsilon}(h_{i}(t)),\,\dot{h}_{i}(t)\big\rangle. Substitute ( 4.3 ) and identify terms using ( 4.5 ). ∎ Lemma 4.3 (Two-sided decay bound) . For all t , \lambda_{h}\big(N_{\varepsilon}(t)-\varepsilon\big)\leq C_{\varepsilon}(t)\leq\lambda_{h}N_{\varepsilon}(t). Consequently, \displaystyle-D_{\varepsilon}(t)-\lambda_{h}N_{\varepsilon}(t)+R_{\varepsilon}(t)\leq\dot{N}_{\varepsilon}(t) (4.6) \displaystyle\leq-D_{\varepsilon}(t)-\lambda_{h}\big(N_{\varepsilon}(t)-\varepsilon\big)+R_{\varepsilon}(t). Proof. For any u\in\mathbb{R} , 0\leq\frac{u^{2}}{\sqrt{u^{2}+\varepsilon^{2}}}\leq\sqrt{u^{2}+\varepsilon^{2}}=\rho_{\varepsilon}(u), \frac{u^{2}}{\sqrt{u^{2}+\varepsilon^{2}}}=\rho_{\varepsilon}(u)-\frac{\varepsilon^{2}}{\rho_{\varepsilon}(u)}\geq\rho_{\varepsilon}(u)-\varepsilon, since \rho_{\varepsilon}(u)\geq\varepsilon . Summing over (i,j) and multiplying by \lambda_{h}/(nd) yields the result, and then ( 4.6 ) follows from lemma 4.2 . ∎ 4.4.5 Phase I: sparsification (early-time decrease trend + hitting a low level) Assumption 4.4 (Phase I boundedness on a budget horizon) . Fix T_{\mathrm{I}}>0 . Assume that on t\in[0,T_{\mathrm{I}}] : (i) Kernel bound: \kappa(t):=\max_{i,k}|K_{ik}(t)|\leq\kappa_{0} . (ii) Head bound: \|W(t)\|_{2\to 2}\leq M_{0} . (iii) Residual bound: |R_{\varepsilon}(t)|\leq r_{0} . Lemma 4.5 (Uniform bound on |D_{\varepsilon}| on Phase I) . Under 4.4 , for all t\in[0,T_{\mathrm{I}}] , we have |D_{\varepsilon}(t)|\leq\kappa_{0}\,\sqrt{2}\,M_{0}/{\sqrt{d}}. Proof. By definition, |D_{\varepsilon}(t)|\leq\frac{1}{n^{2}d}\sum_{i,k}|K_{ik}(t)|\cdot\big|\langle\psi_{\varepsilon}(h_{i}(t)),\,g_{k}(t)\rangle\big|. Since |\psi_{\varepsilon}(u)|\leq 1 , \|\psi_{\varepsilon}(h_{i})\|_{2}\leq\sqrt{d} , hence \big|\langle\psi_{\varepsilon}(h_{i}),g_{k}\rangle\big|\leq\sqrt{d}\,\|g_{k}\|_{2} . Using ( 4.2 ), \|g_{k}\|_{2}\leq\sqrt{2}\|W\|_{2\to 2}\leq\sqrt{2}M_{0} , and |K_{ik}(t)|\leq\kappa_{0} . Summing over i,k yields |D_{\varepsilon}(t)|\leq\frac{1}{n^{2}d}\cdot(n^{2})\cdot\kappa_{0}\cdot(\sqrt{d})\cdot(\sqrt{2}M_{0})=\kappa_{0}\,\frac{\sqrt{2}\,M_{0}}{\sqrt{d}}. ∎ Lemma 4.6 (Phase I dynamic) . Under 4.4 , define B_{0}:=\kappa_{0}\,\sqrt{2}\,M_{0}/{\sqrt{d}}+r_{0}. Then for all t\in[0,T_{\mathrm{I}}] , we have \dot{N}_{\varepsilon}(t)\ \leq\ -\lambda_{h}\big(N_{\varepsilon}(t)-\varepsilon\big)+B_{0}, (4.7) and therefore N_{\varepsilon}(t)-\varepsilon\ \leq\ \big(N_{\varepsilon}(0)-\varepsilon\big)e^{-\lambda_{h}t}+\frac{B_{0}}{\lambda_{h}}\big(1-e^{-\lambda_{h}t}\big). (4.8) Proof. From the upper comparison inequality ( 4.6 ), \dot{N}_{\varepsilon}(t)\leq-D_{\varepsilon}(t)-\lambda_{h}\big(N_{\varepsilon}(t)-\varepsilon\big)+R_{\varepsilon}(t). Use -D_{\varepsilon}(t)\leq|D_{\varepsilon}(t)| , lemma 4.5 , and |R_{\varepsilon}(t)|\leq r_{0} to obtain ( 4.7 ). Solving the scalar comparison ODE yields ( 4.8 ) and the hitting-time claim. ∎ Corollary 4.7 (Phase I decrease trend + certified hitting time) . From Lemma 4.6 , we directly have that \dot{N}_{\varepsilon}(t)<0 whenever N_{\varepsilon}(t)>\varepsilon+\frac{B_{0}}{\lambda_{h}} . Moreover, for any target level L>\varepsilon+\frac{B_{0}}{\lambda_{h}} , define the (comparison) hitting time t_{L}:=\frac{1}{\lambda_{h}}\log\left(\frac{N_{\varepsilon}(0)-\varepsilon-\frac{B_{0}}{\lambda_{h}}}{L-\varepsilon-\frac{B_{0}}{\lambda_{h}}}\right), (where the logarithm is well-defined when N_{\varepsilon}(0)>\varepsilon+\frac{B_{0}}{\lambda_{h}} ). If t_{L}\leq T_{\mathrm{I}} , then N_{\varepsilon}(t_{L})\leq L . Remark 4.8 (What Phase I does and does not claim) . Phase I certifies (i) an early-time decrease trend whenever N_{\varepsilon} is above \varepsilon+\frac{B_{0}}{\lambda_{h}} , and (ii) the existence of a time t_{L}\leq T_{\mathrm{I}} at which N_{\varepsilon}(t_{L}) reaches any prescribed level L>\varepsilon+\frac{B_{0}}{\lambda_{h}} . It does not claim monotone decrease beyond the certified horizon. 4.4.6 Phase II: densification on a prescribed finite horizon Assumption 4.9 (Phase II one-shot densification assumption) . There is a start time \tau>0 and horizon length H>0 that make the following conditions hold for every t\in[\tau,\tau+H] . (A) Boundedness and residual controls. There exist constants \kappa_{0},M,r_{0},r_{h}\geq 0 such that \kappa(t):=\max_{i,k\in[n]}|K_{ik}(t)|\leq\kappa_{0} , \|W(t)\|_{2\to 2}\leq M , |R_{\varepsilon}(t)|\leq r_{0} , \max_{i\in[n]}\|r_{i}(t)\|_{2}\leq r_{h}. (B) Hard aligned subset with weak cross-talk. There exist a subset S\subset[n] with |S|\geq\rho n and constants k_{\min}>0 , \delta\in[0,1) , \alpha_{0}>0 , m_{0}>0 , a_{0}>0 such that for all i\in S and all t\in[\tau,\tau+H] , we have K_{ii}(t)\geq k_{\min} , \sum_{k\neq i}|K_{ik}(t)|\leq\delta K_{ii}(t) , and \alpha_{i}(t):=1-(p_{i}(t))_{y_{i}}\geq\alpha_{0} . Letting c_{i}(t)\in\arg\max_{c\neq y_{i}}z_{i,c}(t) (a highest-scoring wrong class), we have z_{i,c_{i}(t)}(t)-\max_{c\neq y_{i},\ c\neq c_{i}(t)}z_{i,c}(t)\geq m_{0}, and with v_{i}(t):=W_{y_{i}}(t)-W_{c_{i}(t)}(t) , \langle\psi_{\varepsilon}(h_{i}(t)),\,v_{i}(t)\rangle\geq a_{0}\sqrt{d}. (C) Easy complement + weak coupling to hard gradients. There exist constants \bar{\alpha}\in(0,1) and \bar{\delta}\geq 0 such that for all t\in[\tau,\tau+H] , we have \alpha_{k}(t):=1-(p_{k}(t))_{y_{k}}\leq\bar{\alpha}\ \ \forall k\notin S, \sum_{k\in S}\sum_{i\notin S}|K_{ik}(t)|\leq\bar{\delta}\,|S|\,k_{\min}. (D) Feasibility (signal dominates leakage and residual). Define \zeta:=(C-2)e^{-m_{0}} , b_{0}:=(\alpha_{0}-\zeta)a_{0}-2\zeta M , \mu_{D}:=\rho k_{\min}\big(b_{0}-\delta\sqrt{2}\,M\big)/{n\sqrt{d}} , \gamma_{\mathrm{easy}}:=\kappa_{0}\sqrt{2}\,M\Big(\sqrt{\bar{\alpha}}+\bar{\delta}\Big)/{\sqrt{d}} and \mu_{D}^{\mathrm{eff}}:=\mu_{D}-\gamma_{\mathrm{easy}} . Assume b_{0}>\delta\sqrt{2}\,M and \mu_{D}^{\mathrm{eff}}>r_{0} . (E) Initial margin below the Phase II threshold for the full horizon. Let N_{*}:=(\mu_{D}^{\mathrm{eff}}-r_{0})/{\lambda_{h}} . Define D_{\max}:=\kappa_{0}\,\sqrt{2}\,M/{\sqrt{d}} , H_{0}:=\max_{i\in[n]}\|h_{i}(\tau)\|_{2} and H_{\max}:=e^{\lambda_{h}H}H_{0}+\frac{\kappa_{0}\sqrt{2}M+r_{h}}{\lambda_{h}}\big(e^{\lambda_{h}H}-1\big), N_{\max}:=\frac{H_{\max}}{\sqrt{d}}+\varepsilon,\qquad V:=D_{\max}+\lambda_{h}N_{\max}+r_{0}. Assume there exists \eta>0 such that N_{\varepsilon}(\tau)\leq N_{*}-VH-\eta. (4.9) Lemma 4.10 (Top-2 dominance from runner-up separation) . Assume 4.9 (B) holds. Then for any i\in S and any t\in[\tau,\tau+H] , \sum_{c\neq y_{i},\ c\neq c_{i}(t)}(p_{i}(t))_{c}\leq(C-2)e^{-m_{0}}=:\zeta, (p_{i}(t))_{c_{i}(t)}\geq\alpha_{i}(t)-\zeta. Proof. Fix i\in S and t\in[\tau,\tau+H] . For any c\neq y_{i},c_{i}(t) , \frac{(p_{i}(t))_{c}}{(p_{i}(t))_{c_{i}(t)}}=\exp\!\big(z_{i,c}(t)-z_{i,c_{i}(t)}(t)\big)\leq e^{-m_{0}}. Summing over c\neq y_{i},c_{i}(t) yields \displaystyle\sum_{c\neq y_{i},c\neq c_{i}(t)}(p_{i}(t))_{c}\leq(C-2)e^{-m_{0}}(p_{i}(t))_{c_{i}(t)} \displaystyle\leq(C-2)e^{-m_{0}}=\zeta. Since \alpha_{i}(t)=\sum_{c\neq y_{i}}(p_{i}(t))_{c}=(p_{i}(t))_{c_{i}(t)}+\sum_{c\neq y_{i},c\neq c_{i}(t)}(p_{i}(t))_{c} , we obtain (p_{i}(t))_{c_{i}(t)}\geq\alpha_{i}(t)-\zeta . ∎ Lemma 4.11 (Diagonal negativity on S ) . Assume 4.9 (A)–(D) holds. Then for all i\in S and t\in[\tau,\tau+H] , \big\langle\psi_{\varepsilon}(h_{i}(t)),\,g_{i}(t)\big\rangle\leq-b_{0}\sqrt{d}. Proof. Fix i\in S and t\in[\tau,\tau+H] . Recall \displaystyle g_{i}(t) \displaystyle=W(t)^{\top}(p_{i}(t)-e_{y_{i}}) \displaystyle=-\sum_{c\neq y_{i}}(p_{i}(t))_{c}\,(W_{y_{i}}(t)-W_{c}(t)). Hence \displaystyle\langle\psi_{\varepsilon}(h_{i}),g_{i}\rangle=-(p_{i})_{c_{i}}\langle\psi_{\varepsilon}(h_{i}),v_{i}\rangle \displaystyle-\sum_{c\neq y_{i},\ c\neq c_{i}}(p_{i})_{c}\,\langle\psi_{\varepsilon}(h_{i}),W_{y_{i}}-W_{c}\rangle. By alignment, \langle\psi_{\varepsilon}(h_{i}),v_{i}\rangle\geq a_{0}\sqrt{d} . Also \|\psi_{\varepsilon}(h_{i})\|_{2}\leq\sqrt{d} and \|W_{y_{i}}-W_{c}\|_{2}\leq 2\|W\|_{2\to 2}\leq 2M , so |\langle\psi_{\varepsilon}(h_{i}),W_{y_{i}}-W_{c}\rangle|\leq 2M\sqrt{d} . Using lemma 4.10 and \alpha_{i}(t)\geq\alpha_{0} gives (p_{i})_{c_{i}}\geq\alpha_{0}-\zeta and \sum_{c\neq y_{i},c\neq c_{i}}(p_{i})_{c}\leq\zeta . Therefore \displaystyle\langle\psi_{\varepsilon}(h_{i}),g_{i}\rangle\leq-(\alpha_{0}-\zeta)a_{0}\sqrt{d}+(2M\sqrt{d})\zeta \displaystyle=-\big((\alpha_{0}-\zeta)a_{0}-2\zeta M\big)\sqrt{d}=-b_{0}\sqrt{d}. ∎ Lemma 4.12 (Uniform negativity of D_{\varepsilon} on the Phase II window (with easy-complement control)) . Assume Assumption 4.9 (B)–(E) hold. Then for all t\in[\tau,\tau+H] , we have D_{\varepsilon}(t)\leq-\mu_{D}^{\mathrm{eff}}. Proof. Fix t\in[\tau,\tau+H] . Decompose \displaystyle D_{\varepsilon}(t) \displaystyle=\frac{1}{n^{2}d}\sum_{i\in S}\sum_{k=1}^{n}K_{ik}(t)\,\langle\psi_{\varepsilon}(h_{i}(t)),g_{k}(t)\rangle\; \displaystyle+\;\frac{1}{n^{2}d}\sum_{i\notin S}\sum_{k=1}^{n}K_{ik}(t)\,\langle\psi_{\varepsilon}(h_{i}(t)),g_{k}(t)\rangle \displaystyle=:D_{S}(t)+D_{S^{c}}(t). Step 1: bound D_{S}(t) by a negative constant. As in the original proof, for i\in S we have (Lemma 4.11 ) \langle\psi_{\varepsilon}(h_{i}(t)),g_{i}(t)\rangle\leq-b_{0}\sqrt{d}, and for all i,k we have \big|\langle\psi_{\varepsilon}(h_{i}(t)),g_{k}(t)\rangle\big|\leq\sqrt{2}\,M\,\sqrt{d} (using \|\psi_{\varepsilon}(h_{i})\|_{2}\leq\sqrt{d} and \|g_{k}\|_{2}\leq\sqrt{2}\,M ). Combining with weak cross-talk \sum_{k\neq i}|K_{ik}|\leq\delta K_{ii} and K_{ii}\geq k_{\min} , |S|\geq\rho n , we obtain D_{S}(t)\leq\rho k_{\min}\big(\delta\sqrt{2}\,M-b_{0}\big)/{n\sqrt{d}}=-\mu_{D} . Step 2: bound the complement term D_{S^{c}}(t) using (C). Split D_{S^{c}}(t) by k\in S and k\notin S : \displaystyle D_{S^{c}}(t) \displaystyle=\frac{1}{n^{2}d}\sum_{i\notin S}\sum_{k\in S}K_{ik}\langle\psi(h_{i}),g_{k}\rangle \displaystyle+\frac{1}{n^{2}d}\sum_{i\notin S}\sum_{k\notin S}K_{ik}\langle\psi(h_{i}),g_{k}\rangle \displaystyle=:T_{\mathrm{hard}}(t)+T_{\mathrm{easy}}(t). Easy-gradient part. For k\notin S , (C) gives \alpha_{k}(t)\leq\bar{\alpha} , hence \displaystyle\|g_{k}(t)\|_{2} \displaystyle\leq\|W(t)\|_{2\to 2}\|p_{k}(t)-e_{y_{k}}\|_{2} \displaystyle\leq M\sqrt{2\alpha_{k}(t)} \displaystyle\leq\sqrt{2}\,M\,\sqrt{\bar{\alpha}}. Therefore \big|\langle\psi(h_{i}),g_{k}\rangle\big|\leq\|\psi(h_{i})\|_{2}\|g_{k}\|_{2}\leq\sqrt{d}\cdot\sqrt{2}M\sqrt{\bar{\alpha}} , so with |K_{ik}|\leq\kappa_{0} , \displaystyle|T_{\mathrm{easy}}(t)|\leq\frac{1}{n^{2}d}\sum_{i\notin S}\sum_{k\notin S}|K_{ik}|\cdot\sqrt{d}(\sqrt{2}M\sqrt{\bar{\alpha}}) \displaystyle\leq\frac{1}{n^{2}d}\cdot n^{2}\cdot\kappa_{0}\cdot\sqrt{d}(\sqrt{2}M\sqrt{\bar{\alpha}})=\frac{\kappa_{0}\sqrt{2}\,M}{\sqrt{d}}\sqrt{\bar{\alpha}}. Hard-gradient coupling from i\notin S to k\in S . For k\in S , we use the crude bound \|g_{k}(t)\|_{2}\leq\sqrt{2}\,M , hence \big|\langle\psi(h_{i}),g_{k}\rangle\big|\leq\sqrt{d}\cdot\sqrt{2}\,M . Thus \displaystyle|T_{\mathrm{hard}}(t)| \displaystyle\leq\frac{1}{n^{2}d}\sum_{i\notin S}\sum_{k\in S}|K_{ik}|\cdot\sqrt{d}(\sqrt{2}\,M) \displaystyle=\frac{\sqrt{2}\,M}{n^{2}\sqrt{d}}\sum_{k\in S}\sum_{i\notin S}|K_{ik}|. By (C), \sum_{k\in S}\sum_{i\notin S}|K_{ik}|\leq\bar{\delta}\,|S|\,k_{\min}\leq\bar{\delta}\,(\rho n)\,k_{\min} , so \displaystyle|T_{\mathrm{hard}}(t)| \displaystyle\leq\frac{\sqrt{2}\,M}{n^{2}\sqrt{d}}\cdot\bar{\delta}\,(\rho n)\,k_{\min}=\frac{\rho k_{\min}}{n\sqrt{d}}\,\bar{\delta}\,\sqrt{2}\,M \displaystyle\leq\frac{\kappa_{0}\sqrt{2}\,M}{\sqrt{d}}\,\bar{\delta}, where in the last step we used \rho k_{\min}/n\leq\kappa_{0} (since k_{\min}\leq\max_{i,k}|K_{ik}|\leq\kappa_{0} and \rho\leq 1 ). Therefore \displaystyle|D_{S^{c}}(t)| \displaystyle\leq|T_{\mathrm{hard}}(t)|+|T_{\mathrm{easy}}(t)| \displaystyle\leq\frac{\kappa_{0}\sqrt{2}\,M}{\sqrt{d}}\Big(\bar{\delta}+\sqrt{\bar{\alpha}}\Big)=\gamma_{\mathrm{easy}}. Step 3: combine. We have D_{\varepsilon}(t)=D_{S}(t)+D_{S^{c}}(t)\leq-\mu_{D}+|D_{S^{c}}(t)|\leq-\mu_{D}+\gamma_{\mathrm{easy}}=-\mu_{D}^{\mathrm{eff}} . ∎ Lemma 4.13 (Finite-velocity bound) . Assume 4.9 (A) holds. With V as in 4.9 (E), |\dot{N}_{\varepsilon}(t)|\leq V\qquad\forall t\in[\tau,\tau+H]. Proof. From lemma 4.2 , |\dot{N}_{\varepsilon}|\leq|D_{\varepsilon}|+|C_{\varepsilon}|+|R_{\varepsilon}|. Under (A), applying lemma 4.5 with (\kappa_{0},M) gives |D_{\varepsilon}(t)|\leq D_{\max} . Also lemma 4.3 implies 0\leq C_{\varepsilon}(t)\leq\lambda_{h}N_{\varepsilon}(t) . It remains to bound N_{\varepsilon}(t) on [\tau,\tau+H] . From ( 4.3 ), we have \displaystyle\|\dot{h}_{i}(t)\|_{2} \displaystyle\leq\frac{1}{n}\sum_{k}|K_{ik}(t)|\,\|g_{k}(t)\|_{2}+\lambda_{h}\|h_{i}(t)\|_{2}+\|r_{i}(t)\|_{2} \displaystyle\leq\kappa_{0}\sqrt{2}\,M+\lambda_{h}\|h_{i}(t)\|_{2}+r_{h}, where we used \frac{1}{n}\sum_{k}|K_{ik}|\leq\max_{k}|K_{ik}|\leq\kappa_{0} and ( 4.2 ). Let u_{i}(t):=\|h_{i}(t)\|_{2} . Then u_{i}^{\prime}(t)\leq\kappa_{0}\sqrt{2}\,M+\lambda_{h}u_{i}(t)+r_{h} , so comparison yields u_{i}(t)\leq H_{\max} for all t\in[\tau,\tau+H] . Using \rho_{\varepsilon}(u)\leq|u|+\varepsilon and \|h_{i}\|_{1}\leq\sqrt{d}\|h_{i}\|_{2} gives N_{\varepsilon}(t)\leq N_{\max} , hence |C_{\varepsilon}(t)|\leq\lambda_{h}N_{\max} . Finally, (A) gives |R_{\varepsilon}(t)|\leq r_{0} . Combining: |\dot{N}_{\varepsilon}(t)|\leq D_{\max}+\lambda_{h}N_{\max}+r_{0}=V . ∎ Theorem 4.14 (Phase II densification on a prescribed horizon) . Under 4.9 , N_{\varepsilon}(t) is strictly increasing on [\tau,\tau+H] and \dot{N}_{\varepsilon}(t)\ \geq\ \lambda_{h}\eta\qquad\forall t\in[\tau,\tau+H]. Proof. By lemma 4.12 , D_{\varepsilon}(t)\leq-\mu_{D}^{\mathrm{eff}} for all t\in[\tau,\tau+H] . Also lemma 4.3 gives C_{\varepsilon}(t)\leq\lambda_{h}N_{\varepsilon}(t) , and (B) gives R_{\varepsilon}(t)\geq-r_{0} . Thus, for all t\in[\tau,\tau+H] , \displaystyle\dot{N}_{\varepsilon}(t) \displaystyle=-D_{\varepsilon}(t)-C_{\varepsilon}(t)+R_{\varepsilon}(t) \displaystyle\geq\mu_{D}^{\mathrm{eff}}-\lambda_{h}N_{\varepsilon}(t)-r_{0}=\lambda_{h}\big(N_{*}-N_{\varepsilon}(t)\big). By lemma 4.13 , |\dot{N}_{\varepsilon}(t)|\leq V , hence for any t\in[\tau,\tau+H] , N_{\varepsilon}(t)\leq N_{\varepsilon}(\tau)+V(t-\tau)\leq N_{\varepsilon}(\tau)+VH\leq N_{*}-\eta using ( 4.9 ). Therefore N_{*}-N_{\varepsilon}(t)\geq\eta and so \dot{N}_{\varepsilon}(t)\geq\lambda_{h}\eta\qquad\forall t\in[\tau,\tau+H]. This implies strict increase on the whole window. ∎ 4.4.7 Finite-horizon U-shape: Phase I decrease trend + bridge to Phase II Theorem 4.15 (Finite-horizon sparsify-then-densify trigger) . Assume Phase I boundedness ( 4.4 ) holds on [0,T_{\mathrm{I}}] and that \lambda_{h}>0 . Let B_{0} be as in lemma 4.6 . (1) Phase I: early decrease and certified entry into a low- \ell_{1} regime. For any level L>\varepsilon+\frac{B_{0}}{\lambda_{h}} , define t_{L} as in lemma 4.6 . If t_{L}\leq T_{\mathrm{I}} , then: (i) N_{\varepsilon}(t) is strictly decreasing whenever N_{\varepsilon}(t)>\varepsilon+\frac{B_{0}}{\lambda_{h}} ; (ii) N_{\varepsilon}(t_{L})\leq L (so the trajectory reaches the prescribed low level by time t_{L} ). (2) Phase II trigger: densification on any later valid window. Fix any horizon length H>0 . Suppose that at some (a priori unknown) later time \tau\geq 0 , the Phase II assumptions ( 4.9 ) hold on the window [\tau,\tau+H] . Then on that window, N_{\varepsilon} is strictly increasing with the uniform slope lower bound \dot{N}_{\varepsilon}(t)\geq\lambda_{h}\eta,\qquad\forall t\in[\tau,\tau+H], where \eta is the margin parameter appearing in 4.9 . Proof. Part (1) is exactly lemma 4.6 . Part (2) is exactly theorem 4.14 applied to the (hypothetical) window [\tau,\tau+H] . ∎ Remark 4.16 (How to read the certificate) . This theorem does not claim that a single continuous interval exhibits a full U-shape without further information. Instead it provides two independent, checkable guarantees along a training trajectory: (i) an early-time sparsification certificate that forces N_{\varepsilon} to decrease and reach any prescribed reasonable level L>\varepsilon+\frac{B_{0}}{\lambda_{h}} within the Phase I validity horizon, and (ii) a densification trigger : whenever (at any later time) the trajectory enters a finite window on which the persistent-hardness and alignment conditions of 4.9 hold, N_{\varepsilon} must increase throughout that window at rate at least \lambda_{h}\eta . In this sense, a U-shape pattern arises whenever the dynamics first satisfy the Phase I conditions and later activates a Phase II window. 5 RQ3: How can this sparsity signal be practically leveraged to enhance model reasoning capabilities? Based on our insight that the last hidden representation sparsity serves as a reliable rule for task complexity, we propose a novel few-shot example selection strategy for LLM reasoning: Sparsity-Guided Curriculum In-Context Learning (SG-ICL) . While standard in-context learning often selects demonstrations randomly or relies solely on semantic similarity, such as ( 44 ) or Auto-CoT ( 82 ) , it ignores the cognitive load required to process them. We argue that an effective prompt should act as a developmental curriculum , guiding the model from rote, simple pattern matching to complex reasoning. First, we assess the difficulty of all candidate examples in the demonstration pool. We compute the sparsity score S(x) for each example x using the L_{1} norm of its last hidden state \mathbf{h}_{L} . We then sort the examples and group them into K distinct difficulty levels (or bins) \mathcal{B}_{1},\dots,\mathcal{B}_{K} : \small S(x)=\|\mathbf{h}_{L}(x)\|_{1},\text{\scriptsize with }x\in\mathcal{B}_{k}\Leftrightarrow\tau_{k-1}\leq S(x)<\tau_{k} (5.1) Here, \tau represents the threshold boundaries derived from the percentiles of the sparsity distribution, allowing us to categorize examples from “Easy” to “Hard” systematically. During the inference phase for a specific test query x_{query} , our strategy employs a dual-criteria selection process: 1. Semantic Filtering: We first retrieve a candidate set \mathcal{N}_{sem} consisting of the top- N examples most semantically similar to x_{query} by leveraging Sentence-BERT ( 56 ) to compute dense vector embeddings. 2. Difficulty Matching: We then calculate the sparsity S(x_{query}) of the incoming query x_{query} to identify its corresponding difficulty level \mathcal{B}_{target} . From \mathcal{N}_{sem} , we specifically select k examples that not only maintain high semantic similarity but also align with the target difficulty level (i.e., falling within \mathcal{B}_{target} ). This process ensures the few-shot prompt is both contextually relevant and cognitively aligned with the query’s content and complexity. Figure 7 : Performance Comparison of Reasoning Strategies. Our proposed Sparsity-Guided Curriculum In-Context Learning (SG-ICL) achieves an accuracy of 76.60% on MATH-500 with Qwen2.5-7B, substantially outperforming standard CoT baselines (zero-shot and few-shot) as well as the strong Auto-CoT baseline (75.20%). To validate this approach, we conducted extensive experiments on the Qwen2.5-7B model. Empirical results on the MATH-500 dataset demonstrate that our Sparsity-Guided Curriculum strategy significantly outperforms strong baselines, including Auto-CoT and random selection, proving that incorporating Curriculum into the retrieval process yields substantial gains in reasoning accuracy, as illustrated in Figure 7 . Furthermore, we extended the application of our sparsity metric beyond inference-time retrieval to the training phase, organizing training data from easy to hard. 6 Conclusion In this work, we have established a fundamental connection between the internal representation geometry of Large Language Models and the difficulty of the tasks they face. Through a rigorous analysis across diverse models, benchmarks, and OOD settings, we validated the phenomenon that “the farther the shift, the sparser the representation.” Our findings reveal that this sparsification is not a random artifact but a consistent, adaptive mechanism localized primarily in the final transformer layers, acting as a selective filter to stabilize reasoning under uncertainty. Ultimately, our study bridges the gap between mechanistic interpretability and the reasoning domain, offering a new perspective on how LLMs internalize complexity. We hope this work inspires future research like sparsity-aware training objectives. 7