Predicting LoRA size for any dataset engram.com · 13 points · 0 comments · HN th...
HN Best 200 @best
Predicting LoRA size for any dataset engram.com · 13 points · 0 comments · HN thread
TL;DR Engram, a model-customization company, presents a method to predict how large a LoRA adapter (by rank) must be to fit a given dataset. The approach measures dataset size in bits under the base model via its negative log-likelihood, derives a theoretical capacity curve for LoRA rank using random matrix theory, and validates it on synthetic and real datasets, reporting rank predictions within about 5% error. The post has 13 points and no comments yet.
- A LoRA adapter's capacity in bits is modeled as a function of rank; capacity grows roughly linearly at low rank and plateaus as singular values decrease, reaching mn/(2 ln 2) bits at full rank.
- For an 800M Qwen3.5 model's 512x1024 v_proj, theory predicts about 378k bits, or roughly 1.3-1.4 bits per parameter at low rank and 0.48 at full rank.
- Synthetic datasets with an exact bit count are generated by running arithmetic coding in reverse on a base model, so the data's size under the model is known.
- When several matrices are adapted jointly, capacity is super-additive: total capacity rises from 1.5 to 3.3 bits per parameter as more layers are adapted.
- Models forget roughly as much as they learn in the experiments, e.g. learning 10 KB may cost about 12 KB of old information.
- To size a real dataset, the method extends context to 2M tokens via YaRN, measures its bits under the model, reads the required rank off the capacity curve, and was tested against measured minimum ranks on datasets such as GSM8K, No Robots and enwik8.
Discussion No comments have been posted yet, so the thread has no discussion to summarize.