Skip to main content
QUICK REVIEW

[论文解读] Systematic Generalization and Emergent Structures in Transformers Trained on Structured Tasks

Yuxuan Li, James L. McClelland|arXiv (Cornell University)|Oct 2, 2022
Topic Modeling被引用 4
一句话总结

该论文表明,使用基于标签的顺序编码的两层因果变换器在复制、反转和分层排序等算法任务上实现了强大的系统泛化能力,能够泛化到训练时未见过的更长序列。模型发展出可解释的任务分解注意力模式,并在相关任务间利用共享计算,揭示了自注意力机制如何在无需显式符号组件的情况下实现结构化计算。

ABSTRACT

Transformer networks have seen great success in natural language processing and machine vision, where task objectives such as next word prediction and image classification benefit from nuanced context sensitivity across high-dimensional inputs. However, there is an ongoing debate about how and when transformers can acquire highly structured behavior and achieve systematic generalization. Here, we explore how well a causal transformer can perform a set of algorithmic tasks, including copying, sorting, and hierarchical compositions of these operations. We demonstrate strong generalization to sequences longer than those used in training by replacing the standard positional encoding typically used in transformers with labels arbitrarily paired with items in the sequence. We search for the layer and head configuration sufficient to solve these tasks, then probe for signs of systematic processing in latent representations and attention patterns. We show that two-layer transformers learn reliable solutions to multi-level problems, develop signs of task decomposition, and encode input items in a way that encourages the exploitation of shared computation across related tasks. These results provide key insights into how attention layers support structured computation both within a task and across multiple tasks.

研究动机与目标

  • 研究变换器如何在无显式符号归纳偏置的情况下,实现对结构化算法任务的系统泛化。
  • 评估基于标签的顺序编码与标准位置编码在实现长度泛化方面的有效性。
  • 分析注意力机制和潜在表征,以寻找任务分解和跨相关任务共享计算的迹象。
  • 理解多头注意力在支持结构化、多层级推理中的计算动态。

提出的方法

  • 在包含10万条序列(5–50个元素)的数据集上训练了一个两层因果变换器,使用独热/多热标记编码实现特征的解耦表示。
  • 用为每个元素分配的随机标签替代标准位置编码,以传达序列顺序,从而实现对更长序列的泛化。
  • 使用特定于任务的独热标记来控制模型执行期望操作(例如,复制、排序、分组)。
  • 通过注意力掩码和表征探测分析潜在空间中头级别和层级别的动态。
  • 在超过最大训练长度(50个元素)的测试序列上评估模型性能。
  • 分析注意力模式和特征表征,以检测系统性处理和任务分解的迹象。

实验结果

研究问题

  • RQ1一个最小化的两层因果变换器能否在涉及序列操作的多个算法任务上学习并实现系统泛化?
  • RQ2基于标签的顺序编码与标准位置编码相比,在实现长度泛化方面表现如何?
  • RQ3变换器中的注意力头是否发展出可解释的、特定于任务的角色,反映出复杂操作的系统性分解?
  • RQ4潜在表征在多大程度上编码了相关任务之间的共享结构模式?

主要发现

  • 基于标签的顺序编码实现了强大的长度泛化,使模型能够可靠地泛化到最大训练长度(50个元素)以上的序列。
  • 两层变换器学习到了对分层排序和分组等多层级任务的可靠解决方案,表现出系统泛化能力。
  • 注意力头表现出任务分解的迹象,特定头专注于特征分组或排序等子组件。
  • 潜在表征以促进相关任务间共享计算的方式编码了项目特征,例如按不同特征顺序排序。
  • 模型发展出与已知任务结构一致的可解释注意力模式,表明出现了类似符号处理的涌现行为。
  • 可学习位置编码和正弦位置编码在长度泛化和训练速度方面均劣于基于标签的方法。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。