[论文解读] Tree-Transformer: A Transformer-Based Method for Correction of Tree-Structured Data
引入 Tree-Transformer,一种在树结构数据上执行的 Transformer 变体,用于代码和自然语言纠错,在代码上显著优于序列模型,在GEC基准测试中达到具有竞争力/领先的结果。
Many common sequential data sources, such as source code and natural language, have a natural tree-structured representation. These trees can be generated by fitting a sequence to a grammar, yielding a hierarchical ordering of the tokens in the sequence. This structure encodes a high degree of syntactic information, making it ideal for problems such as grammar correction. However, little work has been done to develop neural networks that can operate on and exploit tree-structured data. In this paper we present the Tree-Transformer extemdash{} a novel neural network architecture designed to translate between arbitrary input and output trees. We applied this architecture to correction tasks in both the source code and natural language domains. On source code, our model achieved an improvement of $25\%$ $ ext{F}0.5$ over the best sequential method. On natural language, we achieved comparable results to the most complex state of the art systems, obtaining a $10\%$ improvement in recall on the CoNLL 2014 benchmark and the highest to date $ ext{F}0.5$ score on the AESW benchmark of $50.43$.
研究动机与目标
- 在树结构数据(代码与自然语言)上激发纠错任务的研究动机,因为语法提供丰富的句法信息。
- 开发一种基于 Transformer 的架构,通过 Tree Convolution Block (TCB) 直接处理树结构,以捕获父节点和左兄弟节点的上下文。
- 通过对深度优先顺序生成树结构且不使用位置编码,启用树到树的纠错。
- 展示在代码纠错中优于基于序列的模型,并在语法错误纠正(GEC)中具备竞争力的表现。
- 探索面向相对较小纠错数据集的训练策略和正则化方法。
提出的方法
- 用 Tree Convolution Block (TCB) 替代 Transformer 的前馈子层,通过学习到的仿射变换和非线性将节点、父节点和左兄弟表示结合在一起。
- 结合带有 TCB 的自上而下的编码器/解码器;通过将同级节点当作带有结束符的序列来实现树结构的生成。
- 使用深度优先顺序以确保在解码时可获得父节点和左兄弟输入,并相应应用自注意力的屏蔽。
- 省略位置编码,因为 TCB 提供结构局部性,并避免在较小数据集上过拟合。
- 使用 Adam 优化器、dropout、标签平滑和束搜索进行训练;利用编码器-解码器注意力来对输入进行条件化,以及自注意力机制来对先前生成的节点进行条件化。
- 通过在大规模单语数据上的预训练和用于语法错误纠正(GEC)的去噪自编码目标扩展训练。
实验结果
研究问题
- RQ1能否有效地将基于 Transformer 的架构改编为直接在树结构数据上进行纠错任务?
- RQ2将父节点-同级树卷积块引入是否比序列方法在代码和语言领域的语法纠错输出更优?
- RQ3哪些训练策略(预训练、去噪、束搜索、正则化)最能支持在小型数据集上的树到树纠错?
- RQ4与最先进的序列模型相比,Tree-Transformer 在代码纠错与语法错误纠正基准上的表现如何?
- RQ5深度优先节点排序和缺乏位置编码在模型性能和过拟合中的作用是什么?
主要发现
- 在 SATE IV 数据的代码纠错中,Tree-Transformer 达到 84.7 F0.5,超过 4-layer LSTM (51.7) 和 standard Transformer (63.5)。
- 在 GEC(CoNLL 2014)中,Tree-Transformer 展现出比先前方法更高的 recall 但精度较低,未使用单语增强时得到 47.50 F0.5,加入增强后改进的变体。
- 在 AESW 上,Tree-Transformer 达到迄今为止报道的最高 F0.5 分数 50.43,超过基于序列的 Transformer (48.03)。
- 该模型由于对树结构的注意力可批处理,训练效率良好,在大规模数据集上将训练时间从数月缩短到不到一天。
- 该架构避免位置编码,因为 TCBs 和树结构提供了足够的局部化,从而减少在小型纠错数据集上的过拟合。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。