arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2305.19370cs.CLcs.LG
收藏

分块并行Transformer用于大上下文模型

Blockwise Parallel Transformer for Large Context Models

UC Berkeley(加州大学伯克利分校)

Hao Liu, Pieter Abbeel

AI总结:

提出分块并行Transformer(BPT),通过分块计算自注意力和融合前馈网络降低内存成本,支持比原始Transformer长32倍、比现有高效方法长4倍的序列训练,实验验证其在语言建模和强化学习中的有效性。

摘要:

Transformer已成为最先进的自然语言处理模型的基石,在各种人工智能应用中展现出卓越的性能。然而,Transformer中的自注意力机制和大型前馈网络所带来的内存需求限制了其处理长序列的能力,从而为涉及多个长序列或长期依赖关系的任务带来了挑战。我们提出了一种独特的方法——分块并行Transformer(BPT),它利用自注意力的分块计算和前馈网络融合来最小化内存成本。通过在处理更长输入序列的同时保持内存效率,BPT使得训练序列长度比原始Transformer长32倍,比之前的内存高效方法长最多4倍。在语言建模和强化学习任务上的大量实验证明了BPT在减少内存需求和提升性能方面的有效性。

英文摘要:

Transformers have emerged as the cornerstone of state-of-the-art natural language processing models, showcasing exceptional performance across a wide range of AI applications. However, the memory demands posed by the self-attention mechanism and the large feedforward network in Transformers limit their ability to handle long sequences, thereby creating challenges for tasks involving multiple long sequences or long-term dependencies. We present a distinct approach, Blockwise Parallel Transformer (BPT), that leverages blockwise computation of self-attention and feedforward network fusion to minimize memory costs. By processing longer input sequences while maintaining memory efficiency, BPT enables training sequences 32 times longer than vanilla Transformers and up to 4 times longer than previous memory-efficient methods. Extensive experiments on language modeling and reinforcement learning tasks demonstrate the effectiveness of BPT in reducing memory requirements and improving performance.

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

↑