In plain words: Instead of keeping the attention calculation in memory, it works through it in blocks and merges it with the next step to save space. It trains sequences 32 times longer than the standard setup, and up to 4 times longer than prior memory-saving tricks.
Abstract · Blockwise Parallel Transformer for Large Context Models
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.
Hao Liu, Pieter Abbeel
arXiv:2305.19370 · cs.CL, cs.LG · submitted May 30, 2023 · updated Aug 28, 2023
abstract · pdf · html