FutureFill is a novel algorithm that transforms auto-regressive generation in convolutional sequence models from a slow, quadratic process into a fast, quasilinear one. By pre-computing the influence of past tokens on future ones, it enables exact inference that is significantly faster and more memory-efficient than standard methods, making convolutional architectures a formidable rival to Transformers for long-context tasks.
The Inference Bottleneck in Convolutional Models
While Transformers currently dominate the AI landscape, their core "attention" mechanism is computationally expensive, scaling quadratically with sequence length. Convolutional sequence models—such as Hyena, State Space Models (SSMs), and Spectral Transform Units (STUs)—have emerged as highly efficient alternatives because they can be trained in near-linear time using the Fast Fourier Transform (FFT).
However, these models hit a severe wall during inference (generating text token-by-token). To generate a new token, a naive implementation must re-run the convolution over the entire previous context. This results in an $O(L^2)$ complexity—the exact same quadratic bottleneck that plagues Transformers. Researchers have previously tried to solve this by "distilling" convolutional models into SSMs, but this often introduces approximation errors. The authors of FutureFill asked a critical question: Can we achieve fast, sub-quadratic generation without losing any model quality?
The FutureFill Primitive
The core of the paper is the FutureFill primitive. In a convolution, the contribution of a token at time $t$ to a future output at time $t+s$ depends only on the fixed filter weights. FutureFill exploits this property by "filling in" the future contributions of current tokens before those future tokens are even generated.
You do not need to know the future input to calculate the contribution of the past to the future. In a fixed convolution, the "influence" of token $i$ on position $j$ is determined the moment token $i$ is seen. Based on this insight, the authors propose two main algorithms:
- Epoched-FutureFill: This version updates a "future cache" every $K$ steps. It offers a tunable trade-off between memory and speed, achieving a runtime of $O(L^{3/2} \sqrt{\log L})$.
- Continuous-FutureFill: A more sophisticated "divide-and-conquer" approach. It updates the cache at various scales (powers of 2), achieving a quasilinear total generation time of $O(L \log^2 L)$.
Unlike many efficiency hacks, these are exact algorithms. The output is bit-for-bit identical to the slow, naive version, ensuring zero degradation in model quality.
Cache Efficiency and Memory Wins
In a standard Transformer, the Key-Value (KV) cache grows with the length of the prompt. In FutureFill, the generation cache size is determined only by the number of tokens to be generated. For use cases involving long-context prompts with relatively short responses, this translates to a massive reduction in memory overhead. Furthermore, FutureFill is highly generalizable; it isn't tied to one specific architecture and works for any model using convolutional operators.
Empirical Results and Speedups
The researchers validated FutureFill using controlled synthetic tests to verify theoretical scaling laws, as well as deep convolutional and hybrid (convolution + attention) models (FlashSTU-T variants) with up to 826M parameters.
Empirical tests confirmed that while naive generation time explodes quadratically, FutureFill scales far more gracefully. On an NVIDIA H100 GPU, FutureFill achieved a 1.7x speedup for pure convolutional models and a 1.5x speedup for hybrid models at a context length of 128k tokens. In head-to-head comparisons for generating long sequences from scratch, FutureFill-equipped models were substantially faster than standard Transformer implementations.
Crucially, evaluation on downstream benchmarks like HellaSwag, WinoGrande, and PiQA confirmed that FutureFill produces the exact same results as naive convolution, maintaining the pretrained model's original accuracy.
Limitations and Future Work
While FutureFill represents a massive leap forward, challenges remain:
- Hardware Optimization: Although the algorithmic complexity is lower, actual wall-clock speed depends heavily on how efficiently FFTs are implemented on GPUs compared to the highly optimized matrix multiplications (GEMMs) used in Transformers.
- Prefill Memory: For extremely long prompts, the initial "prefill" stage can still be a memory bottleneck, occasionally triggering Out-Of-Memory (OOM) errors on a single GPU.
- The $O(1)$ Holy Grail: While $O(\log^2 L)$ is a massive improvement over $O(L^2)$, State Space Models (SSMs) can theoretically generate tokens in $O(1)$ time (constant time per token). The authors leave it as an open question whether exact convolutional models can ever reach that absolute limit without relying on approximations.
Summary updated