Code-Switching and Mixed-Language Text › Deployment Failure Modes
Language AI HandbookAll chapters Use this checklist to trace where mixed-language text can fail during routing, evaluation, and serving.
Silent LID misrouting. Suppose a document tagged en goes to an English-only pipeline even though part of it uses another language. Log the label and available scores. A top-two score margin can flag close classifications for review. Measure what your threshold catches and audit confident assignments on mixed inputs too.
Romanized text treated as English. In the example ‘Mujhe kal call karna’, the Hindi phrase and the English-origin call appear in Latin letters. Test what a script-only router selects and compare it with the search or moderation policy for the intended content.
Normalization can remove distinctions. In the fixture, NFKC merges halfwidth and fullwidth variants. An ASCII-only whitelist can remove the code points in an Indic or Arabic word. Test your chosen cleaning rules with those examples and keep the original where exact spelling matters.
Bidi display. Check the visual display and the mapping from a selected span to logical offsets in the original text. Test isolation of reference and hypothesis fields before annotating production examples.
Moderation errors. Evaluate moderation on reviewed mixed-language examples, including benign and policy-violating content. Report false positives and false negatives separately for the language combinations your service handles.
Output language drift. Measure each turn and the trailing window of each reply. Evaluate whether a retry or repair improves the intended behavior on reviewed examples. A session-wide average can conceal a monolingual final turn.
Token cost. Compare the same deployed tokenizer on verified Romanized Hindi, Devanagari Hindi, English, and mixed-language variants. Report the measured input lengths by slice, then apply the service’s billing rules and benchmark latency independently.
Search and retrieval asymmetry. Test whether a mixed query retrieves a valid monolingual document. Report lexical and dense retrieval separately on matched language and script slices; recompute the aggregate to see whether a large slice masks a smaller one.
Annotation drift. Record the loanword policy and compare agreement on mixed and monolingual spans. Inspect disagreements before treating them as model errors or changing the annotation rules.
Cache and deduplication keys. The Café example shows that distinct byte sequences can become identical after normalization. First decide which requests are equivalent for response reuse. Include the text representation and the relevant context, such as tenant or authorization scope, model and prompt version, response language, history, and tool options. Keep raw text when an output depends on its exact signs or spelling. Use a separate content-comparison key and test identical text under different request settings.
Check which failure modes occur in your own traffic before using aggregate completions or quality metrics as evidence about mixed-language support.
Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!