TL;DR
Extended Transformer Construction (ETC) is a new architecture designed to break the two biggest bottlenecks in standard Transformers: the quadratic scaling of memory/compute with input length and the inability to naturally encode structured data (like hierarchies or graphs). By using a novel "global-local" attention mechanism and relative position encodings, ETC achieves state-of-the-art results on long-form and structured NLP tasks while remaining compatible with pre-trained models like BERT.
What Problem Does This Paper Address?
Standard Transformer models, such as BERT and RoBERTa, have revolutionized NLP but suffer from two major limitations:
- The $O(n^2)$ Bottleneck: The self-attention mechanism requires every token to attend to every other token. This quadratic complexity typically limits input lengths to 512 tokens, which is insufficient for long documents or multi-document reasoning.
- Flat Representation: Transformers treat text as a flat sequence of tokens. However, real-world data is often structured—organized into sentences, paragraphs, or even complex web DOM trees. Standard models struggle to leverage these inherent relationships.
The authors introduce ETC to scale Transformers to much longer inputs (thousands of tokens) and provide a flexible way to inject structural information directly into the attention mechanism.
Methods
The core of ETC is built on three main pillars:
- Global-Local Attention: Instead of one long sequence, ETC uses two: a long input (the actual text) and a global input (a much smaller set of auxiliary summary tokens). Attention is split into four pieces:
- Global-to-Global (g2g): Full attention between global tokens.
- Global-to-Long (g2l) & Long-to-Global (l2g): Full attention between the two sequences.
- Long-to-Long (l2l): Restricted to a local "sliding window" radius. This reduces complexity to $O(n_g^2 + n_g n_l + n_l r)$, making it linear relative to the long input length $n_l$.
- Relative Position Encodings: ETC replaces absolute position embeddings with relative ones. This allows the model to generalize to longer sequences than those seen during training. Crucially, these encodings are treated as edge labels in a graph, allowing the model to represent arbitrary relationships (e.g., "this token belongs to this sentence").
- Contrastive Predictive Coding (CPC): A new pre-training task where the model must distinguish a masked sentence's representation from random "negative" sentences. This encourages global tokens to capture high-level semantic summaries.
- Weight Lifting: ETC can "lift" weights from existing pre-trained models like RoBERTa, allowing researchers to benefit from massive existing compute without starting from scratch.
Datasets
The authors evaluated ETC on four datasets that demand long-range reasoning or structural awareness:
- Natural Questions (NQ): Finding answers in full Wikipedia articles.
- HotpotQA: Multi-hop question answering across 10 different paragraphs.
- WikiHop: Reasoning across multiple Wikipedia contexts to answer a query.
- OpenKP: Extracting keyphrases from web pages, utilizing the hierarchical DOM structure.
Key Insights and Ideas
- The Global Bridge: The global tokens act as a "communication hub." Even though long tokens can only see their immediate neighbors locally, they can pass information to a global token, which then broadcasts it to the rest of the sequence.
- Transformer as a Graph Neural Network: By using relative position labels to define structure, the authors effectively treat the Transformer as a GNN. This allows for sophisticated "hard masking" (e.g., preventing tokens in one document from attending to another) and explicit hierarchical modeling (context -> sentence -> token).
- Linear Scaling in Practice: As shown in the paper's efficiency analysis, ETC becomes significantly faster and more memory-efficient than BERT once input lengths exceed roughly 1,500 tokens.
Key Results
ETC set a new state-of-the-art (at the time of submission) across all four benchmarks:
- NQ: Achieved a Long Answer F1 of 78.2, outperforming the previous best (RikiNet).
- HotpotQA: Reached 89.4 Support F1, taking the #1 spot on the leaderboard.
- WikiHop: Achieved 82.25% accuracy, a significant jump over the Longformer baseline.
- OpenKP: Reached an F1@3 of 0.423, demonstrating the power of encoding visual and DOM structure.
Limitations and Future Work
- Encoder Only: This work focuses strictly on the Transformer encoder. Extending ETC to a sequence-to-sequence (encoder-decoder) architecture for generative tasks is a clear next step.
- Scaling Limits: While linear, the model still has overhead. The authors suggest investigating even more efficient sparse attention mechanisms, like those in Reformer or Routing Transformer, to push lengths even further.
- Richer Structures: While they tested on DOM trees and document hierarchies, the authors note that the datasets used have relatively "limited" structure compared to full knowledge graphs, which remains an area for future exploration.
Summary updated