Enhancing Code-Switching for Cross-lingual SLU: A Unified View of Semantic and Grammatical Coherence

Zhihong Zhu, Xuxin Cheng, Zhiqi Huang, Dongsheng Chen, Yuexian Zou

Abstract

Despite the success of spoken language understanding (SLU) in high-resource languages, achieving similar performance in low-resource settings, such as zero-shot scenarios, remains challenging due to limited labeled training data. To improve zero-shot cross-lingual SLU, recent studies have explored code-switched sentences containing tokens from multiple languages. However, vanilla code-switched sentences often lack semantic and grammatical coherence. We ascribe this lack to two issues: (1) randomly replacing code-switched tokens with equal probability and (2) disregarding token-level dependency within each language. To tackle these issues, in this paper, we propose a novel method termed SoGo, for zero-shot cross-lingual SLU. First, we use a saliency-based substitution approach to extract keywords as substitution options. Then, we introduce a novel token-level alignment strategy that considers the similarity between the context and the code-switched tokens, ensuring grammatical coherence in code-switched sentences. Extensive experiments and analyses demonstrate the superior performance of SoGo across nine languages on MultiATIS++.

Introduction

Spoken Language Understanding (SLU) is a critical component of voice-controlled systems, tasked with identifying user intents and extracting semantic slots. While SLU models perform exceptionally well in high-resource languages like English, their performance degrades significantly in low-resource or zero-shot scenarios. A common strategy to bridge this gap is cross-lingual transfer, where models are trained on English and evaluated on target languages. Code-switching—the practice of mixing source and target language tokens—has emerged as a powerful data augmentation technique for this purpose.

However, existing code-switching methods often suffer from two primary limitations. First, they typically employ random substitution, which may replace non-informative tokens (e.g., stop words) instead of task-critical keywords. Second, the resulting "Frankenstein" sentences often lack grammatical and semantic coherence, creating a noisy training signal that hinders model convergence.

Methodology: The SoGo Framework

To address these challenges, we propose SoGo (Saliency-based substitution and Grammatical cOherence). The framework consists of two core innovations designed to improve the quality of code-switched training data.

Saliency-based Substitution (SbS)

Instead of random selection, SoGo identifies "salient" keywords using gradient-based importance scores. By calculating the impact of each token on the model's prediction, we prioritize the substitution of words that carry the most semantic weight for intent detection and slot filling. These keywords are then replaced with their equivalents from a bilingual dictionary.

Token-level Alignment (TIA)

To maintain grammatical coherence, SoGo introduces a token-level alignment strategy within the lower layers of the multilingual BERT (mBERT) encoder. This component aligns the embeddings of substituted foreign tokens with the original English context. By focusing on the first six layers—which are known to capture syntactic information—SoGo ensures that the model maintains a unified contextual space despite the linguistic mixture.

Overview of the SoGo framework, including (a) saliency-based substitution and (b) token-level alignment within mBERT layers.

Experimental Results

We evaluated SoGo on the MultiATIS++ benchmark, covering nine languages. Our model was trained exclusively on English data and tested in a zero-shot manner on the remaining eight languages.

Performance Gains

SoGo achieved state-of-the-art results, with the SoGo_GL variant reaching an average overall accuracy of 57.02%, significantly outperforming previous benchmarks like LAJ-MCL (52.50%). The improvements were particularly pronounced in slot filling, a task that requires precise token-level understanding across languages.

The Impact of Saliency

A key finding of our study is the efficiency of saliency-based substitution. As shown in Figure 6, SoGo maintains high accuracy even when only 1% of keywords are substituted. In contrast, random substitution methods require much higher replacement rates to achieve comparable performance and exhibit a sharp decline as the number of keywords decreases.

Comparison of saliency-based vs. random keyword selection across varying percentages of substituted tokens.

Conclusion

SoGo provides a unified approach to enhancing code-switching for cross-lingual SLU by ensuring both semantic relevance and grammatical coherence. By intelligently selecting salient keywords and aligning them within the model's syntactic layers, we significantly improve zero-shot transfer performance. Future work will explore reducing reliance on bilingual dictionaries and incorporating explicit linguistic structures like dependency trees to further refine syntactic invariance.

Summary updated

BibTeX
@inproceedings{zhu2023enhancing,
  author = {Zhihong Zhu and Xuxin Cheng and Zhiqi Huang and Dongsheng Chen and Yuexian Zou},
  title = {{Enhancing Code-Switching for Cross-lingual SLU: A Unified View of Semantic and Grammatical Coherence}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  url = {https://openreview.net/forum?id=X597Q58y1U},
}
Figure