Fovea Transformer: Efficient Long-Context Modeling with Structured Fine-To-Coarse Attention

Ziwei He, Jian Yuan, Le Zhou, Jingwen Leng, Bo Jiang

TL;DR

The Fovea Transformer introduces a novel attention mechanism that mimics human vision to solve the "quadratic bottleneck" of standard Transformers. By using a multi-scale tree structure, it allows tokens to attend to nearby neighbors with high precision and distant context with progressively coarser granularity, achieving $O(N \log N)$ complexity and state-of-the-art results on long-text summarization tasks.

What Problem Does This Paper Address?

Standard Transformers suffer from a "quadratic complexity" problem: as the input sequence length ($N$) grows, the memory and time required for self-attention grow by $N^2$. This makes processing long documents (like books or scientific papers) prohibitively expensive.

Existing solutions usually split attention into two modes: local (attending to immediate neighbors) and global (attending to a few "summary" tokens). The authors argue this creates an "abrupt change" in granularity—you either see a token perfectly or you see a massive segment squashed into one representation. The Fovea Transformer aims for a smoother transition, providing a "fine-to-coarse" view of the entire document for every single token.

Methods

The core innovation is Fovea Attention, inspired by the human eye's fovea, where visual acuity is sharpest at the center and blurs toward the periphery.

  1. Multi-scale Representation Tree: The model builds a tree from the input sequence bottom-up. Leaf nodes are individual token blocks. Each level up represents an average of the nodes below it, covering a larger "receptive field" (e.g., Level 1 averages 2 blocks, Level 2 averages 4, etc.).
  2. Structured Selection: When a specific "query" token looks at the document, it selects:
  3. Individual tokens in its immediate neighborhood (Level 0).
  4. Coarser, averaged representations for segments slightly further away (Level 1).
  5. Even coarser representations for very distant segments (Level 2+).
  6. Hardware Efficiency: To stay fast on modern GPUs, the authors use block-wise averaging. Instead of processing every single token, they group tokens into blocks (e.g., size 16 or 32), making memory transactions much more efficient.
  7. Parameter-Free: Crucially, this mechanism adds zero new parameters to the model. It is a "drop-in replacement" for standard attention and can be warm-started from existing pre-trained models like LongT5.

Datasets

The authors evaluated the model on three long-context abstractive summarization benchmarks:

  • Multi-News: A large-scale dataset of multi-document news summaries.
  • WCEP-10: Summarization of news events from the Wikipedia Current Events Portal (using the 10 most relevant documents per cluster).
  • PubMed: Long-form scientific papers where the goal is to generate the abstract.

Key Insights and Ideas

  • Smooth Granularity is Key: The "aha moment" is that models benefit from seeing the entire context at varying resolutions rather than just a "local window + global summary." This allows the model to capture long-range dependencies without the "information staleness" found in other graph-based methods.
  • Complexity Reduction: By selecting a fixed number of nodes ($k$) at each level of the tree, the attention complexity drops from $O(N^2)$ to $O(N \log N)$.
  • No Pre-training Required: Because it introduces no new parameters, the authors could take a pre-trained LongT5-xl (3B parameters) and fine-tune it directly, saving massive amounts of compute.

Key Results

  • State-of-the-Art (SOTA): Fovea Transformer achieved the highest ROUGE scores on Multi-News (50.32 R1) and WCEP-10 (46.1 R1), outperforming specialized models like PRIMER and LongT5.
  • Competitive on PubMed: It achieved the best ROUGE-1 score on PubMed, though it trailed slightly behind LongT5-xl on ROUGE-2 and ROUGE-L.
  • Efficiency Gains: In head-to-head tests against the standard T5 and LongT5, the Fovea Transformer showed significantly faster training speeds (more "samples per second") as sequence lengths increased toward 8k and 16k tokens, while maintaining a much smaller memory footprint than vanilla T5.

Limitations and Future Work

  • Task Specificity: The paper focuses exclusively on abstractive summarization. While this is a classic long-context task, it remains to be seen how Fovea Attention performs on tasks like long-form QA or code generation.
  • Fixed Tree Structure: The current tree is built via simple averaging. Future work could explore more sophisticated ways to aggregate information into the higher-level "coarse" nodes.
  • PubMed Performance: The authors noted a "mixed improvement and setback" on the PubMed dataset, suggesting that scientific text might require different granularity settings than news text.

Summary updated

BibTeX
@inproceedings{he2024fovea,
  author = {Ziwei He and Jian Yuan and Le Zhou and Jingwen Leng and Bo Jiang},
  title = {{Fovea Transformer: Efficient Long-Context Modeling with Structured Fine-To-Coarse Attention}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2024},
  doi = {10.1109/icassp48485.2024.10446483},
}
Figure