通过层间几何改进大语言模型最终表示
Improving LLM Final Representations with Inter-Layer Geometry
AI总结:
本文提出通过图神经网络和Cayley图优化大语言模型层间表示,提升预测性能,同时减少计算开销,实验显示在13个任务上准确率提升达40个百分点。
摘要:
在基于大语言模型(LLM)的预测中,通常使用最终层表示作为下游预测器的输入。然而,中间层可能编码互补的任务相关信号。现有方法要么为每个任务搜索最佳层,要么应用昂贵的注意力机制来学习层间聚合。本文首先表明这种复杂性是不必要的:在LLM层之间构建完全连接图的图神经网络更高效,并在预测性能上显著优于现有方法。我们随后引入Cayley-Encoder,通过将完全连接图替换为SL(2,Zn)上的Cayley图,进一步提升效率和预测性能。这些Cayley图提供了数学上坚实的拓扑结构,稀疏、由构造保证的正则性和低直径。这使层间能够有效通信,同时约束聚合结构并减少GNN过拟合的风险。在对13个任务和9个LLM的评估中,Cayley-Encoder始终优于基线,准确率提升达40个百分点,同时仅引入最多0.1%的额外参数。我们进一步证明Cayley-Encoder在少样本情况下也有效。最后,我们展示Cayley-Encoder在冻结LLM的情况下优于LoRA微调。我们最后通过可解释性分析,证明多个层对最终预测有显著贡献,支持我们的假设。
英文摘要:
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 13 LLMs, Cayley-Encoder consistently outperforms baselines, achieving improvements of up to 48 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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。