Pith. sign in

REVIEW 5 cited by

Lightning Attention-2: A Free Lunch for Handling Unlimited Sequence Lengths in Large Language Models

Not yet reviewed by Pith; the record is open.

This paper has not been read by Pith yet. Machine review is queued; the pith claim, tier, and objections will appear here once it completes.

SPECIMEN: schema-true, not a live event

T0 review · schema-true

One-sentence machine reading of the paper's core claim.

pith:XXXXXXXX · record.json · timestamp

arxiv 2401.04658 v2 pith:E32QJURG submitted 2024-01-09 cs.CL cs.AI

classification cs.CLcs.AI
keywords attentionlinearsequenceattention-2lengthslightningspeedadvantage
verification ladder T0 review T1 audit T2 compute T3 formal
0 comments
read the original abstract

Linear attention is an efficient attention mechanism that has recently emerged as a promising alternative to conventional softmax attention. With its ability to process tokens in linear computational complexities, linear attention, in theory, can handle sequences of unlimited length without sacrificing speed, i.e., maintaining a constant training speed for various sequence lengths with a fixed memory consumption. However, due to the issue with cumulative summation (cumsum), current linear attention algorithms cannot demonstrate their theoretical advantage in a causal setting. In this paper, we present Lightning Attention-2, the first linear attention implementation that enables linear attention to realize its theoretical computational benefits. To achieve this, we leverage the thought of tiling, separately handling the intra-block and inter-block components in linear attention calculation. Specifically, we utilize the conventional attention computation mechanism for the intra-blocks and apply linear attention kernel tricks for the inter-blocks. A tiling technique is adopted through both forward and backward procedures to take full advantage of the GPU hardware. We implement our algorithm in Triton to make it IO-aware and hardware-friendly. Various experiments are conducted on different model sizes and sequence lengths. Lightning Attention-2 retains consistent training and inference speed regardless of input sequence length and is significantly faster than other attention mechanisms. The source code is available at https://github.com/OpenNLPLab/lightning-attention.

Discussion (0). Sign in to comment.

Forward citations

Cited by 5 Pith papers

Reviewed papers in the Pith corpus that reference this work. Sorted by Pith novelty score. Full citation record

  1. HYPIC: Accelerating Hybrid-Attention LLM Serving with Position-Independent Caching

    cs.DC 2026-07 unverdicted novelty 7.0 of 10

    Hypic enables position-independent KV/state reuse on hybrid-attention LLMs via cached segment transitions, seam-window repair, and inter-instance segment parallelism, cutting TTFT 3.25x over prefix caching.

  2. Ring-Zero: Scaling Zero RL to a Trillion Parameters for Emergent Reasoning

    cs.CL 2026-07 unverdicted novelty 6.0 of 10

    Scaling zero-RL training to a 1T-parameter model yields competitive math performance and spontaneous cognitive behaviors such as self-verification and structured formatting.

  3. AuroraLong: Bringing RNNs Back to Efficient Open-Ended Video Understanding

    cs.CV 2025-07 conditional novelty 6.0 of 10

    A 2B-parameter video-language model using an RWKV linear-RNN backbone and sorted token merging achieves competitive long-video QA accuracy with far lower memory cost than transformer-based models.

  4. DistrAttention: An Efficient and Flexible Self-Attention Mechanism on Modern GPUs

    cs.LG 2025-07 conditional novelty 5.0 of 10

    DistrAttention approximates self-attention by LSH-based grouping of embedding-dimension columns of Q and K, reducing compute along d while keeping all tokens in context.

  5. SageAttention2++: A More Efficient Implementation of SageAttention2

    cs.LG 2025-05 conditional novelty 4.0 of 10

    Using the FP16-accumulator FP8 matmul instruction with narrowed quantization ranges for P and V yields up to 3.9x speedup over FlashAttention2 with negligible accuracy loss.

Pith tools