Deep Context: End-to-end Contextual Speech Recognition

Golan Pundak, Tara N. Sainath, Rohit Prabhavalkar, Anjuli Kannan, Ding Zhao

Introduction

Modern End-to-End (E2E) Automatic Speech Recognition (ASR) models, such as Google’s "Listen, Attend, and Spell" (LAS), have revolutionized the field by integrating acoustic, pronunciation, and language models into a single neural network. Despite their power, these models often struggle with contextual biasing—the ability to recognize rare or personalized terms like specific contact names ("Call Zaphod Beeblebrox") or niche song titles that are underrepresented in general training data.

Traditional approaches address this by "rescoring" model outputs using external lists (shallow fusion), but these methods are difficult to tune and often apply biasing too late in the decoding process. This paper introduces Contextual Listen, Attend and Spell (CLAS), an all-neural system that dynamically incorporates contextual information directly into the model's internal representations during the listening process.

Methods: The CLAS Architecture

The core innovation of CLAS is the addition of a parallel stream for context alongside the standard audio processing pipeline.

Comparison of the baseline LAS model (a) and the proposed CLAS model (b), which introduces a Bias Encoder and secondary Attention mechanism.

As shown in the architecture comparison, CLAS modifies the standard LAS framework with several key components:

  1. Bias-Encoder: A dedicated LSTM network that transforms a list of "bias phrases" (e.g., "Play Radiohead") into fixed-dimensional embeddings.
  2. Contextual Attention: A second attention mechanism that operates in parallel with the audio attention. At each decoding step, the model calculates which bias phrase embedding best matches the current acoustic and linguistic state.
  3. Joint Training: Unlike post-hoc rescoring, CLAS is trained from scratch to utilize this context. To ensure the model remains robust when no context is relevant, the authors include a learnable "no-bias" vector that the model can attend to by default.
  4. The </bias> Token: A special symbol is inserted after matched bias phrases during training, forcing the model to explicitly signal when it has finished using a contextual phrase.

Visualizing Contextual Attention

The effectiveness of the dual-attention mechanism can be seen in how the model shifts its focus between the general "no-bias" state and specific phrases in the bias list as the utterance progresses.

Attention heatmap showing the model transitioning from the "no-bias" state to specific phrases like "talk to" and "what fruit are you" during decoding.

In the example above, the model successfully identifies the prefix "talk to" and then focuses its attention on the relevant long-tail phrase "what fruit are you" from the bias list. This dynamic shifting allows the model to leverage external knowledge without becoming "addicted" to the bias list for common words.

Key Results and Performance

CLAS demonstrates significant improvements across various contextual tasks compared to both vanilla LAS and traditional rescoring methods:

  • Songs Task: CLAS achieved a 6.9% Word Error Rate (WER), a massive improvement over the standard LAS model's 18.7% and even outperforming the best-tuned traditional rescoring method (9.4%).
  • Relative Gains: In specific configurations, CLAS provided up to a 68% relative improvement in WER.
  • Scaling with Bias-Conditioning: For large bias lists (e.g., the "Talk-To" set with 3,000+ phrases), the authors introduced Bias-Conditioning. By only "enabling" phrases once a specific prefix (like "Talk to") is detected, they reduced the WER on this difficult task from 14% to 5.6%.

Conclusion and Future Work

The CLAS model proves that joint optimization of the biasing mechanism with the ASR model is superior to modular, late-stage fusion. While the system currently faces scaling challenges as bias lists grow into the tens of thousands—where embedding overlap can cause performance degradation—it represents a major step toward truly personalized, context-aware speech recognition. Future research will focus on more algorithmic, automated ways to index and handle massive contextual vocabularies without increasing computational overhead.

Summary updated

Abstract

In automatic speech recognition (ASR) what a user says depends on the particular context she is in. Typically, this context is represented as a set of word n-grams. In this work, we present a novel, all-neural, end-to-end (E2E) ASR system that utilizes such context. Our approach, which we refer to as Contextual Listen, Attend and Spell (CLAS) jointly-optimizes the ASR components along with embeddings of the context n-grams. During inference, the CLAS system can be presented with context phrases which might contain-of-vocabulary (OOV) terms not seen during training. We compare our proposed system to a more traditional contextualization approach, which performs shallow-fusion between independently trained LAS and contextual n-gram models during beam search. Across a number of tasks, we find that the proposed CLAS system outperforms the baseline method by as much as 68% relative WER, indicating the advantage of joint optimization over individually trained components.
BibTeX
@inproceedings{pundak2018deep,
  author = {Golan Pundak and Tara N. Sainath and Rohit Prabhavalkar and Anjuli Kannan and Ding Zhao},
  title = {{Deep Context: End-to-end Contextual Speech Recognition}},
  booktitle = {SLT},
  year = {2018},
  url = {https://openreview.net/forum?id=8C3yHD5Bq9S},
}
Figure