Long Context Barrier: QKᵀ's Memory & Compute Limits

The quadratic scaling of QKᵀ's computational and memory requirements severely limits Large Language Models (LLMs) from efficiently processing very long sequences. For contexts exceeding ~4096 tokens, the N×N attention matrix often surpasses GPU memory capacity, becoming the primary bottleneck. Doubling the sequence length quadruples both memory and compute costs.

Sources

Open the full topic