Abstract
Code-switching (CS), the practice of alternating between languages within a single conversation, presents a significant challenge for monolingual Natural Language Processing (NLP) systems. This paper introduces a novel "task-free" semantic learning framework that utilizes code-switching as a bridge for cross-lingual understanding. By implementing a Semantic Invariance Loss ($L_{sil}$), the model is constrained to map different language-mixed versions of the same sentence to a unified semantic representation. Experimental results across speech recognition, translation, and large language model (LLM) generation demonstrate substantial performance improvements, highlighting the efficacy of explicit semantic alignment in multi-lingual contexts.
Introduction
Code-switching is a common linguistic phenomenon (e.g., "I want to eat 苹果") that remains difficult for standard NLP models due to data scarcity and the "representation gap"—the failure to recognize that "You are so cute," "你 so cute," and "你真可爱" share a singular semantic core. Traditional approaches often treat CS as a simple data augmentation technique or an isolated task. In contrast, this work proposes that code-switching can serve as a mediator to bind disparate language expressions into a shared semantic space.
Methodology: Semantic Invariance Learning
The proposed framework employs a unified architecture designed for Automatic Speech Recognition (ASR) and Automatic Speech Translation (AST).
System Architecture
- Acoustic Encoder: Utilizes a "Conformer" structure, combining Convolution and Transformer layers to extract high-level features from raw audio.
- Multi-Task Decoder: A Transformer-based decoder capable of generating three distinct outputs for a single input: an English translation, a Chinese translation, and a code-switched transcription.
Semantic Invariance Loss ($L_{sil}$)
The core innovation lies in enforcing semantic consistency across different linguistic outputs. The model extracts a "semantic vector" for each output (via [CLS] tokens or average pooling) and minimizes the distance between these vectors using KL divergence or Mean Squared Error. This forces the model to project all variations of a sentence into the same region of a language-agnostic semantic space, enhancing robustness.
Experimental Setup
The framework was evaluated on several benchmarks:
- ASRU 2019: Mandarin-English code-switching (200 hours).
- Fisher Dataset: English-Spanish code-switching utterances.
- TED English-Chinese: Standard speech translation to test generalization.
- Llama 2 (7B & 13B): Assessing improvements in LLM code-switching generation.
Results and Discussion
The proposed method consistently outperformed baseline models. In ASR tasks on the ASRU 2019 dataset, the Mix Error Rate (MER) decreased from 11.25% to 10.37%. Translation quality on the Fisher dataset saw BLEU scores rise from 25.31 to 27.02. Furthermore, fine-tuning Llama 2-13B with $L_{sil}$ increased the qualification rate of generated code-switching text from 44% to 59%.
Visualization using t-SNE confirms that the model learns conceptual representations rather than just word-level mappings. As shown in the figure above, the proposed model clusters cross-lingual synonym pairs significantly more tightly than standard multi-task models, validating the "semantic invariant" hypothesis.
Conclusion and Future Work
This research demonstrates that explicit semantic modeling via code-switching significantly improves multi-lingual performance. While effective, the approach currently requires "triplet" data (audio, transcription, and dual translations), which can be costly. Future research will focus on extending this constraint to more language pairs and exploring its utility in low-resource settings where annotated code-switching data is minimal.
Summary updated