用于字符级转换的硬非单调注意力
Hard Non-Monotonic Attention for Character-Level Transduction
AI总结:
本文提出一种精确的多项式时间算法,用于对字符串间指数级非单调对齐进行边缘化,使硬非单调注意力在字符级转换任务中显著优于随机近似和软注意力。
摘要:
字符级字符串到字符串的转换是各种NLP任务的重要组成部分。其目标是将输入字符串映射到输出字符串,其中两个字符串的长度可能不同,并且包含来自不同字母表的字符。最近的方法使用了带有注意力机制的序列到序列模型,来学习在生成输出字符串时模型应关注输入字符串的哪些部分。软注意力和硬单调注意力都已被使用,但硬非单调注意力仅在图像描述等其他序列建模任务中被使用过,并且需要随机近似来计算梯度。在这项工作中,我们引入了一种精确的多项式时间算法,用于对两个字符串之间指数级数量的非单调对齐进行边缘化,表明硬注意力模型可以被视为经典IBM Model 1的神经重参数化。我们在实验中比较了软注意力和硬非单调注意力,发现精确算法显著提高了随机近似的性能,并且优于软注意力。代码可在https://github.com/shijie-wu/neural-transducer获取。
英文摘要:
Character-level string-to-string transduction is an important component of various NLP tasks. The goal is to map an input string to an output string, where the strings may be of different lengths and have characters taken from different alphabets. Recent approaches have used sequence-to-sequence models with an attention mechanism to learn which parts of the input string the model should focus on during the generation of the output string. Both soft attention and hard monotonic attention have been used, but hard non-monotonic attention has only been used in other sequence modeling tasks such as image captioning (Xu et al., 2015), and has required a stochastic approximation to compute the gradient. In this work, we introduce an exact, polynomial-time algorithm for marginalizing over the exponential number of non-monotonic alignments between two strings, showing that hard attention models can be viewed as neural reparameterizations of the classical IBM Model 1. We compare soft and hard non-monotonic attention experimentally and find that the exact algorithm significantly improves performance over the stochastic approximation and outperforms soft attention. Code is available at https://github. com/shijie-wu/neural-transducer.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。