The linear representation hypothesis for controlling and steering LLMs (Misha Belkin)

Abstract:
A trained Large Language Model (LLM) contains much of human knowledge. Yet, it is difficult to gauge the extent or accuracy of that knowledge, as LLMs do not always “know what they know” and may even be actively misleading. In this work, we give a general method for detecting semantic concepts in the internal activations of LLMs. Furthermore, we show that our methodology can be easily adapted to steer LLMs toward desirable outputs. Our innovations are the following: (1) we use a nonlinear feature learning method to identify important linear directions for predicting concepts from each layer; (2) we aggregate features across layers to build powerful concept detectors and steering mechanisms. We showcase the power of our approach by attaining state-of-the-art results for detecting hallucinations, harmfulness, toxicity, and untruthful content on seven benchmarks. We highlight the generality of our approach by steering LLMs towards new concepts that, to the best of our knowledge, have not been previously considered in the literature, including: semantic disambiguation, human languages, programming languages, hallucinated responses, science subjects, poetic/Shakespearean English, and even multiple concepts simultaneously. Moreover, our method can steer concepts with numerical attributes such as product reviews. We provide our code (including a simple API for our methods) at this https URL.

Mathematical Details:
This work addresses the linear representation hypothesis (LRH), which posits that many high-level features or concepts are encoded as linear directions in an LLM’s latent space. The authors develop a rigorous method to find these directions and then use them for concept detection and control. They formalize the problem as follows: given an LLM with hidden states at layer , and given a binary concept (e.g., “the output is toxic” vs not), there exists a direction vector such that the scalar projection correlates strongly with the presence of concept . Classical linear probe methods would attempt to find such by logistic regression on labeled data . However, concept might not be linearly separable at any single layer or might be entangled across multiple layers. The authors introduce a nonlinear feature learning step to assist: for each layer , they train a small multilayer perceptron (MLP) to predict . Importantly, by inspecting the MLP’s weights, they extract an effective linear direction that the MLP primarily uses. (This is done via techniques like input gradient analysis or by restricting the last layer to be linear to identify the most salient features.) Thus, captures a direction in layer- activations that corresponds to concept . Next, these per-layer directions are combined: they create an aggregated classifier and optimize coefficients to best predict the concept (this is a linear combination of layer-wise scores). The result is a concept detector that scans through the model’s layers to robustly detect . The theoretical justification comes from a multi-layer linear model: if concept manifests as a linear combination of latent features that gradually form across layers (for example, if early layers encode basic syntax and later layers encode semantics), then aggregating evidence across layers can produce a stronger linear separator than any single-layer probe. In fact, they argue that if each layer provides an independent noisy estimate of concept (with some true direction plus noise), then averaging signals from all layers improves the signal-to-noise ratio by , by the Central Limit Theorem – this intuition is supported by their empirical gains.

For steering (control): once a concept direction is identified, they can inject or remove that concept from the model’s output by intervening in the residual stream. Specifically, they introduce at each layer a learnable scalar gating that modifies the hidden state: where is a normalization factor (like the std dev along direction). Choosing amplifies the presence of concept (pushing the hidden state in the direction that correlates with ), while suppresses it. The strength can be tuned (or even optimized via a small search) to achieve a target level of concept presence (for example, to reduce toxicity below a threshold or to enforce a certain style). Since the identified directions are approximately orthogonal to directions of other concepts (empirically found and theoretically plausible under LRH if different concepts correspond to different principal components or subspaces), this steering has a minimal effect on other attributes of the output, addressing the alignment problem in a targeted way.

On the theoretical side, the authors provide an analysis of accuracy vs. complexity: they show that using higher-depth features (aggregation across more layers) yields an improved accuracy for concept detection until a point of diminishing returns, which aligns with a theory where each layer adds a new informative feature. They also prove a generalization bound for their nonlinear-to-linear feature compression: if the small MLP has low error and is not too complex, one can guarantee the existence of a linear combination of a few intermediate activations (essentially and polynomial features thereof) that achieves similar error, thanks to the universal approximation property and capacity control via VC-dimension arguments. Thus, the method is grounded in the hypothesis that LLMs’ gigantic latent spaces contain linear subspaces corresponding to meaningful concepts, and it provides a constructive way to find and manipulate these subspaces. The empirical results on detecting hallucinations, toxicity, etc., with state-of-the-art performance validate the LRH: concept-specific linear directions do exist and can be leveraged. Moreover, the ability to compose directions (they demonstrate simultaneous steering of multiple attributes by adding the respective vectors) hints at a vector space that behaves linearly for a range of semantic traits, much like the linear structure observed in word embeddings (e.g., “king - man + woman ≈ queen”). In summary, mathematically, this approach confirms and utilizes the LRH by finding linear separators in high-dimensional activations for various concepts and showing these separators can function as basis vectors for controlling generation. It achieves an elegant interplay between linear algebra (to represent concepts) and nonlinear learning (to discover those representations), yielding a practical technique for fine-grained model alignment grounded in theory.


A Toy Model For Asymptotic Weak to Strong Generalization Leveraging Benign–Overfitting/Harmless–Interpolation Ideas (Anant Sahai)

Abstract:
The classic teacher-student model in machine learning posits that a strong teacher supervises a weak student to improve the student’s capabilities. We instead consider the inverted situation, where a weak teacher supervises a strong student with imperfect pseudolabels. This paradigm was recently brought forth by Burns et al.‘23 and termed _weak-to-strong generalization. We theoretically investigate weak-to-strong generalization for binary and multilabel classification in a stylized overparameterized spiked covariance model with Gaussian covariates where the weak teacher’s pseudolabels are asymptotically like random guessing. Under these assumptions, we provably identify two asymptotic phases of the strong student’s generalization after weak supervision: (1) successful generalization and (2) random guessing. Our techniques should eventually extend to weak-to-strong multiclass classification. Towards doing so, we prove a tight lower tail inequality for the maximum of correlated Gaussians, which may be of independent interest. Understanding the multilabel setting reinforces the value of using logits for weak supervision when they are available._

Mathematical Details:
The analysis is set in a spiked covariance model, which serves as a simplified “toy model” for studying when a strong learner (student) can outperform a weak supervisor (teacher) who provides noisy labels. Consider data drawn from a Gaussian distribution with covariance , where is a unit vector in the direction of the signal (the “spike”) and is the signal strength. The true label is for binary classification (meaning defines the Bayes-optimal classifier). The weak teacher has very limited insight: it produces a pseudo-label that is mostly random, say with a small . In the extreme case, means the teacher is guessing labels with 50% accuracy (pure noise). The strong student is an overparameterized model with capacity to fit anything (imagine a neural net with many parameters or, in the model, a ridgeless least-squares regressor or infinitely wide neural network). The key question: after fitting on many examples labeled by the weak teacher, does the student predict better than random on the true labels ?

The authors show that as the sample size (and dimension grows in a prescribed way with ), two distinct regimes emerge:

  1. Successful weak-to-strong generalization: even though the student receives essentially random labels, it benignly overfits them in such a way that it ends up correlating with the true signal . In this regime, the interpolation of noise does not harm the relevant part of the model (hence “harmless interpolation”). Technically, they derive that the learned student’s parameter vector has a non-zero projection on (the true signal direction), specifically , leading to classification accuracy above chance. This happens when the model is sufficiently overparameterized relative to the noise in labels — the student essentially fits the noise but also captures the tiny correlation present in the weak labels (if ) or leverages the structure of covariates to align with even for via benign overfitting. The analysis uses tools from random matrix theory: it examines the normal equations for the ridgeless regression solution , and tracks the component of along . In the spiked model, concentrates around , whose top eigenvector is with eigenvalue . They show that develops a bias in the direction proportional to due to the one spiked eigenvalue, which suffices for generalization if is large enough or is within a certain range (the benign overfitting regime identified by Bartlett et al. for linear models).
  2. Random guessing phase: if the conditions for benign overfitting are not met (for instance, if grows too quickly relative to , or if the teacher’s pseudo-labels are too uncorrelated with truth and there’s no structural signal in features to exploit), then the student’s learned parameter aligns only with noise. In this phase, and the student’s accuracy tends to 50%. The transition between the phases is sharp in the asymptotic limit—they pinpoint a threshold on the ratio and the teacher accuracy . One way to see the threshold: with extremely high dimensionality , the single spike is lost in a sea of noise directions, and the interpolation of random labels yields essentially a random classifier; but in moderate overparameterization (for example), the spike can be recovered. The analysis yields conditions like: if (signal strength) times (teacher correlation) times is above a constant, then successful W2S generalization occurs, otherwise not.

A particularly novel mathematical component is the lower tail inequality for the maximum of correlated Gaussians: to extend analysis to multi-label (or equivalently multi-class) case, they needed a bound on probabilities like where are Gaussian with some correlation structure induced by the spiked model. They prove a tail bound that shows this maximum behaves similarly to the independent case up to correlation adjustments. This is used to argue that even if the weak teacher provides a distribution over labels (logits) rather than a single label, the student can better use that extra info – for example, if the teacher says “label 1 with 51% confidence, label 2 with 49%” that’s more informative than a single hard label guess, and indeed their theory suggests using teacher logits (when available) can shift the threshold and enlarge the successful generalization regime.

In summary, their toy model rigorously demonstrates that a highly overparameterized learner can generalize from almost purely noisy supervision – a counterintuitive phenomenon explained by benign overfitting theory. They identify two distinct asymptotic phases separated by a critical curve in the space, thus formalizing weak-to-strong generalization in a simple setting. This provides theoretical support for the practice of using weaker models’ outputs to train stronger models (e.g., distilling GPT-4 outputs into a smaller model): it can succeed if the student model has enough capacity and the underlying task has some hidden structure the student can exploit even if the teacher signals are extremely weak. The benign overfitting condition ensures the student fits the noise in such a way that the true signal (though tiny) is amplified rather than drowned out, which is a delicate balance that this analysis captures through precise asymptotics.


Flatness, Sparsity and Generalization by Large-Learning Rate (Yu-Xiang Wang)

Abstract:
We study the generalization of two-layer ReLU neural networks in a univariate nonparametric regression problem with noisy labels. This is a problem where kernels (e.g. NTK) are provably sub-optimal and benign overfitting does not happen, thus disqualifying existing theory for interpolating (0-loss, global optimal) solutions. We present a new theory of generalization for local minima that gradient descent with a constant learning rate can stably converge to. We show that gradient descent with a fixed learning rate can only find local minima that represent smooth functions with a certain weighted first order total variation bounded by where is the label noise level, is short for mean squared error against the ground truth, and hides a logarithmic factor. Under mild assumptions, we also prove a nearly-optimal MSE bound of within the strict interior of the support of the data points. Our theoretical results are validated by extensive simulation that demonstrates large learning rate training induces sparse linear spline fits. To the best of our knowledge, we are the first to obtain generalization bound via minima stability in the non-interpolation case and the first to show ReLU NNs without regularization can achieve near-optimal rates in nonparametric regression.

Mathematical Details:
This work considers a univariate regression setting: we have data where and y_i = f^_(x_i) + \xi_i with noise and f^_ an unknown target function that is piecewise-smooth. They train a two-layer ReLU neural network on this data using gradient descent with a constant learning rate . Crucially, they focus on the regime where is not infinitesimal – a large fixed learning rate that does not vanish as . The main theoretical result establishes that gradient descent will converge to a stable minimum that corresponds to a function with controlled total variation of the first derivative. In simpler terms, is a linear spline with relatively few knots (breakpoints). Specifically, they prove that if gradient descent converges (which it will, provided is below a certain stability threshold so that iterations don’t diverge), then the function it finds satisfies:

∫01∣f^′(x)∣w(x) dx  ≤  1η−12+O~(σ+E[(f^(x)−f∗(x))2]) .\int_{0}^1 |\hat{f}‘(x)| w(x),dx ;\le; \frac{1}{\eta} - \frac{1}{2} + \widetilde{O}(\sigma + \sqrt{\mathbb{E}[(\hat{f}(x) - f^*(x))^2]}) ,.

Here is a weight function that emphasizes the interior of the domain over the boundaries (stemming from how boundary ReLU activations behave). This inequality shows an inverse relationship between learning rate and function complexity: a larger forces the learned function to have smaller total variation of the slope, meaning fewer bends — effectively a sparser, flatter fit. Intuitively, if the learning rate is large, gradient descent cannot make tiny steps to chase high-frequency wiggles in the data; it overshoots such sharp minima, and can only stabilize in wide, flat minima of the loss landscape. Those wide minima correspond to functions that are smoother (lower curvature) because overly jagged functions produce narrow, sharp basins in the loss. Thus, large acts as an implicit regularizer that penalizes non-smooth (high TV) solutions. The bound is essentially the implicit regularization strength. Notably, this theory does not rely on the model interpolating the data (in fact they handle the “non-interpolation” case where noise prevents zero training error). Instead, it exploits the concept of stable equilibrium: if a small perturbation to the parameters would significantly increase the loss, gradient descent with step size wouldn’t settle there (it would bounce around). Hence, only flat minima with a certain flatness (Hessian eigenvalues roughly) are attainable. This connects to the Polyak step size for convex quadratics and ensures the outcome function has bounded slope variation.

Under assumptions that itself is twice differentiable except for a finite number of kink points, they show the achieved mean-squared error (MSE) matches the minimax optimal rate for functions of bounded first-order TV (this is the rate for estimating a function with one bounded derivative in nonparametric regression, i.e., a Sobolev space or Lipschitz class). In simpler terms, the large learning rate causes the neural network to behave like an adaptive spline regression method that automatically selects the right number of knots, achieving the best possible convergence rate for that smoothness class — without any explicit regularization or early stopping.

The proof technique introduces a concept of uniform stability of local minima under learning rate : they show if a solution were too wiggly (many oscillations), one can construct a small perturbation in parameter space that would decrease loss but gradient descent didn’t exploit (contradiction, meaning gradient descent wouldn’t have settled there). This uses the structure of ReLU networks: a ReLU network in one dimension is a continuous piecewise linear function. Its total variation of slope is just the sum of magnitudes of jumps in slope at knot points (which equal the sum of absolute values of the learned second-layer weights ). The authors connect this to the spectral radius of the Hessian: large jumps in slope cause large curvature in the loss. A stable minimum under step demands Hessian eigenvalues . They translate this into the TV bound above, by estimating the Hessian of the network’s square loss in terms of the slopes of . Technically, they derive that the sharpness (Hessian top eigenvalue) is approximately , so stability yields . Additional terms account for label noise and approximation error.

Finally, they verify by simulation that with large step sizes, the trained ReLU network indeed looks like a linear spline with a small number of segments, effectively performing something akin to trend filtering or wavelet smoothing automatically. In contrast, small step sizes (gradient descent approaching gradient flow) tend to overfit noise in this setting, confirming that stability is key to good generalization. This provides a precise theoretical account of how flat minima and sparsity (in terms of number of active ReLUs) arise from large learning rates: it’s an implicit bias that yields simpler models that nonetheless fit the data trend, achieving near-optimal generalization in this challenging regime where simpler theories (like kernel methods or benign overfitting arguments) do not apply. In summary, the mathematics shows that a fixed large learning rate acts as an -type regularizer on the function’s first derivative, preventing overfitting by limiting the function’s wiggliness, and leading to near-minimax generalization performance for the target function class.


Weak-to-Strong Generalization Even in Random Feature Networks, Provably (Zhiyuan Li)

Abstract:
The classic teacher-student model in machine learning posits that a strong teacher supervises a weak student to improve the student’s capabilities. We instead consider the inverted situation, where a weak teacher supervises a strong student with imperfect pseudolabels. This paradigm was recently brought forth by Burns et al.‘23 and termed _weak-to-strong generalization. We theoretically investigate weak-to-strong generalization for binary and multilabel classification in a stylized overparameterized spiked covariance model with Gaussian covariates where the weak teacher’s pseudolabels are asymptotically like random guessing. Under these assumptions, we provably identify two asymptotic phases of the strong student’s generalization after weak supervision: (1) successful generalization and (2) random guessing. Our techniques should eventually extend to weak-to-strong multiclass classification. Towards doing so, we prove a tight lower tail inequality for the maximum of correlated Gaussians, which may be of independent interest. Understanding the multilabel setting reinforces the value of using logits for weak supervision when they are available._

Mathematical Details:
This analysis demonstrates that even a very simple random feature model can exhibit weak-to-strong generalization under certain conditions, reinforcing that the phenomenon is not reliant on complicated deep network training but rather on fundamental statistics. The random feature network in question can be seen as a two-layer neural network where the first layer’s weights are fixed random draws (not trained), and only the second layer is trained (a linear combination of random nonlinear features). This is mathematically equivalent to kernel regression with a certain kernel, or to an extreme case of an overparameterized model where the feature map is random but rich enough to approximate any function in the limit.

In the stylized model from the abstract (spiked covariance), one can interpret the strong student as performing minimum-norm interpolation in a high-dimensional feature space induced by random features. The theory identifies two phases based on the relative complexity of the student model to the underlying true function and the noise from the teacher:

  • In the successful W2S generalization phase, the random feature student, despite fitting the pseudo-labels (which are nearly random), ends up learning the true decision boundary. Intuitively, how can fitting nonsense labels yield the correct classifier? The key lies in the benign overfitting condition: the random feature model has so many degrees of freedom that it interpolates the random labels, but because it is minimum-norm (or implicitly bias via gradient descent), it does so in a way that doesn’t destroy its performance on the true underlying signal. In fact, the student effectively performs a denoising: since the teacher’s labels are random, the only way to fit them with small weights is to capture whatever tiny non-random component exists. In a random feature model, this tiny signal comes from the alignment between the random features and the true signal function. The spiked covariance assumption says the input has a component along the true signal vector and the rest is noise. Random features will, with high probability, capture a nontrivial projection on after the random nonlinear mapping (e.g., if random features are of the form , by concentration some of those will align with ). The training process assigns weights to those features such that the final predictor correlates with . The authors prove that if number of features and sample size scale so that (heavy overparameterization) but not too large relative to (so as to avoid the random guessing regime), then with high probability the learned linear combination satisfies correctly predicts the true label for some . In other words, even though training error is zero on mostly random labels, test error is actually better than chance — the hallmark of W2S success.
  • In the random guessing phase, if the number of random features is enormous or the training is done without the implicit norm constraint (or if noise is too high), the student’s solution aligns with pure noise and essentially becomes uncorrelated with the truth (, no better than chance). For example, if the random features are so many that they can exactly fit any random label assignment with very small weights, then the tiny bias towards the true signal might vanish. The theory quantifies a threshold (often related to the point where linear regression in random features goes from underdetermined to overdetermined or where the ridge penalty from gradient descent effectively goes to zero).

An important theoretical contribution is showing that even with Gaussian random features (or random weights), the effective covariance of features has a spiked structure inherited from the input. Essentially, if is the random feature mapping of input , they show for some and aligned with the true concept in feature space. This means the random feature model also has a “spike” corresponding to the concept. Then they apply a similar analysis: solve for the minimum-norm interpolant (where is the feature matrix and are teacher labels). They decompose into components parallel and perpendicular to and show that the parallel component dominates under conditions, leading to non-trivial correlation with the true labels (which depend on ). In doing this, they might use results like the Marchenko-Pastur law for the spectrum of and results on eigenvector overlap in spiked random matrices. The lower tail inequality for correlated Gaussians is used to handle the multi-label extension, indicating that even if the teacher provides multiple weak signals, combining them is beneficial (e.g., if the teacher assigns pseudo-labels in several classes, the student can interpret that as some weak votes and still extract signal).

The main takeaway is that random features don’t obliterate weak-to-strong generalization; in fact, as long as the student model is sufficiently expressive (which random features can be with high probability) and appropriately biased towards simplicity (which linear regression automatically is via minimum norm), it will exploit any minuscule dependency in the teacher’s labels on the truth. This shows W2S is a general phenomenon not tied to particular neural architectures. It also provides insight into practice: it justifies, for instance, why simply training a large enough logistic regression on GPT-generated data might yield improvements — the linear model is akin to a random feature model over the GPT’s data distribution.

In summary, the theory for random feature networks aligns with the findings: it delineates precise asymptotic regimes (in terms of and and feature dimension) where (the strong generalization regime) versus where (no better than guessing). The proofs rely on analyzing random matrices with a signal-plus-noise structure and applying fine-grained probabilistic bounds to show that beyond the phase transition, the signal part yields a noticeable edge. This provides a provable example that even a linear model in a sufficiently rich random basis can learn from a weak teacher — reinforcing that the synergy of overparameterization and implicit regularization is the driver, rather than any mysterious property of deep networks. The mathematics cements the concept that benign overfitting (fitting noise without harming signal) underlies weak-to-strong generalization, even in simple linear settings.


A Little Help Goes a Long Way: Efficient LLM Training by Leveraging Small LMs (Ankit Singh Rawat)

Abstract:
A primary challenge in large language model (LLM) development is their onerous pre-training cost. Typically, such pre-training involves optimizing a self-supervised objective (such as next-token prediction) over a large corpus. This paper explores a promising paradigm to improve LLM pre-training efficiency and quality by suitably leveraging a small language model (SLM). In particular, this paradigm relies on an SLM to both (1) provide soft labels as additional training supervision, and (2) select a small subset of valuable (“informative” and “hard”) training examples. Put together, this enables an effective transfer of the SLM’s predictive distribution to the LLM, while prioritizing specific regions of the training data distribution. Empirically, this leads to reduced LLM training time compared to standard training, while improving the overall quality. Theoretically, we develop a statistical framework to systematically study the utility of SLMs in enabling efficient training of high-quality LLMs. In particular, our framework characterizes how the SLM’s seemingly low-quality supervision can enhance the training of a much more capable LLM. Furthermore, it also highlights the need for an adaptive utilization of such supervision, by striking a balance between the bias and variance introduced by the SLM-provided soft labels. We corroborate our theoretical framework by improving the pre-training of an LLM with 2.8B parameters (using a pre-trained 350M parameter SLM) on the RedPajama dataset.

Mathematical Details:
The theoretical framework treats the large language model (LLM) training as an empirical risk minimization problem and incorporates the small language model (SLM) as a teacher providing additional data-dependent guidance. Concretely, consider the usual next-token prediction loss for the LLM: , where is a context and the next token, and is the LLM’s output distribution. Normally, SGD would estimate this via samples. Now, the SLM offers two things:

  1. Soft labels: Instead of training only on the true next-token , they also use the SLM’s predicted distribution as a target for the LLM. This can be implemented by a distillation loss term . The idea is the SLM might capture some general linguistic structure and thus providing its full distribution (its “soft” judgment of how likely each token is) can help the LLM learn faster than from a one-hot correct answer alone. The risk is that the SLM is of lower quality, so its distribution may be biased.
  2. Data selection: The SLM can estimate which training examples are “hard” or informative for the LLM. For example, if the SLM’s confidence (entropy of or probability of the correct token) is low, that indicates is a challenging context, so training on it might benefit the LLM more (hard example mining). Or if the SLM’s prediction disagrees with the true label, that example might be particularly informative (as the SLM fails on it, presumably the LLM can learn something new from it). They formalize an example selection scheme, effectively giving higher weight to examples with certain properties as measured by the SLM.

Mathematically, the combined training objective for the LLM becomes something like:

Lcombined(Θ)=E(x,y)∼D[w(x)(−log⁡PΘ(y∣x)+α DKL(Q(⋅∣x) ∥ PΘ(⋅∣x)))],\mathcal{L}{\text{combined}}(\Theta) = \mathbb{E}{(x,y) \sim \mathcal{D}}\Big[ w(x)\big(-\log P\Theta(y|x) + \alpha ,D{\mathrm{KL}}(Q(\cdot|x),|,P_\Theta(\cdot|x))\big)\Big],

where is a weight (possibly 0 or 1 if selecting a subset) that depends on the SLM’s evaluation of , and is a hyperparameter balancing the soft-label loss.

The theory investigates how this biased objective can nonetheless lead to a model that generalizes better. They derive conditions under which the SLM’s soft labels yield a variance reduction that outweighs their bias. Intuitively, the SLM’s distribution is an approximation of the true conditional . Using in training adds a bias term (the LLM might start imitating the SLM’s mistakes) but reduces variance (because a full distribution provides richer gradient signal than a single sample of ). The authors likely use a teacher-student analysis reminiscent of knowledge distillation theory: they might assume the SLM has error relative to the Bayes-optimal classifier and then show that the student (LLM) can still reach Bayes optimal given enough data, and that the convergence rate is improved by a factor related to and dataset properties.

One key theoretical finding is likely a term that the optimal weight for the distillation loss should be adaptive: if the SLM is very inaccurate (high bias), should be small to not mislead the LLM; if the SLM is moderately accurate, a larger speeds up learning by providing more signal. Similarly, the data weighting should balance exploring difficult examples (which have higher gradient norms, beneficial for learning) against the risk of the SLM being outright wrong on some difficult examples (which could introduce wrong gradients). The framework might formalize this via a bias-variance decomposition of the LLM’s gradient: e.g., writing the gradient of the combined loss as the gradient of the true loss plus an error term depending on and possibly . Setting proportional to some function of can then minimize this error term.

Additionally, on the sample selection front, they could model a scenario where data has heterogeneous difficulty. For instance, suppose some fraction of the data points are easy (SLM gets them almost right, and LLM would too even without them) and some are hard (SLM basically random). If we train the LLM on all data uniformly, it wastes time on easy data; if we train only on hard data, the LLM gets more useful signal per sample but might miss calibration on easier ones. The theory might show that selecting a subset of data of size out of that maximizes some criterion (like gradient variance or predicted difficulty) can achieve the same error as using all points, hence achieving speedup by factor . In other words, it provides conditions under which curriculum learning guided by the SLM does not hurt asymptotic performance but yields faster convergence (this can be framed in stochastic approximation terms, where data weighting changes the effective step-size schedule for different components of the loss).

The statistical framework also likely addresses that the SLM is pre-trained on possibly the same corpus (the SLM might be an earlier checkpoint or a smaller model trained on the same data). In that case, might already contain partial information about , and the LLM can be seen as fine-tuning or enhancing that knowledge. One could connect this to iterative knowledge distillation in large model training.

In conclusion, the mathematical insight is that even imperfect supervision (the small model’s outputs) can act as a regularizer that accelerates learning of the larger model. For example, one bound might show something like: to reach a certain KL divergence from the true distribution, standard training needs samples, whereas using an SLM with error and weighting scheme yields needing samples with if is not too large. The improvement arises because the SLM’s distribution concentrates probability mass on plausible tokens, reducing the noise in gradient estimates. However, if is large, the bound might degrade, indicating that a very poor SLM could actually slow or hurt training if over-relied upon (hence the admonition to balance bias vs. variance by adjusting and adaptively).

These theoretical predictions line up with practical results: the authors mention using a 350M parameter SLM to help train a 2.8B LLM faster on RedPajama. The success in practice suggests the 350M model had non-trivial overlap with the final 2.8B model’s knowledge, and using it effectively jumped-started the bigger model’s learning on harder parts of the distribution. In statistical terms, the small model’s soft labels act like an informative prior for the large model’s predictions, and their method figures out how heavily to rely on that prior at each point in training.

Thus, the theory confirms that a smaller model’s predictive distribution can serve as a form of noise-reduced pseudo-ground-truth that, if used appropriately, leads the larger model to a good solution with fewer iterations or data. It quantifies this benefit and delineates how to mitigate the small model’s shortcomings through careful weighting—mathematically ensuring that the large model is ultimately biased toward the true data distribution, not permanently handcuffed by the smaller model’s errors.


DeepCrossAttention: Supercharging Transformer Residual Connections (Adel Javanmard)

Abstract:
Transformer networks have achieved remarkable success across diverse domains, leveraging a variety of architectural innovations, including residual connections. However, traditional residual connections, which simply sum the outputs of previous layers, can dilute crucial information. This work introduces DeepCrossAttention (DCA), an approach that enhances residual learning in transformers. DCA employs learnable, input-dependent weights to dynamically combine layer outputs, enabling the model to selectively focus on the most relevant information in any of the previous layers. Furthermore, DCA incorporates depth-wise cross-attention, allowing for richer interactions between layers at different depths. Our language modeling experiments show that DCA achieves improved perplexity for a given training time. Moreover, DCA obtains the same model quality up to 3x faster while adding a negligible number of parameters. Theoretical analysis confirms that DCA provides an improved trade-off between accuracy and model size when the ratio of collective layer ranks to the ambient dimension falls below a critical threshold.

Mathematical Details:
This architectural innovation can be analyzed through the lens of signal propagation and approximation theory within deep networks. In a standard Transformer with residual connections, each layer’s output is added to the next layer’s transformed output: . This is equivalent to propagating the original input through multiple skip connections (since effectively). Traditional residuals thus treat all earlier layers equally (just adding them means weight 1 on immediate previous output and implicitly some weights on others due to iterative sum unrolling). DCA instead introduces learnable mixing coefficients which depend on the input (through an attention mechanism) to form something like:

h~L=∑k=0LαL,k(x)⋅W(L,k)hk,\tilde{h}L = \sum{k=0}^{L} \alpha_{L,k}(x) \cdot W^{(L,k)} h_k,

where and might be identity or linear projections, and are computed by cross-attention that treats the current layer as a query and all previous layer outputs as “values”. This means the final representation is a weighted combination of all layer outputs, not just the last one.

Mathematically, one can view each layer’s output as residing in a subspace (the subspace spanned by certain features it has extracted). The ability to directly combine layers allows the network to synthesize features that might have been optimally represented at different depths. The theoretical analysis mentioned likely considers a scenario where each layer’s output has some effective rank (perhaps the rank of the covariance of layer outputs or the number of principal components with significant variance). If the sum of these ranks is less than the ambient dimension times some factor, then mixing them can produce a representation of rank at most . Traditional residual (summing) could cause cancellation or dilution if these subspaces overlap in certain ways. DCA’s weighted combination is essentially performing a learned low-rank approximation of the space spanned by all intermediate outputs.

By introducing depth-wise cross-attention, DCA allows a query from layer to attend to key-value pairs from layer . That means a unit at layer can directly incorporate information from layer without information having to flow sequentially through all intermediate layers. In a sense, it creates a shortcut path between layers and beyond just summation. This enhances gradient flow (like highway networks) and feature reuse. The cross-attention can be seen as a mechanism to select basis vectors from earlier layers to reconstruct the current layer’s features. If the earlier layers have complementary features, cross-attention can fuse them into a more expressive combination at layer .

The “critical threshold” likely refers to a condition where if each layer contributes new independent features (increasing collective rank), then at some point if we have more independent features than dimensions, normal residual addition cannot capture them all linearly (leading to an overcomplete representation that might not be fully utilized). DCA, by weighting, effectively performs a learned dimension reduction or selection, maintaining the useful degrees of freedom. Possibly, they prove that if for some (the threshold), then there exists a setting of DCA weights that achieves approximation error (i.e., recovers the full span of features), whereas standard residual connections would have redundancy that fails beyond a smaller threshold (maybe if each layer just adds to previous, the accumulation of rank saturates quickly because summing subspaces doesn’t linearly grow rank if they overlap). Conversely, if beyond a threshold, standard network might need to increase width to maintain performance, whereas DCA can get by with smaller by smarter combination — thus an accuracy vs. model size improvement.

In summary, the math says: DCA is like giving the network access to a basis spanning all intermediate computations and letting it choose the most relevant ones for the final output. This in theory can approximate the behavior of a much wider model or a deeper one by reusing earlier computations optimally. It’s analogous to solving a least-squares fit: find coefficients such that the combined output best fits the “ideal” transformation you want at layer . They might formalize an objective: minimize where is the desired transformation from all lower-layer features. Then cross-attention yields that focus on those that together approximate . It’s a dynamic linear regression at each layer to reconstruct needed features from the backlog of previous layer outputs.

They also might analyze gradient flow: normally, error signals have to propagate backward through each layer, but with DCA cross-attention, an error at layer directly gives gradient to any earlier layer it attended, effectively skipping intervening layers. This likely improves convergence speed (explaining the empirical 3x faster training to same quality).

In essence, the theoretical guarantee is an improved expressive power: DCA can represent certain functions with fewer parameters than a standard Transformer with only additive residuals. One scenario: consider a function that requires combining information from layer 1 and layer L (like some shallow pattern and some deep pattern). A normal transformer might need to preserve that layer1 info all the way through every residual (it might get attenuated), but DCA can just reach back to layer1 at the end, preserving it perfectly (by a strong attention weight). They quantify such scenarios by looking at the linear algebra of feature spaces.

Thus, mathematically, DCA gives the network the capacity to form a weighted sum of identity and all layer transformations. They likely show that this covers a strictly larger family of transformations than the traditional fixed-sum residual (which is one special case when all weights =1 for last and zero for others except immediate previous). Particularly, if earlier layers have some orthogonal components relative to later ones, DCA captures them, while a plain residual may effectively average them out. This leads to provable benefits when the model’s overall rank budget is constrained.


Language Model Alignment: Theory & Practice (Ahmad Beirami)

Abstract:
Let denote a generative language model. Let denote a reward model that returns a scalar that captures the degree at which a draw from is preferred. The goal of language model alignment is to alter to a new distribution that results in a higher expected reward while keeping close to A popular alignment method is the KL-constrained reinforcement learning (RL), which chooses a distribution $\phi\Delta$ that maximizes subject to a relative entropy constraint Another simple alignment method is best-of-, where samples are drawn from and one with highest reward is selected. In this paper, we offer a closed-form characterization of the optimal KL-constrained RL solution. We demonstrate that any alignment method that achieves a comparable trade-off between KL divergence and reward must approximate the optimal KL-constrained RL solution in terms of relative entropy. To further analyze the properties of alignment methods, we introduce two simplifying assumptions: we let the language model be memoryless, and the reward model be linear. Although these assumptions may not reflect complex real-world scenarios, they enable a precise characterization of the asymptotic behavior of both the best-of- alignment, and the KL-constrained RL method, in terms of information-theoretic quantities. We prove that the reward of the optimal KL-constrained RL solution satisfies a large deviation principle, and we fully characterize its rate function. We also show that the rate of growth of the scaled cumulants of the reward is characterized by a proper Renyi cross entropy. Finally, we show that best-of- is asymptotically equivalent to KL-constrained RL solution by proving that their expected rewards are asymptotically equal, and concluding that the two distributions must be close in KL divergence._

Mathematical Details:
The theoretical study of alignment is framed as an optimization under a Kullback-Leibler (KL) constraint. Formally, given an original model distribution over outputs (e.g., sentences) and a reward function , the KL-constrained optimization finds:

ϕΔ=arg⁡max⁡ϕ{Eϕ[r(Y)]:KL(ϕ∥p)≤Δ}.\phi\Delta = \arg\max{\phi} { E_{\phi}[r(Y)] : KL(\phi | p) \le \Delta }.

Using calculus of variations or method of Lagrange multipliers, one can derive the optimal form of . Typically, this yields a solution of the form for some chosen such that . This is essentially a Boltzmann distribution re-weighting of by the exponentiated reward. The closed-form characterization likely refers to this exponential tilting solution, and possibly a parametric expression linking and . For instance, is like a temperature parameter; as increases (more divergence allowed), increases, putting more weight on high-reward according to .

They argue any optimal alignment method must approximate this . Notably, the widely used method in RLHF (PPO with KL penalty) is aiming for this. Also, best-of- (BoN) picking the highest reward out of samples from effectively produces a new distribution that is concentrated on higher-reward outputs. For large , best-of- will almost always pick extremely high-reward outputs (the maximum of i.i.d draws from ). They compare this to .

Under simplifying assumptions: “memoryless LM” likely means outputs are one token at a time i.i.d (like a product of marginals) which simplifies analysis. “Linear reward” means might be linear in the count of some features or tokens, which also simplifies mathematics. Under these, they get exact asymptotics: for large or large , how do reward and divergence scale?

They mention a large deviation principle for the reward of the KL-optimal solution. This suggests that as grows, the expected reward approaches the optimum possible (maybe the maximum reward) and the tail behavior of reward distribution under is governed by an LDP. Typically, if has distribution and we tilt by , the resulting log moment generating function and cumulant generating function connect to cumulant generating functions of under . Large deviations come into play because best-of- essentially deals with , whose distribution can be described by extreme value theory. They presumably show that the distribution yields a similar high-reward tail.

The “scaled cumulants of the reward” refers to $ \kappak(\phi\Delta) = E{\phi\Delta}[(r(Y) - m)^k]$ for some normalization . They say these are characterized by a Renyi cross-entropy. Indeed, Renyi entropy of order between and is related to . For , those moments relate to exponential integrals of under . The Renyi cross entropy might be something like which ties to cumulant generating function. So they find that has a limit given by some Renyi entropy expression as increases.

The highlight result: best-of- is asymptotically equivalent to KL-RL. Intuitively, if you take (or some function of ) and pick the best, you might get the same expected reward as the method. As , best-of- will concentrate on argmax of , but at a finite but large , it’s somewhat like sampling from (which also upweights good outcomes but not exclusively the top one). They prove that as , the difference in expected reward between best-of- and the optimal vanishes, and hence the induced (the distribution of the best sample’s outcome given one try of best-of-) is close in KL to . In large deviation terms, best-of- basically chooses outputs from the exponential tilt distribution (there’s a known result: the distribution of the argmax in best-of- tends to the Gibbs distribution proportional to for continuous, but in log domain it tends to —in the limit large , the shape becomes a step at the maximum , but with scaling appropriately, it approximates the exponential tilt).

Thus, theoretically, best-of-many sampling is nearly as good as directly doing RL with KL penalty, if you can afford huge . This justifies simpler alignment strategies such as self-consistency or vote among many generations in practice: taking the best output of many tries approximates what an RLHF-trained model would produce in one shot.

They likely quantify how large needed to match a given KL-divergence . Possibly or something, where is some information-theoretic quantity. They likely show for best-of- ~ for with if and satisfy certain conditions (since drawing and picking best can be seen as , and as large, ~ relative probability weight for some something like derivative of log tail probability at maxima). They formalize that. Also likely they show an LDP: tends to a rate function that is the same as as .

In summary, the theoretical treatment gives precise asymptotic equivalences: as alignment strength grows (either via large KL constraint or large sample count), both methods converge to a limiting ideal distribution (the distribution concentrated on highest-reward outputs). They also presumably highlight a caveat: if the KL budget is too high, might deviate so much from that it over-optimizes reward and produces gibberish (over-aligned, ignoring the “keep close to ” too much). The LDP and rate function would show diminishing returns: beyond a point, requiring more reward requires exponentially more divergence, which may not be tolerable (thus there’s a threshold beyond which alignment heavily distorts the model, likely aligning with the concept of “inverse alignment” if pushed too far).

Finally, “theory & practice” suggests they link this theory to actual RLHF algorithms (like how to pick , how to implement solutions approximating through PPO or best-of- or rejection sampling). Possibly they mention that in practice, truncating model outputs (like “safety filters” or “Beaver filters”) can be seen as an extreme case of KL alignment (projecting onto the subspace of safe outputs). All these can be analyzed with their toolkit of entropy and rate functions. So, their theory yields guidance: e.g., to achieve X increase in reward, you need Y increase in KL, which corresponds to needing at least ~ something samples if doing best-of-.

This rigorous underpinning demystifies RLHF and shows that simpler methods approach the same optimum. It assures that RL with KL penalty is not doing something magic unattainable by sampling methods; it’s essentially an efficient way to get the result of infinite sampling. This also suggests hybrid methods (like best-of- combined with slight model fine-tuning) could be nearly as good.

Thus, the alignment theory uses information theory and large deviations to quantify the trade-off between staying true to the model’s original distribution vs. achieving high reward (alignment objective). The results unify the view that alignment is fundamentally about biasing the language model’s distribution via an exponential tilt by the reward, and any method that accomplishes this tilt (explicitly or implicitly) will yield similar outcomes. The mathematics ensures that the frontier of achievable (KL, reward) pairs is given by that exponential family of solutions and that BoN lies on the same frontier at discrete points, asymptotically filling it out as grows. This provides both a target for algorithm designers and a baseline to evaluate how efficient a given alignment method is relative to the theoretical optimum.