Code-Switching and Syntax: A Large-Scale Experiment (2025)

Abstract: The theoretical code-switching (CS) literature provides numerous pointwise investigations that aim to explain patterns in CS, i.e. why bilinguals switch language in certain positions in a sentence more often than in others. A resulting consensus is that CS can be explained by the syntax of the contributing languages. There is however no large-scale, multi-language, cross-phenomena experiment that tests this claim. When designing such an experiment, we need to make sure that the system that is predicting where bilinguals tend to switch has access only to syntactic information. We provide such an experiment here. Results show that syntax alone is sufficient for an automatic system to distinguish between sentences in minimal pairs of CS, to the same degree as bilingual humans. Furthermore, the learnt syntactic patterns generalise well to unseen language pairs.

## introduction language contact occurs when language communities intersect. one product of nearly all language contact situations is the phenomenon of code-switching @xcite . codeswitching (henceforth cs) occurs when multilingual speakers use more than one language in an utterance. it is generally agreed that bilinguals have shared knowledge of what constitutes acceptable cs @xcite . however, every cs model ever proposed has been refuted in subsequent investigations, which presented data that the model is unable to explain @xcite @xcite @xcite . computational experiments have aimed at the comparison of existing theories, but still no one single theory has emerged @xcite . one general consensus of these decades of theoretical study is that the syntactic structure of the cs utterances are a good starting point any future theory @xcite @xcite . this postulate can be traced back to the equivalence constraint @xcite , a claim that cs can only occur at points when the surface structure of the contributing languages align. this precise theoretical claim has since frequently been challenged (see e.g. @xcite , but no large-scale empirical evidence has been brought forward. in the present work, we do not aim to compare existing theories of cs or propose any new theory of cs. instead, our goal is to empirically answer the question: is syntactic structure alone sufficient to distinguish naturally-observed from synthetically manipulated cs? any future theory of cs will only stand the test of time if it can be successfully applied across a wide range of data sources and language pairs. we will therefore also aim to empirically answer the question: to what extent do syntactic cs patterns in one language pair generalise to others? a consideration in this second question is the domain of cs under investigation; pron aux pron part adp det noun verb cconj sconj pron noun verb aux nsubj aux obj advmod case det obl cc mark nsubj obj aux conj er hat nicht für die controversy apologised sondern dass er exols geworried hat pron aux part verb adp det noun cconj sconj pron verb noun nsubj aux advmod case det obl cc mark nsubj obj conj figure 2: example input to the gnn. original cs sentence and alignments provided only for reference. yellow is german, green is english and grey is named entities, words of mixed morphology or punctuation. in previous work @xcite , we designed an evaluation methodology and benchmark that makes it possible to answer these questions. our benchmark contains up to 1,000 minimal pairs of cs sentences each for 11 language pairs. as part of the validation of that benchmark, a sample of minimal pairs was judged by at least one bilingual for all language pairs. the construction of the minimal pairs involves the translation of a cs sentence into two monolingual versions, as shown in figure 3 . this makes it possible to run a universal dependency parser @xcite . additionally, cs information is retained by mapping word-level language identification onto the words in the monolingual translations. a minimal pair is then algorithmically created by changing the language of one word at the switch point. in the previous work, we tested offthe-shelf language models on the task of predicting how relatively acceptable a sentence is compared to its counterpart in a minimal pair. in this paper, we present a trained computational model for the same task. it is neuro-symbolic. as input, instead of the surface forms of the sentences, it receives the syntactic analyses of the two monolingual versions. good performance of such a model would be empirical evidence that syntax alone can predict where bilinguals are likely to switch language in a cs sentence. furthermore, we will train the model only on german-english written cs, and test it on data from the same language pair, other language pairs of written cs and language pairs of spoken cs. figure 1 gives a summary of results for 3 language pairs (written german-english cs, written spanish-english cs and spoken turkish-german cs); they are representative for many other language pairs for which we do not have space here (see appendix figure 4 ). we can see that training based on syntax leads to good performance on the benchmark. in order to approach the human ceiling, training data on the order of 6,000-8,000 pairs is necessary. further, the learnt patterns generalise well to written cs data from an unseen language pair. when transcriptions of spoken cs are used instead of written cs, generalisation still holds but is weaker. the results provide concrete empirical evidence -on a scale much larger than previous experiments -that general syntactic patterns in cs do exist. foot_0 ## computational model of cs we design a model that is trained to take as input syntactic information from the contributing languages of a cs sentence and output a prediction of the more acceptable cs sentence in a minimal pair. ## conclusion the current experiment provides concrete empirical evidence -on a scale much larger than all previous experiments -that general syntactic patterns influence the way in which cs operates. we propose csntax-gnn -a gnn trained on a syntactic representation of minimal pairs that is universal across languages. on the same language pair as it is trained, it achieves performance comparable to bilingual humans. we also posed the question to which extent syntactic patterns in one language pair generalise to others. for unseen written language pairs we observe a drop in performance (avg.