TL;DR
Hugging Face researchers have presented two changes designed to lower the cost of distilling large language models: reusable top-K teacher outputs and a fused, chunked loss. Their paper reports peak memory of about 128GB for one test that reached roughly 250GB with dense KL, but independent validation and broader quality results were not supplied.
Hugging Face researchers have presented a method intended to make large-language-model knowledge distillation less costly by caching a teacher model’s most likely outputs and processing the training loss in chunks. The accompanying paper reports that its fused approach reduced peak memory in one long-context test from roughly 250GB to about 128GB, bringing the workload below the stated 141GB capacity of a single Nvidia H200.
The paper, titled Efficient Knowledge Distillation for LLMs: Offline Top-K Logits and a Fused Chunked KL Loss, combines offline teacher inference with a memory-efficient KL-divergence loss. The system runs the teacher once, saves its top 100 predicted tokens at every position and then trains the smaller student from that cache. This removes the need to keep both models loaded or repeat an unchanged teacher calculation at every training step.
The second change targets a large intermediate tensor created during conventional distillation. For a model such as gpt-oss-120b, with a reported vocabulary of 201,088 tokens, the teacher-probability tensor at a 32,768-token sequence length and batch size four would occupy about 50GB in bfloat16 before model weights, activations, gradients and optimizer states are counted. Hugging Face says a dense training step can peak near 250GB of GPU memory.
The proposed fused chunked KL loss joins the student model’s output projection to the loss calculation. It processes and discards one sequence chunk at a time instead of retaining the full student-logit matrix. During backpropagation, each chunk is recalculated. That adds projection work but, according to the paper, keeps peak memory growth tied more closely to sequence length and avoids the large dense allocation.
Making Knowledge Distillation Cheap Enough to Run at Scale
Hugging Face researchers propose two linked changes: cache a teacher’s top-K outputs once, then calculate the student’s KL loss in fused chunks. The reported result is a dramatic reduction in peak GPU memory—but quality, runtime and independent replication remain open questions.
Author-reported memory use in one long-context test.
Reported to fit below a single H200’s stated 141GB capacity.
Highest-probability token predictions retained at every position.
Two bottlenecks, two changes
The approach separates teacher inference from student training and prevents the full token-by-vocabulary student-logit matrix from remaining in GPU memory.
Infer once
Run the large teacher ahead of training instead of keeping it loaded for every student step.
Cache top-K logits
Save the teacher’s top 100 token predictions at each position and reuse them across students, ablations and hyperparameter runs.
Fuse and chunk
Join output projection with KL-loss calculation, process one sequence chunk at a time and discard it before moving on.
From online teacher to reusable supervision
The teacher still has to run. The saving comes from running it once, storing a sparse version of its predictions and removing it from subsequent student-training loops.
Teacher inference
Process the training corpus with the large model.
Select top 100
Retain the most likely tokens and their scores per position.
Write cache
Store sparse teacher outputs outside the training loop.
Train in chunks
Project, compare and discard small student-logit segments.
Recompute backward
Repeat projection work during backpropagation to save memory.
The teacher never has to sit in memory during training.
Hugging Face article describing the paperMemory is exchanged for recomputation
Forward chunking can be fast, but it still retains full student logits for backpropagation. The fused method avoids that allocation by recalculating each projection chunk later.
| Method | Teacher in loop | Full student grid | Memory profile | Compute trade-off |
|---|---|---|---|---|
| Dense online KL | ✗ Required | ✗ Retained | Highest reported peak | Direct backward pass |
| Forward-chunked KL | ~ Optional cache | ✗ Retained | Lower forward pressure | Reported fastest benchmark |
| Fused chunked KL | ✓ Offline | ✓ Avoided | Lowest reported peak | Projection recomputed backward |
Reported peak GPU memory
Why dense KL spikes
Every token receives a score for every vocabulary entry.
Long context multiplies the token dimension dramatically.
Training state adds weights, activations, gradients and optimizer memory.
Chunking caps the live logit allocation instead of holding the entire grid.
Promising economics, incomplete validation
The headline memory result is author-reported. The supplied material does not establish peer-review status, independent reproduction or broad student-quality equivalence.
Peak memory fell in one test
The paper reports a reduction from roughly 250GB with dense KL to about 128GB with fused chunking.
Quality after top-K truncation
Keeping only 100 predictions discards most of the teacher distribution; cross-task and cross-language effects were not shown.
End-to-end economics
Cache storage, teacher preprocessing cost and the wall-clock penalty from backward recomputation remain unspecified.
Independent replication
Comparisons are needed across teacher-student pairs, sequence lengths, accelerators, datasets and software configurations.
What the result does—and does not—mean
Lower memory can make long-context recovery and repeated experiments more accessible. It does not automatically prove equal student capability or lower total compute cost.
What changed?
Teacher inference moved outside the student loop, the top 100 predictions were cached, and the student loss was fused with a chunked output projection.
Is the teacher unnecessary?
No. It must still run once to create the cached predictions, but it need not remain loaded during later student runs.
Can the workload fit on one GPU?
The reported 128GB peak sits below the stated 141GB capacity of one Nvidia H200. The exact hardware and benchmark setup still require verification.
Does lower memory guarantee equal quality?
No. Accuracy, reasoning, language coverage and long-context behavior must be evaluated separately from memory efficiency.
Single-GPU Distillation Becomes Plausible
Lower memory requirements could widen access to long-context model recovery, a stage used after pruning or compressing a large model. Hugging Face says the combined changes make some such work possible on one GPU and make repeated experiments cheaper because researchers can reuse the same teacher cache across student models, hyperparameter tests and ablations.
The method may also reduce dependence on hundreds of coordinated GPUs and elaborate tensor-parallel configurations. That matters as open models grow: the source cites Kimi-K3 at 2.8 trillion parameters and roughly 3TB of memory merely to load. Smaller recovered models can be less expensive to serve, though the supplied results do not establish how much deployment cost or model quality changes across different architectures.
GPU memory optimizer for AI training
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Dense KL Creates the Bottleneck
Knowledge distillation trains a smaller student to reproduce a larger teacher’s predictions. In conventional online distillation, both models remain resident during training, and the teacher performs a new forward pass for every step. The method preserves the teacher’s full output distribution but creates full-vocabulary tensors for every token position.
Hugging Face compared three implementations: dense KL, a forward-chunked version and the fused chunked loss. It reports that forward chunking was fastest in its benchmarks but still retained the student’s full logits for backpropagation. The fused version used less memory by never creating that full matrix, while accepting the compute cost of repeating the output projection during the backward pass.
“The teacher never has to sit in memory during training.”
— Hugging Face article describing the paper

LLM Systems Engineering: Training and Building Large Language Models – Engineering AI Models Through Fine-Tuning, Continued Pretraining, and From-Scratch Development
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Quality and Generality Need Testing
The supplied material does not state whether the paper has undergone peer review, nor does it provide enough information for an independent check of the reported benchmarks. It is also unclear which GPU, model, dataset and software settings support the claim that long-context healing can run on one device.
Caching only the top 100 teacher logits discards most of the full probability distribution. The source describes the three loss implementations as mathematically equivalent for its setup, but the material does not show whether truncation changes student quality across tasks, languages, architectures or vocabulary sizes. Storage requirements for large caches and the wall-clock tradeoff from backward-pass recomputation also remain unspecified.

AI Value Creators: Beyond the Generative AI User Mindset
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Replication Will Test the Savings
The next step is independent reproduction across different teacher-student pairs, sequence lengths and accelerator classes. Researchers will also need direct comparisons of training cost, runtime and final student accuracy, including tests against online distillation and other sparse-teacher methods. Release details for code, cached logits or benchmark configurations were not included in the supplied source.

Parallel Computing for AI and ML Engineers: Build Scalable Deep Learning Systems with GPU Programming, Multi-GPU Training, and Production Workloads
As an affiliate, we earn on qualifying purchases.
As an affiliate, we earn on qualifying purchases.
Key Questions
What did Hugging Face change?
The researchers moved teacher inference outside the student-training loop, cached each position’s top 100 predictions and created a fused loss that processes student outputs in smaller chunks.
How much GPU memory did the method save?
In the example reported by the paper, peak use fell from roughly 250GB with dense KL to about 128GB with fused chunking. Those figures are author-reported and were not independently verified in the supplied material.
Does the method make the teacher model unnecessary?
No. The teacher must still run once to create the cached predictions. It does not need to remain loaded or repeat inference during subsequent student-training runs that use the same data.
Does lower memory guarantee an equally capable student?
No. Memory efficiency and model quality are separate questions. The source reports lower peak memory, but broader evidence is still needed on accuracy, reasoning, language coverage and long-context behavior.
Source: Hugging Face