Training Large Language Models (LLMs) with low-rank optimizers saves memory but typically relies on slow, computationally heavy matrix factorizations like SVD or QR decomposition. This paper introduces a faster, memory-efficient alternative that dynamically selects columns from a fixed Discrete Cosine Transform (DCT) matrix to approximate these projections. The resulting optimizers—Trion and DCT-AdamW—match or exceed the performance of existing methods while cutting memory usage by up to 25% and significantly speeding up training.
The Memory Bottleneck in LLM Training
Training modern LLMs requires massive amounts of memory, largely due to the internal states maintained by adaptive optimizers like AdamW. To solve this, researchers have developed "low-rank optimizers" (like GaLore, Muon, and Dion) that compress gradients into a lower-dimensional space, drastically reducing the memory footprint.
However, finding the optimal low-dimensional subspace for each layer usually requires Singular Value Decomposition (SVD) or QR decomposition. These operations are computationally expensive ($O(n^3)$ time complexity), scale poorly as the rank increases, and require storing unique projection matrices for every single layer. This creates a bottleneck: the memory and compute overhead of managing these projections eats into the very savings the low-rank methods were designed to provide.
Dynamic Subspace Selection via DCT
The authors propose replacing expensive, per-layer SVD/QR decompositions with a Dynamic Column Selection approach using a predefined orthogonal matrix: the Discrete Cosine Transform (DCT).
Instead of calculating a new basis from scratch, the method works in two steps:
- Alignment: It computes the similarity between a layer's gradient (or momentum) and the columns of the fixed DCT matrix. For large layers, this can be done in $O(n^2 \log n)$ time using Makhoul’s FFT-based algorithm, bypassing standard matrix multiplication.
- Selection: It ranks the DCT columns based on their $\ell_1$ or $\ell_2$ norm and selects the top-$r$ (where $r$ is the target rank) to form the projection matrix.
The authors integrate this technique into two new optimizers:
- Trion: An upgrade to the recent Dion optimizer. It replaces Dion's slow Power-Iteration and QR decomposition with DCT-based selection, followed by a low-rank Newton-Schulz orthogonalization.
- DCT-AdamW: A standalone low-rank AdamW variant that replaces SVD with DCT and uses 8-bit quantized error feedback to maintain accuracy without bloating memory.
Core Innovations
- DCT is a Natural Eigenbasis: The use of DCT isn't just a random choice of an orthogonal matrix. The authors provide theoretical justification showing that, due to the properties of circulant matrix decomposition, the DCT naturally serves as a linear approximation of the gradient matrices' true eigenbases.
- Storing Indices Instead of Matrices: Because the DCT matrix is fixed and predefined, the system only needs to store one DCT matrix per GPU for the entire model. For individual layers, it only stores $r$ integer indices (pointing to the selected columns) rather than full $n \times r$ projection matrices. This is a massive memory win.
- Rank-Independent Runtime: In QR-based methods, the time it takes to compute the projection increases as the target rank $r$ increases. Because this new method relies on a fixed matrix and a simple top-$r$ sorting step, its runtime is virtually independent of the rank.
Experimental Results
Models were evaluated primarily on pretraining tasks using the C4 (Colossal Clean Crawled Corpus) dataset, training Llama-architecture models from scratch with Chinchilla-optimal token counts.
- Trion vs. Dion: Across Llama models (350M, 800M, 1.3B), Trion consistently achieved lower training and validation perplexity than Dion. Furthermore, Trion was 8–18% faster at higher ranks ($r=512$) and used ~10% less memory.
- DCT-AdamW vs. LDAdamW: When pretraining an 800M Llama model, DCT-AdamW achieved better validation perplexity (13.69 vs 13.91) while reducing memory usage by ~20% (57.82 GiB vs 72.10 GiB). It also cut runtime by over 25%, saving roughly 10 hours of compute time compared to LDAdamW.
- Lower Projection Error: Empirical tests showed that Trion's DCT-based projection yielded strictly lower reconstruction errors compared to the Power-Iteration method used by Dion.
Limitations and Future Directions
- Scale of Experiments: The models tested max out at 1.3B parameters trained on Chinchilla-optimal token counts. The authors acknowledge that additional work is needed to validate the technique on much larger models (e.g., 7B+ parameters) and longer training runs.
- Hardware Thresholds for FFT: The embedding sizes ($d \le 2048$) of the tested models were actually too small to observe the full theoretical speedup of the $O(n^2 \log n)$ Makhoul's FFT algorithm over highly optimized GPU matrix multiplication. Testing on larger models with wider hidden dimensions is required to see the FFT advantage materialize in wall-clock time.
Summary updated