[论文解读] Addressing Some Limitations of Transformers with Feedback Memory
论文提出了 Feedback Transformer,通过共享反馈记忆使所有过去的表示对未来计算可访问,使浅层模型在语言建模、翻译和强化学习上能够匹配甚至超过 Transformers,同时提供更快的解码和更小的内存占用。
Transformers have been successfully applied to sequential, auto-regressive tasks despite being feedforward networks. Unlike recurrent neural networks, Transformers use attention to capture temporal relations while processing input tokens in parallel. While this parallelization makes them computationally efficient, it restricts the model from fully exploiting the sequential nature of the input. The representation at a given layer can only access representations from lower layers, rather than the higher level representations already available. In this work, we propose the Feedback Transformer architecture that exposes all previous representations to all future representations, meaning the lowest representation of the current timestep is formed from the highest-level abstract representation of the past. We demonstrate on a variety of benchmarks in language modeling, machine translation, and reinforcement learning that the increased representation capacity can create small, shallow models with much stronger performance than comparable Transformers.
研究动机与目标
- 阐明并解决标准 Transformer 在自回归序列建模中的局限性。
- 引入基于记忆的 Feedback Transformer,复用过去的高层表示来计算当前步骤。
- 证明浅层的 Feedback Transformer 在解码更快、内存占用更少的情况下也能达到较强的性能。
- 在语言建模、机器翻译和强化学习基准上进行评估。
- 与循环结构和其他 Transformer 变体进行比较,以确立反馈记忆的优势。
提出的方法
- 使用带有可学习权重 w^l 且经 Softmax 归一化的分层加权和,在时间 t 将来自所有层的表示聚合为记忆向量 m_t:m_t = sum_l Softmax(w^l) x_t^l。
- 将自注意力的输入替换为关注记忆 m_t,而不仅仅是较低层的输出:z_t^l = Attn(x_t^l, {m_{t-τ}, ..., m_{t-1}})。
- 在所有层之间共享键和值的投影,使得 k_t^l = k_t = W_k m_t,v_t^l = v_t = W_v m_t,从而减少内存和计算。
- 将来自所有层的过去表示合并成每个时间步的单一反馈记忆,支持递归计算,除了 w^l 之外不增加参数数量。
- 在生成时保持序列式计算,同时在训练阶段通过记忆共享利用对硬件友好的并行性。
- 证明较小的 Feedback Transformer 在翻译任务中,使用浅解码器和大编码器时也能取得强劲结果,并展示改进的内存和速度特性。
实验结果
研究问题
- RQ1通过 Feedback Memory 将所有过去的表示暴露给未来计算,能否比标准 Transformer 改善自回归建模?
- RQ2Feedback Transformer 是否能在较小、较浅的网络中实现有效的递归计算和长期状态跟踪?
- RQ3在语言建模、翻译和强化学习任务中,Feedback Transformer 与循环模型及其他 Transformer 变体相比如何?
- RQ4在 Feedback Transformer 中应用共享的键值投影时,内存和速度的权衡有哪些?
- RQ5在实际设置中,反馈机制如何影响解码速度和训练效率?
主要发现
- 与标准 Transformer 相比,Feedback Transformer 在翻译和语言任务上以更浅的结构保持或提高性能。
- 共享键和值的投影降低内存使用并加快训练和推理,特别是在浅解码器下实现更快的解码。
- 在长上下文任务和强化学习中,Feedback 模型在有限内存下保持性能,并展现出比标准 Transformer 更好的状态跟踪。
- 在如 WMT En-De 和 WikiText-103 等标准基准上,使用更小参数量的情况下,该架构可以超越循环模型和某些 Transformer 混合变体。
- 反馈记忆使递归计算成为可能,允许在时间步之间迭代地细化表示而不增加模型深度。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。