
Detecting Code-Switching via Language-Selective Dimensions in Speech Models

Code-switching (CS), alternating between languages within one utterance, is common in multilingual speech but underrepresented in pretraining corpora. Finding CS utterances in large speech collections is therefore useful for building more representative training data. The standard route is to transcribe the audio and detect language alternation in the text, but that depends on accurate multilingual transcriptions, which are hard to obtain. The authors propose a lightweight method that detects CS directly from the speech signal.
The method works with pretrained speech encoders by exploiting frame-level language information. Using monolingual recordings, they identify hidden-state dimensions that are selectively activated by particular languages; then they aggregate frame-level activations across those dimensions to decide whether an utterance contains both languages. Only a small CS set is needed to tune the decision rule, so no full detector is trained and no transcriptions are required.
On CS-FLEURS, which covers 14 language pairs, the Whisper-small encoder reaches a mean F1 of 0.798. That compares favorably with a CNN (0.776) and a HuBERT linear baseline (0.751) trained for monolingual language identification. The results suggest pretrained speech encoders already encode enough information to identify code-switched utterances. The paper frames the method as a lightweight tool for filtering large speech corpora; the detection is utterance-level, indicating presence of both languages rather than the exact switching boundaries.


