Skip to content

Three Ways to Cut LLM Training and Serving Costs Without Losing Accuracy

#llm-training #optimizers #speculative-decoding #federated-learning #energy-efficiency #inference-optimization

SOAP beats AdamW on loss per training step and then hands you the bill: a second eigendecomposition per layer, plus a dense rotated second moment the size of your weight matrix. FOAM keeps the loss curve and cuts most of that cost. At 760M parameters, a fp32 optimizer tensor costs 3 GB, so "half of SOAP's optimizer state" is not an accounting detail. It's a batch size.

The same pattern shows up in the other two papers here. A CPU classifier that predicts tokens from a four-token window still beats a GPU draft model in joules. And in federated LoRA, the local step count explains up to 91% of the variance in energy and emissions, which means hardware choice is the wrong dial to obsess over.

Three papers, one lesson: the knob people tune is usually not the knob that costs.

SOAP's bill comes due in the eigenbasis ​

Shampoo and SOAP precondition gradients with a Kronecker factorization: one matrix summarizing the input side of a layer, one summarizing the output side. Each needs an eigendecomposition to rotate the gradient into its eigenbasis. SOAP then runs Adam inside that rotated basis, which forces it to carry a dense second-moment tensor the full size of the weight matrix.

So you pay twice. Memory for the preconditioners and the rotated moment. Compute for two eigendecompositions per layer per step, which is why SOAP rarely shows up in a production training run even when the loss curve looks better.

Drop the right factor, factor the moment ​

FOAM makes two structural changes, and both are arguments about the Hessian rather than empirical hacks.

The first is input-only preconditioning. Drop the output-side Kronecker factor entirely. Under a Kronecker-structured Hessian this is exact when the output-side curvature is diagonal, and nearly lossless when it's near-diagonal. The authors measure 15-20% violation of the K-FAC Fisher assumption and find it has negligible effect on the update.

The second is a factored Adam moment. Instead of keeping SOAP's dense rotated second moment, FOAM estimates it from row and column statistics. Under the K-FAC Fisher assumption with diagonal output curvature, this estimator recovers SOAP's dense moment exactly. No approximation to argue about in the ideal case.

The reported numbers: matches SOAP and Muon on validation loss across LLM pre-training, uses half of SOAP's optimizer state, runs at Muon-class wall-clock time, and holds up across a three-fold learning-rate range. Tested from 124M to 760M parameters.

Key Numbers760M parameters, the top of FOAM's validated range 2x reduction in optimizer state versus SOAP 1 eigendecomposition per layer instead of two 15-20% measured K-FAC violation, negligible effect on the update 3x learning-rate range over which results hold 0 experiments above 1B parameters

That last row is the honest caveat. Both SOAP and Muon have been trained at scales well past 760M. FOAM's evidence stops there, so "scalable" in the title is a claim about the math, not a demonstrated 70B run.

Quick Take: FOAM's real contribution is proving that SOAP's gains come from the input-side preconditioner, not the output-side one, which means a full class of second-order optimizers can be simplified rather than abandoned.

Where the state actually goes ​

OptimizerPreconditioningOptimizer state vs AdamWEigendecomps per stepWall-clock class
AdamWnone2 fp32 moments (~8 B/param)0baseline
SOAPKronecker, both sides~2x AdamW plus two factors2 per layerslowest
MuonNewton-Schulz orthogonalization~1 fp32 momentum buffer0AdamW-class
FOAMKronecker, input side only~half of SOAP1 per layerMuon-class

For a 760M model, AdamW's moments alone come to roughly 6 GB. SOAP stacks more fp32 tensors on top of that, and the savings FOAM reports are the difference between a comfortable batch size and gradient checkpointing on a 40 GB card. Below 1B parameters, that's the entire argument.

A drafter cheap enough to be free ​

Speculative decoding has a dirty secret that got worse as verifiers got faster. The draft model has to be roughly free, or the verification savings disappear into drafting cost. A 1B-parameter neural drafter running on the same GPU is not free.

Olifant is a memory-based classifier. It looks at the last four tokens, matches them against an in-memory structure, and emits a next-token distribution. Under 0.3 ms on CPU. No GPU, no backprop, no accelerator memory. In the no-KV-cache regime, a domain-matched Olifant model reaches 38.1% acceptance on EU legal text, which translates to 2.43x throughput and 2.51x lower energy per token than the verifier running alone.

Two in five drafted tokens surviving verification sounds mediocre until you remember drafting costs nothing. Compare that with a neural drafter at 80% acceptance that burns a GPU forward pass per token.

The KV cache flips which lever matters ​

Everything changes once the verifier has a KV cache. Caching is itself roughly a 10x energy saver, which means the verifier's per-token cost drops far enough that drafting becomes visible in the budget.

A TinyLlama drafter with a KV-cached verifier halves throughput and triples energy. High acceptance, negative return. Olifant still delivers 1.25x throughput and the lowest energy figure in the study: 93 J per 100 tokens. Working backward from the reported 14x figure, the uncached verifier baseline is about 1.3 kJ per 100 tokens, so the whole stack lands an order of magnitude below where it started.

There's a second finding buried in there that matters more than the headline. Longer drafts raise power draw during verification, so the energy-optimal draft length sits below the speed-optimal one. If you tune draft length against tokens per second, you will overpay in joules. For a single workstation that's rounding error. For a fleet under a power cap, it's the bill.

Federated LoRA: the carbon is in the step count ​

The third paper asks a question most federated learning work skips: where do the joules actually go? The setup is a 2² full factorial design with 135M and 360M models, 10 versus 100 local steps per round, on NVIDIA A40, RTX 6000 Ada, and A100 hardware. CodeCarbon tracked energy and estimated CO₂-equivalent emissions.

Descriptive allocation of variation put 84.8-91.2% of the energy and emissions variance on local step count. Everything else, including the GPU, was noise by comparison. On the A40 and RTX 6000 Ada, dropping to fewer local steps kept accuracy comparable while cutting energy 6-8x, which also raises accuracy per kWh.

Accuracy per kWh is the metric worth copying. Raw joules can always be lowered by training less, and a per-kWh denominator catches that trick immediately.

FactorLevels testedShare of energy/emissions variance
Local steps10 vs 10084.8-91.2%
Model size135M vs 360Mremainder
HardwareA40, RTX 6000 Ada, A100remainder

One wrinkle: the 6-8x energy win with comparable accuracy is reported for the A40 and RTX 6000 Ada. The A100 doesn't behave identically. Hardware still matters, just not in the direction most people assume.

What trips people up ​

Draft length tuned for tokens per second. With a KV-cached verifier, longer drafts raise verification power draw, so the speed-optimal draft length is longer than the energy-optimal one. Benchmark in joules if joules are what you're paying for.

Benchmarking speculative decoding without the KV cache. The 2.43x uncached number is real, but it doesn't survive contact with a cached verifier, where a neural drafter halves throughput and triples energy. Measure the configuration you'll actually deploy.

Assuming FOAM is architecture-agnostic. Input-only preconditioning is exact for diagonal output-side curvature. Past 760M parameters, or on architectures where that curvature is far from diagonal, you're leaning on an approximation nobody has validated at your scale.

Running a domain-matched drafter outside its domain. That 38.1% acceptance is on EU legal text. Point the same classifier at generated code and acceptance drops, and once it falls far enough the verification overhead dominates again.

Reporting federated energy at 100 local steps. That's the top of the range where 84.8-91.2% of the variance lives. A number measured there says almost nothing about a deployment running 10 steps per round.

One thing to remember ​

All three papers are arguments about where cost hides, and in every case the answer contradicts intuition. The second eigendecomposition in SOAP was the expensive half, not the memory. The GPU draft model was the wrong choice next to a cached verifier. The GPU choice mattered less than the step count. Before you optimize anything, measure which term in the cost equation actually has room to move.

The Bottom Line ​

If you're pre-training at or below 1B parameters and optimizer state is limiting your batch size, adopt FOAM now. Half of SOAP's state, Muon-class wall clock, and matched loss from 124M to 760M is a trade with no visible downside. Above 1B, wait for someone to publish the larger run.

If your serving stack already runs a KV-cached verifier, skip the neural drafter entirely. Olifant's memory-based classifier gives 1.25x throughput and the lowest joules in the study, while a TinyLlama drafter halves throughput and triples energy despite higher acceptance. Cheap drafting is the only drafting that pays when the verifier is fast.

If you're budgeting a federated LoRA deployment, tune local step count before you touch hardware. Ten steps instead of a hundred cut energy 6-8x with comparable accuracy on the A40 and RTX 6000 Ada, and that beats any GPU swap you can make within this range.