arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2412.04703cs.CLcs.AIcs.LG
收藏

Transformer 难以学习搜索

Transformers Struggle to Learn to Search

Purdue University(普渡大学);New York University(纽约大学);Google(谷歌);Boston University(波士顿大学)

Abulhair Saparov, Srushti Pawar, Shreyas Pimpalgaonkar, Nitish Joshi, Richard Yuanzhe Pang, Vishakh Padmakumar, Seyed Mehran Kazemi, Najoung Kim, He He

AI总结:

本文以图连通性为测试平台,结合机制可解释性分析小型 transformer 的搜索学习机制,证明其可并行扩展可达集,但模型扩大和思维链均无法克服大图上的学习困难。

摘要:

搜索是许多重要任务中的一项基础能力,而近期研究表明,大型语言模型(LLM)难以稳健地执行搜索。目前尚不清楚这种能力缺失是由于数据不足、模型参数不够,还是 transformer 架构的根本限制。在本研究中,我们使用基础性的图连通性问题作为测试平台,生成实际上无限且高覆盖的数据,用于训练小型 transformer,并测试它们是否能够学习执行搜索。我们发现,当给定合适的训练分布时,transformer 能够学习搜索。\n\n我们通过一种新颖的机制可解释性技术分析 transformer 所学到的算法,该技术使我们能够从训练后的模型中提取计算图。我们发现,transformer 会在每个顶点上并行执行搜索:对于输入图中的每个顶点,transformer 计算从该顶点可达的顶点集合。随后,每一层逐步扩展这些集合,使模型能够搜索数量随 $n_{\ ext{layers}}$ 指数增长的顶点。\n\n然而,我们发现,随着输入图规模增大,transformer 学习该任务的难度也会增加。即使增加参数数量,这一困难也没有得到解决,这表明扩大模型规模并不会带来稳健的搜索能力。我们还发现,在上下文中执行搜索(即思维链)并不能解决这种在更大图上学习搜索的能力缺失。

英文摘要:

Search is an ability foundational in many important tasks, and recent studies have shown that large language models (LLMs) struggle to perform search robustly. It is unknown whether this inability is due to a lack of data, insufficient model parameters, or fundamental limitations of the transformer architecture. In this work, we use the foundational graph connectivity problem as a testbed to generate effectively limitless high-coverage data to train small transformers and test whether they can learn to perform search. We find that, when given the right training distribution, the transformer is able to learn to search. We analyze the algorithm that the transformer has learned through a novel mechanistic interpretability technique that enables us to extract the computation graph from the trained model. We find that transformers perform search at every vertex in parallel: For each vertex in the input graph, transformers compute the set of vertices reachable from that vertex. Each layer then progressively expands these sets, allowing the model to search over a number of vertices exponential in $n_{\text{layers}}$. However, we find that as the input graph size increases, the transformer has greater difficulty in learning the task. This difficulty is not resolved even as the number of parameters is increased, suggesting that increasing model scale will not lead to robust search abilities. We also find that performing search in-context (i.e., chain-of-thought) does not resolve this inability to learn to search on larger graphs.

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

↑