potentialpaper

FlashBoB: I/O-Efficient Exact Backward-over-Backward for Softmax Attention

Keep the title, authors and abstract in paper.json

potentialpaper · 2026-11-23 20:41 UTC · 3585b72c0503 ·

.potentialpaper/metadata.json modified

+++ b/.potentialpaper/metadata.json
@@ -1,23 +1,5 @@
{
- "layout": 5,
- "identifiers": [
- {
- "scheme": "openreview",
- "value": "jDTHY0c03X"
- }
- ],
- "title": "FlashBoB: I/O-Efficient Exact Backward-over-Backward for Softmax Attention",
- "authors": [
- "Anthony Givans",
- "Michael Crawshaw",
- "Mingrui Liu"
- ],
- "abstract": "Transformer models built on the attention mechanism have become a central building block in modern deep learning, yet softmax attention remains a major bottleneck for long-context workloads. While FlashAttention makes the forward and first backward passes I/O-efficient, it does not support backward-over-backward (BoB), which enables exact differentiation through the backward pass for applications such as second-order optimization, test-time training, gradient-written memory, and meta-learning. Existing BoB implementations either materialize large intermediate tensors or exhaust GPU memory at long sequence lengths.\n\nWe present FlashBoB, an exact, I/O-efficient algorithm for BoB in softmax attention that keeps computation within on-chip tiles and avoids all $N \\times N$ intermediate tensors, where $N$ is the sequence length. The key insight is a hierarchical affine structure in the softmax double backward: two row-wise scalars determine all outputs through affine transformations. This yields a two-pass schedule with bounded on-chip static random-access memory (SRAM) usage and minimal off-chip high-bandwidth memory (HBM) traffic. FlashBoB achieves $\\Theta(N^2 d^2/M)$ HBM traffic ($d$ is the head dimension and $M$ is the on-chip SRAM size) and, within the standard FlashAttention-style score-recomputation model, matches the inherited large-cache lower bound for exact forward attention. Empirically, in an isolated attention-layer benchmark on a single A100 80GB GPU, it computes exact attention BoB at $N=262\\text{K}$, where prior PyTorch exact baselines exhaust memory by $N=16\\text{K}$, and it is up to $9.4\\times$ faster than FlashBack. Across complete second-order steps on GPT-2, Pythia, and five native GQA and MoE models, FlashBoB is $1.6$--$3.8\\times$ faster than the fastest exact baseline that fits on chip, supports $2$--$8\\times$ longer contexts, and cuts 1B-token Sophia-H training time and peak memory on FineWeb by $2.2\\times$. These results make exact second-order attention practical at long-context sequence lengths where prior implementations cannot run efficiently.",
- "year": 2026,
- "venue": "NeurIPS 2026",
- "source": "openreview",
- "license": {
- "metadata": "CC0-1.0",
- "abstract": "CC0-1.0"
- }
+ "layout": 6,
+ "kind": "paper",
+ "key": "4c5e4da2-9330-4e67-a0c2-3831e5d83561"
}

paper.json added

+++ b/paper.json
@@ -0,0 +1,13 @@
+{
+ "title": "FlashBoB: I/O-Efficient Exact Backward-over-Backward for Softmax Attention",
+ "authors": [
+ "Anthony Givans",
+ "Michael Crawshaw",
+ "Mingrui Liu"
+ ],
+ "abstract": "Transformer models built on the attention mechanism have become a central building block in modern deep learning, yet softmax attention remains a major bottleneck for long-context workloads. While FlashAttention makes the forward and first backward passes I/O-efficient, it does not support backward-over-backward (BoB), which enables exact differentiation through the backward pass for applications such as second-order optimization, test-time training, gradient-written memory, and meta-learning. Existing BoB implementations either materialize large intermediate tensors or exhaust GPU memory at long sequence lengths.\n\nWe present FlashBoB, an exact, I/O-efficient algorithm for BoB in softmax attention that keeps computation within on-chip tiles and avoids all $N \\times N$ intermediate tensors, where $N$ is the sequence length. The key insight is a hierarchical affine structure in the softmax double backward: two row-wise scalars determine all outputs through affine transformations. This yields a two-pass schedule with bounded on-chip static random-access memory (SRAM) usage and minimal off-chip high-bandwidth memory (HBM) traffic. FlashBoB achieves $\\Theta(N^2 d^2/M)$ HBM traffic ($d$ is the head dimension and $M$ is the on-chip SRAM size) and, within the standard FlashAttention-style score-recomputation model, matches the inherited large-cache lower bound for exact forward attention. Empirically, in an isolated attention-layer benchmark on a single A100 80GB GPU, it computes exact attention BoB at $N=262\\text{K}$, where prior PyTorch exact baselines exhaust memory by $N=16\\text{K}$, and it is up to $9.4\\times$ faster than FlashBack. Across complete second-order steps on GPT-2, Pythia, and five native GQA and MoE models, FlashBoB is $1.6$--$3.8\\times$ faster than the fastest exact baseline that fits on chip, supports $2$--$8\\times$ longer contexts, and cuts 1B-token Sophia-H training time and peak memory on FineWeb by $2.2\\times$. These results make exact second-order attention practical at long-context sequence lengths where prior implementations cannot run efficiently.",
+ "license": {
+ "metadata": "CC0-1.0",
+ "abstract": "CC0-1.0"
+ }
+}