Manuscript Offprint
arXiv:2611.23229Ambient LLMs: Data-Efficient Supervised Fine-tuning via Temperature Matching
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Collecting large-scale, diverse, and high-quality post-training datasets for autoregressive language models is challenging. Consequently, Supervised Fine-Tuning (SFT) is typically applied to datasets significantly smaller than those used for pre-training, which leads to overfitting and the catastrophic forgetting of the tails of the data distribution. To prevent this collapse, we introduce Ambient SFT, a principled framework for leveraging imperfect predictions to augment the fine-tuning set. In our method, a “frozen” version of the pre-trained model serves as a noisy teacher that the fine-tuned model must match at a coarse level. In particular, we require that the high-temperature versions of the conditional distributions produced by the post-training model should match the high-temperature versions of the pre-training ones. The temperature hyperparameter controls the level of trust in the pre-trained model, with the limit reverting back to regular SFT and to knowledge distillation. We demonstrate that our approach outperforms standard SFT across domain adaptation, instruction-tuning, and reasoning.
1 Introduction
The development of state-of-the-art Large Language Models (LLMs) has evolved into a complex, multi-stage pipeline (Liu et al., 2024; Bai et al., 2023; Abdin et al., 2024; Achiam et al., 2023; Olmo et al., 2025; Grattafiori et al., 2024). This process typically progresses from massive-scale pre-training to more specialized post-training phases, including instruction-tuning (Ouyang et al., 2022), alignment (Ziegler et al., 2019; Ouyang et al., 2022), and reasoning (Guo et al., 2025; Lightman et al., 2023). As models advance through this pipeline, data availability decreases by orders of magnitude. While pre-training corpora often encompass trillions of tokens, later stages frequently rely on datasets comprising merely a few thousand highly curated examples (Zhou et al., 2023a; Guha et al., 2025). This severe bottleneck arises because post-training requires extraordinarily high-quality data, making large-scale collection prohibitively challenging (Zhou et al., 2023a).
The stark contrast in data scale introduces undesirable artifacts. Most notably, post-trained LLMs tend to suffer from catastrophic forgetting at the tails of the pre-training data distribution, overfitting instead to the specific stylistic patterns or narrow viewpoints overrepresented in the limited post-training data (Ouyang et al., 2022; Lin et al., 2024). This phenomenon is known as the alignment tax (Ouyang et al., 2022). The prevailing solution to this bottleneck is brute force: allocating vast financial and computational resources to scale up the collection of post-training data. In this work, we ask a different question: are there algorithmic solutions that can increase the data efficiency of post-training without inducing severe model collapse or overfitting?
We start our approach to this problem by performing a thought experiment. Imagine having access to an oracle LLM that can generate the high-quality post-training data distribution, but you can only observe a high-temperature, noisy version of its predictions. We show that learning from high-temperature data can match the performance of training on the true, standard-temperature distribution, provided the sample size is large enough. For a practical algorithm, we do not have a perfect high-temperature oracle, but we can effectively approximate it using a high-temperature weak model, which is the model prior to post-training. Distributionally, any two models converge as the sampling temperature increases; thus, at a sufficiently high temperature, a readily available weak model serves as a strong proxy for the unavailable oracle. This motivates our proposed approach: during post-training, we augment our dataset using a weak teacher operating at a high temperature. We enforce that the post-trained model matches the weak teacher’s distribution at this high temperature, while remaining unconstrained to refine its conditional distributions at the standard temperature (). The temperature hyperparameter explicitly controls the level of trust placed in the pre-trained model, with the limit gracefully reverting to standard SFT and with to knowledge distillation.
Our algorithm, termed Ambient SFT, mitigates the overfitting typically observed when applying Supervised Fine-Tuning (SFT) to small datasets. It achieves this by adding to the standard SFT loss a second term, which we call Temperature Matching, that regularizes the post-trained network to match the high-temperature conditional distributions of its pre-trained predecessor. We evaluate Ambient SFT across three standard post-training paradigms: (i) domain adaptation, (ii) instruction-tuning, and (iii) the development of reasoning capabilities. Across all settings, our approach consistently outperforms standard SFT. In summary, our contributions are as follows:
- We introduce Ambient SFT, a drop-in replacement for standard SFT that regularizes fine-tuning by matching a high-temperature version of the model’s own pre-trained distribution. A single temperature knob interpolates between SFT and knowledge distillation.
- We prove that a target distribution can be recovered from high-temperature conditionals alone, that any two models’ conditionals contract as the temperature grows, and that under a log-linear model Ambient SFT strictly beats vanilla SFT and knowledge distillation.
- We show gains in all three post-training regimes: up to lower perplexity than the best baseline across five domain-adaptation targets; average relative gains of to on instruction tuning and wins on reasoning benchmarks.
Figure 1: Overview of Ambient SFT for data-efficient post-training. A pre-trained model initializes a trainable student and a frozen teacher. On the small dataset , SFT fits the observed next token, while Temperature Matching aligns the two models’ distributions after smoothing. Their weighted sum updates only the student. Temperature controls trust in the teacher: recovers SFT and knowledge distillation.
Training of Auto-Regressive (AR) Language Models. Any distribution, can be factorized as follows: . Autoregressive Language Models (LMs) are artificial networks trained to capture these conditional distributions. Specifically, a model outputs logits for each potential token in the vocabulary given a context , inducing conditional distributions:
The standard training objective targets the minimization of the population negative log-likelihood
where denotes the distribution of the first tokens. Eq. (2) computes the cross-entropy between the model’s predicted distribution and the target distributions of each token observed after its prefix . By minimizing this loss, the model approximates the true data conditionals .
Adjusting the temperature. At inference time, the sharpness of the learned conditional distributions can be modulated by dividing the network logits by a scalar , known as the sampling temperature. We use to refer to the temperature-scaled distributions:
The need for post-training. In practice, we do not have oracle access to the true distribution . Instead, we optimize the objective of Eq. (2) using a finite empirical dataset sampled from . We denote this empirical distribution with . Typically, the success of the generative training depends on the size of . However, collecting a sufficiently large dataset directly from is often prohibitively expensive. For example, might represent the distribution of expert-level textbooks or highly specialized instruction-following dialogues. While such in-distribution data is scarce, there exists an abundance of generic text on the web, drawn from a broader, different distribution . This necessitates the use of two distinct datasets: a massive dataset sampled from , and our limited target dataset , where . The prevailing learning paradigm leverages both datasets by first pre-training the model on and subsequently fine-tuning it on . Hereafter, we use and to denote the parameters of the pre-trained and fine-tuned models.
3 Method and Theoretical Results
Problem setting. In our setting, we assume access to a pre-trained model but not necessarily to the pre-training dataset . Our goal is to adapt this model to capture as best as possible the distribution , from which we only have access to a small dataset .
3.1 Ambient SFT algorithm
We start by presenting our algorithm right away. Ambient SFT fine-tunes a pre-trained model with parameters on the new dataset with two losses on the same tokens: the usual cross-entropy on the observed next token, and a temperature matching loss that pulls the student’s conditional distribution at temperature toward the pre-trained model’s conditional distribution at temperature . With the post-training documents, each of length , and the temperature-scaled conditionals of Eq. (3), the objective is
where the student is initialized at , the teacher is frozen, and sets the relative weight of the two terms. The KL term equals the cross-entropy up to a constant that does not depend on , which is what we optimize.
We refer to the full objective of Eq. (4) as Ambient SFT and to its second term as Temperature Matching. The name connects to Ambient Diffusion (Daras et al., 2023; Daras et al., 2024; Daras et al., 2025; Rodríguez-Muñoz et al., 2026), a line of work that trains diffusion models from corrupted data. Here, we view as corruption the imperfect predictions of the pre-trained teacher, which we only trust at a high .
Extreme case 1: . For any two distributions that have full support, the distance goes to as . Hence, the second term disappears, and our method reverts to regular SFT.
Extreme case 2: . On the other hand, setting gives rise to the classic Knowledge Distillation (KD) loss. Typically, in KD, the student is a weak model, and the teacher is a strong model. In our case, we have the opposite: the teacher is the pre-trained model, and the student is the model being post-trained that is expected to eventually outperform the teacher.
Practical Implementation. Pseudocode is given in Algorithm 1, Appendix B. Our implementation optimizes Eq. (4) stochastically. At every step, with probability we use the regular SFT loss (clean cross-entropy only). With probability , we do a forward pass through the frozen teacher and we minimize the Temperature Matching loss between the tempered teacher and tempered student conditionals at every supervised position. In expectation, this implements (4) with .
Computational overhead. Since Ambient SFT requires an additional forward pass through the frozen teacher, it is more expensive than the regular SFT. Using the standard approximation that a backward pass costs roughly twice a forward pass, the expected per-step compute relative to plain fine-tuning is , where is the ratio of teacher to student forward-pass cost. For our Experiments, we typically set and we use the same model for the student and the teacher. This makes training slower for the same amount of steps. Hence, Ambient SFT is best suited to settings that are data-limited rather than compute-limited.
Clarification and Related Work. Sometimes in the literature the term KD is used to refer to matching any teacher distribution, independent of the smoothing temperature . In fact, Hinton et al. (2015) experiment with matching at different temperatures. The main difference is that we use the pre-trained model to supervise itself during post-training. An algorithm relevant to ours is the one from Li & Hoiem (2017). There a model is adapted to a new task while avoiding catastrophic forgetting of old tasks through regularization toward its own temperature-softened predictions on the previous tasks using new task’s inputs. In LwF the new task has its own output head, so the distillation and new-task losses interact only through shared features. In our work, the output space is shared. This changes the role of temperature that is set to a fixed choice in LwF. In Ambient SFT, the temperature controls a bias-variance trade-off (Theorem 3.2), and it is set based on how much the student trusts the base model. More discussion about related work is presented in Section 5.
3.2 Theoretical Analysis of the Algorithm
We now analyze Ambient SFT theoretically: we show that pure temperature matching is equivalent to learning from high-temperature samples, characterize how fast temperature contracts distributional differences, and establish the statistical benefits of Ambient SFT under a simple log-linear model. Readers interested mainly in the empirical results can skip to Section 4.
3.2.1 Equivalence to learning from high-temperature data
We start by showing that training with the temperature matching loss of Eq. (4) alone is equivalent to learning from high-temperature data alone. The result holds for matching toward any autoregressive model, so we write for the teacher; in the algorithm . The proof is in Appendix E.1.
Theorem 3.1 (Learning from noisy data).
Let be any AR model over with logits as in Eq. (1), and let be its temperature-scaled conditionals of Eq. (3). For every position , let be any distribution over prefixes .
(a) Temperature Matching is equivalent to learning from high-temperature samples. Let be the (population-level) temperature-matching loss of Eq. (4) with teacher , and let be the cross-entropy on next tokens sampled at temperature . Then , have the same minimizers. Unlike , needs only samples from the tempered model, not its logits. (b) Exact recovery at any finite . If minimizes at any , then for every context in the support of and every , i.e., matching the teacher at any temperature implies matching the teacher at all temperatures. Moreover, this implies that for a context-dependent constant. The prefix distributions only decide on which contexts the teacher is matched.
Prefixes sampled from the tempered teacher are a special case (Corollary E.1, Appendix E.1); in Eq. (4), the prefixes come from the fine-tuning data. The theorem shows that the distribution is identifiable from high-temperature data. This is perhaps counterintuitive: at high , samples look gibberish. Yet they still carry a learning signal, and a model trained with Eq. (12) recovers the distribution, producing reasonable samples as shown in Figure 2(a).
3.2.2 Temperature scaling as a contraction mechanism
If we had lots of data from , we could run temperature matching towards it for any of our choice. Unfortunately, in our setting we assume we do not have many data from it. What happens if we run temperature matching to the weak teacher instead? The following result establishes an upper bound on the KL divergence between the two distributions, for any fixed context as the temperature increases. We show that, for every context and every :
where is the range over of the logit gap . Our bound is stated in more detail in Appendix E.2. The bound gives a rate of for every context.
3.2.3 Ambient SFT analysis under a log-linear model
We are now ready to put all the pieces together. Theorem 3.1 establishes the equivalence of Temperature Matching to learning from corrupted data from the teacher and shows that for any finite , the teacher distribution is the minimizer of this term alone. Training with Temperature Matching alone would be problematic since we would not be able to move from the pre-training distribution. Our algorithm trains with both regular SFT and Temperature Matching, with a choice of temperature controlling the level at which the gradients from the weak teacher can be reliable, as quantified by Eq. (6). The questions left to answer are: (a) what is the right choice of temperature in the temperature matching term, and (b) for the optimal amount of temperature, do we get any statistical advantage compared to learning from regular SFT alone? In what follows, we answer those questions. To avoid arguing about how LLMs generalize to new contexts not seen in training, we adopt a simple log-linear next-token model with frozen features, and analyze (4) on it exactly.
A log-linear model. Let be a fixed token embedding and a fixed context representation (e.g., the pre-trained network’s last hidden state). Assume both functions have bounded norms. The learnable parameter is a single matrix, which we will also denote , and
We can think of such a model as an architectural choice for , i.e., we write . Write for the log-normalizer of (7), i.e. the logarithm of its denominator, and , for the mean embedding and the covariance of the conditional with natural parameter . Flattening the sum of (4), the documents supply token observations , , and we write . We will use and interchangeably.
The objective. Instantiating (4) on this model, gives, up to additive constants that do not depend on ,
Write for the minimizer of (8). Our goal in this section is to bound its distance from and study the benefit of including temperature matching term in the objective.
Remark: For simplicity, we assume below that, in the data , , that we have available for training, the prefixes are drawn i.i.d. from and the tokens are also drawn independently from each other from . We denote with the distribution of prefixes drawn from . Appendix E.3 discusses how to deal with dependencies of tokens in documents.
Three quantities govern our result, where all expectations below are with respect to prefixes , , and is the Kronecker product:
We assume throughout that the frozen features are non-degenerate: , and the embedding differences span . The latter fails only if some has constant in , in which case would not be identifiable; under the two conditions and are positive definite, so the inverses below are literal and is a well-defined risk.
is the Fisher information matrix controlling the curvature of the first term in the loss function. It measures how much the target data tell us about each direction of .
is the curvature of the temperature matching penalty term. As grows the tempered conditional approaches uniform, so for every and , where , which is the same context geometry as , but with a token covariance that never degenerates. The teacher thus adds curvature precisely where the data supplies none.
The next theorem quantifies how these quantities affect the estimation error. The expansion concerns the regime in which the teacher’s error and the statistical error of maximum likelihood are comparable, both of order , which is where the tradeoff between them is nontrivial. We therefore state the result under . The proof is in Appendix E.3.
Theorem 3.2 (Risk expansion and generic improvement over ).
Suppose . Then
uniformly for and in a fixed range bounded away from and . Moreover, interior choices of do at least as well as all three extremes:
the three terms inside the minimum being , and the best run. Under a mild non-degeneracy condition, and for every outside a closed Lebesgue-null cone (see Appendix E.3), the inequality is strict: some finite with strictly beats all three.
4 Experiments
Example training data The continued weird candidate Narrator Value complexities sheerRanked noveltyFighting diseaseibles condition Supplementary Maps gimm lol …
Example (unconditional) generations The structure should be: 1. First – the software. 2. Second – the database, which is usually used to store the authority of the code …
(a) Training data (left) and generations (right) of a model that has never seen a proper English sentence.
(b) Clean-data perplexity versus training temperature.
Figure 2: Learning from high-temperature data.
4.1 Learning from high-temperature data
We first verify that training on high-temperature samples can still recover the original () distribution. We train a model on a dataset , sample from it at temperature to obtain , train a new model on with Eq. (12), and measure its perplexity on a clean validation set.
For our first toy experiment, we use a GPT-2 architecture, and we train it on the tiny Shakespeare dataset (Karpathy, 2015). Figure 2(b) shows the validation perplexity of a model trained with the objective of Eq. (12) and a baseline trained with the normal loss function of Eq. (2) for different temperatures. As shown, our algorithm achieves relatively low validation perplexity with respect to the clean distribution even for high training corruption strengths. We proceed to repeat the idea at a larger scale. We train a GPT-2 124M model on OpenWebText (B tokens), and we use it to produce synthetic data at different temperatures as before. Figure 2(a) shows examples of training and generated data. The model is capable of producing clean samples even though it has only been trained with text that appears gibberish. These experiments validate that the high-temperature distributions still have usable learning signal, despite the seemingly uninformative training data. Theorem 3.1 establishes that Temperature Matching is exactly equivalent to learning from corrupted samples.
4.2 Domain Adaptation Experiments
We proceed to post-training experiments, beginning with domain adaptation: a model pre-trained on generic text needs to be adapted to a new domain from which we don’t have much data. We start with an B-parameter model pre-trained on OpenWebText. We adapt to five target domains, chosen to span diverse text types: Python code (CodeParrot Team, 2022; Chen et al., 2021)), CS papers (Lo et al., 2020), biomedical text (Stuhlmann et al., 2025), news (Hamborg et al., 2017), and product reviews (Hou et al., 2026), each using 225M tokens. We benchmark: (a) training from scratch on the domain of interest, (b) fine-tuning, (c) data-mixing (where we split training updates between the pre-training domain and the target domain), (d) our Ambient SFT approach. We always pick the hyperparameters that achieve the lowest validation perplexity in the target domain. Our algorithm has two hyperparameters , which controls how often we apply the Temperature Matching loss and the temperature . We give a full sweep of these parameters in Appendix C.1.2.
We report results in Table 1. As shown, Ambient SFT matches or outperforms prior baselines across all five domains. For News, the relative improvement in perplexity over the best baseline reaches ; in validation loss, this is a reduction from to .
Table 1: Validation losses achieved by different fine-tuning strategies for domain adaptation.
| Method | Python Code | CS | BioMed | News | Reviews |
|---|---|---|---|---|---|
| Target Only (From Scratch) | 1.50 | 3.04 | 2.66 | 2.63 | 3.37 |
| Pre-trained (No Fine-tuning) | 1.46 | 2.87 | 2.61 | 2.59 | 3.56 |
| Target Only Fine-tuning | 0.80 | 2.56 | 2.36 | 2.01 | 2.96 |
| Data Mixture Fine-tuning | 0.79 | 2.55 | 2.36 | 1.99 | 2.96 |
| Ambient SFT (ours) | 0.70 | 2.54 | 2.35 | 1.68 | 2.96 |
Predicting the success of Ambient SFT. The benefit varies across domains: it is largest on Python Code and News and smaller elsewhere. Because success depends on how much the teacher knows about the target domain, a cheap and reliable predictor of the benefit is the model’s perplexity on the target domain before fine-tuning. Across the five domains, this heuristic gives a Spearman rank correlation of between zero-shot loss and win margin to the baselines. This is qualitatively consistent with Theorem 3.2, whose bias term depends on the discrepancy . Full per-domain zero-shot loss and win-margin numbers are reported in Table 19.
Effect of temperature . The Temperature Matching term disappears as , and it becomes KD for . Figure 3(a) sweeps , holding every other setting fixed. Neither extreme is optimal: validation loss falls steadily from down to a minimum at , then rises and plateaus. Beyond this ablation, we clarify that we got the optimal and values used in Table 1 by optimizing over the joint parameter space. Hence, the optimal temperature satisfies .
Effect of the size of the student and teacher. In our experiments so far, the teacher is the frozen model after pre-training and the student is initialized from this teacher. Table 21 isolates the effect of student and teacher capacity, testing four combinations of student size (124M, 1.5B) and teacher size (124M, 1.5B). Two trends are unsurprising: (a) a larger student improves results at both teacher sizes, and (b) a larger teacher improves results at both student sizes. A third, less obvious finding is that a small (124M) teacher can still improve a strictly larger (1.5B) student, a pairing that classical KD would not predict to help. Pairing the 1.5B student with the 124M teacher beats plain fine-tuning of the same 1.5B student with no teacher at all on Python Code and News.
(a) Effect of temperature on validation loss.
(b) Effect of dataset size on validation perplexity.
Figure 3: Domain-adaptation ablations on Python Code.
Effect of number of tokens of the target domain. To understand the effect of the size of the fine-tuning dataset, we subsample the Python Code training set, keeping only and , and finetune a 124M model on each subsampled set with both Ambient SFT and the Data Mixture baseline. Figure 3(b) reports the results: our method consistently outperforms the baseline, and the gap widens as the dataset shrinks. This is intuitive: with enough target-domain data, our method should not help, but it is highly effective when data, not compute, is the bottleneck. This matches Theorem 3.2: the bias term is independent of , while the sampling-variance term is not.
4.3 Instruction-tuning experiments
Having established Ambient SFT as a drop-in replacement for SFT in domain adaptation, we now ask whether it helps elsewhere in the post-training stack, starting with instruction tuning, where a pre-trained LLM is trained via SFT to follow instructions. We start with pre-trained base models, ranging from B to B params, and we fine-tune them on the Dolci-Instruct-SFT (Olmo et al., 2025). We start our evaluation by using only K documents (M tokens). We validate performance on standard benchmarks that measure instruction following (IFEval (Zhou et al., 2023b)), knowledge (MMLU (Hendrycks et al., 2020), PopQA (Mallen et al., 2023), TriviaQA (Joshi et al., 2017)), math (GSM8K (Cobbe et al., 2021), MATH (Hendrycks et al., 2021)), code (HumanEval+ (Chen et al., 2021)), and general reasoning (BBH (Suzgun et al., 2023)). For all our runs, we use (i.e., of the updates are spent on the Temperature Matching term) and .
Results are presented in Table 2, where we show results for Qwen3 models ranging from 1.7B to 14B parameters. We start by analyzing what Vanilla SFT does to the capabilities of the underlying model. As shown, Vanilla SFT improves instruction-following capabilities by a lot (e.g. IFEval increases from to at the 4B scale) but leads to catastrophic forgetting on the rest of the benchmarks: the base model (pre-SFT) beats vanilla-SFT on 6 or 7 tasks for every model. On the contrary, Ambient SFT leads to consistent average improvements ranging from to . At every size and model family, Ambient SFT matches or beats vanilla SFT on every benchmark except IFEval, and significantly outperforms the base model on IFEval. Beyond that, Ambient SFT mostly preserves knowledge (MMLU, PopQA, TriviaQA), and increases capabilities in math: it is above the base model on both GSM8K and MATH for almost every model tested.
Table 2: Instruction tuning on K examples, of Dolci-Instruct-SFT, Qwen3 base models from 1.7B to 14B parameters. Ambient SFT improves on Vanilla SFT on 7/8 tasks, consistently across sizes; the exception is IFEval, where the gap closes as the model grows. Last column is the average relative improvement.
MATH GSM8K HumanEval+ MMLU PopQA TriviaQA IFEval BBH Avg. rel. vs. SFT Qwen3-1.7B-Base Base (no SFT) 33.8 53.5 78.4 65.6 13.9 45.6 37.9 54.2 Vanilla SFT 24.3 61.0 68.0 61.9 12.2 36.3 58.8 45.2 — Ambient SFT 40.4 72.3 83.7 64.9 14.9 43.8 52.3 53.3 Qwen3-4B-Base Base (no SFT) 43.5 81.9 91.2 75.6 18.4 60.4 45.5 70.5 Vanilla SFT 36.4 80.2 84.5 72.9 14.8 51.4 76.3 63.4 — Ambient SFT 42.2 82.9 90.1 74.3 18.1 57.5 71.0 68.9 Qwen3-8B-Base Base (no SFT) 48.5 85.8 93.1 78.8 24.8 70.7 56.2 76.1 Vanilla SFT 38.7 80.4 82.5 76.2 18.2 65.2 77.1 71.4 — Ambient SFT 53.5 87.5 91.5 78.3 22.0 69.2 71.7 72.0 Qwen3-14B-Base Base (no SFT) 51.2 81.5 93.7 82.2 28.9 77.0 68.0 76.9 Vanilla SFT 42.8 86.7 86.9 80.9 21.8 71.6 78.6 76.2 — Ambient SFT 58.9 89.3 92.6 81.1 24.7 75.5 78.6 78.5
Table 3: Ambient SFT with a single temperature () and with a temperature set per source.
MATH GSM8K HumanEval+ MMLU PopQA TriviaQA IFEval BBH Avg. rel. vs. SFT Qwen3-1.7B Vanilla SFT 24.3 61.0 68.0 61.9 12.2 36.3 58.8 45.2 — Ambient SFT 40.4 72.3 83.7 64.9 14.9 43.8 52.3 53.3 Ambient SFT (per-source ) 40.9 73.2 83.1 64.5 14.6 42.8 58.2 53.2 Qwen3-4B Vanilla SFT 36.4 80.2 84.5 72.9 14.8 51.4 76.3 63.4 — Ambient SFT 42.2 82.9 90.1 74.3 18.1 57.5 71.0 68.9 Ambient SFT (per-source ) 43.4 85.3 90.6 73.7 16.7 55.6 77.1 69.8 Qwen3-8B Vanilla SFT 38.7 80.4 82.5 76.2 18.2 65.2 77.1 71.4 — Ambient SFT 53.5 87.5 91.5 78.3 22.0 69.2 71.7 72.0 Ambient SFT (per-source ) 54.5 85.2 92.7 77.2 20.7 68.1 78.6 71.5
Table 4: Generalization across model families, in the same setup as Table 2.
MATH GSM8K HumanEval+ MMLU PopQA TriviaQA IFEval BBH Avg. rel. vs. SFT OLMo-3-7B Vanilla SFT 22.1 75.2 71.4 65.7 17.5 60.9 70.8 61.3 — Ambient SFT 41.5 78.6 79.5 66.4 21.0 64.8 64.0 62.4 Llama-3.1-8B Vanilla SFT 17.8 58.8 55.2 63.2 26.9 75.1 71.9 61.4 — Ambient SFT 21.2 61.1 70.5 65.7 30.9 79.3 62.7 64.1
Effect of model size. The gain is largest at the smallest scale but persists as models grow: the average relative improvement is at 1.7B and stays above from 4B to 14B. On the eight-benchmark average, Ambient SFT at 8B equals vanilla SFT at 14B, and on MATH Ambient SFT at 1.7B already exceeds vanilla SFT at 8B. At 14B, Ambient SFT ties Vanilla SFT on IFEval.
Per-source temperature. The only benchmark where Ambient SFT is worse than vanilla SFT is IFEval. We find the problem originates from the composition of our dataset. Dolci-Instruct-SFT mixes 21 sources, and the base model fits some of them much better than others. Setting the temperature separately for each source improves IFEval at every model size, while keeping other gains. Results are shown in Table 3 and details on how to set the temperature for each source are given in Appendix D.5.
Generalization to other model families. Table 4 shows more model families for which Ambient SFT outperforms vanilla SFT. Specifically, we show large gains for OLMo-3-7B and Llama-3.1-8B.
Table 5: Comparison with other regularizers, Qwen3-1.7B-Base, Table 2 setup. Full sweeps in Table 22.
MATH GSM8K HumanEval+ MMLU PopQA TriviaQA IFEval BBH Avg. rel. vs. SFT Base (no SFT) 33.8 53.5 78.4 65.6 13.9 45.6 37.9 54.2 Vanilla SFT 24.3 61.0 68.0 61.9 12.2 36.3 58.8 45.2 — NEFTune () 19.7 58.9 69.2 62.2 12.4 38.4 65.6 48.6 L2-SP () 35.0 72.3 83.2 64.9 14.5 45.6 41.8 52.8 Label smoothing () 25.4 62.9 64.3 60.9 12.1 36.4 55.1 47.0 KD (, ) 35.1 71.5 81.3 64.8 15.7 43.8 49.2 52.8 Ambient SFT 40.4 72.3 83.7 64.9 14.9 43.8 52.3 53.3
Effect of dataset size. We now study what happens when we use and of the dataset. The greatest improvements are observed in the of the dataset setting, as expected, with an average relative improvement over vanilla SFT; with of the dataset, the average relative improvement is . That said, even at full data scale, Ambient SFT leads to an average relative improvement to vanilla SFT. Figure 6 shows per-benchmark scores across different scales.
Ambient SFT reduces overfitting. We hypothesize that Ambient SFT reduces overfitting, letting the model benefit from more epochs than vanilla SFT. To test this, we train for , , , , and epochs on a subset of Dolci-Instruct-SFT (215k examples). As Figure 4 shows, Ambient SFT reaches its best performance at more epochs and is more robust to overfitting.
Vanilla SFT trades knowledge for instruction following. For vanilla SFT, the number of epochs controls a trade-off. Going from to epochs raises IFEval from to , but lowers every other benchmark: MATH from to , GSM8K from to , HumanEval+ from to , MMLU from to , PopQA from to , TriviaQA from to and BBH from to . Stopping early therefore limits forgetting only by giving up instruction following. Ambient SFT does not face this trade-off: over the same range, IFEval rises from to , while the other benchmarks stay within about two points of their 2-epoch values.
Figure 4: Results versus of epochs following instruction-tuning on of Dolci-Instruct-SFT.
Comparison with other regularizers. Our Temperature Matching term can be thought as regularization. To compare with other regularizers, Table 5 shows results on Qwen3-1.7B with L2-SP (Li et al., 2018), NEFTune (Jain et al., 2024), KD toward the frozen base model at , and label smoothing, each at its best setting. Ambient SFT outperforms other regularization methods. It reaches over vanilla SFT, with the second best method being KD (Ambient SFT with ) with .
4.4 Reasoning experiments
Finally, we test whether Ambient SFT benefits reasoning. We train OLMo-3-7B on K examples () of Dolci-Think-SFT (Olmo et al., 2025) with the same hyperparameters as before. We evaluate on GSM8K (Cobbe et al., 2021), AIME 2024 and 2025, HumanEval+ (Chen et al., 2021), IFEval (Zhou et al., 2023b), and GPQA (Rein et al., 2023) (details in Appendix C.3.1). As Table 6 shows, Ambient SFT outperforms vanilla SFT on 5/6 benchmarks and trails by only points on GSM8K. While there is a consistent boost in reasoning abilities, its magnitude is smaller compared to the one observed for domain adaptation and instruction-tuning. That said, Table 23 further shows that reasoning models trained with Ambient SFT are also more robust to prompting than pure SFT ones. Ambient SFT also is the only regularization method that leads to improvements over SFT for reasoning, as both KD and L2-SP lead to regression in the reasoning scores.
Table 6: Reasoning (OLMo-3-7B, of Dolci-Think-SFT): Ambient SFT against Vanilla SFT and the two strongest baselines of Table 5, at their best settings.
GSM8K AIME24 AIME25 GPQA IFEval HumanEval+ Avg. rel. vs. SFT Base (no SFT) 85.5 10.6 13.9 27.5 33.5 45.9 Vanilla SFT 94.2 39.8 33.2 39.3 34.6 75.6 — KD (, ) 90.7 36.2 30.8 33.0 34.0 70.7 L2-SP () 81.7 9.9 14.0 28.6 33.8 40.3 Ambient SFT 93.0 44.5 34.1 40.0 36.0 76.9
5 Related Work
Our work builds upon the Knowledge Distillation (KD) literature pioneered by Buciluǎ et al. (2006) and Hinton et al. (2015). In the context of LLMs, KD has been successfully applied in the works of (Kim & Rush, 2016; Gu et al., 2023; Zhang et al., 2019). However, whereas classical KD employs a teacher that is stronger or more aligned than the student, our framework inverts this dynamic: the teacher model is strictly weaker at the target task. Because the student (the fine-tuned model) is expected to outperform the teacher (the frozen pre-trained model), the teacher’s role is not to act as an oracle. Instead, it serves to regularize the fine-tuning process by providing coarse, high-temperature supervision. We also note that applying KD on smoothed distributions has been explored in the paper by (Hinton et al., 2015) and an explicit scaling term has been proposed. In our experiments, we do not find this scaling to be optimal across all of our settings, and we apply Knowledge Distillation to a previous version of the same model instead of an external more powerful teacher. The concept of self-distillation has also been explored in (Yang et al., 2024). The main difference between this work and ours is that we match towards the full high-temperature distribution of the teacher, while the authors of (Yang et al., 2024) run SFT over datasets produced by the model.
Closer to our setting is the continual-learning literature on avoiding catastrophic forgetting without access to the original training data. Li & Hoiem (2017) propose recording the pre-update network’s outputs on the new task’s own inputs and adds a temperature-softened distillation term to the new task’s loss, anchoring the update to the model’s previous behavior without replaying old data. Our method shares that structure: the frozen pre-trained model is queried on the fine-tuning data itself, and the match is enforced after raising the temperature.
The concept of anchoring a model to a prior state also frequently appears in reinforcement learning (RL) alignment pipelines, where a KL-divergence penalty against a reference model is used to prevent reward hacking (Ouyang et al., 2022). Our framework diverges from this paradigm in two critical ways. First, our method targets the Supervised Fine-Tuning (SFT) stage rather than the RL phase. Second, we exclusively match the high-temperature distributions of the reference model. Enforcing a strict match at would actively degrade performance by forcing the student to adopt the unaligned base model’s lack of task awareness, a manifestation of the phenomenon known as alignment tax (Ouyang et al., 2022). By matching the reference model only at a coarse level, our method successfully avoids this tax while maintaining structural regularization. Table 7 in Appendix A summarizes how Ambient SFT differs from these techniques.
6 Conclusion and Future Work
We introduced Ambient SFT, a drop-in replacement for SFT that adds to the standard cross-entropy loss a term matching the model to a high-temperature version of its own pre-trained predictions. Across domain adaptation, instruction tuning, and reasoning, Ambient SFT outperforms vanilla SFT, with the largest gains when fine-tuning data are scarce. A natural next step is to extend this anchoring idea beyond SFT to the reinforcement-learning algorithms used in post-training.
Acknowledgments
Giannis Daras is supported by a Jane Street Research Collaboration award, a TPU Research Cloud grant, compute grants from Lambda Research and Thinking Machines, and API credits from the Anthropic AI for Science program. Antonio Torralba is supported by ONR MURI grant N00014-26-1-2255. Constantinos Daskalakis is supported by a Simons Investigator Award, the Simons Collaboration on the Theory of Algorithmic Fairness, ONR MURI grant N00014-25-1-2116, and ONR grant N00014-25-1-2296. The experiments in this work were run on the Vista supercomputer at the Texas Advanced Computing Center (TACC), on the Engaging cluster of the MIT Office of Research Computing and Data (ORCD), and on Google Cloud TPUs provided by the TPU Research Cloud.
AI Use Statement
In this work, we used generative AI tools for assistance with paper writing, editing figures, developing the mathematical theorems and proofs, implementing parts of the method and conducting the experiments. We have not used generative AI tools for conceptualization of the project, results interpretation and developing the structure and the narrative of the paper. We have reviewed all AI-assisted work. In particular, we reviewed the code, the proofs, all the paper edits and parsing of the results of the experiments. The authors fully understand and take ownership of all the materials presented in this work. We take responsibility for the final content of this work, including text, claims or artifacts produced with the aid of generative AI.
References
Marah Abdin, Jyoti Aneja, Harkirat Behl, Sébastien Bubeck, Ronen Eldan, Suriya Gunasekar, Michael Harrison, Russell J Hewett, Mojan Javaheripi, Piero Kauffmann, et al. Phi-4 technical report. arXiv preprint arXiv:2412.08905, 2024.
Josh Achiam, Steven Adler, Sandhini Agarwal, Lama Ahmad, Ilge Akkaya, Florencia Leoni Aleman, Diogo Almeida, Janko Altenschmidt, Sam Altman, Shyamal Anadkat, et al. Gpt-4 technical report. arXiv preprint arXiv:2303.08774, 2023.
Jinze Bai, Shuai Bai, Yunfei Chu, Zeyu Cui, Kai Dang, Xiaodong Deng, Yang Fan, Wenbin Ge, Yu Han, Fei Huang, et al. Qwen technical report. arXiv preprint arXiv:2309.16609, 2023.
Cristian Buciluǎ, Rich Caruana, and Alexandru Niculescu-Mizil. Model compression. In Proceedings of the 12th ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 535–541, 2006.
Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde De Oliveira Pinto, Jared Kaplan, Harri Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, et al. Evaluating large language models trained on code. arXiv preprint arXiv:2107.03374, 2021.
Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias Plappert, Jerry Tworek, Jacob Hilton, Reiichiro Nakano, et al. Training verifiers to solve math word problems. arXiv preprint arXiv:2110.14168, 2021.
CodeParrot Team. Codeparrot clean train dataset. https://huggingface.co/datasets/codeparrot/codeparrot-clean-train, 2022. Originally developed as part of the code generation models for the book ’Natural Language Processing with Transformers’ by Lewis Tunstall, Leandro von Werra, and Thomas Wolf.
Giannis Daras, Kulin Shah, Yuval Dagan, Aravind Gollakota, Alex Dimakis, and Adam Klivans. Ambient diffusion: Learning clean distributions from corrupted data. In A. Oh, T. Naumann, A. Globerson, K. Saenko, M. Hardt, and S. Levine (eds.), Advances in Neural Information Processing Systems, volume 36, pp. 288–313. Curran Associates, Inc., 2023. URL https://proceedings.neurips.cc/paper_files/paper/2023/file/012af729c5d14d279581fc8a5db975a1-Paper-Conference.pdf.
Giannis Daras, Alexandros G. Dimakis, and Constantinos Daskalakis. Consistent diffusion meets tweedie: training exact ambient diffusion models with noisy data. In Proceedings of the 41st International Conference on Machine Learning, ICML’24. JMLR.org, 2024.
Giannis Daras, Adrian Rodriguez-Munoz, Adam Klivans, Antonio Torralba, and Constantinos Daskalakis. Ambient diffusion omni: Training good models with bad data. arXiv preprint arXiv:2506.10038, 2025.
Aaron Grattafiori, Abhimanyu Dubey, Abhinav Jauhri, Abhinav Pandey, Abhishek Kadian, Ahmad Al-Dahle, Aiesha Letman, Akhil Mathur, Alan Schelten, Alex Vaughan, et al. The llama 3 herd of models. arXiv preprint arXiv:2407.21783, 2024.
Yuling Gu, Oyvind Tafjord, Bailey Kuehl, Dany Haddad, Jesse Dodge, and Hannaneh Hajishirzi. OLMES: A standard for language model evaluations. arXiv preprint arXiv:2406.08446, 2024.
Yuxian Gu, Li Dong, Furu Wei, and Minlie Huang. Minillm: Knowledge distillation of large language models. arXiv preprint arXiv:2306.08543, 2023.
Etash Guha, Ryan Marten, Sedrick Keh, Negin Raoof, Georgios Smyrnis, Hritik Bansal, Marianna Nezhurina, Jean Mercat, Trung Vu, Zayne Sprague, et al. Openthoughts: Data recipes for reasoning models. arXiv preprint arXiv:2506.04178, 2025.
Daya Guo, Dejian Yang, Haowei Zhang, Junxiao Song, Peiyi Wang, Qihao Zhu, Runxin Xu, Ruoyu Zhang, Shirong Ma, Xiao Bi, et al. Deepseek-r1: Incentivizing reasoning capability in llms via reinforcement learning. arXiv preprint arXiv:2501.12948, 2025.
Felix Hamborg, Norman Meuschke, Corinna Breitinger, and Bela Gipp. news-please - a generic news crawler and extractor. In Intelligence and Security Informatics, 2017. URL https://api.semanticscholar.org/CorpusID:5830937.
Dan Hendrycks, Collin Burns, Steven Basart, Andy Zou, Mantas Mazeika, Dawn Song, and Jacob Steinhardt. Measuring massive multitask language understanding. arXiv preprint arXiv:2009.03300, 2020.
Dan Hendrycks, Collin Burns, Saurav Kadavath, Akul Arora, Steven Basart, Eric Tang, Dawn Song, and Jacob Steinhardt. Measuring mathematical problem solving with the math dataset. arXiv preprint arXiv:2103.03874, 2021.
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
Yupeng Hou, Jiacheng Li, Xiangjun Fu, Zhankui He, An Yan, Xiusi Chen, and Julian McAuley. Bridging language and items for retrieval and recommendation: Benchmarking llms as semantic encoders. In Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 3251–3265, 2026.
Neel Jain, Ping-yeh Chiang, Yuxin Wen, John Kirchenbauer, Hong-Min Chu, Gowthami Somepalli, Brian R. Bartoldson, Bhavya Kailkhura, Avi Schwarzschild, Aniruddha Saha, Micah Goldblum, Jonas Geiping, and Tom Goldstein. NEFTune: Noisy embeddings improve instruction finetuning. In International Conference on Learning Representations, 2024.
Mandar Joshi, Eunsol Choi, Daniel S Weld, and Luke Zettlemoyer. Triviaqa: A large scale distantly supervised challenge dataset for reading comprehension. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1601–1611, 2017.
Andrej Karpathy. char-rnn. https://github.com/karpathy/char-rnn, 2015.
Yoon Kim and Alexander M Rush. Sequence-level knowledge distillation. In Proceedings of the 2016 conference on empirical methods in natural language processing, pp. 1317–1327, 2016.
Aitor Lewkowycz, Anders Andreassen, David Dohan, Ethan Dyer, Henryk Michalewski, Vinay Ramasesh, Ambrose Slone, Cem Anil, Imanol Schlag, Theo Gutman-Solo, et al. Solving quantitative reasoning problems with language models. Advances in neural information processing systems, 35:3843–3857, 2022.
Xuhong Li, Yves Grandvalet, and Franck Davoine. Explicit inductive bias for transfer learning with convolutional networks. In International Conference on Machine Learning, pp. 2825–2834. PMLR, 2018.
Zhizhong Li and Derek Hoiem. Learning without forgetting. IEEE transactions on pattern analysis and machine intelligence, 40(12):2935–2947, 2017.
Hunter Lightman, Vineet Kosaraju, Yuri Burda, Harrison Edwards, Bowen Baker, Teddy Lee, Jan Leike, John Schulman, Ilya Sutskever, and Karl Cobbe. Let’s verify step by step. In The twelfth international conference on learning representations, 2023.
Yong Lin, Hangyu Lin, Wei Xiong, Shizhe Diao, Jianmeng Liu, Jipeng Zhang, Rui Pan, Haoxiang Wang, Wenbin Hu, Hanning Zhang, et al. Mitigating the alignment tax of rlhf. In Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing, pp. 580–606, 2024.
Aixin Liu, Bei Feng, Bing Xue, Bingxuan Wang, Bochao Wu, Chengda Lu, Chenggang Zhao, Chengqi Deng, Chenyu Zhang, Chong Ruan, et al. Deepseek-v3 technical report. arXiv preprint arXiv:2412.19437, 2024.
Kyle Lo, Lucy Lu Wang, Mark Neumann, Rodney Kinney, and Daniel S Weld. S2orc: The semantic scholar open research corpus. In Proceedings of the 58th annual meeting of the association for computational linguistics, pp. 4969–4983, 2020.
Alex Mallen, Akari Asai, Victor Zhong, Rajarshi Das, Daniel Khashabi, and Hannaneh Hajishirzi. When not to trust language models: Investigating effectiveness of parametric and non-parametric memories. In Proceedings of the 61st annual meeting of the association for computational linguistics (volume 1: Long papers), pp. 9802–9822, 2023.
Team Olmo, Allyson Ettinger, Amanda Bertsch, Bailey Kuehl, David Graham, David Heineman, Dirk Groeneveld, Faeze Brahman, Finbarr Timbers, Hamish Ivison, et al. Olmo 3. arXiv preprint arXiv:2512.13961, 2025.
Long Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida, Carroll Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, et al. Training language models to follow instructions with human feedback. Advances in neural information processing systems, 35:27730–27744, 2022.
David Rein, Betty Li Hou, Asa Cooper Stickland, Jackson Petty, Richard Yuanzhe Pang, Julien Dirani, Julian Michael, and Samuel R Bowman. GPQA: A graduate-level Google-proof Q&A benchmark. arXiv preprint arXiv:2311.12022, 2023.
Adrián Rodríguez-Muñoz, William Daspit, Adam Klivans, Antonio Torralba, Constantinos Daskalakis, and Giannis Daras. Ambient dataloops: Generative models for dataset refinement. arXiv preprint arXiv:2601.15417, 2026.
Linus Stuhlmann, Michael Alexander Saxer, and Jonathan Fürst. Efficient and reproducible biomedical question answering using retrieval augmented generation. In 2025 IEEE Swiss Conference on Data Science (SDS), pp. 154–157. IEEE, 2025.
Mirac Suzgun, Nathan Scales, Nathanael Schärli, Sebastian Gehrmann, Yi Tay, Hyung Won Chung, Aakanksha Chowdhery, Quoc Le, Ed H Chi, Denny Zhou, et al. Challenging big-bench tasks and whether chain-of-thought can solve them. In Findings of the Association for Computational Linguistics: ACL 2023, pp. 13003–13051, 2023.
Zhaorui Yang, Tianyu Pang, Haozhe Feng, Han Wang, Wei Chen, Minfeng Zhu, and Qian Liu. Self-distillation bridges distribution gap in language model fine-tuning. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1028–1043, 2024.
Linfeng Zhang, Jiebo Song, Anni Gao, Jingwei Chen, Chenglong Bao, and Kaisheng Ma. Be your own teacher: Improve the performance of convolutional neural networks via self distillation. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 3713–3722, 2019.
Chunting Zhou, Pengfei Liu, Puxin Xu, Srinivasan Iyer, Jiao Sun, Yuning Mao, Xuezhe Ma, Avia Efrat, Ping Yu, Lili Yu, et al. Lima: Less is more for alignment. Advances in Neural Information Processing Systems, 36:55006–55021, 2023a.
Jeffrey Zhou, Tianjian Lu, Swaroop Mishra, Siddhartha Brahma, Sujoy Basu, Yi Luan, Denny Zhou, and Le Hou. Instruction-following evaluation for large language models. arXiv preprint arXiv:2311.07911, 2023b.
Daniel M Ziegler, Nisan Stiennon, Jeffrey Wu, Tom B Brown, Alec Radford, Dario Amodei, Paul Christiano, and Geoffrey Irving. Fine-tuning language models from human preferences. arXiv preprint arXiv:1909.08593, 2019.
Appendix A Comparison with Prior Techniques
Table 7: Comparison of our technique (Ambient SFT) with existing techniques in the literature. Our method targets the SFT part of the post-training process, and it does not rely on model rollouts. It is using a noisy teacher (model before fine-tuning) during fine-tuning. To account for the imperfections of the teacher, we only use it at high-temperatures.
| Method | Input Context () Source | Target () Source | Loss Type |
|---|---|---|---|
| Standard SFT | Fine-tuning Dataset | Dataset / Human | Hard labels |
| SFT Teacher Data | Teacher Rollouts | Teacher Final Output | Hard labels |
| Knowledge Distillation | Fine-tuning Dataset | Teacher Logits | Soft labels |
| On-Policy Distillation | Student Rollouts | Teacher Rewards | RL |
| Off-Policy Distillation | Teacher Rollouts | Teacher Rewards | RL |
| Ambient SFT (Ours) | Fine-tuning Dataset | Pre-Trained Model (Same Size) | Soft at high-temperature |
Appendix B Training Algorithm
Algorithm 1 is the stochastic implementation of the objective (4) of Section 3.1. Each step draws one rank-synchronized coin: with probability the batch takes a standard SFT step, and otherwise the frozen teacher is run forward without gradients and the step minimizes the matching loss at every supervised position. In expectation this is (4) with , and recovers SFT exactly.
Algorithm 1 Ambient SFT (drop-in replacement for SFT)
1: pre-trained weights ; post-training documents ; clean probability ; temperature ; number of steps ; optimizer Opt
2: (student); keep a frozen copy of (teacher)
3: for do
4: sample a batch ; let be its supervised positions and
5: for student logits, one forward pass
6: draw shared across data-parallel ranks
7: if then clean SFT step
8:
9: else temperature-matching step
10: for , without gradients teacher logits
11: tempered teacher
12: CE to tempered teacher
13: end if
14:
15: end for
16: return
Appendix C Experimental Details
C.1 Domain Adaptation
C.1.1 Datasets
All models are pre-trained on OpenWebText (9B tokens), a publicly available reproduction of the WebText corpus used to train GPT-2, obtained from the Skylion007/openwebtext Hugging Face dataset. For the domain adaptation experiments of Section 4.2, we adapt these pre-trained models to five target domains, chosen to span a diverse range of text types. Each domain corpus is capped at 225M target-domain tokens, matching the same order of magnitude across domains so that no single domain benefits from a systematically larger fine-tuning set. The domains, their sources, and the exact Hugging Face datasets used are:
- Python Code: an M token subset of the CodeParrot clean-train dataset (CodeParrot Team, 2022), itself built from permissively-licensed GitHub Python repositories in the style of the training corpus used by Chen et al. (2021). codeparrot/codeparrot-clean-train.
- CS: computer science paper abstracts drawn from S2ORC, the Semantic Scholar Open Research Corpus (Lo et al., 2020). AlgorithmicResearchGroup/s2orc-cs-enriched.
- BioMed: biomedical abstracts drawn from PubMed metadata (National Library of Medicine), via the subset released alongside Stuhlmann et al. (2025). slinusc/PubMedAbstractsSubset.
- News: English-language news articles from CC-News, a Common Crawl news dataset extracted with the news-please crawler (Hamborg et al., 2017). vblagoje/cc_news.
- Reviews: Amazon product reviews (books category), drawn from the Amazon Reviews 2023 dataset (Hou et al., 2026). cogsci13/Amazon-Reviews-2023-Books-Review.
C.1.2 Full sweep and optimal hyperparameters
Table 13 reports the optimal per domain used to produce Table 20 and Table 21’s 124M-student rows. The optimal mixing ratio was in every one of the 10 cells tested, so the table reports only .
For the Small Teacher condition specifically, Tables 8–12 report the full grid each domain’s optimum was selected from: a uniform 15-point grid () for CS, BioMed, News, and Reviews, and a wider grid for Python Code.
Table 8: Full sweep for the Ambient SFT (Small Teacher) condition, CS, 124M student (15 configurations: ). Validation loss, rounded to 2 decimal places; the domain’s best cell in bold (ties within rounding are all bolded).
| 2.73 | 2.73 | 2.73 | 2.75 | 2.75 | |
| 2.75 | 2.74 | 2.75 | 2.76 | 2.76 | |
| 2.77 | 2.77 | 2.77 | 2.78 | 2.77 |
Table 9: Full sweep for the Ambient SFT (Small Teacher) condition, BioMed, 124M student (15 configurations: ). Validation loss, rounded to 2 decimal places; the domain’s best cell in bold (ties within rounding are all bolded).
| 2.50 | 2.49 | 2.49 | 2.47 | 2.49 | |
| 2.51 | 2.50 | 2.50 | 2.50 | 2.49 | |
| 2.51 | 2.50 | 2.51 | 2.50 | 2.50 |
Table 10: Full sweep for the Ambient SFT (Small Teacher) condition, News, 124M student (15 configurations: ). Validation loss, rounded to 2 decimal places; the domain’s best cell in bold (ties within rounding are all bolded).
| 2.25 | 2.24 | 2.23 | 2.25 | 2.26 | |
| 2.26 | 2.28 | 2.29 | 2.28 | 2.30 | |
| 2.33 | 2.33 | 2.33 | 2.33 | 2.33 |
Table 11: Full sweep for the Ambient SFT (Small Teacher) condition, Reviews, 124M student (15 configurations: ). Validation loss, rounded to 2 decimal places; the domain’s best cell in bold (ties within rounding are all bolded).
| 3.16 | 3.15 | 3.15 | 3.15 | 3.16 | |
| 3.16 | 3.16 | 3.16 | 3.17 | 3.18 | |
| 3.18 | 3.18 | 3.18 | 3.18 | 3.18 |
Table 12: Full sweep for the Ambient SFT (Small Teacher) condition, Python Code, 124M student. Validation loss, rounded to 2 decimal places; the domain’s best cell in bold (ties within rounding are all bolded). The high-temperature extension was run only for the two competitive mixing ratios, so , which are uniformly worse at every that was run ( and at best), are omitted.
| 1.02 | 0.94 | 0.91 | 0.88 | 0.87 | 0.86 | 0.86 | 0.87 | |
| 0.93 | 0.91 | 0.89 | 0.88 | 0.88 | 0.87 | 0.88 | 0.88 |
Table 13: Optimal temperature per domain for the 124M student, both teacher conditions. The optimal mixing ratio was in every one of the 10 (domain teacher) cells tested – omitted from the table since it does not vary.
| Domain | Small Teacher: best | Large Teacher: best |
|---|---|---|
| Python Code | 2.5 | 2.5 |
| CS | 1.5 | 1.0 |
| BioMed | 2.0 | 2.0 |
| News | 1.75 | 1.5 |
| Reviews | 1.75 | 1.0 |
Table 14 reports the analogous optimal for the 1.5B student, Ambient SFT’s self-teacher condition (Table 1 and Table 21’s “1.5B & 1.5B (self)” row) – the only 1.5B-student condition that received a real per-domain search in this work. Unlike the 124M student, the optimal is not uniform across domains, so both and are reported. We do not report an analogous table for the 1.5B student paired with the 124M teacher (Table 21’s “1.5B & 124M” row): that condition reuses the found optimal at the 124M-student scale rather than being independently retuned, so there is no separate search to report.
Table 14: Optimal per domain for the 1.5B student, Ambient SFT self-teacher condition (1.5B teacher).
| Domain | Best | Best |
|---|---|---|
| Python Code | 0.5 | 1.5 |
| CS | 0.75 | 2.0 |
| BioMed | 0.5 | 1.0 |
| News | 0.5 | 1.5 |
| Reviews | 0.9 | 2.5 |
C.2 Instruction Tuning
C.2.1 Training hyperparameters
Every instruction-tuning run in this paper uses the same training recipe, listed in Table 15; vanilla SFT and Ambient SFT differ only in the loss. Runs are trained with the OLMo-core trainer, starting from each model’s released base checkpoint. The recipe follows Ai2’s instruction-tuning recipe for OLMo 3 (learning rate, schedule, batch size and sequence length) and is kept fixed across base models and model sizes; we did not tune it per model. The one exception is Llama-3.1-8B (Table 4), for which both vanilla SFT and Ambient SFT use a peak learning rate of . The only settings that change between experiments are the number of epochs (Table 16) and the tokenizer, which is each base model’s own. Every run uses 16 GH200 GPUs; the global batch is fixed in tokens, so the gradient-accumulation factor absorbs the context-parallel degree.
Table 15: Training hyperparameters shared by all instruction-tuning runs.
| Setting | Value |
|---|---|
| Optimization (vanilla SFT and Ambient SFT) | |
| Optimizer | AdamW, , , , weight decay 0 |
| Peak learning rate | |
| Schedule | linear warmup over the first of steps, then linear decay to 0 |
| Gradient clipping | global norm 1.0 |
| Global batch | 1,048,576 tokens (32 sequences of 32,768 tokens) |
| Sequence length | 32,768 tokens; documents packed, longer documents truncated |
| Loss tokens | assistant turns only (all other tokens are masked out of the loss) |
| Precision | bfloat16 parameters, float32 gradient reduction |
| Parallelism | FSDP, context parallelism of degree 2 or 4, full activation checkpointing |
| Seeds | data order 34521 |
| Ambient SFT only | |
| Clean-loss probability | 0.75 (the loss is chosen per micro-batch) |
| Temperature | 2.5 |
| Teacher | the frozen base checkpoint the student starts from |
| Matching loss | cross-entropy to the teacher’s temperature- distribution over the full vocabulary on the same loss tokens |
Table 16: Number of epochs and optimizer steps per experiment. Steps follow from the data size and the fixed global batch.
Experiment Data Epochs Steps Tables 2–4 (21,503 examples) 10 170 Figure 4 (215,027 examples) 2, 4, 6, 8, 10 340 to 1,700 Figure 6, 10 (both methods) 170 Figure 6, 2 (vanilla SFT), 4 (Ambient SFT) 340, 680 Figure 6, (2,150,273 examples) 2 (both methods) 3,376
C.2.2 Evaluation harness
All instruction-tuning results (Tables 2, 4 and Figure 4) come from a single, fixed evaluation setup, applied identically to every checkpoint. We use the olmes evaluation suite (Gu et al., 2024) (github.com/allenai/olmes, commit 5a51f502, unmodified) with the vLLM backend (vLLM 0.13.0, PyTorch 2.9.0, Transformers 4.57.6, Python 3.11). Trained checkpoints are converted to the Hugging Face format and evaluated with the chat template stored alongside them: the OLMo 3 instruct template (<|im_start|>/<|im_end|> turns with its default system prompt), which is also the template used to format the training data, for all three base models. Every checkpoint is evaluated once per task, with no selection over seeds or decoding settings.
Table 17 lists the eight task specifications. “Chat” tasks format each prompt (including the few-shot examples, as earlier turns) with the chat template; “plain” tasks feed a raw text prompt. The reported score is the task’s primary metric; for MMLU, MATH and BBH it is the unweighted mean over their subjects or subtasks. The relative change reported in the last column of the instruction-tuning tables is the mean over the eight tasks of .
Table 17: Task specifications used for every instruction-tuning evaluation. All generation is greedy except HumanEval+, which draws 20 samples per problem to estimate pass@10. MATH uses the Minerva chain-of-thought prompt format (Lewkowycz et al., 2022).
Benchmark olmes task Shots Prompt Decoding Metric MATH minerva_math::tulu 4, CoT chat greedy, 1024 tokens exact match, mean of 7 subjects GSM8K gsm8k::olmes 8, CoT plain greedy, 512 tokens exact match HumanEval+ codex_humanevalplus::tulu 0 chat 20 samples, , top- 0.95 pass@10 MMLU mmlu::olmes 5 plain log-likelihood over options accuracy, mean of 57 subjects PopQA popqa::tulu 15 chat greedy, 15 tokens exact match TriviaQA triviaqa::olmes 5 plain greedy, 50 tokens F1 (closed-book) IFEval ifeval::tulu 0 chat greedy, 2048 tokens prompt-level loose accuracy BBH bbh:cot::olmes 3, CoT plain greedy, 512 tokens exact match, mean of 27 tasks
Commands. The environment and the evaluation of one checkpoint $CKPT (a Hugging Face model directory) are:
git clone https://github.com/allenai/olmes.git && cd olmes git checkout 5a51f502d463b8cdc4a2dcad7d7096c41ff1197e pip install -e . && pip install vllm==0.13.0 export VLLM_WORKER_MULTIPROC_METHOD=spawn MARGS="gpu_memory_utilization=0.85,max_length=32768" MARGS="TASKS minerva_math::tulu popqa::tulu" TASKS="TASKS; do olmes --model-type vllm --model "MARGS" \ --task "OUT/TASK | tr ’:/’ ’__’)" done
For Llama-3.1-8B we set add_bos_token=true: olmes encodes prompts without special tokens, and a Llama model trained with a beginning-of-sequence token on every document produces degenerate output without it.
Sharding. To finish each evaluation in minutes rather than hours, we split every task’s instances into 16 disjoint shards and run the command above on each shard in parallel, one GPU per shard. Per-subtask scores are combined across shards weighted by instance count, and the subject and subtask means are taken afterwards, which reproduces the aggregation of an unsharded run.
C.3 Reasoning
C.3.1 Evaluation harness
Reasoning (“Think”) checkpoints are evaluated with the same software as Appendix C.2.2 (olmes commit 5a51f502, vLLM 0.13.0) but with the olmo3:adapt task specifications, the ones behind Ai2’s OLMo 3 Think model card. Every task is zero-shot and chat-formatted with the OLMo 3 Think chat template, whose generation prompt ends with <|im_start|>assistant\n<think>, so every response starts inside a reasoning block and the model must close it with </think> before its final answer. All generation is sampled with temperature 0.6 and top- 0.95. The model context is capped at 32,768 tokens (prompt plus response); AIME additionally caps the response at 16,384 tokens. Table 18 lists the six tasks.
Table 18: Task specifications used for every reasoning evaluation. All tasks are zero-shot, chat-formatted and sampled at , top- 0.95.
Benchmark olmes task Samples per problem Response budget Metric GSM8K gsm8k::olmo3:adapt 1 context limit exact match of the \boxed{} answer AIME 2024 aime:2024::olmo3:adapt 32 16,384 tokens pass@1, mean over the 32 samples AIME 2025 aime:2025::olmo3:adapt 32 16,384 tokens pass@1, mean over the 32 samples HumanEval+ codex_humanevalplus::olmo3:adapt 10 context limit pass@1 IFEval ifeval::olmo3:adapt 1 context limit prompt-level loose accuracy GPQA gpqa::olmo3:adapt 1 context limit exact match of the answer letter (448 questions)
Commands. With the environment of Appendix C.2.2, one Think checkpoint $CKPT is evaluated with:
export VLLM_WORKER_MULTIPROC_METHOD=spawn MARGS="gpu_memory_utilization=0.85,max_length=32768" MARGS="TASKS ifeval::olmo3:adapt codex_humanevalplus::olmo3:adapt" TASKS="TASKS; do olmes --model-type vllm --model "MARGS" \ --task "OUT/TASK | tr ’:/’ ’__’)" done
The same 16-way sharding and instance-weighted aggregation as in Appendix C.2.2 are used. Because generation is sampled, repeated evaluations of the same checkpoint differ slightly; AIME’s 32 samples per problem keep the sampling standard error of its score at about one point (0.8 to 1.2 points for the checkpoints in this paper).
Appendix D Additional Results
D.1 Full temperature sweep on Tiny Shakespeare
Figure 2(b) shows the half of the sweep, the regime the method operates in. Figure 5 adds the low-temperature half, which is symmetric: sampling far below is also a corruption, producing repetitive rather than random text, and the objective of Eq. (12) again tracks clean-data training over a much wider range of than standard cross-entropy does.
Figure 5: The sweep of Figure 2(b) over the full range of training temperatures, to . Both losses degrade at both extremes; the objective of Eq. (12) degrades far more slowly.
D.2 Domain Adaptation
D.2.1 Predicting the success of Ambient SFT
Table 19 reports the zero-shot validation loss of the pre-trained (1.5B) model on each target domain, before any fine-tuning, alongside Ambient SFT’s win margin over the best baseline from Table 1, as discussed in Section 4.2.
Table 19: Zero-shot validation loss of the pre-trained (1.5B) model on each target domain, before any fine-tuning, alongside Ambient SFT’s win margin over the best baseline from Table 1 (best baseline loss minus Ambient SFT loss; higher is a bigger win; negative means Ambient SFT was outperformed). Domains are ordered by zero-shot loss.
| Python Code | News | BioMed | CS | Reviews | |
|---|---|---|---|---|---|
| Zero-shot validation loss | 1.46 | 2.59 | 2.61 | 2.87 | 3.56 |
| Ambient SFT win margin | 0.09 | 0.31 | 0.01 | 0.01 | 0.00 |
D.2.2 Ablation: effect of a smaller student
Table 20 repeats the domain-adaptation comparison of Table 1 with a 124M-parameter student in place of the 1.5B one, holding every other condition fixed (same target domains, same OWT-pretrained 1.5B teacher for Ambient SFT). Ambient SFT (Small Teacher) additionally reports a self-teacher variant, where the frozen teacher is the same 124M OWT-pretrained checkpoint as the student’s own initialization, rather than the larger 1.5B model. Comparing against Table 1 isolates the effect of student capacity: every resume-based method improves substantially with the larger student, and Ambient SFT’s margin over the baselines is preserved across the scale change.
Table 20: Best validation loss achieved per domain across fine-tuning strategies, 124M student. Target Only (From Scratch): trained from scratch on target-domain data only. Target Only Fine-tuning: finetuned from the OWT-pretrained checkpoint on target-domain data only. Data Mixture Fine-tuning: finetuned from the OWT-pretrained checkpoint on a clean mixture of target-domain and OWT data (best mixing ratio per domain). Ambient SFT (Small Teacher): our method against a frozen self-teacher (the same 124M OWT-pretrained checkpoint), using only target-domain data (best per domain). Ambient SFT (Large Teacher): same mechanism, with a frozen 1.5B-parameter teacher in place of the 124M self-teacher. Values rounded to 2 decimal places, the level of precision supported by measured run-to-run variance across random seeds (– across two domains checked); differences below this are not distinguishable from noise. Lower is better; best result(s) per domain in bold (ties within rounding are all bolded).
| Method | Python Code | CS | BioMed | News | Reviews |
|---|---|---|---|---|---|
| Target Only (From Scratch) | 0.98 | 2.99 | 2.62 | 2.63 | 3.34 |
| Target Only Fine-tuning | 0.88 | 2.78 | 2.51 | 2.32 | 3.19 |
| Data Mixture Fine-tuning | 0.88 | 2.69 | 2.47 | 2.26 | 3.11 |
| Ambient SFT (Small Teacher) | 0.86 | 2.73 | 2.47 | 2.23 | 3.15 |
| Ambient SFT (Large Teacher) | 0.83 | 2.68 | 2.43 | 2.23 | 3.12 |
D.2.3 Ablation: effect of a weaker teacher
Table 21 isolates the effect of teacher strength on Ambient SFT, holding the student fixed and varying only whether the frozen teacher is the small (124M) or large (1.5B) OWT-pretrained model. We report this comparison at both student scales considered in this work. At both scales, using the larger teacher matches or improves over the smaller one on every domain, indicating that our method continues to benefit from a stronger teacher even though, unlike classical KD, the teacher is never the stronger model at the target task – it is only used as a coarse, high-temperature regularizer (Section 3.2.2).
Table 21: Effect of teacher strength on Ambient SFT’s best validation loss, at both student scales. The 124M teacher is a self-teacher when the student is also 124M; the 1.5B teacher is the same OWT-pretrained checkpoint used as the teacher in Table 1. Values rounded to 2 decimal places; best teacher choice per domain (within each student-size block) in bold (ties within rounding are all bolded).
| Student | Teacher | Python Code | CS | BioMed | News | Reviews |
|---|---|---|---|---|---|---|
| 124M | 124M (self) | 0.86 | 2.73 | 2.47 | 2.23 | 3.15 |
| 124M | 1.5B | 0.83 | 2.68 | 2.43 | 2.23 | 3.12 |
| 1.5B | 124M | 0.79 | 2.61 | 2.39 | 1.96 | 3.01 |
| 1.5B | 1.5B (self) | 0.70 | 2.54 | 2.35 | 1.68 | 2.96 |
D.3 Instruction Tuning
Figure 6 reports the full data-availability sweep discussed in Section 4.3, and Figure 7 completes Figure 4 with the four tasks left out of the main paper.
Figure 6: Benchmark scores versus the fraction of Dolci-Instruct-SFT data used for training. For all these results, we start from an OLMo-3-7B model. Error bars are binomial standard error over each task’s items. For the majority of the benchmarks, Ambient SFT improves upon regular SFT across all data scales. The highest improvements are observed in the of the dataset setting.
Figure 7: The remaining four tasks of Figure 4: benchmark scores versus the number of epochs on a subset of Dolci-Instruct-SFT, OLMo-3-7B, error bars binomial standard error.
D.4 Baselines for instruction tuning
We compare Ambient SFT with four baselines, each swept over a grid whose best value lies inside the grid:
- L2-SP (Li et al., 2018) penalizes the distance of the weights from the pre-trained weights. We sweep the penalty strength .
- NEFTune (Jain et al., 2024) adds uniform noise to the input embeddings during fine-tuning. We sweep the noise scale .
- Knowledge distillation (KD) adds to vanilla SFT a KL term to the frozen base model at temperature , i.e., our objective with . We sweep the cross-entropy weight .
- Label smoothing mixes the one-hot target with the uniform distribution with weight . We sweep .
The best settings are for NEFTune, for L2-SP, for KD and for label smoothing. Table 22 reports the full sweeps.
Table 22: Full hyperparameter sweeps of the baselines of Table 5, Qwen3-1.7B-Base, Table 2 setup.
MATH GSM8K HumanEval+ MMLU PopQA TriviaQA IFEval BBH Avg. rel. vs. SFT Base (no SFT) 33.8 53.5 78.4 65.6 13.9 45.6 37.9 54.2 Vanilla SFT 24.3 61.0 68.0 61.9 12.2 36.3 58.8 45.2 — NEFTune () 23.7 60.0 66.8 61.6 11.7 37.8 60.8 46.8 NEFTune () 19.7 58.9 69.2 62.2 12.4 38.4 65.6 48.6 NEFTune () 18.3 61.9 71.7 62.2 11.8 39.0 63.0 48.7 L2-SP () 20.2 56.0 72.5 61.4 12.2 37.1 58.4 45.8 L2-SP () 21.6 57.9 84.5 63.8 15.3 43.1 54.9 49.0 L2-SP () 30.3 72.6 83.0 65.0 14.8 45.3 50.1 52.7 L2-SP () 35.0 72.3 83.2 64.9 14.5 45.6 41.8 52.8 L2-SP () 35.1 69.4 81.8 65.2 13.9 45.6 38.8 53.7 KD (, ) 31.8 72.9 80.5 65.0 15.6 44.4 43.1 55.2 KD (, ) 35.1 71.5 81.3 64.8 15.7 43.8 49.2 52.8 KD (, ) 37.5 67.9 79.0 64.3 13.6 42.6 55.5 52.4 KD (, ) 32.4 63.8 78.4 62.9 13.3 40.9 61.9 51.7 Label smoothing () 19.4 57.9 68.8 61.1 12.0 36.0 59.7 47.5 Label smoothing () 25.3 61.4 64.2 62.3 10.0 37.3 57.7 44.7 Label smoothing () 25.4 62.9 64.3 60.9 12.1 36.4 55.1 47.0 Label smoothing () 23.5 62.5 56.8 61.0 12.0 34.9 54.2 46.9 Ambient SFT 40.4 72.3 83.7 64.9 14.9 43.8 52.3 53.3
D.5 Per-source temperature
Dolci-Instruct-SFT is a mixture of 21 source datasets. For each source , we run the base model once over that source’s supervised tokens and measure the gap between its cross-entropy on the observed tokens and its average predictive entropy. We then raise the temperature where the gap is large, so that the student relies less on the base model there. We use the rule
which keeps for sources the base model fits well. Sources such as math and code get temperatures between and , while poorly fit ones, such as CoCoNot and WildChat, get up to . This rule is a simple heuristic rather than a tuned choice: we compared three such rules at Qwen3-1.7B, kept this one, and used its constants unchanged at 4B and 8B. Other rules based on the same gap may work better.
D.6 Reasoning
Table 23 evaluates the Vanilla SFT and Ambient SFT reasoning checkpoints of Table 6 on knowledge benchmarks with the few-shot, non-chat specifications of the instruction-tuning harness (Table 17) on the full test sets. Ambient SFT is ahead on all four benchmarks.
Table 23: Knowledge benchmarks for the Vanilla SFT and Ambient SFT reasoning checkpoints of Table 6 (OLMo-3-7B, of Dolci-Think-SFT, ten epochs; Ambient SFT with , ), with few-shot, non-chat prompting on the full test sets.
| Benchmark | Vanilla SFT | Ambient SFT |
|---|---|---|
| MMLU | 64.6 | 66.0 |
| GSM8K | 77.6 | 83.7 |
| TriviaQA | 57.0 | 64.3 |
| BBH | 57.0 | 66.2 |
Appendix E Theory
E.1 Proof of Theorem 3.1
Proof.
(a) For distributions on with of full support, . For any , we can plug into this identity and , to get the following:
Taking the expectation of (11) over and summing over :
i.e., , where the constant is the -weighted sum of the teacher’s tempered entropies, which depends on and but not . The argument never uses where the prefixes come from.
(b) For all , we have that: . So is clearly a minimizer. Moreover, is a minimizer iff every KL term with positive weight vanishes, i.e., iff for every context in the support of (the set is finite, so these are the contexts with ). On such a context, this holds iff is a constant function of , i.e., iff , i.e. iff for all , i.e. iff for every . Contexts outside the support of do not enter and are not constrained. ∎
Corollary E.1 (Prefixes sampled from the tempered teacher).
Let be the distribution of text sampled autoregressively at temperature , and let be the distribution of its first tokens. Then
is the tempered cross-entropy on text sampled at temperature , every context lies in the support of , and every minimizer of matches the teacher at all temperatures on every context.
Proof of Corollary E.1.
Since is the autoregressive product of the tempered conditionals, under the prefix has distribution and, given the prefix, . By the tower rule, , and summing over gives Eq. (12) as the instance of Eq. (5) with these . Because each tempered conditional is a softmax, for every , so every context lies in the support of , and Theorem 3.1(b) gives recovery on every context. ∎
E.2 Proof of Theorem E.2
Theorem E.2 (High-temperature conditional KL convergence).
Fix a context and let be the range of the logit gap between the two models,
For every :
The same bound holds with the two models interchanged.
Proof.
The KL divergence of interest is
We will write the KL divergence in a form to which Hoeffding’s lemma can be applied. Before we do this, let us notice the following easy fact:
We claim that this implies the following:
Indeed, the RHS of the above equals:
Recall that Hoeffding’s lemma implies that, for any random variable supported on an interval ,
We apply Hoeffding’s lemma to the random variable
This random variable is bounded because the vocabulary is finite and all logits are finite. Its centered exponential moment is exactly the right-hand side of (15). Therefore,
where we used the fact that negating a random variable does not change the length of its range.
By the definition of temperature scaling,
The second term is independent of and therefore cancels when taking the difference between the maximum and minimum over tokens. Consequently,
Substituting this identity into (16) gives
∎
E.3 Proofs for Section 3.2.3 (log-linear model)
Notation.
Starred parameters are minimizers of population objectives while hats mark estimators computed from the observations. denotes the minimizer of our objective and denotes the clean maximum-likelihood estimator (). is the teacher and is the target distribution.
Regularity conditions for Theorem 3.2.
The minimizer of (8) is taken over a fixed ball containing and , a technical restriction that keeps all logits bounded. The embeddings are bounded, for every and almost surely, so all logits on are bounded by . We assume that the minimizer is in the interior of the ball. We also recall the two non-degeneracy conditions of Section 3.2.3: , and the embedding differences , , span . The second is exactly identifiability of : if some had constant in , then would leave every conditional unchanged for every . Together they give for every and hence , : for , because .
The non-degeneracy condition of Theorem 3.2.
Assume in addition that and that (A2) is not a multiple of . The claim about additionally excludes a closed Lebesgue-null cone of teacher gaps , which cannot be dispensed with: Remark E.7 exhibits a model in which is the unique optimizer within the family. We will show that under these conditions the inequality in (10) is strict: some finite with makes Ambient SFT strictly better than maximum likelihood, than the frozen teacher and than every knowledge-distillation run. We do not claim that the infimum is attained, and Remark E.8 shows that it need not be: the reachable penalty shapes form a curve that is open at its hot end.
Throughout, stacks the token embeddings , so that with , and , where is the softmax and . We identify with , so that for a linear map the chain rule gives and .
Proposition E.3 (Structure of the objective).
For every and :
(i) is convex in , and strictly convex along every direction that changes some logit difference on some observed context, i.e., for some and . Hence its minimizer is unique up to directions that leave every conditional unchanged. (ii) The temperature matching term is a Bregman divergence centered at the pre-trained model: , where with equality iff . Thus is a penalized maximum likelihood with a data-dependent penalty that vanishes exactly at . (iii) (Moment matching.) Its gradient is so at a minimizer the model’s mean embedding matches the data on average, corrected by times the gap between the student’s and teacher’s tempered mean embeddings. (iv) (Curvature.) Its Hessian, as an operator on , is and as , for every . The teacher therefore contributes curvature with : a ridge penalty toward whose strength is set by and whose geometry is fixed by the embeddings and the context covariance.
Proof of Proposition E.3.
(i) is convex, and and are linear in , so every summand of (8) is convex in ; the linear terms do not affect convexity. For strictness, and , which is positive unless is constant on . Along a direction , the second directional derivative of the -th clean summand is , positive iff is non-constant; the matching summand contributes the same quantity at temperature times . Summing over gives strict convexity along every that changes a logit difference on some observed context, and flatness along the others; the latter are exactly the directions that leave every conditional unchanged, since a conditional depends on only through its logit differences.
(ii) Expanding and comparing with the -th matching summand, , and the last two terms do not depend on . is the Bregman divergence of the convex function between and , hence nonnegative, and zero iff is affine on the segment joining them, i.e., iff is constant on by the variance computation in (i), i.e., iff the two tempered conditionals coincide. Equivalently , the standard identity between Bregman divergences of the log-partition and KL divergences in an exponential family.
(iii) and (iv) follow from the chain rule stated above applied to , , and ; the factor from differentiating appears once in the gradient and twice in the Hessian. Finally as for every fixed , so , uniformly on bounded sets of . ∎
Setting for Theorem 3.2. Let denote the -th summand of (8) (clean plus times matching), so and , the expectation over and . We consider the local regime with fixed, so ; all constants below are uniform. Write for the curvature of the penalty at its center; by smoothness of . and are positive definite by the non-degeneracy conditions above.
Lemma E.4 (Consistency, asymptotic normality, second moments).
For fixed , and : almost surely and , with and . Moreover , , and .
Proof.
Each is convex and in with bounded derivatives on bounded sets (the logits are bounded by ), and is strictly convex with positive definite Hessian , so it has a unique minimizer . Pointwise convergence (strong law) together with convexity gives uniform convergence on compacts and hence almost surely. Asymptotic normality is the classical result for smooth M-estimators: expanding the first-order condition around , , where the first term is a sum of i.i.d. mean-zero (by optimality of ) bounded vectors and converges to with , and the bracket converges to . Slutsky gives . Writing split it at into the clean part and the teacher part , which is a deterministic function of . Conditionally on the only randomness is , with covariance , so has conditional mean zero and the law of total covariance gives , the second term being because uniformly. Moving the evaluation point from to , and since by Lemma E.5 and is smooth, and .
For the second moments, one cannot simply condition on the prefixes: a finite sample may miss feature directions, and then is not strongly convex for that realization. Work instead on the event , where . The summands are i.i.d. and positive semidefinite with and mean , so the matrix Chernoff bound gives with . On the empirical objective is strongly convex on : the set is compact and on it by the two non-degeneracy conditions, so there and, for every , , the first inequality discarding the matching term of the Hessian, which is positive semidefinite. With that modulus , the two-point inequality at the interior minimizer of gives on , and is an average of i.i.d. bounded terms with mean , so and . On we use only that both iterates lie in , an operator-norm ball, so and that part contributes at most , which is for every ; hence for every . The same event carries the refinement that follows: all derivatives of are bounded on , so the one-step expansion of the first-order condition can be carried one order further on : with and the complement again exponentially negligible. That bound is where the fourth moments enter: writing for the empirical score and for the Hessian fluctuation, both are averages of bounded i.i.d. mean-zero terms, so and ; on the curvature bound gives , and the second-order Taylor remainder of the first-order condition is bounded by plus a third-derivative term of order , so by Cauchy–Schwarz. Hence by Cauchy–Schwarz on the cross term, and . ∎
Lemma E.5 (Population bias).
as , and .
Proof.
Let and , so . Since , , which vanishes at with ; likewise vanishes at with . The minimizer solves . Taylor-expanding around and around , with and , . For the unique solution is (then minimizes both terms). For small , the implicit function theorem applied to the smooth map , whose -derivative is invertible, gives . ∎
Proof of Theorem 3.2.
The expansion. Write for the risk. Decompose , so . By Lemma E.4 and , the first term is . By Lemma E.5 with and , the second is . The cross term is . Since , this is exactly (9); uniformity in on compacts holds because every constant above is continuous in . For the rest of the proof denotes the leading term of (9) itself, and its rescaling, in which the maximum-likelihood value is and the teacher gap enters as . The strictness argument below is stated for , the window calculation and the aligned Example for .
Endpoints. In the rescaled units, is immediate; unscaled this reads . As , because , so the bias term tends to , i.e. , and the variance is at most .
Derivative at zero (Remark E.6). The bias term is and contributes nothing. With we have , so , which is negative because and ; equivalently and .
Strictness. In two steps: the slice already beats the other two extremes, and moving off beats the slice for generic .
(i) The slice. Setting in the definition of gives . Hence , the shrinkage operator is with , and (9) becomes, for every and ,
a scalar bias–variance tradeoff. It is strictly convex in and minimized at , i.e. at the interior point , where . Its value there is the harmonic-type mean , which is strictly smaller than both and whenever , that is, whenever . Since is the maximum-likelihood risk and is the frozen-teacher risk, the best run already beats those two strictly. No further assumption is needed for this step.
(ii) Off . Regard as a function of the penalty alone. For a symmetric direction , differentiating and at , where , gives
Taking returns , which vanishes exactly at , as it must. Take instead . Since and , and since , we get with . Writing , and , so that , equation (17) collects into a quadratic form in :
using . The matrix depends on and only, and if and only if is a multiple of : in an eigenbasis of with eigenvalues one has , so forces for and , i.e. ; conversely gives and , hence . Thus (A2) says precisely , and then is the zero set of a nonzero quadratic form: closed, of Lebesgue measure zero, and a cone, so membership of is unaffected by the scaling of . For we have , so moving off in the descent direction strictly decreases below , and by step (i) below all three extremes. The descent direction is when and when ; the theorem claims improvement, not that it is always on the hot side. Note that this argument needs no commutativity between , and , and no analyticity: is a polynomial.
The weak statement (10). It is pure continuity, and needs neither nor (A2). is continuous on and has a finite limit at , so , both extremes being limits of interior values; the same argument in gives and . Taking the smallest of the three right-hand sides gives (10); the assumptions are what turn it into a strict inequality.
The window (Remark E.6). Write with and eigenpairs . Then , so the variance equals . Since , we have for , whence the variance is at most . The bias term is at most . Hence , which is negative for . Finally, for fixed , once is large enough. ∎
Remark E.6 (How much teacher, explicitly).
The improvement over maximum likelihood comes from , the bias entering only at second order in ; at the other end, as , pure bias. Carrying both terms explicitly, every below
improves on maximum likelihood; this window is of order when the teacher gap dominates.
Remark E.7 ( can be optimal).
The exceptional set is not empty. Take with scalar embeddings , , two equally likely context features , and target logits and , so and every are diagonal, with and . Choose the teacher gap with , which is of the order the theorem assumes. Each coordinate then contributes to , minimized at ; since , the single choice attains that in both coordinates at once, so minimizes over all diagonal penalties, and in particular over the family , whose every member is diagonal here. Moreover is strictly decreasing in , so has the unique solution : knowledge distillation is not merely tied here but is the unique optimizer. (A2) holds, the diagonal ratios of to being and ; what fails is . Indeed is constant across directions, which makes and, by (18), , so and is stationary. Note that is weaker than , which fails here: by (17) the gradient has the off-diagonal entries of , which are nonzero, so is optimal within the reachable family but not among all positive-definite penalties. The coincidence has measure zero in , which is what the genericity caveat excludes.
Remark E.8 (The infimum need not be attained).
Theorem 3.2 asserts a strict inequality, not the existence of a best , and the distinction is real. The risk depends on the pair only through , so sets the scale of the penalty and its shape, and the reachable shapes trace the curve , which starts at at and tends to as . Convergence by itself decides nothing about attainment: if the target conditionals are uniform then at every temperature and the curve is a single point. But the limiting shape need not be reachable at any finite , and then the joint infimum can fail to be attained even under the non-degeneracy condition. The following example does that, on an open set of teacher gaps. Keep the model of Remark E.7 but take and . By the Example below the best penalty eigenvalues are , that is , whereas the reachable ratio is , which exceeds at every finite and tends to only as . With free to set the scale, the reachable set is therefore exactly the open cone , and the unconstrained optimum lies outside it. The optimum over the closure is a different point: each coordinate contributes , strictly decreasing then strictly increasing with minimum at , so from any feasible one can move to the diagonal without increasing either contribution, and the constrained minimum sits on the face . That face is disjoint from the reachable set, so the infimum over finite is approached only as with and is never attained. Note that this is a different limit from the maximum-likelihood one in (10), which sends at fixed and does kill the penalty. Read positively, a missing minimizer says the model would like the hottest teacher available, with raised to compensate for the flattening.
Example (aligned case). Suppose and share eigenvectors, with eigenvalues and , and let be the coordinates of in that basis. Then
Diagonalizing both terms of in the common eigenbasis, direction contributes , using . Comparing with the maximum-likelihood value : the shrunk direction is better iff , i.e. iff . Minimizing over with gives . In the original units ( with the coordinates of ) these read and : the amount of teacher to trust in a direction is set by the ratio of the teacher’s squared error to the sampling variance there. Differentiating at recovers . Finally, since the shrinkage in direction depends on only through the eigenvalue of , through , the optimal corresponds to : the penalty should be strongest in the directions where the teacher’s error is smallest, a shape that depends on the teacher and not on the data, and one that (i.e. ) cannot produce unless is constant across directions (Theorem 3.2).
Lemma E.9 (Curvature of a softmax is at least its smallest probability).
For every , , where and .
Proof.
Let and . Then , where is the -weighted mean, the unweighted mean, and the last inequality holds because the unweighted mean minimizes . Hence , and with . ∎
Dependence within documents. Theorem 3.2 is stated for independent prefixes for clarity, but nothing is lost when the tokens come from independent documents of fixed length , which is the situation of (4). Group the score by document, . The are i.i.d. across , so Lemma E.4 applies with at fixed , its empirical-curvature concentration now run on the document-level averages, and with constants that may depend on . What has to be rechecked is the covariance. Per document it carries an extra factor of , so define the token-normalized quantity ; the claim is , which is what the sandwich needs because . Split the per-token score at into a clean part and a teacher part . Only the clean part is a martingale difference for the prefix filtration: conditionally on the token has mean embedding , so clean parts at different positions of the same document are uncorrelated and their covariances add, contributing to , hence to , with now read as an average over positions. The teacher part is not a martingale difference: it is a deterministic function of whose conditional mean is generally nonzero, and its within-document correlations do not cancel. They are harmless only because the whole term is , so it adds to , and the cross term with the clean part adds there, only pairs surviving since for is measurable with respect to the prefix at . In these become and , both absorbed into at fixed . We do not claim a version with growing with : there the within-document correlations of the teacher term enter a long-run variance, and a martingale central limit theorem would in any case not supply by itself the second-moment remainder that (9) uses. No repetition of contexts is assumed anywhere.