Effective Sentence Scoring Method Using BERT for Speech Recognition

Joonbo Shin, Yoonhyung Lee, Kyomin JungACML 2019

Abstract

Traditional Automatic Speech Recognition (ASR) systems rely on unidirectional language models for rescoring n-best hypotheses. While bidirectional context is known to be superior, effectively fusing left and right information has remained a challenge. This paper presents a novel sentence scoring method using a Bidirectional Self-Attention Network Language Model (biSANLM) based on the BERT architecture. By employing a masked language modeling objective to calculate the joint probability of a sentence through multiple passes, the proposed method achieves significant Word Error Rate (WER) reductions on the LibriSpeech benchmark, outperforming both unidirectional baselines and simple bidirectional ensembles without requiring task-specific fine-tuning.

Introduction: What Problem Does This Paper Address?

In Automatic Speech Recognition (ASR), an acoustic model typically generates an "n-best" list of possible transcriptions for a given audio clip. A Language Model (LM) is then used to "rescore" these hypotheses, picking the sentence that makes the most grammatical and contextual sense.

Historically, unidirectional LMs—which predict the next word based only on past words—have been the standard. Researchers have attempted to use bidirectional LMs (biLMs) to capture full context, but early attempts often simply concatenated independent forward and backward passes. Because the left and right contexts never truly interacted during feature extraction, these models barely outperformed unidirectional ones.

Comparison of unidirectional (a) and bidirectional (b) language model architectures.

While BERT solved this fusion problem in NLP via Masked Language Modeling (MLM), it is designed to predict missing words or classify text, not to assign a single probability score to an entire sentence. This paper bridges that gap, adapting BERT's architecture to measure the "naturalness" of a complete sentence for ASR rescoring.

Methods

The authors build a Bidirectional Self-Attention Network Language Model (biSANLM) based on the BERT architecture, but with key modifications for sentence scoring.

The biSANLM architecture (a) and the internal multi-head attention mechanism (b).

Model Architecture and Training

The biSANLM simplifies the standard BERT setup by stripping away the "next sentence prediction" task and segment embeddings, focusing purely on the Masked Language Modeling (MLM) task within single sentences. This allows the model to concentrate on the internal dependencies of a single utterance.

The N-Pass Scoring Algorithm

Traditional LMs score a sentence in one pass by multiplying the probabilities of each sequential word. Because BERT needs bidirectional context, the authors use a multi-pass workaround: for an $N$-word sentence, they create $N$ copies. In each copy, a different word is replaced with a [MASK] token. The model predicts the probability of the true word for each masked position. The final "sentence score" is the sum of the log-likelihoods of all $N$ masked words. This aggregated LM score is then linearly interpolated with the acoustic model's score to select the best transcription from the n-best list.

Datasets and Evaluation

The method was evaluated on the LibriSpeech ASR Corpus, a standard 1000-hour dataset of read English audiobooks.

  • Acoustic Model: A Listen, Attend and Spell (LAS) model trained on 960 hours of audio.
  • Language Model Training: 1.5GB of normalized text from the LibriSpeech corpus was used to train both the unidirectional and bidirectional LMs.
  • Evaluation Splits: Standard LibriSpeech splits (dev-clean, dev-other, test-clean, test-other).

Key Results and Insights

The proposed biSANLM consistently and significantly outperformed both the baseline acoustic model and unidirectional LMs. On the test-clean set, the biSANLM dropped the WER to 5.65% (from a 7.26% baseline). On the more difficult test-other set, it achieved 17.44% (from a 20.37% baseline).

True Context Fusion is Crucial

The paper proves that simply averaging a forward LM and a backward LM is insufficient. Forcing the model to predict a masked word using surrounding context through deep Transformer layers is what actually unlocks the power of bidirectionality. The biSANLM comfortably beat an ensemble combining forward and backward unidirectional LMs (6.18% / 18.22%).

Early-Sentence Robustness

Unidirectional LMs often struggle at the beginning of a sentence because they have no prior context. The biLM shines here; by looking ahead at the rest of the sentence, it easily corrects misrecognized words at the very beginning of an utterance.

Limitations and Future Work

Despite its success, the biSANLM does not appear to complement unidirectional models; experiments showed that ensembling the two did not yield additional gains. Furthermore, the scoring method requires $N$ separate forward passes through a Transformer to score a single $N$-word sentence. This makes inference significantly more computationally expensive and slower than a traditional causal language model, presenting a challenge for real-time applications.

Summary updated

BibTeX
@inproceedings{shin2019effective,
  author = {Joonbo Shin and Yoonhyung Lee and Kyomin Jung},
  title = {{Effective Sentence Scoring Method Using BERT for Speech Recognition}},
  booktitle = {ACML},
  year = {2019},
}
Figure