Skip to main content
QUICK REVIEW

[论文解读] On Sparsifying Encoder Outputs in Sequence-to-Sequence Models

Biao Zhang, Ivan Titov|Zurich Open Repository and Archive (University of Zurich)|Apr 24, 2020
Topic Modeling参考文献 30被引用 7
一句话总结

本文提出 L₀ Drop,一种可微分的稀疏化激励层,可在 Transformer 基础的序列到序列模型中剪枝高达 70% 的编码器输出,且性能损失可忽略不计。通过在随机门上施加 L₀ 惩罚,该方法可学习屏蔽无信息量的源表示——尤其是功能词和标点符号——从而在摘要生成任务中实现最高达 1.65 倍的解码加速,同时保持优异的生成质量。

ABSTRACT

Sequence-to-sequence models usually transfer all encoder outputs to the decoder for generation. In this work, by contrast, we hypothesize that these encoder outputs can be compressed to shorten the sequence delivered for decoding. We take Transformer as the testbed and introduce a layer of stochastic gates in-between the encoder and the decoder. The gates are regularized using the expected value of the sparsity-inducing L0penalty, resulting in completely masking-out a subset of encoder outputs. In other words, via joint training, the L0DROP layer forces Transformer to route information through a subset of its encoder states. We investigate the effects of this sparsification on two machine translation and two summarization tasks. Experiments show that, depending on the task, around 40-70% of source encodings can be pruned without significantly compromising quality. The decrease of the output length endows L0DROP with the potential of improving decoding efficiency, where it yields a speedup of up to 1.65x on document summarization tasks against the standard Transformer. We analyze the L0DROP behaviour and observe that it exhibits systematic preferences for pruning certain word types, e.g., function words and punctuation get pruned most. Inspired by these observations, we explore the feasibility of specifying rule-based patterns that mask out encoder outputs based on information such as part-of-speech tags, word frequency and word position.

研究动机与目标

  • 探究序列到序列模型中的编码器输出是否可通过移除冗余或无信息的表示实现压缩。
  • 通过缩短传递给解码器的编码器状态序列长度,降低解码复杂度。
  • 开发一种可微分、端到端可训练的方法,实现编码器输出的动态稀疏化。
  • 评估数据驱动的稀疏化(L₀ Drop)是否在不同任务间具有泛化能力,或基于规则的模式是否有效且可迁移。
  • 分析哪些类型的词汇(如功能词、标点符号)被优先剪枝,以及此类模式是否可用于高效推理。

提出的方法

  • 在 Transformer 模型的编码器与解码器之间引入一种可微分的稀疏化层 L₀ Drop。
  • L₀ Drop 使用二值随机门,作为可微分近似,实现对整个编码器输出的精确置零。
  • 通过向损失函数中添加 L₀ 惩罚的期望值来诱导稀疏性,从而促使门值趋向于零。
  • 该方法端到端训练,使模型能够学习识别冗余的编码器输出并安全剪枝。
  • 提出一种专用的解码算法,仅关注未被掩码(激活)的编码器状态,将复杂度从 O(NM) 降低至 O(N′M),其中 N′ < N。
  • 基于对 L₀ Drop 行为的分析,设计了基于规则的稀疏化模式,包括词性标注、词频和位置过滤(如仅保留奇数位置)。

实验结果

研究问题

  • RQ1在序列到序列模型中,是否能有效剪枝编码器输出而不降低生成质量?
  • RQ2剪枝编码器输出是否能带来可测量的解码效率提升?
  • RQ3L₀ Drop 机制优先剪枝哪些类型的词汇(如功能词、内容词)?
  • RQ4基于规则的稀疏化模式(如词性标注、频率、位置)是否能达到与数据驱动的 L₀ Drop 相当的性能?
  • RQ5基于规则的稀疏化模式是否在不同任务(如机器翻译和抽象摘要)间具有泛化能力?

主要发现

  • 在 WMT14 En-De 数据集上,使用 L₀ Drop 可剪枝高达 70% 的编码器输出,且生成质量影响极小,BLEU 分数仅比基线低 0.5 分以内。
  • 在文档摘要任务中,L₀ Drop 通过减少传递给解码器的有效输入长度,实现了最高达 1.65 倍的解码加速。
  • L₀ Drop 系统性地剪枝了功能词、标点符号和高频词,同时保留了稀有、富含内容的词汇表示。
  • 基于规则的模式(如词性过滤和基于频率的剪枝)在翻译任务中实现了与 L₀ Drop 相当的性能(例如,46.7% 的剪枝率,BLEU 27.11),但在摘要任务中无法泛化。
  • 组模式(剪枝所有偶数位置的编码表示)在 CNN/Daily Mail 数据集上导致性能显著下降(ROUGE-L 下降 5.82),表明其在不同任务间泛化能力差。
  • 逆频率模式(剪枝罕见词)表现较差,支持信息论直觉:高频词携带的信息量更少,更易于压缩。

更好的研究,从现在开始

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

无需绑定信用卡

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