The Cascade Transformer: an Application for Efficient Answer Sentence Selection

Luca Soldaini, Alessandro Moschitti

Abstract

Large-scale Transformer models have set new benchmarks in Answer Sentence Selection (AS2), yet their computational demands remain a barrier for real-time applications. This paper introduces the Cascade Transformer (CT), a "fail-fast" architecture designed to optimize inference by pruning unlikely candidates at intermediate layers. By sharing hidden states across a multi-stage pipeline and employing multi-task training, the CT reduces total computation by up to 37% with no loss in accuracy, and up to 51% with minimal impact, outperforming traditional monolithic and sequential ranking baselines.

Introduction

In the domain of Question Answering, Answer Sentence Selection (AS2) requires ranking a vast pool of candidate sentences to identify the most relevant response. While state-of-the-art models like BERT and RoBERTa provide high precision, their 12-layer depth makes processing hundreds of candidates per query computationally prohibitive.

Current efficiency strategies often rely on model compression techniques like distillation or pruning. However, these methods treat all input candidates equally. The authors observe that many candidates are "easy-to-reject" and do not require the full depth of a large model. The Cascade Transformer addresses this by identifying and discarding these candidates early in the inference process.

The Cascade Transformer Architecture

The Cascade Transformer (CT) transforms a standard Transformer into a dynamic, multi-stage pipeline through several key innovations:

  1. Intermediate Classifiers: Small feed-forward networks (classification heads) are attached to intermediate layers (specifically layers 4, 6, 8, and 10).
  2. Sequential Pruning: During inference, candidates are scored at these intermediate stages. A fixed fraction ($\alpha$) of the lowest-scoring candidates is dropped, and only the remaining "harder" candidates proceed to deeper layers.
  3. Computation Sharing: Unlike a sequence of independent models, the CT re-uses the hidden states from lower layers to feed the upper layers, eliminating redundant feature extraction.
  4. Multi-task Training: To ensure intermediate heads provide reliable signals, the model is trained using a multi-task approach where gradients from randomly selected layers flow back to the input embeddings.
Architecture of the Cascade Transformer showing intermediate classification layers and batch pruning.

Experimental Setup

The model was rigorously evaluated across four English datasets:

  • ASNQ (Answer Sentence Natural Questions): A large-scale dataset with 23 million samples.
  • GPD (General Purpose Dataset): An internal benchmark from Amazon Alexa with ~100 candidates per question.
  • WikiQA & TRECQA: Standard academic benchmarks used to verify the stability of the CT training strategy on smaller data.

Key Results and Insights

The Cascade Transformer demonstrates that lower layers capture sufficient semantic information to filter noise, even if they cannot yet identify the absolute best answer. This hierarchical approach is orthogonal to other efficiency methods, meaning it could potentially be combined with quantization or distillation for further gains.

Performance and cost reduction metrics across ASNQ and GPD datasets.

Key findings include:

  • Efficiency Gains: The CT reduced computation by 37% with zero impact on accuracy. More aggressive pruning ($\alpha=0.5$) achieved a 51% reduction with only a minor performance dip.
  • Superior Throughput: By shrinking the batch size as it moves deeper, the CT can handle larger initial batches within the same memory footprint compared to monolithic models.
  • Accuracy Improvements: On ASNQ, the CT achieved a P@1 of 53.2, slightly exceeding the TANDA baseline (52.1). This suggests that the intermediate tasks may act as a form of regularization, improving model robustness.

Conclusion and Future Work

The Cascade Transformer provides a scalable solution for efficient ranking in NLP. While currently using fixed drop rates, future iterations could implement score-based thresholding for dynamic pruning. Additionally, exploring optimal layer placement for intermediate heads and testing the architecture on broader tasks like document retrieval remain promising avenues for research.

Summary updated

BibTeX
@inproceedings{soldaini2020cascade,
  author = {Luca Soldaini and Alessandro Moschitti},
  title = {{The Cascade Transformer: an Application for Efficient Answer Sentence Selection}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2020},
  doi = {10.18653/v1/2020.acl-main.504},
}
Figure