用Transformer学习元胞自动机规则,发现模型能抽象规律但难长程规划。
Learning Elementary Cellular Automata with Transformers
- 通过随机初态和局部规则生成序列训练Transformer,使其学会抽象规则。
- 单步预测准确率高,多步规划任务性能骤降,缺乏中间上下文。
- 加入未来状态或规则预测损失后,模型长程推理能力显著提升。
大型语言模型虽具备出色数学能力,但在抽象推理与规划方面仍显不足。本文研究Transformer是否能学习元胞自动机(Elementary Cellular Automata)的规则并实现泛化。通过在随机初态和局部规则生成的状态序列上训练,模型可跨不同固定阶数的布尔函数实现规则抽象,且在下一状态预测任务中表现优异。然而,在无中间上下文支持的多步规划任务中性能急剧下降。分析表明,将未来状态或规则预测纳入训练损失,能增强模型对规则的内部表征,从而提升长程规划与自回归生成能力。此外,增加模型深度对复杂推理任务中的序列计算至关重要。这表明,通过在损失函数中引入更长规划视野,并结合循环机制与自适应计算时间,有望进一步提升大模型的推理能力。
原文摘要 · Abstract (English)
Large Language Models demonstrate remarkable mathematical capabilities but at the same time struggle with abstract reasoning and planning. In this study, we explore whether Transformers can learn to abstract and generalize the rules governing Elementary Cellular Automata. By training Transformers on state sequences generated with random initial conditions and local rules, we show that they can generalize across different Boolean functions of fixed arity, effectively abstracting the underlying rules. While the models achieve high accuracy in next-state prediction, their performance declines sharply in multi-step planning tasks without intermediate context. Our analysis reveals that including future states or rule prediction in the training loss enhances the models' ability to form internal representations of the rules, leading to improved performance in longer planning horizons and autoregressive generation. Furthermore, we confirm that increasing the model's depth plays a crucial role in extended sequential computations required for complex reasoning tasks. This highlights the potential to improve LLM with inclusion of longer horizons in loss function, as well as incorporating recurrence and adaptive computation time for dynamic control of model depth.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。