arXiv cs.CL论文
Transformer语言模型中内外计算的可解释涌现机制研究
针对自然语言句法结构和解析歧义,现有研究多关注训练完成后的状态。本文从理论角度切入,首次探讨Transformer模型如何学习近似经典的“内外”(inside-outside)解析算法,旨在揭示这一复杂计算能力在模型内部的涌现过程与可解释性机制。
这篇是正式发表的长论文,站内提供中文解读,全文请到原文阅读 PDF。
Abstract:Variability in syntactic structure and parsing ambiguity are fundamental aspects of natural language which modern LLMs have to learn to deal with proficiently. Previous "post-mortem" studies have shown that fully trained Transformers indeed approximate canonical parsing algorithms such as inside-outside, but little is established theoretically about how this is actually learned. Here, we make a first step towards addressing this by studying the learning dynamics in synthetic context-free grammars with variable parse tree topology. The stagewise learning curves are fully interpretable, in the sense that all of the loss stages a) can be computed analytically, and b) can be clearly associated to the representation of a hidden latent tree variable, which allows to lift ambiguity and utilize information from wider contexts. By probing representations, we visualize the emergence of inside-outside computation across depth and during training: while during early stages local (bigram/trigram) information is used and involves only a few initial layers, gradually the Transformer develops an encoder-decoder structure where the most abstract latent information is encoded in the middle, and the latter half of the network is used to progressively refine the final token prediction. This organization of computation is reminiscent of findings in real-world LLMs, and importantly applies here to a synthetic model which allows full analytical control of the data statistics, thus opening the door to theoretical progress.