Abstract
Code-switching (CS)—the practice of alternating between two or more languages in a single conversation—remains a significant challenge for Automatic Speech Recognition (ASR) systems. The primary obstacle is the scarcity of transcribed code-switched data, even when monolingual data for the constituent languages is abundant. This paper explores a novel method to train end-to-end (E2E) ASR models capable of handling code-switching using exclusively monolingual training data. By applying geometric constraints to the model's output embeddings, we force the internal representations of different languages to overlap, facilitating smoother transitions during inference. Our approach achieves up to a 4.5% absolute improvement in Mixed Error Rate (MER) on the SEAME corpus without the use of any bilingual training samples.
Introduction
While humans in multilingual environments switch between languages with ease, AI models struggle to replicate this behavior. Standard E2E models trained on monolingual data tend to "silo" languages into distinct regions of their mathematical latent space. Because the output embeddings for English and Mandarin, for example, are mapped far apart, the model finds it difficult to "jump" from one language to another mid-sentence. This research addresses the "embedding gap" by introducing a cross-lingual signal during training that does not rely on actual code-switched speech.
Methodology
The proposed system utilizes a Hybrid CTC/Attention architecture. To prevent the language representations from drifting apart, the researchers introduced two mathematical constraints to the loss function during the training phase:
- Jensen-Shannon Divergence (JSD): This constraint forces the statistical distributions of the output embeddings for both languages to look similar. It ensures that the "shape" of the data clusters is comparable across the language boundary.
- Cosine Distance (CD): This constraint minimizes the distance between the centroids (the average centers) of the language clusters, effectively pulling the two language distributions toward the same region in the embedding space.
By integrating these constraints, the model is forced to map similar acoustic and semantic concepts from different languages into the same internal region. This acts as a bridge, allowing the decoder to transition between languages more fluidly during the recognition of code-switched speech.
Experimental Setup
The study utilized the SEAME corpus, a benchmark dataset for conversational Mandarin-English code-switching. To rigorously test the hypothesis that monolingual data alone is sufficient, the researchers modified the training set by removing all code-switched utterances. The model was trained only on the remaining purely Mandarin and purely English segments.
Evaluation was conducted on two subsets: test_man (Mandarin-dominant) and test_eng (English-dominant), both of which contained significant natural code-switching.
Results and Discussion
The performance was measured using the Mixed Error Rate (MER), which accounts for errors across both languages. The results demonstrated that the constrained embedding approach significantly outperforms standard monolingual training:
- Mandarin-dominant set: The baseline E2E model achieved an MER of 49.5%. With the addition of JSD and CD constraints, the MER dropped to 45.6% (a 3.9% absolute improvement).
- English-dominant set: The improvement was even more significant, with the MER decreasing from 58.9% to 54.4% (a 4.5% absolute improvement).
Visual analysis using Principal Component Analysis (PCA) provided a clear explanation for these gains. In the baseline model, English and Mandarin tokens formed two entirely separate clusters. In the constrained model, these clusters merged into a single, overlapping distribution. This overlap provides the necessary acoustic-phonetic bridge that allows the model to switch languages even when it has never seen a bilingual sentence during training.
Conclusion
This research demonstrates that the structural organization of a model's output space is as critical as the training data itself. By enforcing distribution and centroid alignment, researchers can mitigate the need for expensive code-switched datasets. Future work will explore the scalability of this method to larger datasets and its applicability to language pairs with different scripts, such as Arabic and English, where a shared subword vocabulary is not naturally present.
Summary updated