arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.08794cs.LG
收藏

光谱之旅:Transformer如何预测最短路径

Spectral Journey: How Transformers Predict the Shortest Path

Meta AI (FAIR)(Meta AI(FAIR))

Andrew Cohen, Andrey Gromov, Kaiyu Yang, Yuandong Tian

AI总结:

针对仅解码器Transformer是否具备规划推理能力的争议,本文通过在可控图数据中训练模型并解释其表示,发现两层模型可预测含10节点图的最短路径,其嵌入与线图谱分解相关,并据此提出SLN近似路径查找算法。

摘要:

仅解码器Transformer为大型语言模型的能力带来了阶跃式变化。然而,关于它们是否真正在进行规划或推理,观点存在分歧。在这一方向取得进展的途径是在精心控制数据的环境中研究模型行为,然后解释学习到的表示并逆向工程其内部执行的计算。我们研究了从头训练的仅解码器Transformer语言模型,用于在简单、连通且无向的图上预测最短路径。在此环境中,模型学习到的表示和动态是可解释的。我们提出三个主要结果:(1)两层仅解码器语言模型能够学习预测包含最多10个节点的简单连通图的最短路径;(2)模型学习到的图嵌入与线图的谱分解相关;(3)基于这些见解,我们发现了一种新颖的近似路径查找算法Spectral Line Navigator(SLN,谱线导航器),它通过在线图的谱嵌入空间中贪婪选择节点来找到最短路径。

英文摘要:

Decoder-only transformers lead to a step-change in capability of large language models. However, opinions are mixed as to whether they are really planning or reasoning. A path to making progress in this direction is to study the model's behavior in a setting with carefully controlled data. Then interpret the learned representations and reverse-engineer the computation performed internally. We study decoder-only transformer language models trained from scratch to predict shortest paths on simple, connected and undirected graphs. In this setting, the representations and the dynamics learned by the model are interpretable. We present three major results: (1) Two-layer decoder-only language models can learn to predict shortest paths on simple, connected graphs containing up to 10 nodes. (2) Models learn a graph embedding that is correlated with the spectral decomposition of the line graph. (3) Following the insights, we discover a novel approximate path-finding algorithm Spectral Line Navigator (SLN) that finds shortest path by greedily selecting nodes in the space of spectral embedding of the line graph.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑