atlas

Research map / Architectures and efficiency / RNNs and normalization

Cut Your Losses in Large-Vocabulary Language Models

ICLR 2025 · Architectures and efficiency › RNNs and normalization · approach: Neural scaling laws · 2 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes Cut Cross-Entropy (CCE), a fused Triton kernel that computes LLM cross-entropy loss and its gradient without materializing the full logit matrix, plus gradient filtering that skips negligible softmax blocks.

Problem

The cross-entropy loss layer, whose memory scales with batch tokens times vocabulary size, dominates LLM training memory for models with large vocabularies.

Approach

Compute the correct-token logit directly and the log-sum-exp over the vocabulary on the fly in on-chip SRAM via a fused matmul-plus-reduction kernel, so logits are never written to global memory; the backward pass recomputes logits blockwise and skips blocks whose softmax entries fall below bfloat16 precision, with vocabulary sorting to increase block sparsity.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Replace the PyTorch cross-entropy baseline with CCEGemma 2 (2B) classifier head · Alpaca, 8192 tokensLoss+Gradient memory: 28000 MB -> 1164 MBHelped
Replace the PyTorch cross-entropy baseline with CCEGemma 2 (2B) classifier head · Alpaca, 8192 tokensLoss+Gradient time: 208 ms -> 145 msHelped
Replace torch.compile with CCEGemma 2 (2B) classifier head · Alpaca, 8192 tokensLoss+Gradient time: 143 ms -> 145 msHurt
Add vocabulary sorting (ablation)CCE · Gemma 2 (2B), Alpaca, 8192 tokensLoss+Gradient time: 159 ms -> 145 msHelped
Add gradient filtering (ablation)CCE · Gemma 2 (2B), Alpaca, 8192 tokensLoss+Gradient time: 357 ms -> 145 msHelped
Use Kahan summation (ablation)CCE · Gemma 2 (2B), Alpaca, 8192 tokensLoss+Gradient time: 145 ms -> 160 msHurt
Use Kahan summation and disable gradient filtering for classifier gradient (ablation)CCE · Gemma 2 (2B), Alpaca, 8192 tokensLoss+Gradient time: 160 ms -> 313 msHurt
Use Kahan summation and disable gradient filtering for embedding gradient (ablation)CCE · Gemma 2 (2B), Alpaca, 8192 tokensLoss+Gradient time: 160 ms -> 292 msHurt
Use CCE instead of torch.compileQwen 2.5 7B Instruct fine-tuning · Alpacatraining lossNo clear effect
Use CCE-Kahan-FullC instead of torch.compileQwen 2.5 7B Instruct pretraining · Open WebText validation (held-out 0.25%)perplexityNo clear effect
Use CCE-Kahan-FullC instead of torch.compileMistral NeMo pretraining · Open WebText validation (held-out 0.25%)training time: 2 hours (16%)Helped

Surprising findings

Limitations

Experimental setup

Datasets: Alpaca OpenWebText

Metrics: peak memory (MB) wall-clock time (ms) training loss curves validation perplexity maximum batch size

Baselines: Baseline PyTorch cross-entropy torch.compile Liger Kernels Torch Tune chunked cross-entropy

Builds on: FlashAttention Liger Kernels torch.compile Kahan summation

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy