Skip to main content
QUICK REVIEW

[论文解读] Frustratingly Short Attention Spans in Neural Language Modeling

Michał Daniluk, Tim Rocktäschel|arXiv (Cornell University)|Feb 15, 2017
Topic Modeling被引用 10
一句话总结

本文提出了一种在神经语言模型中的键值预测注意力机制,将输出表征解耦为预测、记忆键入和值检索三个部分,显著降低了基线LSTM模型的困惑度。令人惊讶的是,该模型主要依赖于最近五个标记的表征,而一种仅通过拼接最后三个输出的简单基线模型,其性能与复杂注意力机制相当或更优。

ABSTRACT

Neural language models predict the next token using a latent representation of the immediate token history. Recently, various methods for augmenting neural language models with an attention mechanism over a differentiable memory have been proposed. For predicting the next token, these models query information from a memory of the recent history which can facilitate learning mid- and long-range dependencies. However, conventional attention mechanisms used in memory-augmented neural language models produce a single output vector per time step. This vector is used both for predicting the next token as well as for the key and value of a differentiable memory of a token history. In this paper, we propose a neural language model with a key-value attention mechanism that outputs separate representations for the key and value of a differentiable memory, as well as for encoding the next-word distribution. This model outperforms existing memory-augmented neural language models on two corpora. Yet, we found that our method mainly utilizes a memory of the five most recent output representations. This led to the unexpected main finding that a much simpler model based only on the concatenation of recent output representations from previous time steps is on par with more sophisticated memory-augmented neural language models.

研究动机与目标

  • 为解决训练神经语言模型以利用长距离依赖关系的困难,通过显式分离输出表征的预测、记忆键入和值检索功能。
  • 探究在注意力机制中将预测、键和值功能解耦是否能提升性能,相较于标准注意力机制。
  • 评估基于近期输出拼接的简化模型是否能超越更复杂的记忆增强架构。
  • 确定记忆增强型神经语言模型在实际应用中的有效注意力范围。

提出的方法

  • 在每个时间步,模型输出三个独立的向量:一个用于预测下一个词,一个作为注意力的键,一个作为记忆检索的值。
  • 注意力机制通过当前隐藏状态与过去记忆键之间的学习兼容函数计算上下文向量,权重由注意力分数决定。
  • 维护一个最后L个输出表征的滑动窗口作为可微分记忆,注意力在该窗口上计算。
  • 键值预测机制将输出分为三个部分:预测、键和值,减轻了单个向量的功能过载。
  • 引入一种简单基线模型,通过拼接最后三个输出表征来预测下一个词,不使用注意力或记忆组件。
  • 在Wikipedia和儿童读本测试(CBT)语料库上进行实验,比较不同模型的困惑度和准确率。

实验结果

研究问题

  • RQ1在注意力机制中解耦预测、键和值功能是否能提升神经语言模型的性能?
  • RQ2记忆增强型神经语言模型在实际中捕捉长距离依赖关系的效率如何?
  • RQ3基于近期输出表征拼接的简化模型是否能超越更复杂的基于注意力的架构?
  • RQ4当前最先进的记忆增强语言模型的有效注意力范围是多少?

主要发现

  • 在Wikipedia语料库上,与普通LSTM相比,键值预测模型将困惑度降低了9.4点,与RM(+tM-g)模型相比降低了4.3点。
  • 在CBT数据集上,键值预测模型在动词上的准确率提高了1.0个百分点,在介词上的准确率提高了1.7个百分点。
  • 尽管在记忆窗口上使用了注意力机制,所有注意力模型主要关注最近五个表征,表明其有效注意力范围较短。
  • 简单的$4$-gram RNN模型(通过拼接最后三个输出表征)实现了与更复杂的键值预测模型相当或更优的困惑度。
  • 增大注意力窗口大小并未显著提升性能,表明当前架构中长距离记忆的效用有限。
  • 结果表明,即使使用注意力机制,训练神经语言模型以有效利用长距离依赖关系仍然极具挑战性。

更好的研究,从现在开始

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

无需绑定信用卡

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