Transformer models have demonstrated impressive capabilities when trained at scale, excelling at difficult cognitive tasks requiring complex reasoning and rational decision-making. In this paper, we explore the application of transformers to chess, focusing on the critical role of the position representation within the attention mechanism. We show that transformers endowed with a sufficiently expressive position representation can match existing chess-playing models at a fraction of the computational cost. Our architecture, which we call the Chessformer, significantly outperforms AlphaZero in both playing strength and puzzle solving ability with 8x less computation and matches prior grandmaster-level transformer-based agents in those metrics with 30x less computation. Our models also display an understanding of chess dissimilar and orthogonal to that of top traditional engines, detecting high-level positional features like trapped pieces and fortresses that those engines struggle with. This work demonstrates that domain-specific enhancements can in large part replace the need for model scale, while also highlighting that deep learning can make strides even in areas dominated by search-based methods.
The Chess Transformer: Mastering Play using Generative Language Models
PeopleTec;Auburn University(奥本大学)
这项工作表明,自然语言Transformers可以支持更通用的战略建模,特别是对文本存档的游戏。除了学习自然语言技能之外,抽象的Transformer架构还可以在棋盘上生成有意义的移动。通过进一步的微调,Transformer通过在Portable Game Notation中对280万盘国际象棋进行训练来学习复杂的游戏玩法。经过30,000个训练步骤后,OpenAI的生成式预训练Transformer(GPT-2)优化了7.74亿个参数的权重。这款经过微调的国际象棋Transformer可以生成合理的策略,并显示可识别为经典开局的游戏阵型,例如英语或斯拉夫交换。最后,在现场比赛中,新模型展示了一个人对Transformer的界面,正确过滤非法移动,并提供了一种新的方法来挑战Transformer的象棋策略。我们预计未来的工作将建立在这个Transformer的承诺,特别是在其他战略游戏中,功能可以捕获简单但富有表现力的玩家注释的基础复杂的规则语法。
Tracing the Thought of a Grandmaster-level Chess-Playing Transformer
Shanghai Innovation Institute, Shanghai, China(上海创新研究院);School of Computer Science, Fudan University, Shanghai, China(复旦大学计算机科学技术学院);School of Mathematics and Statistics, Xi’an Jiaotong University(西安交通大学数学与统计学院)