用数学构造的稀疏图优化大模型中间层表示,提升预测性能且几乎不增加参数。
Improving LLM Final Representations with Inter-Layer Geometry
- 构建基于凯莱图的轻量GNN,以稀疏规则结构连接模型各层。
- 在13个任务上最高提升40个百分点准确率,仅增0.1%参数。
- 适用于少样本场景,且优于微调,可解释多层协同作用。
当前大模型预测普遍使用最后一层表示,但中间层可能包含互补任务信号。现有方法或搜索最佳层,或采用昂贵的注意力机制聚合层间信息。本文提出无需复杂设计:在全连接层图上使用轻量图神经网络,即可实现更优性能。进一步引入凯莱编码器(Cayley-Encoder),将全连接图替换为SL(2,Zn)上的凯莱图,该图具有稀疏性、规则性和低直径特性,有效促进层间通信同时约束聚合结构,降低过拟合风险。在13项任务和9个大模型上的评估表明,凯莱编码器持续优于基线,准确率最高提升40个百分点,额外参数不超过模型大小的0.1%。其在少样本场景中表现优异,且在冻结模型下超越LoRA微调。可解释性分析显示多层对最终预测均有贡献,验证了核心假设。
原文摘要 · Abstract (English)
The standard in LLM-based prediction is to use the final-layer representation as the input to a downstream predictor. However, intermediate layers may encode complementary task-relevant signals. Existing approaches therefore either search for the best layer for each task or apply expensive attention-based mechanisms to learn inter-layer aggregation. In this work, we first show that such complexity is unnecessary: a lightweight Graph Neural Network over a fully connected graph of LLM layers is more efficient and achieves significantly stronger predictive performance than existing approaches. We then introduce the Cayley-Encoder, which further improves both efficiency and predictive performance by replacing the fully connected graph with a Cayley graph over SL(2, Zn). These Cayley graphs provide a mathematically grounded topology that is sparse, regular by construction, and has low diameter. This enables effective communication across layers while constraining the aggregation structure and reducing the risk of GNN overfitting. In an evaluation of Cayley-Encoder across 13 tasks and 9 LLMs, Cayley-Encoder consistently outperforms baselines, achieving improvements of up to 40 percentage points in accuracy, while introducing at most 0.1% additional parameters relative to the LLM size. We further show that Cayley-Encoder is effective in few-shot regimes. Finally, we show that Cayley-Encoder outperforms LoRA fine-tuning while operating on the frozen LLM. We conclude with an explainability analysis showing that multiple layers contribute meaningfully to the final prediction, supporting our hypothesis.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。