R508 · Agent architecture › Self-improvement and learning loops

Pick the rank by measuring the dataset: LoRA capacity in bits

Read the original

fine-tuningadapterscapacityinformation-theoryforgettingvendor-claimsclaim-checking

A predictive theory of how much a LoRA adapter can hold, in bits — what it gets right, and the single-model-size caveat under all of it.

The question it answers

LoRA's hyperparameters are well covered in the literature with one exception: the rank. Too low and the adapter cannot hold the dataset; too high and memory, training time and adapter size are spent for little gain. The usual answer is a sweep — train at several ranks and keep the one that works — which costs a multiple of the training run it is meant to size.

The proposal is to replace the sweep with a measurement. Put the dataset and the adapter in the same unit, bits. Treat the base model as a compressor: the harder it finds the data to predict, the more genuinely new information is in it, and the more adapter capacity is needed to absorb it. Then size the adapter from the measurement instead of discovering it by trial.

The capacity side

From a classical statistical result, the authors derive a closed form for how many bits a LoRA of a given rank can hold, and it has a shape worth internalising: capacity per parameter falls as rank rises. On an 800M-parameter model with 512×1024 value projections, the theory gives about 378k bits — roughly 0.48 bits per parameter at full rank against 1.3–1.4 at low rank. A small adapter is not just cheaper, it is more efficient per parameter, which is the opposite of the intuition that a bigger adapter is a better one.

Depth behaves differently from width. A single adapted layer stores about 1.5 bits per parameter; spreading the same rank across 24 layers raises it to about 3.3 — a super-additive effect, and the clearest practical advice in the work: given a parameter budget, spread it across layers rather than concentrating it in a high rank on few layers.

That figure also deserves to be read carefully. For the 24-layer configuration it reports three numbers, not one: about 3.29 bits per parameter in the infinite-step limit, 2.85 at sixteen thousand steps, and 1.30 as the theory's own prediction. The depth effect is measured, not derived — the theory under-predicts it by more than a factor of two — which is honest of the authors to show and easy to lose when the range "1.5 to 3.3" travels on its own.

Conservation of capacity

The result most likely to change a decision is about forgetting. Measuring the model's likelihood on samples from the base model gives a count of bits lost during training, and across every model trained for this work the quantity lost tracked the quantity gained almost exactly — the illustrated run learns 45.8 KB and forgets 45.8 KB, a ratio of 1.00.

If that holds, adapter capacity is not free headroom: learning a megabyte of new behaviour costs about a megabyte of the model's prior behaviour, whatever the rank. The decision it informs is not "what rank" but "how much do I want this model to stop being good at", and it reframes a large adapter as a large edit rather than a safe one.

How well it predicts

Dataset size is estimated over consecutive two-million-token windows, which the authors note slightly overestimates total information content. For a new dataset the predicted rank is read off a capacity curve built from synthetic data, LoRAs are then trained on the real dataset at half to double that rank, and the measured rank is the smallest that stores 95% of the data. Predictions land within about 5%, over a spread of public datasets — a coding-repository set, two maths sets, two instruction sets, a reasoning set — plus several private workspace datasets.

What would have to be true

One model, one size. Every number here comes from a single 0.8B model of one family. Nothing in the work tests whether the constants, the depth effect or the conservation result survive at 8B or 70B, and the per-parameter capacity of a LoRA is exactly the sort of quantity that could move with hidden-dimension size.

The capacity curve is synthetic. It is fitted on data drawn from the base model itself, which is stated plainly, and then applied to real datasets. The within-5% check on real data is the only evidence that the transfer holds, and it is the load-bearing assumption of the method.

The target is memorization, not quality. "Stores 95% of the dataset" is the success criterion throughout. A rank sufficient to memorize is not demonstrated to be a rank that generalizes, and prior work on LoRA's trade-off between learning and forgetting cuts directly across this.

Finally, this is a company blog rather than a paper — no review, no released code — from a company whose product is customising many models cheaply, which is precisely what sizing adapters automatically enables. None of that makes the measurements wrong; it means the replication is still owed.

A short checklist

Connections

See R508 on the knowledge map

Part of the Research notes on nowucca.com. Figures and claims are the source's own unless the summary says otherwise.