TL;DR
Task-oriented semantic parsing systems frequently break down when users mix languages (code-switching), primarily due to a severe lack of labeled training data. This paper introduces CSTOP, a new dataset of 5,800 Spanglish utterances, and demonstrates how clever data augmentation techniques—specifically Translate-and-Align and a generative Match-and-Filter approach—can leverage abundant English data to bridge the code-switching performance gap by two-thirds.
What Problem Does This Paper Address?
Modern virtual assistants are expected to understand natural, spoken language. However, in many bilingual communities, speakers naturally alternate between languages within a single conversation or sentence—a phenomenon known as code-switching (CS). For example, a user might say, "Dime el clima para next Friday" (Tell me the weather for next Friday).
To parse this, a model must perform task-oriented semantic parsing: identifying the overall intent (IN:GET_WEATHER) and extracting specific slots (SL:DATE_TIME for "para next Friday").
Building these parsers is incredibly difficult because:
- Labeled code-switched data is scarce and requires expensive bilingual annotators.
- Code-switching patterns are highly dynamic, changing across regions, domains, and time.
The authors tackle this bottleneck by exploring how state-of-the-art cross-lingual language models can generalize to code-switched data when developers only have access to standard English datasets and either zero or very few code-switched examples.
Methods
The authors evaluate several architectures, including a baseline BiLSTM (using frozen multilingual MUSE embeddings), XLM, and XLM-R. To boost performance without massive manual data collection, they introduce two distinct data augmentation strategies:
1. Translate-and-Align (Zero-Shot Setting)
When no code-switched data is available, the authors translate existing English datasets into Spanish. To preserve slot labels, they project the annotations from English to the translated Spanish text. They compare two alignment methods:
- Attention Alignment: Pulling alignment directly from a Neural Machine Translation (NMT) model's attention scores.
- Unsupervised Word Alignment (
fast-align): A statistical approach that allows many-to-many token mappings.
2. Match-and-Filter (Few-Shot Setting)
If a tiny sliver of code-switched data (~100 sentences) is available, the authors use a generative approach to expand it:
- Match: For every code-switched sentence, they find the top-$K$ closest English sentences in their dataset based on Levenshtein (edit) distance.
- Train: They fine-tune BART (a generative encoder-decoder model) on this pseudo-parallel corpus to learn how to map English sentences into Spanglish.
- Filter: They use the fine-tuned BART to generate new Spanglish variations from English data via beam search, filtering out any generations that produce invalid semantic parse trees or mismatching intents.
Datasets
- CSTOP (Code-Switched Task-Oriented Parsing): The core contribution dataset containing 5,800 Spanglish utterances across two domains: Weather (slot-heavy, averaging 1.6 slots/utterance) and Device (intent-heavy, averaging 0.8 slots/utterance). The data is split into 4,077 training, 1,167 testing, and 559 validation utterances.
- TOP Dataset: A standard English monolingual dataset used for cross-lingual transfer. The authors also released 1,000 new English Device utterances to complement it.
Key Insights and Ideas
- Many-to-Many Alignment is Crucial for Slots: Attention-based alignment often assumes a strict one-to-one word mapping, which fails during translation. For instance, the English word "percent" translates to the two-word Spanish phrase "por ciento". Unsupervised tools like
fast-alignhandle these length changes gracefully, preventing noisy slot boundaries.
- BART Can Generate Spanglish Out-of-the-Box: Surprisingly, even though BART was primarily pre-trained on English, it proved highly effective at generating Spanglish when fine-tuned on a tiny parallel corpus. The authors hypothesize this is due to the implicit presence of Spanish text snippets within English web data and shared sub-word tokens.
- The Power of Cross-Lingual Pre-training: Massive models like XLM-R build such strong shared representations that training on just the native substrate language (Spanish) yields performance nearly identical to training on both English and Spanish data.
Key Results
The primary evaluation metric is exact-match accuracy (requiring both the intent and all slots to be perfectly predicted).
- Full-Data Upper Bound: XLM-R trained on the entire CSTOP dataset achieves 94.4% accuracy.
- Zero-Shot Baseline: Training XLM-R purely on English data yields 66.6% accuracy on Spanglish. Adding the Translate-and-Align data pushes this up to 69.2%.
- Few-Shot Breakthrough: In a restrictive few-shot setting (only 100 Spanglish examples), vanilla XLM-R scores a low 61.2%. However, pre-training on English data jumps this baseline to 82.6%.
- The Winning Combo: Combining English data, translated Spanish data, and the generative Match-and-Filter augmentation achieves 84.8% accuracy. This effectively closes the initial 30-point gap between zero-shot and full-data settings by two-thirds.
Limitations and Future Work
While the proposed augmentation techniques are entirely generic and do not rely on language-specific tools like constituency parsers, this study focused exclusively on Spanglish (Spanish+English). The authors note that validating these techniques on other prominent code-switched pairs (such as Hindi+English) and combining them with other cross-lingual data generation frameworks are important directions for future research.
Summary updated