Explore the research collection
1 entry · Follow this search
- Post
Predicting LoRA size for any dataset
Engram, 'Predicting LoRA size for any dataset' (blog, Nov 24 2026). A predictive theory and measurement method for sizing a LoRA adapter to an SFT dataset, in bits. Capacity of a rank-r adapter is C(r) ~ (1 / 2 ln 2) E[sum of the top-r squared singular values of an iid Gaussian matrix] - about 1.3-1.4 bits per LoRA parameter at low rank, ~0.48 at full rank (Qwen3.5-0.8B v_proj, 512x1024, ~378k bits), with a closed form via the Marchenko-Pastur law. Method: measure a dataset's size in bits under the base model (log-likelihood, YaRN-extended 2M-token windows), generate synthetic datasets of exactly N bits by arithmetic coding under the base model to measure capacity, then read the required rank off the capacity curve. Predictions hold on real datasets: rank predicted within 5% error across Engram's own workspaces, Harvey legal data, developer docs, swebench-django, MATH-500, GSM8K, Tulu 3, No Robots, OpenThoughts3, MMMLU, and enwik8. Two structural findings: capacity is super-additive across layers (1.5 bits/param for one layer to 3.3 for 24 layers), and learning is conserved against forgetting - models forget roughly as much as they learn (forgetting/learning ~1.00), so new information displaces old information rather than adding to it. Flags: first-party blog, not peer-reviewed; all results on a single base model (Qwen3.5-0.8B); no code linked in the post. Cross-references: CSPD (staged slot 31) reports 2.40x rank-4 LoRA throughput as its serving baseline - this post is the rank theory behind that baseline choice; the forgetting-conservation finding pairs with Unified Training (ID 1762) and staged Deletion Tuning (slot 13) in the retention thread, and the bits-per-parameter capacity framing with Subspace Tuning (#116) and MobileSpec/FuRA-S (staged slot 6). For the user's stack: a principled rank picker for his SFT/RLVR adapters instead of a default r=16 sweep, a capacity budget in bits for post-training on his 250M, and a forgetting~learning conservation check for Helm retention monitoring.