Introduction
Code-switching (CS)—the practice of alternating between two or more languages in a single conversation—is a prevalent linguistic phenomenon in multilingual regions like Singapore and Hong Kong. For Automatic Speech Recognition (ASR) systems, CS presents significant challenges. Primarily, there is a severe scarcity of large-scale transcribed code-switching data compared to monolingual corpora. Furthermore, standard bilingual models often struggle to capture the distinct acoustic nuances of both languages simultaneously, frequently settling for a suboptimal "middle ground."
To address these issues, researchers have proposed the Multi-Encoder-Decoder (MED) Transformer. This architecture maintains language-specific expertise through specialized encoders while unifying the decoding process to handle fluid transitions between languages.
The MED Architecture
The core innovation of the MED Transformer is its departure from the standard single-encoder Transformer design. Instead, it utilizes a symmetric dual-encoder structure.
Key Components:
- Symmetric Language-Specific Encoders: The model features two parallel encoder branches, one optimized for English and the other for Mandarin.
- Language-Specific Multi-Head Attention (MHA): The decoder employs specialized attention mechanisms to "attend" to the outputs of both encoders. These representations are averaged to inform the final linguistic prediction.
- Intra-language Transfer Learning: To mitigate data scarcity, the English encoder is pre-trained on 960 hours of LibriSpeech, and the Mandarin encoder is pre-trained on 1,000 hours of AISHELL-2. The entire system is then fine-tuned on the SEAME code-switching dataset.
- Multi-Objective Learning: Training incorporates both Connectionist Temporal Classification (CTC) loss and standard Attention loss to ensure precise alignment between speech signals and text.
Language Specialization Analysis
A critical insight of this research is that specialization outperforms generalization in CS tasks. By keeping encoders separate, the model preserves high-level discriminative features for each language.
Visual analysis of encoder activations confirms this specialization. When Mandarin is spoken, the Mandarin encoder shows significantly higher activity and variance compared to the English encoder, and vice versa. This demonstrates that the encoders have successfully learned to focus on their respective target languages, while the decoder acts as a unifier to integrate these distinct signals without the "competition" often seen in dual-decoder systems.
Performance and Results
The MED Transformer was evaluated on the SEAME corpus, a Mandarin-English conversational dataset. Evaluation was split into evalman (Mandarin-dominant) and evalsge (Singapore English-dominant) sets.
The system achieved a new state-of-the-art for the SEAME benchmark, delivering a 10.2% relative error reduction in Token Error Rate (TER) on the Mandarin-dominant set and a 10.8% reduction on the English-dominant set compared to standard Transformer baselines. Final TER reached 16.7% on evalman and 23.1% on evalsge, significantly outperforming traditional hybrid systems like Kaldi LF-MMI.
Limitations and Future Outlook
While highly effective, the MED architecture does introduce computational overhead, as the dual-encoder setup nearly doubles the parameters and computation required during the encoding stage. Additionally, scaling this symmetric approach to three or more languages (e.g., English, Mandarin, and Malay) would require further architectural refinements to maintain efficiency. Future work will focus on testing the MED Transformer on larger, more diverse code-switching datasets and optimizing the architecture for resource-constrained environments.
Summary updated