Introduction
Code-switching (CS)—the linguistic phenomenon where a speaker alternates between two or more languages within a single conversation—presents a significant challenge for modern Automatic Speech Recognition (ASR) systems. While humans navigate these transitions seamlessly, ASR models often struggle due to the extreme scarcity of high-quality, labeled code-switching audio data compared to monolingual corpora.
This research, a collaboration between Microsoft and Shanghai Jiao Tong University, focuses on improving Mandarin-English CS-ASR within the Transformer-Transducer (T-T) architecture. T-T models are the industry standard for "streaming" ASR, where text is generated in real-time as a user speaks. However, these models are notoriously difficult to train using text-only data because they lack an explicit attention mechanism between the encoder and decoder and utilize a "blank token" system that complicates the integration of external Language Models (LMs). This paper proposes a two-pronged strategy to overcome these hurdles: synthetic text generation and innovative data injection techniques.
Methodology
The researchers developed a pipeline consisting of two primary phases: the generation of realistic synthetic code-switching text and the injection of that text into the T-T model.
1. Code-Switching Text Generation
To create synthetic text that mimics natural speech patterns, the team employed a strategy based on linguistic substitution rather than random mixing:
- Machine Translation & Alignment: Parallel Mandarin-English sentences were aligned at the word level to identify corresponding terms.
- Frequency-based Substitution: Nouns and verbs were replaced across languages based on their frequency in real-world datasets. This ensured the synthetic text reflected natural switching behaviors, where English insertions typically constitute approximately 10% of a sentence.
2. Data Injection Strategies
Once the synthetic text was generated, the researchers explored two distinct methods for integrating this information into the T-T model:
- Explicit Injection (TTS Conversion): This "topline" approach involved converting the synthetic text into audio using a massive Neural Text-to-Speech (TTS) system featuring 18,000 unique voices. This resulted in 14,000 hours of synthetic audio. While highly effective, this method is computationally expensive and requires significant storage.
- Implicit Injection (Cross-modality Learning): This more novel approach avoids audio generation entirely. Instead, it forces the model to align the "latent space" of text and speech. By using a shared encoder, the model learns that the internal representation of a word (e.g., "apple") should be identical whether the input is an acoustic signal or a text string. The researchers evaluated three loss functions for this alignment: Mean Squared Error (MSE), BiInfoNCE (a contrastive loss), and "Modality Swap."
Experimental Setup and Results
The models were trained on a baseline of 1,800 hours of real Mandarin-English code-switching speech, augmented with noise and speed perturbations. The synthetic injection was then tested against three internal evaluation sets totaling 60 hours, covering scenarios such as online meetings, language instruction, and general dictation.
Key Findings
- Significant Error Reduction: The best-performing implicit model (utilizing MSE loss) achieved a 16% relative reduction in Token-based Error Rate (TER) compared to the baseline model.
- Parity with TTS: The implicit cross-modality approach performed nearly as well as the explicit TTS approach. This is a crucial finding, as it suggests that models can achieve high performance without the massive computational overhead required to generate and store tens of thousands of hours of synthetic audio.
- The Boundary Effect: The study found that synthetic injection specifically helps the model navigate the "boundary"—the transition point between Mandarin and English—which is typically where ASR errors are most frequent.
- TTS Artifacts: Interestingly, on "homogeneous" data (evaluation sets very similar in style to the training data), the cross-modality approach actually outperformed TTS. This suggests that the robotic "artifacts" sometimes present in synthetic audio can occasionally hinder performance on clean, human-like speech.
Discussion and Limitations
While the results are promising, the researchers noted a persistent disparity in performance between the two languages. The English Word Error Rate (WER) remained significantly higher (often exceeding 35%) than the Mandarin Character Error Rate (CER) (approximately 10%). This indicates that short, isolated English insertions remain the most difficult element for the system to master.
Furthermore, the current cross-modality alignment is "Mandarin-heavy." Because Mandarin is the dominant language in the training text, the model tends to prioritize alignment for Mandarin tokens, sometimes at the expense of rarer English patterns.
Conclusion
This research demonstrates that synthetic text, when properly generated and injected, can significantly bridge the data gap in code-switching ASR. By aligning the latent spaces of speech and text, researchers can achieve performance gains comparable to massive TTS-based data augmentation with a fraction of the computational cost. Future work will focus on balancing the cross-modality learning process to better support minority languages and leveraging even larger external text corpora to further refine the model's understanding of linguistic transitions.
Summary updated