arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2004.11854cs.CL
收藏

序列到序列模型中编码器输出的稀疏化

On Sparsifying Encoder Outputs in Sequence-to-Sequence Models

University of Edinburgh(爱丁堡大学);University of Amsterdam(阿姆斯特丹大学);University of Zurich(苏黎世大学)

Biao Zhang, Ivan Titov, Rico Sennrich

摘要:

序列到序列模型通常将所有编码器输出传输到解码器进行生成。在这项工作中,相比之下,我们假设这些编码器的输出可以被压缩,以缩短交付解码的序列。我们以Transformer为实验平台,在编码器和解码器之间引入一层随机门。使用稀疏诱导L0惩罚的预期值对门进行正则化,从而完全屏蔽编码器输出的子集。换句话说,通过联合训练,L0 DROP层强制Transformer通过其编码器状态的子集来路由信息。我们研究了这种稀疏化对两个机器翻译和两个摘要任务的影响。实验表明,根据任务的不同,大约40-70%的源编码可以被修剪,而不会显着影响质量。输出长度的减少使L0 DROP具有提高解码效率的潜力,与标准Transformer相比,它在文档摘要任务上的速度提高了1.65倍。我们分析了L0 DROP的行为,并观察到它表现出系统的偏好修剪某些词类型,例如,功能词和标点符号被删减得最多。受这些观察的启发,我们探讨了指定基于规则的模式,掩盖了编码器输出的基础上,如部分的语音标签,词频和单词位置的信息的可行性。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑