用因果语言建模让大模型学会解数独和逻辑谜题,展现深层推理能力。
Causal Language Modeling Can Elicit Search and Reasoning Capabilities on Logic Puzzles

- 训练模型按逻辑步骤解数独,模仿人类推理过程。
- 模型能正确解出94.21%的数独,92.04%的爱因斯坦谜题。
- 内部表征可解码每个格子的可能取值,说明隐含推理机制存在。
近年来,基于Transformer架构的因果语言建模在大语言模型(LLMs)中取得了显著进展。然而,这些模型是否具备基础的搜索与推理能力仍存争议。本文研究了因果语言建模能否学习复杂任务——解数独。解数独需模型在空白格中搜索并选择一个填入,再应用适当策略;有时仅能缩小候选值范围,需连续使用多个策略才能确定值。我们发现,若在求解器生成的逻辑步骤序列上训练,Transformer模型能成功解出数独(准确率达94.21%)。若无此类训练,模型则无法掌握该技能。我们还将方法扩展至齐巴谜题(又称爱因斯坦谜题),模型准确率达92.04%。进一步分析显示,通过线性探测可从模型内部表征中解码任意格子的可能取值集合,表明其权重中隐含强大的推理引擎。
原文摘要 · Abstract (English)
Causal language modeling using the Transformer architecture has yielded remarkable capabilities in Large Language Models (LLMs) over the last few years. However, the extent to which fundamental search and reasoning capabilities emerged within LLMs remains a topic of ongoing debate. In this work, we study if causal language modeling can learn a complex task such as solving Sudoku puzzles. To solve a Sudoku, the model is first required to search over all empty cells of the puzzle to decide on a cell to fill and then apply an appropriate strategy to fill the decided cell. Sometimes, the application of a strategy only results in thinning down the possible values in a cell rather than concluding the exact value of the cell. In such cases, multiple strategies are applied one after the other to fill a single cell. We observe that Transformer models trained on this synthetic task can indeed learn to solve Sudokus (our model solves $94.21\%$ of the puzzles fully correctly) when trained on a logical sequence of steps taken by a solver. We find that training Transformers with the logical sequence of steps is necessary and without such training, they fail to learn Sudoku. We also extend our analysis to Zebra puzzles (known as Einstein puzzles) and show that the model solves $92.04 \%$ of the puzzles fully correctly. In addition, we study the internal representations of the trained Transformer and find that through linear probing, we can decode information about the set of possible values in any given cell from them, pointing to the presence of a strong reasoning engine implicit in the Transformer weights.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。