Language models trained mostly on single-language text handle code-switching poorly. Code-switching means alternating between languages inside one conversation or sentence, as Hindi-English ("Hinglish") speakers do. Existing studies measure this weakness on short inputs, such as a tagged sentence, a classified tweet, or a translated line. This note asks what happens over long generations. When a model keeps producing a Hinglish dialogue for thousands of tokens, does its language mixture stay near how people actually mix, or does it slide steadily toward the dominant language until it stops switching? Control theory calls this second outcome an absorbing state: a condition the process enters and never leaves. A finite-context training objective says nothing about a model's long-run behaviour. That is the same blind spot that planning researchers hit when they move from a fixed horizon to an unbounded one.
We propose to treat the sequence of languages a model emits as a stochastic process and to measure its long-run statistics. The first is the stationary distribution: the fraction of tokens in each language once the process settles. We also measure the switch rate and the distribution of run lengths, meaning how many consecutive tokens stay in one language. These are compared with human corpora. We then correct drift with a self-training loop whose training examples are reweighted, so that the long-run language occupancy of the model's own generations matches human occupancy.
The contribution has two parts. The first is a diagnostic that nobody has run: a horizon-dependent measurement of monolingual collapse. The second is a specific, testable prediction from recent theory, namely that naive self-training should make collapse worse. The proposed fix is built to avoid that failure.
Core Claim
Incoherence in goal-conditioned autoregressive models studies autoregressive generators trained on fixed offline data. It shows that such a generator assumes its future follows the training distribution rather than its own behaviour at generation time. It also proves that repeatedly retraining on the model's own trajectories corrects this in deterministic settings, and that this retraining is equivalent to temperature annealing, i.e. progressively sharpening the output distribution. The paper works only on toy control problems over finite horizons, and it explicitly leaves the infinite-horizon case open.
We read the annealing equivalence as a warning for code-switching. Sharpening a distribution in which one language dominates should push generations further toward that language. Self-training, the obvious remedy for the mismatch between training and generation, would then amplify monolingual bias rather than fix it.
Our claim has three parts. First, multilingual models show measurable long-horizon drift of their language occupancy away from human statistics. Second, unweighted self-training accelerates this drift. Third, self-training reweighted by the ratio of human to model long-run occupancy removes the drift without hurting fluency or switch-point grammar. The third part is the least certain, and the experiments are designed to test it directly.
Research Program
Tagging. The language of each token $z_t \in \{A, B\}$ is assigned by a language-identification tagger fine-tuned on the Hindi-English and Spanish-English portions of LinCE. Token-level identification on these data is reliable: GLUECoS reports 96.6 F1 for Hindi-English, and LinCE reports low-level tasks often exceeding 90% accuracy.
Language state. We define a compact state $s_t = (z_t, \min(r_t, R))$, where $r_t$ is the current run length and $R$ is a truncation cap of about 20 tokens. For a model $p_\theta$ and a long rollout of $L$ tokens, we estimate the occupancy $d_\theta(s)$, the fraction of positions spent in state $s$. We compute the same quantity $d^*(s)$ on human text. The drift statistic is
$$D(L) = \mathrm{KL}\big(d^* \,\|\, d_\theta^{[L/2,\,L]}\big),$$
where $d_\theta^{[L/2,L]}$ is the occupancy measured only over the second half of rollouts of length $L$. A model that holds human-like mixing keeps $D(L)$ flat as $L$ grows. A model that is collapsing shows $D(L)$ rising, together with a minority-language fraction falling toward zero.
The correction: long-run occupancy-reweighted self-training. This borrows the idea behind Breaking the Curse of Horizon: Infinite-Horizon Off-Policy Estimation. That work corrects for a mismatch between the long-run state distributions of two policies by importance-weighting per state. It avoids weighting whole trajectories, whose variance grows with length. At iteration $k$ we sample long rollouts from the current model and refit:
$$\theta_{k+1} = \arg\max_\theta \; \mathbb{E}_{y \sim p_{\theta_k}} \sum_{t=1}^{L} w_k(s_t)\, \log p_\theta(y_t \mid y_{<t}), \qquad w_k(s) = \frac{d^*(s)}{d_{\theta_k}(s)}.$$
The weights are clipped. We mix in a fixed fraction of human code-switched text, and we drop rollouts whose likelihood under the frozen base model falls below a threshold, which guards against degenerate text. Because the weights are indexed by the small language state rather than the full token context, they stay low-variance even for long rollouts.
What is new relative to the closest work. The Karwowski-Douglas operator is the unweighted version of this loop, applied in control. We apply it to language, predict that it fails, and add the long-horizon occupancy correction that their paper names as the missing infinite-horizon ingredient.
Relation to other code-switching work. Two sentence-level methods supply the grammar-sensitive comparison points. Language Informed Modeling of Code-Switched Text jointly predicts tokens and language tags. Improving Pretraining Techniques for Code-Switched NLP concentrates masking at switch points. Both train on bounded windows with local losses, so neither constrains what happens thousands of tokens out.
Analyzing the Role of Part-of-Speech in Code-Switching shows that switching is governed by syntax local to the switch point. This is a constraint on our method, not support for it. Matching global mixing ratios is worthless if switches land in ungrammatical places, so we also track the part-of-speech distribution at switch points.
Evidence that motivates the study. Multilingual Large Language Models Are Not (Yet) Code-Switchers finds that mixed-language prompts conflict with monolingual priors, and that adding more in-context examples can lower accuracy. GupShup finds that 77.8% of mBART summaries of Hinglish dialogues contain incorrect inferences. Neither paper measures language occupancy over long outputs.
Model and data. The base model is an open multilingual decoder of the BLOOMZ family benchmarked by Zhang et al., adapted with parameter-efficient fine-tuning. Human reference statistics come from three sources: the Romanized source dialogues of GupShup, the Hinglish blog corpus of Chandu et al., and Spanish-English text from LinCE and Sentimix. The Spanish-English data separates script effects from mixing dynamics, which matters because CS-FLEURS reports that distinct-script pairs are about 3x worse than same-script pairs in speech.
Baselines
Do-nothing reference. The base model is fine-tuned with ordinary cross-entropy on the same human code-switched text and sampled with tuned temperature and nucleus settings. It answers the most basic question: does drift exist at all, and at what horizon? No reported result was found on Lacuna for long-horizon language occupancy of any code-switching model, so this number is itself a first measurement.
Strongest grammar-aware training method. This combines switch-point-targeted masking in the style of SWITCHMLM from Das et al. with the joint token-and-language-tag objective of Chandu et al., adapted to the decoder. On Chandu et al.'s own corpus, their language-aware model reports test perplexity 19.52, against 20.92 for the base AWD-LSTM. We report perplexity on that held-out split so that our fluency comparison is anchored to a published number. Das et al. report a 5.8 F1 relative gain on Hindi-English question answering over standard masking. We do not rerun that task, because it does not measure generation.
Decoding-time feedback controller. This is the most dangerous competitor. At each step it adds a bias to the logits of language-A or language-B tokens, proportional to the gap between the running mixture and the human target, much as a proportional-integral controller would. It needs no training and directly enforces long-run occupancy.
Unweighted self-training. This is the Karwowski-Douglas operator applied to language, with the same rollouts, filtering, and number of iterations as our method but $w \equiv 1$. It tests the collapse prediction.
Short-horizon ablation. Here the occupancy weights are computed only from the first 64 tokens of each rollout. This isolates whether the long-horizon part of the correction is what matters.
Fairness. All trained variants use the same human data, the same number of generated tokens per iteration, the same parameter-efficient setup, and an equal hyperparameter search budget of about 20 trials, selected on a development split of $D(L)$ plus perplexity.
What counts as beating a baseline. Our method beats a baseline if $D(L)$ at $L = 4096$ is lower with non-overlapping bootstrap intervals, while held-out human-text perplexity rises by no more than 2% and switch-point part-of-speech divergence is no worse.
Why not just…?
Why not just steer the language mix at decoding time? This may work for the headline ratio, and we take it seriously. A controller that forces switches whenever the running ratio lags will fix occupancy, but it is blind to the localized grammar that Chi et al. document. It will insert switches at points where people would not. We measure this through the divergence of part-of-speech distributions at switch points and through blind ratings of naturalness by bilingual annotators.
If the controller matches our method on both measures, then the training-time correction adds nothing. In that case we will say so, and the contribution reduces to the drift diagnostic and the collapse finding.
Why not just fine-tune on more code-switched data, synthetic or natural? More data changes the training distribution but does not change the mismatch between how the model is trained and what it sees when it continues its own text. That mismatch is exactly what Karwowski and Douglas identify as structural. Existing synthetic-data gains also plateau. In GLUECoS, training on synthetic mixed text reaches 96.6 F1 on language identification but only 63.1% accuracy on inference. In CS-FLEURS, synthetic speech reduces CER from 14.38 to 12.67 but leaves errors more than 2x the monolingual level.
The do-nothing baseline is trained on all human data we have. If it shows no drift, the premise of this proposal is false.
Why not just prompt a larger model with code-switched examples? Zhang et al. report that prompted multilingual models trail small fine-tuned ones: about 19 versus 28.5 BLEU on MixMT, and under 20 versus 80+ F1 on 5-shot language identification. Their accuracy also falls as more mixed examples are added. We include a few-shot prompted condition in the drift measurement to test whether in-context examples slow drift or speed it.
Why not just train on longer contexts? Longer windows push the problem further out but do not remove it. We test this by training the do-nothing baseline at two context lengths and checking whether the onset of drift in $D(L)$ scales with the window length.
Proposed Experiments
Check 1: does drift exist? We seed 500 rollouts per condition from GupShup dialogue openings and from blog-corpus paragraphs, generate out to 4096 tokens, and plot the minority-language fraction and $D(L)$ against position alongside the human curves. Our hypothesis predicts a rising $D(L)$ for the do-nothing baseline on Hinglish, and likely a steeper rise than for Spanish-English.
Check 2: does naive self-training worsen collapse? Across three iterations, unweighted self-training should lower the minority-language fraction relative to the do-nothing baseline, as the annealing equivalence predicts. If it does not, the theoretical motivation for weighting weakens and we report that.
Check 3: does the long-horizon correction work, and is the horizon what matters? Our method should hold $D(4096)$ near the level human text shows between its own halves. It should do so without the perplexity or switch-point penalties that the controller is expected to pay, and it should beat the short-horizon ablation specifically at large $L$.
Downstream effect. We fine-tune each variant as a Hinglish-summary generator on GupShup. We report ROUGE against the published mBART figure for English summaries (ROUGE-1 43.14, ROUGE-2 16.83), noting that the task differs, together with the language fidelity of the Hinglish summaries. This tests whether stable long-run mixing carries over to a task people care about.
References
- Incoherence in Goal-Conditioned Autoregressive Models
- LinCE: A Centralized Benchmark for Linguistic Code-switching Evaluation
- GLUECoS: An Evaluation Benchmark for Code-Switched NLP
- Breaking the Curse of Horizon: Infinite-Horizon Off-Policy Estimation
- Language Informed Modeling of Code-Switched Text
- Improving Pretraining Techniques for Code-Switched NLP
- Analyzing the Role of Part-of-Speech in Code-Switching: A Corpus-Based Study
- Multilingual Large Language Models Are Not (Yet) Code-Switchers
- GupShup: Summarizing Open-Domain Code-Switched Conversations
- CS-FLEURS: A Massively Multilingual and Code-Switched Speech Dataset