Training in a Tiny Subspace
Intrinsic dimension, low-rank gradients and the contested claim that training lives in a tiny subspace.
A network with hundreds of thousands of parameters can be trained while moving only inside a random subspace of a few hundred dimensions, and fine-tuning a pretrained language model can need even fewer. Meanwhile the gradient seems to concentrate in the handful of top Hessian directions, suggesting that training itself happens in a tiny subspace. This lesson measures how small the subspaces can be, explains why random ones work, examines the tiny-subspace claim and the experiment that undercut it, and shows how low-rank gradients save memory.
What you’ll learn
- Define the intrinsic dimension of a training problem through random-subspace training, and interpret its measured values for standard tasks, fine-tuning and random labels.
- Explain the threshold training dimension with Gordon's escape theorem and the Gaussian width of sublevel sets, and why subspaces taken from the training trajectory do better.
- State the observation that gradients align with the top Hessian eigenspace and the projection experiments showing that this alignment is spurious, with a quadratic model of why.
- Derive GaLore's update and memory cost, contrast it with LoRA, and relate low-dimensional training to redundancy.
Intrinsic dimension
How many of a network's parameters does training really need? Li, Farkhoor, Liu & Yosinski (2018) answered by training in a random subspace. Fix the initialization and a random matrix with unit-length columns, and train only , started at zero:
| Task | Network | Parameters | |
|---|---|---|---|
| MNIST | fully connected 784–200–200–10 | 199,210 | 750 |
| MNIST | LeNet | 44,426 | 290 |
| MNIST, pixels shuffled | LeNet | 44,426 | 1,400 |
| MNIST, labels shuffled (train accuracy) | fully connected | 959,610 | 190,000 |
| CIFAR-10 | fully connected | 656,810 | 9,000 |
| CIFAR-10 | LeNet | 62,006 | 2,900 |
| ImageNet | SqueezeNet | 1,248,424 | more than 500,000 |
| Inverted pendulum (RL) | fully connected | 562 | 4 |
Four findings stand out.
- Size does not matter much. Across 20 fully connected networks for MNIST, with 1 to 5 hidden layers of 50 to 400 units and sizes that varied by a factor of 24, varied by a factor of only 1.33. Once a network is big enough, extra parameters enlarge the set of solutions rather than the difficulty of reaching one: the -dimensional manifolds of minima of Loss Landscapes (which writes for the parameter count), seen from another angle.
- Architecture is a prior. LeNet needs fewer dimensions than the fully connected network on MNIST (290 against 750), but on pixel-shuffled images its intrinsic dimension rises to 1,400, while the fully connected network, indifferent to pixel order, stays at 750.
- Memorization is expensive. Fitting 50,000 random labels needed 190,000 dimensions, about 3.8 per label.
- A compression bound. A solution can be stored as the random seed plus the numbers in , an upper bound on its description length, which connects intrinsic dimension to compression-based generalization bounds (Generalization Bounds for Deep Networks).
The fully connected MNIST network has parameters and . By what factor does storing the subspace coordinates (plus a random seed) instead of all the weights compress the solution?
Show the answer
266
: the trained network uses about 0.4% of its degrees of freedom. For LeNet the factor is . The price is accuracy, since the subspace solution reaches only 90% of the full model's performance by construction.
Fine-tuning needs even less. Aghajanyan, Zettlemoyer & Gupta (2021) applied the same measurement to fine-tuning pretrained language models: optimizing only 200 parameters, randomly projected into the full space, brought RoBERTa to 90% of full fine-tuning performance on the MRPC paraphrase task. Pretraining lowered the intrinsic dimension of downstream tasks, and larger models had lower intrinsic dimensions after a fixed amount of pretraining. This is the empirical motivation for low-rank fine-tuning (Low-Rank Adaptation in Depth).
import torch
from torch.func import functional_call
def train_in_subspace(model, loss_fn, X, y, d, steps=2000, lr=1e-2):
"""Train only z in θ = θ₀ + P z, with P a fixed random D × d matrix."""
names, shapes = zip(*[(n, p.shape) for n, p in model.named_parameters()])
theta0 = torch.cat([p.detach().reshape(-1) for p in model.parameters()])
D = theta0.numel()
P = torch.randn(D, d) / D ** 0.5 # columns of length ≈ 1, nearly orthogonal
z = torch.zeros(d, requires_grad=True) # start exactly at θ₀
opt = torch.optim.Adam([z], lr=lr)
for _ in range(steps):
chunks = torch.split(theta0 + P @ z, [s.numel() for s in shapes])
params = {n: c.view(s) for n, c, s in zip(names, chunks, shapes)}
loss = loss_fn(functional_call(model, params, (X,)), y)
opt.zero_grad(); loss.backward(); opt.step()
return loss.item()Subspace training with a dense projection, fine for small networks. Sweep upward and the final loss falls; the smallest that reaches 90% of the full model's accuracy is the intrinsic dimension.
Why random subspaces work
Larsen, Fort, Becker & Ganguli (2022) measured the probability that training in a random -dimensional subspace reaches a target loss, and found a sharp transition from 0 to 1 at a threshold training dimension. The threshold rises as the target loss is lowered and falls as the starting loss is lowered. Both dependences follow from the geometry of high-dimensional sets.
Low intrinsic dimension therefore means that the low-loss sublevel sets, seen from the initialization, are wide: they extend in almost all directions, their squared Gaussian width falling short of by only a few hundred or thousand. That is what flat valleys and huge manifolds of minima look like from afar. A lower target loss shrinks the sublevel set and raises the threshold; a starting point closer to it makes the set subtend a larger angle and lowers the threshold. For a quadratic well, Larsen et al. bound the threshold through the Hessian spectrum and the distance to the minimum.
Better than random. A short phase of full training before switching to a random subspace (a burn-in subspace) lowers the threshold, and lottery subspaces, spanned by the top principal directions of a full training trajectory, reach much higher accuracy for a given dimension than random ones. Li, Tan, Tao, Liu & Huang (2021) built subspaces from principal components of snapshots along the training trajectory and found that optimizing in about 40 such dimensions could match regular training. Random subspaces are not special, then; they are simply generic, and by the Johnson–Lindenstrauss lemma a random projection to dimensions preserves all distances among points within a factor .
You measure the threshold training dimension twice: once from the random initialization, and once after a short burn-in of full training that has already halved the loss. What do you expect, and why?
- The same threshold, since the subspace is random in both cases
- A higher threshold after burn-in, because the network is now in a sharper region
- A threshold equal to the number of classes in both cases
- A lower threshold after burn-in, because from a point closer to the low-loss set that set subtends a larger angle and so has a larger projected Gaussian width
Show the answer
D. A lower threshold after burn-in, because from a point closer to the low-loss set that set subtends a larger angle and so has a larger projected Gaussian width
The threshold is about for the sublevel set projected onto a sphere around the starting point. Moving closer to the set makes its projection cover more of the sphere, raising and lowering the threshold, as Larsen et al. measured.
Does gradient descent happen in a tiny subspace?
A different, much smaller subspace appeared in The Hessian of a Deep Network: the span of the top eigenvectors of the Hessian, about one per class. Gur-Ari, Roberts & Dyer (2018) measured how much of the gradient lies in it,
and found that, across fully connected networks, convolutional networks and ResNet-18, rises close to 1 after a short period of training, while the top subspace itself changes only slowly. Since a small step lowers the loss by about , they argued that descending along alone should do nearly as well, so that training might happen in a tiny, slowly moving subspace.
Song, Ahn & Yun (2025) tested this directly. Dom-SGD projects every SGD update onto the top subspace (recomputed at each step), and Bulk-SGD projects it onto the orthogonal complement. Switched on once the alignment had formed, Dom-SGD stopped reducing the training loss, and over long runs even increased it slowly, while Bulk-SGD trained as well as SGD although it discards most of each update. The same held for gradient descent at the edge of stability, for SAM, with momentum and with Adam, and momentum and Adam were found to amplify the bulk component of the update. The alignment is real but spurious: the component along the top directions is large and useless. Its cause depends on the regime. Below the stability threshold it is SGD's noise: switching to full-batch gradient descent made the alignment vanish at once, while the trajectory hardly changed. At the edge of stability it comes from the oscillation that keeps the sharpness near , the self-stabilization mechanism of Damian, Nichani & Lee (2023).
Song et al. reproduce the phenomena with an ill-conditioned two-dimensional quadratic (, , noise from sampling one of two losses). A variant with noise only along the sharp direction can be solved exactly. Take with : is the sharp direction, the bulk. SGD sees the gradient , with noise of variance along the sharp direction, as in networks, where gradient noise lines up with the top of the Hessian. Along the iterate settles into the stationary spread of Gradient Noise, Batch Size & Scaling Rules:
The bulk gradient shrinks as converges, so the gradient's energy ends up almost entirely along : .
Yet the component does nothing for the loss: at stationarity its expected contribution is constant, , and every bit of progress comes from . Dom-SGD updates only and leaves the bulk part of the loss, , where it was; Bulk-SGD updates only and keeps all of SGD's progress. Without noise, decays to zero faster than (whenever , that is, away from the edge of stability) and the alignment disappears, as with full-batch gradient descent in the experiments.
The toy model also explains how both observations can be true. The top subspace really does contain most of the gradient, because the iterate keeps bouncing across the narrow directions of the valley, but the downhill path runs along the floor, in the bulk. This matches The Hessian of a Deep Network: gradient energy concentrated in the outliers is what slows training without batch normalization.
Low-rank gradients for memory
A subspace can also save memory. For a linear layer the gradient of a batch is a sum of outer products, , and in practice gradients of large layers have rapidly decaying singular values. Zhao, Zhang, Chen, Wang, Anandkumar & Tian (2024) proved, under a model of the gradient that reversible networks satisfy, that its stable rank decays during SGD. Their GaLore runs Adam on a low-rank projection of each layer's gradient instead of on the gradient itself.
Every steps ( in their experiments), take the top left singular vectors of the current gradient as a projector (for ), and project each gradient into the small space:
Run Adam on , keeping its moments in , and map the normalized step back to the full space with a scale ( in their experiments). The weights stay full-rank and are updated directly:
Adam's two moments for take numbers; GaLore stores the projector and two moments in the small space, . LoRA, which trains factors beside frozen weights, stores optimizer states and extra weights. Because changes every steps, GaLore's accumulated update can have high rank, which a fixed LoRA factorization cannot.
For a layer with rank , by what factor does GaLore shrink the memory of Adam's optimizer states ( against )?
Show the answer
21.3
numbers against : a factor of about , or of the original when and . The weights and the gradient themselves are unchanged, so the saving in total memory is smaller.
Pretraining LLaMA-style models of up to 7 billion parameters on the C4 dataset (up to 19.7 billion tokens), GaLore cut optimizer-state memory by up to 65.5% while maintaining performance in their comparisons; with 8-bit states, optimizer memory fell by up to 82.5% and total training memory by 63.3% relative to a BF16 baseline, enough to pretrain a 7-billion-parameter model on a single GPU with 24 GB of memory without model parallelism, checkpointing or offloading. As with other optimizer claims (Beyond Adam: Lion, Muon & Steepest Descent), how the method compares with well-tuned full-rank training at scale is still being evaluated.
Key takeaways
- Training in a random -dimensional subspace reaches 90% of full performance at small : 750 for a 199,210-parameter MNIST network, 2,900 for LeNet on CIFAR-10, about 200 for fine-tuning RoBERTa on MRPC, but 190,000 to memorize 50,000 random labels. It barely depends on the network's size.
- The threshold dimension is about , with the Gaussian width of the target sublevel set seen from the start (Gordon's escape theorem): low-loss sets are wide. Burn-in and trajectory-based subspaces need far fewer dimensions than random ones.
- Gradients align with the top Hessian eigenspace after early training, but the aligned part is spurious: Dom-SGD stalls while Bulk-SGD trains as well as SGD. In a noisy quadratic, noise along the sharp direction dominates the gradient yet does nothing for the loss.
- GaLore projects each layer's gradient onto top singular directions, refreshed every steps, and runs Adam there: optimizer states drop from to , while the weights, unlike LoRA's, stay full rank.
Check yourself
In the interactive lesson these are scored with your confidence, and what you miss comes back for review.
What does it mean that a fully connected MNIST network with parameters has intrinsic dimension ?
- Only 750 of its weights matter; the rest can be set to zero
- Training only 750 coordinates in a random subspace through the initialization reaches 90% of the full network's performance
- Its Hessian has exactly 750 nonzero eigenvalues
- It can memorize at most 750 training examples
Show the answer
B. Training only 750 coordinates in a random subspace through the initialization reaches 90% of the full network's performance
Intrinsic dimension is measured by training with a random and . Every weight still changes, but only along 750 random directions. Pruning, which zeroes individual weights, is a different, coordinate-aligned kind of reduction.
Across a family of fully connected networks whose sizes differ by a factor of 24, Li et al. found nearly constant. What is the best interpretation?
- Once a network is large enough, extra parameters mostly add dimensions to the set of solutions, not to the difficulty of reaching one
- Wider networks are no more expressive than narrow ones
- Random subspaces ignore most layers
- The measurement saturates at a fixed maximum value
Show the answer
A. Once a network is large enough, extra parameters mostly add dimensions to the set of solutions, not to the difficulty of reaching one
If the solution set's codimension stays the same while grows, a random subspace of fixed dimension keeps hitting it. This matches the picture of manifolds of minima of dimension whose dimension grows with every added parameter.
Song, Ahn & Yun (2025) projected each SGD update onto the top Hessian eigenspace (Dom-SGD), or onto its orthogonal complement (Bulk-SGD). What happened?
- Both trained as well as SGD, since the gradient lies almost entirely in the top eigenspace
- Dom-SGD trained faster than SGD, since it removes noise in the bulk
- Dom-SGD stopped reducing the loss, while Bulk-SGD trained as well as SGD despite discarding most of each update
- Neither could train: both projections are too restrictive
Show the answer
C. Dom-SGD stopped reducing the loss, while Bulk-SGD trained as well as SGD despite discarding most of each update
The large component of the update along the top eigenspace is real but useless: it mostly reflects oscillation across sharp directions, driven by SGD noise (or by self-stabilization at the edge of stability). The loss decreases through the small bulk component.
How does GaLore differ from LoRA?
- GaLore trains a pair of low-rank factors added to frozen weights, as LoRA does, but initializes them differently
- GaLore keeps full-rank weights, projects each layer's gradient onto a rank- subspace refreshed every steps, and stores Adam's states only in that subspace
- GaLore quantizes the weights to 4 bits and trains adapters
- GaLore trains only the biases
Show the answer
B. GaLore keeps full-rank weights, projects each layer's gradient onto a rank- subspace refreshed every steps, and stores Adam's states only in that subspace
GaLore updates the weights directly, , with Adam run on . Because the projector changes every steps, the accumulated update can have high rank, which LoRA's fixed factorization rules out; and the optimizer states shrink from to numbers plus the projector.
Further reading
- C. Li, H. Farkhoor, R. Liu & J. Yosinski, "Measuring the intrinsic dimension of objective landscapes," ICLR (2018).
- B. W. Larsen, S. Fort, N. Becker & S. Ganguli, "How many degrees of freedom do we need to train deep networks: a loss landscape perspective," ICLR (2022).
- G. Gur-Ari, D. A. Roberts & E. Dyer, "Gradient descent happens in a tiny subspace," arXiv:1812.04754 (2018).
- M. Song, K. Ahn & C. Yun, "Does SGD really happen in tiny subspaces?," ICLR (2025).
- J. Zhao, Z. Zhang, B. Chen, Z. Wang, A. Anandkumar & Y. Tian, "GaLore: Memory-efficient LLM training by gradient low-rank projection," ICML (2024).