用稀疏语义维度解释大模型为何不泛化过拟合
Sparse Semantic Dimension as a Generalization Certificate for LLMs
- 通过稀疏自编码器提取模型内部激活的低维稀疏流形
- 实验证明该维度在真实样本量下给出非空泛的泛化界
- 大模型反而更易识别语义结构,适合安全监测与不确定性检测
标准统计学习理论预测大语言模型(LLMs)因参数量远超训练样本而必然过拟合,但实际中它们泛化能力很强。我们提出,控制泛化的有效容量在于模型内部表示的几何结构:尽管参数空间高维,激活状态却位于一个低维且稀疏的流形上。为此,我们引入稀疏语义维度(SSD),基于在模型层上训练的稀疏自编码器(SAE)的活跃特征词汇量计算。将LLM和SAE视为固定查询器,我们证明模型的泛化能力源于字典的稀疏性,而非总参数量。我们在GPT-2 Small和Gemma-2B上验证该框架,结果显示在合理样本量下该边界为非空泛。关键发现是反直觉的“特征锐度”标度律:尽管Gemma-2B参数量大一个数量级,却只需更少校准样本来识别其活跃流形,表明大模型学得更可压缩、更清晰的语义结构。最后,该框架可作为可靠的安全监控器:分布外输入会引发显著的‘特征爆炸’(活跃特征急剧上升),通过学习到的特征违反信号有效提示认知不确定性。
原文摘要 · Abstract (English)
Standard statistical learning theory predicts that Large Language Models (LLMs) should overfit because their parameter counts vastly exceed the number of training tokens. Yet, in practice, they generalize robustly. We propose that the effective capacity controlling generalization lies in the geometry of the model's internal representations: while the parameter space is high-dimensional, the activation states lie on a low-dimensional, sparse manifold. To formalize this, we introduce the Sparse Semantic Dimension (SSD), a complexity measure derived from the active feature vocabulary of a Sparse Autoencoder (SAE) trained on the model's layers. Treating the LLM and SAE as frozen oracles, we utilize this framework to attribute the model's generalization capabilities to the sparsity of the dictionary rather than the total parameter count. Empirically, we validate this framework on GPT-2 Small and Gemma-2B, demonstrating that our bound provides non-vacuous certificates at realistic sample sizes. Crucially, we uncover a counter-intuitive "feature sharpness" scaling law: despite being an order of magnitude larger, Gemma-2B requires significantly fewer calibration samples to identify its active manifold compared to GPT-2, suggesting that larger models learn more compressible, distinct semantic structures. Finally, we show that this framework functions as a reliable safety monitor: out-of-distribution inputs trigger a measurable "feature explosion" (a sharp spike in active features), effectively signaling epistemic uncertainty through learned feature violation. Code is available at: https://github.com/newcodevelop/sparse-semantic-dimension.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。