Engram Figures Out How to Estimate the Right LoRA Adapter Size in Advance, With Error Up to 5%
LoRA is a lightweight add-on for fine-tuning a model, and its size (the rank) is usually chosen by guesswork: too small and the model underfits, too large and memory and latency grow for nothing. Researchers at Engram propose measuring both the dataset and the adapter in bits, treating the language model as a text compressor. Their pre-training estimate matched the real minimum rank needed to absorb 95% of the data, with an error of up to 5%. That means the rank can be estimated in advance, without dozens of trial runs on a GPU.
AI-processed from TG: @ai_machinelearning_big_data (Machinelearning); edited by Hamidun News
Anyone who has fine-tuned a model with LoRA knows the ritual. LoRA is a small add-on (an adapter) on top of a ready neural network: instead of retraining all the weights, you train only that add-on. The size of the add-on is set by the "rank" parameter, and people set it to 8, 16 or 64 simply because someone else did so in a tutorial.
If the rank is too low, the model won't absorb the dataset. If you take a generous margin, costs grow: the adapter takes up more memory and disk space, and generation becomes slower. Researchers at Engram have published a method that calculates the minimum necessary rank before training even starts, and the result deviates from reality by no more than 5%.
The model as an archiver
The idea is to convert everything into one unit of measurement: bits. The authors treat a language model as an archiver. The worse the model predicts the text in your dataset, the more new information it contains, and the more bits are needed to "record" that novelty. If the dataset consists of texts the model already knows almost by heart, the adapter has nothing to do there. If it is internal documentation that was not part of the training, there is a lot of information.
On the other side, the adapter itself is measured in the same bits: how much information a single one of its layers can hold. The authors derived this capacity theoretically. There is a caveat: at low ranks, each parameter works at maximum efficiency, then returns diminish and capacity levels off on a plateau. For a single attention layer in the compact Qwen3.5-0.8B, the calculation gave about 378 thousand bits. At low ranks that is 1.3–1.4 bits per parameter, and at full rank only 0.48 bits.
By comparing "how much information is in the data" with "how much the adapter can hold," you can immediately see which rank is needed. You can also tell whether LoRA will suffice at all or whether all the weights will have to be fine-tuned.
What the experiments showed
Formulas alone cannot describe transformer behavior, because the layers interact nonlinearly. So the team tested the theory in practice. Using the model and reverse arithmetic coding, they generated synthetic data of a strictly defined size in bits and fine-tuned the network on it.
It turned out that the layers reinforce each other. When the adapter is attached to all 24 layers at once, its useful capacity rises from 1.5 to 3.3 bits per parameter. In other words, across the whole network the adapter "packs" data noticeably better than the single-layer calculation suggests.
There is also an unpleasant side. The model forgets roughly as much old information as it memorizes new information, and sometimes slightly more. For example, to absorb 10 kilobytes of new data, it may lose about 12 kilobytes of base knowledge. For anyone fine-tuning a model for a narrow task and hoping to keep its general skills, this is an important warning: there is no free lunch in training.
How reliable this is
The method was checked on real data: emails, notes and technical documentation. The team also used the open SWE-bench Django, MATH-500, GSM8K, Tulu 3 and MMMLU sets. To estimate the size of large datasets, the model's context was extended to two million tokens via YaRN, and bits were summed across such windows.
The main result: the pre-training calculation matched the real minimum rank needed to absorb 95% of the dataset. The error was no more than 5%. Put simply, if the formula says "you need rank 32," experiment will show a value within five percent of that figure.
The limitations should also be kept in mind. All experiments were conducted on a single compact model, Qwen3.5-0.8B. The authors only expect the approach to transfer to other architectures and sizes, but for now that is an assumption. In addition, "absorbed 95% of the dataset" does not always mean "got better at your task": quality in real scenarios still has to be verified separately.
What this means in practice
If a team regularly fine-tunes models on internal data, searching for the rank by brute force turns into dozens of unnecessary GPU runs. A bit-based estimate lets you narrow the range before starting and save money. And if the calculation shows there is too much data for an adapter of any reasonable size, that is a signal to consider full fine-tuning. Or at least not to expect miracles from LoRA.
The second takeaway concerns forgetting. If you need to pour a large volume of new knowledge into a model, plan in advance to mix in the original data and check whether base skills have degraded. Details and calculations are published on the Engram blog.
- Nov 26, 2026Statista Locked Its Data Away from AI and Lost Search: Monthly Visitors Fell from 35 Million to 8 Million
- Nov 26, 2026MWS Cloud Launches DeepSeek V4.1 Flash with 1M-Token Context at 112 ₽ per Million Tokens
- Nov 26, 2026Anthropic Publishes Seven Free GitHub Repositories for Working with Claude Code
- Nov 26, 2026Warp taught its AI reviewer to learn from human replies: instruction fixes arrive as PRs
Key Questions Answered
What are the key details on The model as an archiver?
The idea is to convert everything into one unit of measurement: bits. The authors treat a language model as an archiver. The worse the model predicts the text in your dataset, the more new information it contains, and the more bits are needed to "record" that novelty. If the dataset consists of texts the model already knows almost by heart, the adapter has nothing to do there. If it is internal documentation that was not part of the training, there is a lot of information.
What the experiments showed?
Formulas alone cannot describe transformer behavior, because the layers interact nonlinearly. So the team tested the theory in practice. Using the model and reverse arithmetic coding, they generated synthetic data of a strictly defined size in bits and fine-tuned the network on it. It turned out that the layers reinforce each other. When the adapter is attached to all 24 layers at once, its useful capacity rises from 1.5 to 3.3 bits per parameter.
How reliable this is?
The method was checked on real data: emails, notes and technical documentation. The team also used the open SWE-bench Django, MATH-500, GSM8K, Tulu 3 and MMMLU sets. To estimate the size of large datasets, the model's context was extended to two million tokens via YaRN, and bits were summed across such windows. The main result: the pre-training calculation matched the real minimum rank needed to absorb 95% of the dataset. The error was no more than 5%.
Test Frontier LLMs & Autonomous Agents in One Workspace
Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.
Daily 60-sec AI Voice Brief + Weekly Production AI Agent Playbook
Listen to a 60-second AI news brief every morning and get a weekly hands-on playbook for shipping AI agents to production — tools, MCP servers and patterns that work. Curated by Jemal Hamidun, Head of AI at Alpina Digital.
