arXiv cs.AI· Amirhossein Basareh, Rishabh Sanjay, Daniel de Mello, Abulhair Saparov·· 12 小时前AI 评分39
Transformer 能装下多少信息?研究揭示记忆容量随维度指数增长
How Much Information Can We Fit inside a Transformer?
AI 导读
研究通过贝叶斯优化超参数搜索,测出完全记忆给定事实所需的最小 Transformer 规模:在 45 至 49,920 共 11 种数据规模上,记忆容量随模型维度指数增长,即所需最小维度随事实数 N 呈对数增长,统计检验拒绝了幂律等其他拟合。沿深度方向,固定宽度下最大可记忆数据量随层数亚线性增长;对含对称关系或两跳组合的结构化数据,Transformer 会利用这些规律进一步提升容量。
正文
Abstract:How efficiently can transformers store factual knowledge? The answer to this question has implications for both model design and understanding the limits of transformer-based systems. Prior studies observe a linear relationship between the number of facts memorized and the number of model parameters required, substantially worse than what theoretical analyses predict is achievable. We re-examine empirical scaling: through rigorous and systematic experiments, including extensive hyperparameter search via Bayesian optimization, we determine the smallest model that can perfectly memorize a given set of facts, and measure how this minimum size scales with the number of facts. On synthetic datasets of random, independent (subject, relation, object) triples---e.g., (Paris, capital_of, France) ---drawn at random with no exploitable structure, we find that memorization capacity, the size of the largest dataset that a model memorizes completely, grows exponentially with the transformer dimension. Equivalently, the minimum transformer dimension $d_{\min}$ required to memorize $N$ facts grows logarithmically in $N$. Across 11 dataset sizes spanning $N = 45$ to $49{,}920$, a lack-of-fit F-test does not reject the logarithmic fit (with an offset), but it does reject all other tested alternatives including power-law. Along the depth axis, however, at fixed width, the maximum memorizable dataset size grows sublinearly with the number of layers over the measured range. We further extend our exploration to structured data containing symmetric relations or two-hop composition. In this setting, we find that transformers exploit these regularities to further improve capacity. All code to reproduce our results is available at this https URL.
| Subjects: | Artificial Intelligence (cs.AI) |
| Cite as: | arXiv:2610.34553 [cs.AI] |
| (or arXiv:2610.34553v1 [cs.AI] for this version) | |
| https://doi.org/10.48550/arXiv.2610.34553 arXiv-issued DOI via DataCite (pending registration) |
Submission history
From: Amirhossein Basareh [view email]
[v1]
Sun, 25 Oct 2026 20:28:17 UTC (130 KB)
来源:arXiv cs.AI · arxiv.org