Abstract
Zero-shot cross-lingual learning aims to transfer knowledge from resource-rich languages to low-resource ones without target-specific labels. However, multilingual models like mBERT often suffer from a "contextual gap" where semantic representations across languages remain unaligned. We present CoSDA-ML, a framework that dynamically generates code-switched training data by replacing source tokens with translations from multiple target languages. This approach forces the model to align diverse languages into a single shared semantic space during training, significantly improving zero-shot performance across various tasks including NLI, sentiment analysis, and dialogue state tracking.
The Problem: The Contextual Gap
In zero-shot cross-lingual learning, models are typically trained on a resource-rich language (usually English) and expected to perform well on target languages without seeing any labeled data for them. Multilingual models like mBERT are the current standard, but they possess an inherent "contextual gap." Because they are pre-trained on monolingual corpora, the model's internal representations of the same concept in different languages often fail to align. Existing solutions, such as bilingual projection, are often inefficient as they align only one pair of languages at a time and frequently require rare parallel corpora.
Methods: Dynamic Multi-Lingual Code-Switching
CoSDA-ML (Multi-lingual Code-Switching Data Augmentation) addresses these issues by creating synthetic code-switched training data on the fly using bilingual dictionaries (e.g., from the MUSE project). Instead of using parallel sentences, the process follows three dynamic steps during each training batch:
- Sentence Selection: Randomly decide which sentences in a batch will be augmented.
- Token Selection: Within those sentences, randomly pick specific words to be replaced.
- Replacement Selection: For each chosen word, randomly select a target language from a pool and replace the word with its translation.
Because this happens dynamically, the model never sees the exact same "mixed" sentence twice. This encourages the model to use the surrounding context to bridge the gap between languages, learning that tokens from different languages are interchangeable when they appear in the same structural positions.
Key Insights: Aligning the Semantic Space
The core innovation of CoSDA-ML is using context as a universal aligner. By placing foreign words in a familiar source-language context, the model implicitly learns that "apple" and "manzana" belong in the same semantic space.
This approach allows a single model to align all target languages simultaneously into one shared space. Furthermore, the method is encoder-agnostic; while it significantly boosts mBERT and XLM, it also improves simpler architectures like BiLSTMs, proving that the benefit lies in the data augmentation strategy itself.
Key Results
CoSDA-ML consistently outperformed standard mBERT and the more powerful XLM model across five distinct NLP tasks covering 19 languages:
- XNLI: Achieved an average accuracy of 75.3%, a significant jump over mBERT (66.3%) and XLM (72.4%).
- Document Classification (MLDoc): Improved average accuracy to 81.8% compared to mBERT’s 74.5%.
- Dialogue State Tracking: In Thai intent detection, accuracy skyrocketed from 28.2% (mBERT) to 76.8%.
- Data Efficiency: The framework is particularly effective when training data is scarce, achieving state-of-the-art results using only 10% of available English training data in some tasks.
Limitations and Future Work
The authors acknowledge that the method depends on the quality of bilingual dictionaries. Word-for-word replacement ignores polysemy and grammatical nuances like gender agreement, which can lead to noisy training data. Additionally, while CoSDA-ML aligns semantics well, it does not explicitly handle differences in word order (syntax) between languages. Future work may explore more "intelligent" code-switching strategies to address these complexities.
Summary updated