Hierarchical Learning for Generation with Long Source Sequences

Tobias Rohde, Xiaoxia Wu, Yinhan LiuarXiv 2021

Abstract

Standard Transformer models often struggle with long-range dependencies in document-level generation tasks. This paper introduces the Hierarchical Attention Transformer (HAT), an architecture that incorporates sentence-level reasoning into the sequence-to-sequence framework. By utilizing specialized hierarchical attention layers and "Beginning of Sentence" (BOS) tokens, HAT effectively captures both local token-level details and global document structure. Experimental results demonstrate state-of-the-art performance on long-form summarization and improvements in document-level machine translation.

Introduction

While Transformers have revolutionized natural language processing, their performance often degrades when processing long documents such as scientific papers or meeting transcripts. The challenge lies in balancing two scales of information: the fine-grained granularity of individual tokens and the high-level context of the entire document's flow. In long sequences, decoders can become overwhelmed by thousands of token-level representations, leading to a loss of structural coherence.

The Hierarchical Attention Transformer (HAT)

To address these limitations, the authors propose the Hierarchical Attention Transformer (HAT). The model introduces a multi-level approach to document encoding and decoding.

Architecture and Methods

The core innovation of HAT is the integration of sentence-level representations into the standard Transformer architecture.

  1. Data Pre-processing: A BOS token is inserted at the start of every sentence in the source document to serve as a structural anchor.
  2. Hierarchical Encoder: Following standard token-level encoding, a specialized layer attends specifically to these BOS tokens, generating a "sentence-level" representation for each sentence.
  3. Hierarchical Decoder: The decoder is augmented with a Hierarchical Attention module. This allows it to perform cross-attention over both individual tokens and the higher-level sentence representations, effectively providing a "map" of the document.
The HAT architecture incorporates hierarchical learning and attention blocks to process sentence-level information alongside token-level data.

For summarization tasks, HAT is initialized with pre-trained weights from BART, while the new hierarchical layers are initialized randomly.

Experimental Setup

The model was evaluated across several domains:

  • Summarization: Long-form (PubMed, arXiv), news (CNN/DailyMail, XSum), and conversational (SAMSum, AMI, ISCI).
  • Machine Translation: Document-level tasks including WMT20 En-De, En-Cs, and TED17 Zh-En.
  • Classification: Ablation studies on SQuAD 2.0, MNLI-m, and RACE.

Key Results and Discussion

HAT achieved state-of-the-art ROUGE scores on major summarization benchmarks. On PubMed, it reached a ROUGE-L of 37.00, outperforming models like BigBird and PEGASUS. In meeting summarization (AMI), HAT significantly improved upon previous ROUGE-2 baselines.

In machine translation, the inclusion of document-level context provided measurable gains. For instance, on the WMT20 English-to-German task, HAT improved the BLEU score from 27.1 to 27.4 compared to a standard Transformer.

Comparison of BLEU scores between standard Transformers and HAT across various document-level translation datasets.

Insights

  • Structural Anchors: BOS tokens act as anchors that prevent the model from getting lost in token-level noise.
  • Selective Attention: Visualization reveals that the model learns to "lock onto" specific sentences at different stages of generation.
  • Efficiency: Despite the added complexity, HAT remains relatively efficient, with the large version containing 471M parameters compared to the standard 408M.

Conclusion and Future Work

HAT demonstrates that hierarchical structures can be effectively integrated into existing large-scale language models to enhance their long-context capabilities. While the model excels in generation, its impact on simple classification tasks is less pronounced. Future work will explore specialized pre-training objectives for hierarchical layers, such as masked sentence representation prediction, to further improve performance on low-resource document-level tasks.

Summary updated

BibTeX
@misc{rohde2021hierarchical,
  author = {Tobias Rohde and Xiaoxia Wu and Yinhan Liu},
  title = {{Hierarchical Learning for Generation with Long Source Sequences}},
  year = {2021},
  eprint = {2104.07545},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2104.07545},
}
Figure