Date: January 27, 2023 | Estimated Reading Time: 45 min | Author: Lilian Weng * Combination of Local and Global Context * Transformers for Reinforcement Learning
核心贡献 · Key contributions
对 2020 年以来 Transformer 架构变体与改进进行了全面、结构化的综述。 Provides a comprehensive structured survey of Transformer architecture variants and improvements since 2020.
系统梳理了注意力机制与位置编码,包括相对位置编码和旋转位置嵌入。 Systematically reviews attention mechanisms and positional encodings, including relative position encoding and rotary position embedding.
讨论了通过记忆与检索扩展上下文窗口的机制,如 Transformer-XL、Compressive Transformer、kNN-LM 和 Memorizing Transformer。 Discusses mechanisms for extending context window via memory and retrieval, such as Transformer-XL, Compressive Transformer, kNN-LM, and Memorizing Transformer.
涵盖了自适应计算方法,包括 Universal Transformer、自适应注意力跨度、深度自适应 Transformer 和 CALM。 Covers adaptive computation methods including Universal Transformer, adaptive attention span, depth-adaptive Transformer, and CALM.
综述了稀疏、局部敏感哈希、低秩和随机特征注意力等效率改进,以降低二次复杂度。 Surveys efficiency improvements like sparse, LSH, low-rank, and random feature attention to reduce quadratic complexity.
重点介绍了局部-全局混合注意力模型,包括 ETC、Longformer 和 Big Bird。 Highlights hybrid local-global attention models including ETC, Longformer, and Big Bird.
局限 · Limitations
该综述是一个快照;Transformer 研究发展迅速,其覆盖范围和框架可能很快过时。 The survey is a snapshot; Transformer research evolves rapidly, so coverage and frameworks may become outdated.
许多技术仅在特定任务和数据集上评估,其相对收益可能无法跨领域或跨模型规模迁移。 Many techniques are evaluated on specific tasks and datasets, so their relative gains may not transfer across domains or model scales.
高效注意力方法常常以精度换取速度和内存,引入近似误差或限制上下文范围。 Efficient attention methods often trade off accuracy for speed and memory, introducing approximation errors or restricted context.
ALiBi 等长上下文外推方法的泛化能力有限,在更长序列上可能性能下降。 Long-context extrapolation methods like ALiBi show limited extrapolation and may degrade on much longer sequences.
基于记忆和检索的增强方法需要额外的存储和计算,在极大规模下可能不切实际。 Memory and retrieval based augmentations require extra storage and computation, which may be impractical at very large scale.
局部与全局上下文的组合Combination of Local and Global Context#(https://lilianweng.github.io/posts/2023-01-27-the-transformer-family-v2/#combination-of-local-and-global-context)
强化学习中的 TransformerTransformers for Reinforcement Learning#(https://lilianweng.github.io/posts/2023-01-27-the-transformer-family-v2/#transformers-for-reinforcement-learning)