Efficient Long-Text Understanding with Short-Text Models

Maor Ivgi, Uri Shaham, Jonathan Berant

TL;DR

SLED (SLiding-Encoder and Decoder) is a simple yet powerful framework that allows standard, short-text pretrained language models (like BART or T5) to process long documents without expensive retraining. By chunking input text and using the decoder to fuse information, SLED achieves performance competitive with specialized long-text models that are up to 50x larger.

What Problem Does This Paper Address?

Standard Transformer models, the backbone of modern NLP, suffer from a "quadratic bottleneck." Their self-attention mechanism scales $O(n^2)$ with the input length $n$, making it computationally impossible to process long documents like books, legal contracts, or scientific papers.

While many "efficient" Transformers (e.g., Longformer, BigBird, LongT5) have been proposed to solve this, they usually require custom, complex implementations and—most importantly—massive, expensive pretraining from scratch on long sequences. The authors of SLED ask: Can we leverage the "battle-tested" models we already have (trained on short text) to understand long text efficiently?

Methods

The authors propose SLED, which relies on the Locality of Information assumption: an encoder only needs local context to represent a token well, while global reasoning can be handled by the decoder.

The SLED workflow (illustrated in Figure 2) involves:

  1. Chunking: The long input document is split into overlapping chunks of a fixed length (e.g., 256 tokens).
  2. Prefixing: If there is a task-specific prefix (like a question in QA), it is prepended to every chunk. This ensures the encoder knows what to look for in each segment.
  3. Independent Encoding: Each chunk is passed through a standard, pretrained short-text encoder (like BART's encoder) independently.
  4. Fusion-in-Decoder: The encoded representations of the "effective" (non-overlapping) parts of each chunk are concatenated. A standard pretrained decoder then performs cross-attention over this entire sequence to generate the final output.
Overview of the SLED architecture showing chunking, prefixing, and fusion.

This approach results in linear $O(n)$ complexity relative to the input length, making it highly scalable.

Datasets

The authors evaluate SLED primarily on SCROLLS, a benchmark designed for long-range language understanding. It consists of seven datasets:

  • Summarization: GovReport, SummScreenFD, QMSum.
  • Question Answering: Qasper, NarrativeQA, QuALITY.
  • Natural Language Inference: ContractNLI.

They also designed controlled experiments using modified versions of SQuAD 1.1 (to test "needle-in-a-haystack" retrieval) and HotpotQA (to test "piecing the puzzle" across chunks).

Key Insights and Ideas

  • Prefixing is the Secret Sauce: A major finding was that prepending the question/task to every chunk is vital. Without it, the encoder produces representations that aren't useful for the specific task, leading to a massive drop in performance.
  • Overlap is Mandatory: Using non-overlapping chunks leads to a performance drop of at least 10% (and sometimes over 50%). The overlap provides the necessary local context for tokens at the edges of chunks.
  • The Decoder is a Great Fuser: The experiments proved that a standard decoder is surprisingly good at "stitching together" information that was encoded in completely separate passes.
  • Efficiency without Pretraining: SLED demonstrates that specialized long-range pretraining isn't always necessary. A strong base model (like BART-large) plus the SLED framework can outperform massive models like UL2 (20B parameters) on long-text tasks.

Key Results

  • Performance Jump: Simply plugging BART or T5 into the SLED framework improved their average SCROLLS score by 4.8 to 7 points compared to just feeding the models the first 1,024 tokens.
  • Competitive with Giants: BART-large-SLED is competitive with LongT5-base and outperforms the 20-billion-parameter UL2 model, despite being 50x smaller.
  • Scaling: As shown in Figure 1, SLED allows smaller models to punch significantly above their weight class in terms of parameter count vs. performance.
Figure 1: Models’ SCROLLS score (Shaham et al., 2022) as a function of parameter count. Plugging exist- ing pretrained LMs into the SLED framework dramat- ically improves their SCROLLS score (arrows from blue circles to orange stars). Gray triangles indicate models with dedicated pretraining for capturing long- range dependencies. BARTlarge-SLED is competitive with LongT5base (Guo et al., 2022) and UL2 (Tay et al., 2022b) (which has 50x more parameters), and slightly lags behind larger LongT5 models.

Limitations and Future Work

  • Long Output Bottleneck: While SLED handles long inputs linearly, the decoder still has quadratic complexity relative to the output length. This makes it unsuitable for tasks requiring very long generations (e.g., writing a whole book chapter).
  • Distant Co-reference: The "locality assumption" might break if a document requires resolving a pronoun or fact from a very distant chunk (e.g., a character mentioned only in Chapter 1 appearing in Chapter 20). In these cases, the encoder won't see the connection, putting all the pressure on the decoder.
  • Multi-hop Reasoning: For extremely complex reasoning that requires jumping back and forth across a document multiple times, the independent encoding step might lose crucial nuances.

Summary updated

BibTeX
@article{ivgi2023efficient,
  author = {Maor Ivgi and Uri Shaham and Jonathan Berant},
  title = {{Efficient Long-Text Understanding with Short-Text Models}},
  journal = {Trans. Assoc. Comput. Linguistics},
  year = {2023},
  url = {https://openreview.net/forum?id=ydsSVdwJBC},
}
Figure