Modeling Context in Answer Sentence Selection Systems on a Latency Budget

Rujun Han, Luca Soldaini, Alessandro Moschitti

Abstract

Answer Sentence Selection (AS2) is a critical component for low-latency open-domain question answering. However, traditional AS2 models process candidate sentences in isolation, missing vital contextual cues. This paper introduces a Multi-way Attention (MWA) architecture that efficiently integrates local and global document context. Evaluated on the ASNQ and WQA datasets, the MWA model achieves accuracy improvements of up to 11% in P@1 over non-contextual baselines while maintaining the strict latency requirements of production environments.

Introduction

In open-domain Question Answering (QA), systems typically choose between Machine Reading (MR) and Answer Sentence Selection (AS2). While MR models are highly accurate due to their ability to process entire passages, they are computationally expensive and often too slow for real-time applications. Conversely, AS2 models are optimized for speed by scoring individual sentences independently against a query.

The primary drawback of traditional AS2 is its lack of "situational awareness." By evaluating sentences in a vacuum, these models often fail to resolve pronouns or understand topical relevance that is only clear from the surrounding text. This research addresses the challenge of incorporating contextual intelligence into the high-speed AS2 framework without exceeding a strict latency budget.

Methodology: Contextual AS2

The researchers propose a two-step pipeline to augment AS2 with context. First, they define Local Context as the sentences immediately adjacent to the candidate answer and Global Context as relevant sentences found elsewhere in the document via semantic similarity (using embeddings) or N-gram overlap.

Architectural Approaches

To integrate this context, three distinct Transformer-based (RoBERTa) architectures were evaluated:

  1. Context Concatenation: The question, answer, and context are joined into a single input string. While simple, this method can lead to "confusion" where the model is distracted by noisy global information.
  2. Context Ensemble: This approach runs local and global context through separate, independent models. While highly accurate, it effectively doubles the computational cost and latency.
  3. Multi-way Attention (MWA): This specialized architecture uses a single transformer but employs a multi-way attention mechanism. It forces the model to process the question, answer, and context separately before merging the information, providing a balance between the speed of concatenation and the accuracy of an ensemble.
Architectural comparison: (a) Context Concatenation, (b) Context Ensemble, and (c) Multi-way Attention (MWA).

Experimental Results

The models were tested on the ASNQ (Answer Sentence Natural Questions) dataset and WQA, an in-house dataset from Alexa AI.

Performance and Latency

As shown in the results for the ASNQ dataset, the MWA model achieved a P@1 of 0.661, a significant jump from the 0.596 baseline. Crucially, the MWA approach mimicked the high performance of the heavy Ensemble model (0.668) while reducing memory usage by 89% and latency by 21.5% compared to the ensemble.

Performance and latency comparison on the ASNQ dataset.

Key findings include:

  • Local Context Dominance: Adjacent sentences generally provide more semantic value than global context.
  • Semantic Search Superiority: Using cosine similarity to find global context outperformed simple keyword matching (N-gram overlap).
  • Efficiency: The MWA model added only a minimal fraction of processing time per sample (approx. 0.33μs) compared to the non-contextual version, making it viable for production use.

Conclusion

By utilizing a Multi-way Attention architecture, AS2 systems can achieve the contextual depth of Machine Reading models without sacrificing the speed required for real-time QA. Future work will focus on extending these techniques to multi-lingual contexts and exploring more efficient methods for global context extraction to further reduce the computational footprint.

Summary updated

BibTeX
@inproceedings{han2021modeling,
  author = {Rujun Han and Luca Soldaini and Alessandro Moschitti},
  title = {{Modeling Context in Answer Sentence Selection Systems on a Latency Budget}},
  booktitle = {EACL},
  year = {2021},
  doi = {10.18653/v1/2021.eacl-main.261},
}
Figure