TL;DR
The Error-Compensating Optimizer (ECO) eliminates the need for high-precision "master weights" during LLM training, a major memory bottleneck. By injecting quantization errors directly into the optimizer's momentum buffer, ECO achieves near-lossless accuracy while reducing static memory usage by up to 25%—all with zero additional memory overhead.
What Problem Does This Paper Address?
Training Large Language Models (LLMs) is incredibly memory-intensive. While researchers use "quantization" (representing numbers with fewer bits, like FP8 or INT4) to save space, they almost always keep a high-precision copy of the model's weights in the background, known as master weights (usually in FP32).
Why? Because individual gradient updates are often tiny—smaller than the "discretization gap" of low-precision formats. Without a high-precision buffer to accumulate these small changes, the updates simply vanish or turn into noise, causing the training to fail or diverge. However, these master weights are a massive "hidden" memory cost, especially for Sparse Mixture of Experts (SMoE) models where weights dominate the memory footprint.
Methods
The authors introduce ECO (Error-Compensating Optimizer), a method that removes master weights entirely by applying updates directly to quantized parameters.
- Error-Feedback Loop: After each training step, ECO quantizes the updated weights. It then calculates the "quantization error" (the difference between the intended update and the quantized result).
- Momentum Injection: Instead of storing this error in a new buffer (which would defeat the purpose of saving memory), ECO injects it into the optimizer’s existing momentum buffer.
- Heuristic Optimization: The authors use a clever heuristic—noting that consecutive quantization errors are highly similar—to create a "memory-free" injection rule. This allows the "lost" parts of an update to be carried forward and recovered in subsequent steps.
- Theoretical Grounding: The paper provides a convergence proof showing that while naive master-weight removal causes errors to explode as the learning rate decays, ECO stays stable and converges to a neighborhood of the true optimum.
Datasets
The researchers evaluated ECO across several scales and tasks:
- C4 Dataset: Used for pre-training scaling law studies on small Transformers (30M–800M parameters) and a Gemma-3 1B model.
- LM1B (One Billion Word Benchmark): Used for pre-training a 2.1B parameter Sparse Mixture of Experts (SMoE) model.
- OpenAssistant-Guanaco: Used for fine-tuning the DeepSeek-MoE-16B model.
Key Insights and Ideas
- The "Aha" Moment: You don't need a separate high-precision buffer if you can "hide" the rounding errors inside the momentum state that the optimizer is already maintaining.
- Stability via Feedback: Without error compensation, training is fundamentally unstable at low precision. ECO prevents the "1/η blow-up" (where error increases as the learning rate η decreases) that plagues naive master-weight-free methods.
- Stochastic Rounding (SR) is Essential: ECO performs best when using Stochastic Rounding because it is unbiased. While it still works with standard Round-to-Nearest (RTN), the "noise floor" (the minimum achievable error) is higher.
- Stackable Savings: ECO is compatible with other techniques like 8-bit optimizer state compression. Combining ECO with 8-bit Adam can reduce the memory footprint of weights and optimizer states by 50% or more.
Key Results
- Near-Lossless Accuracy: In FP8 pre-training (Gemma-3 1B and SMoE 2.1B), ECO nearly matched the validation loss of baselines that used full FP32 master weights.
- Memory Efficiency: ECO reduced static memory usage by approximately 25% (e.g., from 12 bytes per parameter down to 9).
- SMoE Success: For the DeepSeek-MoE-16B model, ECO enabled stable INT4 fine-tuning, whereas naive methods without master weights diverged immediately.
- Pareto Frontier Shift: The method significantly improves the trade-off between validation loss and memory consumption, allowing for larger or better-performing models on the same hardware.
Limitations and Future Work
- Hardware Support: ECO relies heavily on Stochastic Rounding for its strongest guarantees. While SR is becoming more common in modern AI hardware, it is not yet universal.
- Accuracy Ceiling: In some specific settings, there remains a very slight accuracy gap compared to the absolute best master-weight baselines using Round-to-Nearest.
- Second Moment Compression: The current work focuses on the first moment (momentum). The authors suggest that future work could explore similar error-injection strategies for the second moment (variance) in optimizers like Adam to push memory savings even further (potentially up to 75%).
Summary updated