Enhancing Code-Switching Speech Recognition With Interactive Language Biases

Hexin Liu, Leibny Paola García, Xiangyu Zhang, Andy W. H. Khong, Sanjeev Khudanpur

TL;DR

Researchers have developed a new method called Interactive Language Biases (ILB) to significantly improve Automatic Speech Recognition (ASR) for code-switching—the practice of alternating between languages (like Mandarin and English) in a single conversation. By injecting language-specific "hints" at both the acoustic frame level and the text token level, the model learns to better distinguish between languages, achieving a 7.8% relative improvement in accuracy over standard models.

What Problem Does This Paper Address?

Code-switching (CS) is a common linguistic phenomenon in bilingual societies, but it’s a nightmare for traditional ASR systems. Most speech recognizers are optimized for a single language; when a speaker suddenly jumps from Mandarin to English mid-sentence, the model often gets "confused," leading to high error rates.

Existing solutions usually try to solve this in one of two ways:

  1. Frame-level: Identifying the language of short snippets of audio (acoustic frames).
  2. Token-level: Predicting the language of the words or characters being generated.

The gap this paper identifies is that these two levels rarely talk to each other. Frame-level identification is often noisy because audio snippets are too short, while token-level identification lacks the raw acoustic grounding. The authors set out to create a system where these two resolutions of language information interact to reinforce one another.

Methods

The authors built their approach on a hybrid CTC/attention ASR model (using Conformer encoders and Transformer decoders). Their "Interactive Language Biases" (ILB) method introduces two main components:

  • Multi-Level Biasing: They don't just bias the final output. They inject language posteriors (probabilities of which language is being spoken) into the Encoder, the CTC module, and the Decoder simultaneously.
  • The Interaction Loop:
    • A Language Identification (LID) layer processes the encoder's output to provide frame-level hints.
  • A Language Diarization (LD) decoder provides token-level hints based on the text history.
  • Crucially, during training, the frame-level LID (which is unsupervised because we don't have frame-by-frame labels) is "guided" by the token-level labels via backpropagation. This allows the model to align acoustic features with linguistic labels more accurately.

Datasets

The study used the ASRU 2019 Mandarin-English code-switching challenge datasets:

  • Training: 500 hours of Mandarin-only data plus 200 hours of English-Mandarin code-switching data.
  • Evaluation: A 20-hour test set specifically featuring intra-sentence code-switching.
  • Preprocessing: Audio was converted into 83-dimensional features (log-fbank + pitch), and text was tokenized into a mix of 3,000 English byte-pair encodings and 3,920 Mandarin characters.

Key Insights and Ideas

  • Synergy is Key: Frame-level hints alone can actually hurt performance if they are inaccurate. However, when combined with token-level hints, the token-level information "compensates" for the noisy audio frames, leading to a much more robust model.
  • Internal vs. External Language Models: One of the most surprising findings was that adding an external Language Model (LM) during decoding—a standard trick to boost ASR—actually degraded performance for the ILB model. This suggests that by learning language biases, the ASR model develops a superior internal understanding of how code-switching works, making generic external LMs redundant or even harmful.
  • Visualizing "Clarity": By looking at the model's attention matrices (how it "looks" at audio to produce text), the researchers found that ILB produced much sharper boundaries between languages and smoother alignments compared to models using only token-level hints.

Key Results

The performance was measured using Mixed Error Rate (MER), which combines Word Error Rate (English) and Character Error Rate (Mandarin).

  • Baseline (Standard Hybrid Model): 12.8% MER
  • Token-level Bias only: 12.4% MER
  • Interactive Language Biases (Full ILB): 11.8% MER

This represents a 7.8% relative improvement over the baseline. The "Full ILB" configuration (biasing Encoder, Decoder, and CTC) consistently outperformed all single-module biasing strategies.

Limitations and Future Work

  • Language Imbalance: The dataset used was primarily Mandarin-heavy. The authors noted that token-level bias didn't show massive gains on its own because the language didn't switch frequently enough to challenge the multi-task baseline. Testing on more balanced or "rapid-fire" code-switching data would be a valuable next step.
  • Unsupervised Frame Labels: While the interaction helps, the frame-level LID is still trained without explicit ground-truth timestamps for language switches. Future work could explore using forced alignment to provide more "supervision" to the frame-level LID layer.
  • Computational Overhead: Adding multiple biasing layers and an extra LD decoder increases the parameter count and training time (the authors noted training for 80 epochs vs. the baseline's 70). Optimizing this for real-time edge devices remains a challenge.

Summary updated

BibTeX
@inproceedings{liu2024enhancing,
  author = {Hexin Liu and Leibny Paola García and Xiangyu Zhang and Andy W. H. Khong and Sanjeev Khudanpur},
  title = {{Enhancing Code-Switching Speech Recognition With Interactive Language Biases}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2024},
  doi = {10.1109/icassp48485.2024.10448335},
}

Loading related content...

Figure