Transformer建模计数器语言中栈表示的因果证据
Causal Evidence of Stack Representations in Modeling Counter Languages Using Transformers
AI总结:
通过线性探针和消融实验,证明Transformer在计数器语言任务中学习的栈表示对其性能具有因果必要性。
摘要:
形式语言已被证明是理解Transformer内部机制的有效途径。以往研究表明,在计数器语言上进行下一个词预测训练的Transformer会学习到与底层栈结构一致的表示。除了表示分析,本文还研究了这些表示的因果作用。我们训练线性探针从模型隐藏状态中预测每个词符处的栈深度,并从探针中提取主表示方向。从模型中消融该方向会导致序列准确率骤降至接近0%,这提供了强有力的经验证据,表明栈表示不仅是学习到的,而且对模型性能具有因果必要性。
英文摘要:
Formal languages have proven to be effective conduits to understand the inner mechanisms of transformers. Past work has shown that transformers trained on next token prediction over counter languages learn representations consistent with an underlying stack structure. Beyond representational analysis, this paper investigates the causal role of these representations. Linear probes are trained to predict the stack depth at each token from the model's hidden states, and a principal representation direction is extracted from the probe. Ablation of this direction from the model causes sequential accuracy to collapse to near 0%, providing strong empirical evidence that the stack representation is not just learned, but is causally necessary for model performance.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。