Skip to main content
QUICK REVIEW

[Paper Review] ERNIE-SPARSE: Learning Hierarchical Efficient Transformer Through Regularized Self-Attention

Yang Liu, Jiaxiang Liu|arXiv (Cornell University)|Mar 23, 2022
Domain Adaptation and Few-Shot LearningComputer Science6 citations
TL;DR

ERNIE-Sparse proposes a hierarchical sparse transformer (HST) and self-attention regularization (SAR) to address information bottleneck sensitivity and topology inconsistency in sparse attention mechanisms. By introducing hierarchical global representation and enforcing output consistency across topological shifts, it achieves state-of-the-art performance on long-range sequence tasks, improving accuracy by 2.77% on Long Range Arena and 3.24% on QA benchmarks.

ABSTRACT

Sparse Transformer has recently attracted a lot of attention since the ability for reducing the quadratic dependency on the sequence length. We argue that two factors, information bottleneck sensitivity and inconsistency between different attention topologies, could affect the performance of the Sparse Transformer. This paper proposes a well-designed model named ERNIE-Sparse. It consists of two distinctive parts: (i) Hierarchical Sparse Transformer (HST) to sequentially unify local and global information. (ii) Self-Attention Regularization (SAR) method, a novel regularization designed to minimize the distance for transformers with different attention topologies. To evaluate the effectiveness of ERNIE-Sparse, we perform extensive evaluations. Firstly, we perform experiments on a multi-modal long sequence modeling task benchmark, Long Range Arena (LRA). Experimental results demonstrate that ERNIE-Sparse significantly outperforms a variety of strong baseline methods including the dense attention and other efficient sparse attention methods and achieves improvements by 2.77% (57.78% vs. 55.01%). Secondly, to further show the effectiveness of our method, we pretrain ERNIE-Sparse and verified it on 3 text classification and 2 QA downstream tasks, achieve improvements on classification benchmark by 0.83% (92.46% vs. 91.63%), on QA benchmark by 3.24% (74.67% vs. 71.43%). Experimental results continue to demonstrate its superior performance.

Motivation & Objective

  • Address the information bottleneck sensitivity in sparse transformers caused by limited global tokens.
  • Reduce performance degradation due to inconsistent attention topologies under minor input shifts.
  • Improve long-range sequence modeling by introducing a hierarchical attention mechanism for richer global representation.
  • Stabilize model predictions across varying attention topologies through a novel regularization strategy.
  • Demonstrate superior performance across diverse NLP tasks, including long document classification and question answering.

Proposed method

  • Introduce Hierarchical Sparse Transformer (HST), which uses two-stage attention: first local tokens attend within blocks, then representative tokens aggregate and propagate global information.
  • Design Self-Attention Regularization (SAR), a training regularization that minimizes output differences between original and shifted attention topologies.
  • Apply SAR by sampling a perturbed version of the sparse attention input (e.g., shifted by one token) and minimizing the KL divergence between the original and perturbed model outputs.
  • Use shared linear weights between hierarchical and sparse attention heads to improve parameter efficiency and consistency.
  • Train with a combination of standard cross-entropy and SAR loss, enabling robustness to topological variations.
  • Leverage pretraining-fine-tuning paradigm to evaluate generalization on downstream tasks like text classification and question answering.

Experimental results

Research questions

  • RQ1How does the number of global tokens affect model performance in sparse transformers, and can hierarchical attention mitigate this bottleneck effect?
  • RQ2To what extent does input perturbation (e.g., token shift) disrupt model behavior in sparse transformers with fixed attention patterns?
  • RQ3Can a regularization strategy that enforces output consistency across different attention topologies improve model robustness and performance?
  • RQ4How does the proposed HST mechanism compare to standard sparse attention in modeling long-range dependencies across diverse sequence lengths?
  • RQ5Does combining SAR with other regularization techniques like R-Drop further improve model generalization?

Key findings

  • ERNIE-Sparse achieves a 2.77% average accuracy improvement over strong baselines on the Long Range Arena benchmark (57.78% vs. 55.01%).
  • On text classification tasks, ERNIE-Sparse improves accuracy by 0.83% (92.46% vs. 91.63%) compared to strong baselines.
  • On question-answering tasks, ERNIE-Sparse achieves a 3.24% improvement (74.67% vs. 71.43%) over baseline methods.
  • Ablation studies show that removing HST reduces performance by 1.00 point on average, with a 1.78-point drop on the ListOps task.
  • SAR regularization reduces performance drop on Pathfinder by 3.52 points when the attention topology is perturbed (from 78.77 to 75.25), demonstrating its stabilizing effect.
  • SAR outperforms R-Drop in 3 out of 5 tasks and is complementary to dropout, with combined use yielding better results than either alone.

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.