Skip to main content
QUICK REVIEW

[Paper Review] ETC: Encoding Long and Structured Inputs in Transformers

Joshua Ainslie, Santiago Ontañón|arXiv (Cornell University)|Apr 17, 2020
Topic ModelingComputer Science45 references28 citations
TL;DR

This paper introduces Extended Transformer Construction (ETC), a novel Transformer architecture that scales attention to long sequences using global-local attention and encodes structured inputs via relative position encodings and a Contrastive Predictive Coding (CPC) pre-training objective. ETC achieves state-of-the-art results on four long- and structured-input NLP benchmarks, including HotpotQA, WikiHop, Natural Questions, and OpenKP, outperforming existing models with single-model submissions.

ABSTRACT

Transformer models have advanced the state of the art in many Natural Language Processing (NLP) tasks. In this paper, we present a new Transformer architecture, Extended Transformer Construction (ETC), that addresses two key challenges of standard Transformer architectures, namely scaling input length and encoding structured inputs. To scale attention to longer inputs, we introduce a novel global-local attention mechanism between global tokens and regular input tokens. We also show that combining global-local attention with relative position encodings and a Contrastive Predictive Coding (CPC) pre-training objective allows ETC to encode structured inputs. We achieve state-of-the-art results on four natural language datasets requiring long and/or structured inputs.

Motivation & Objective

  • To address the quadratic computational cost of self-attention in standard Transformers, which limits input length to ~512 tokens.
  • To enable effective modeling of structured inputs such as hierarchical document organization, document-level relationships, and markup structure.
  • To improve performance on long-context and structured-input NLP tasks through architectural innovations and pre-training strategies.
  • To allow initialization from pre-trained BERT/RoBERTa models for better fine-tuning efficiency and performance.
  • To demonstrate that structured input modeling and CPC pre-training significantly improve reasoning and long-context understanding.

Proposed method

  • Introduces a global-local attention mechanism that splits input into global tokens and long input tokens, reducing attention complexity from O(n²) to O(n) by restricting attention between global and long tokens.
  • Uses relative position encodings to model dependencies between global and long tokens, enabling structured input modeling without full attention.
  • Employs a Contrastive Predictive Coding (CPC) pre-training objective to learn global input representations, analogous to a sentence-level masked language modeling task.
  • Enables weight transfer from pre-trained RoBERTa models, improving training efficiency and performance.
  • Applies hard g2l (global-to-long) masking to enforce structured attention patterns between global and long tokens.
  • Uses a two-sequence input format: global input (e.g., summary tokens) and long input (full sequence), with cross-attention between them.

Experimental results

Research questions

  • RQ1Can a modified Transformer architecture scale self-attention to long sequences while maintaining quadratic complexity?
  • RQ2How effectively can global-local attention with relative position encodings model hierarchical and structured input dependencies?
  • RQ3Does a CPC pre-training objective improve performance on long-context and structured-input NLP tasks?
  • RQ4To what extent does initializing from RoBERTa improve performance on long and structured inputs?
  • RQ5How do architectural choices like hard g2l masking and flat structure ablation affect performance on structured datasets?

Key findings

  • ETC achieves state-of-the-art performance on all four evaluated datasets: HotpotQA (support F1: 0.869), WikiHop (accuracy: 75.9), Natural Questions (long answer), and OpenKP (F1: 0.399), all with single-model submissions.
  • The model outperforms Longformer-large on HotpotQA and WikiHop, even without ensemble methods, with a 0.869 F1 on HotpotQA and 75.9 accuracy on WikiHop.
  • Removing the CPC pre-training task reduces HotpotQA support F1 from 0.751 to 0.722, demonstrating its importance for structured reasoning.
  • Hard g2l masking improves performance on HotpotQA but slightly hurts WikiHop, suggesting dataset-specific sensitivity to structural inductive biases.
  • Using RoBERTa weights for initialization significantly improves performance, especially on OpenKP and WikiHop, where results improve with larger models and pre-training.
  • Adding visual features to OpenKP yields the largest performance boost, and using max logit over keyphrase candidates further improves results.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.