Modeling the Functional Intent of Code-Switching

You are reading version 1 of this direction, frozen 2026-10-04. The latest version is version 2.

Version 1 of 217 papers31 conceptsfrozen 2026-10-04

In multilingual communities, speakers rarely switch between languages at random. Instead, "code-switching"—the practice of alternating between two or more languages in a single conversation or text—is a sophisticated tool used to signal emotion, manage social relationships, or emphasize a point.

While early natural language processing (NLP) research focused on the detection of language boundaries, a growing body of work treats code-switching as a rich pragmatic signal. By understanding the "why" behind a language switch, models can better interpret the emotional weight and social nuance of human communication.

Code-Switching as an Emotional Catalyst

A recurring finding across social media research is that the secondary language in a code-switched post often carries the core emotional message. Zhongqing Wang and colleagues demonstrated that in Chinese-English posts, speakers frequently use English specifically to trigger or emphasize emotional states.

This isn't just a marginal effect; Yue Zhang and Sophia Yat Mei Lee found that in Chinese-dominant contexts, roughly 20% of the emotional signal can be attributed to the minority language. To capture this, they developed the Bilingual Attention Network (BAN), which uses dedicated attention layers to weigh emotional words in both languages simultaneously. Similarly, Innocent Ndubuisi-Obi and David Jurgens observed that high emotional intensity—whether positive or negative—acts as a catalyst for Nigerians to switch from formal English to more expressive local dialects.

Structural Patterns as Pragmatic Signals

The way a switch occurs—its frequency and structure—provides clues about the speaker's intent. Srijan Bansal and Animesh Mukherjee showed that specific structural patterns correlate with social intent:

  • Humor: Often characterized by frequent, rapid transitions between languages.
  • Sarcasm and Hate Speech: Typically involve longer, sustained blocks of a single language.

By injecting these switching patterns into a Hierarchical Attention Network, the researchers achieved a massive 17.7% improvement in hate speech detection. This suggests that the "rhythm" of code-switching is as informative as the words themselves. Even non-linguistic markers like emoticons can help; Evangelos E. Papalexakis and Dong Nguyen found that emoticons provide contextual cues that improve the prediction of when a user is about to switch languages.

Classifying the "Why"

Moving beyond sentiment, researchers are now building systems that explicitly label the communicative function of a switch. Jeffrey Flanigan and Ritu Belani developed a transformer-based system that categorizes switches into 11 distinct functions, such as:

  • Quoting: Switching to the original language of a cited phrase.
  • Topic Shift: Signaling a change in the subject of conversation.
  • Lexical Borrowing: Using a word from another language because it is more precise or common.

This functional approach has practical stakes. In clinical settings, Flanigan and Belani argue that identifying these functions can prevent the misdiagnosis of language disorders in bilingual individuals by distinguishing strategic linguistic choices from actual speech deficits.

Managing Social Dynamics and Learning

In private spaces, code-switching serves as a tool for "affective management." Analyzing the ABC Codemixed Corpus, Svetlana Churina and Kokil Jaidka found that speakers use different languages to soften requests, maintain politeness, or signal intimacy.

However, current AI systems often fail to grasp these nuances. Yeon Su Park and Juho Kim identified a "pedagogical gap" in AI tutors: while Large Language Models (LLMs) can translate code-switched text, they cannot distinguish between a student switching because they lack vocabulary versus switching for cultural emphasis. Without this distinction, AI cannot provide the sophisticated, context-sensitive feedback that human teachers use to support bilingual learners.

Papers in this version

History & citationVersion 2 · 2026-10-04

Current · Permanent link

  1. Version 2 (latest) · 2026-10-04 · 17 papers
  2. Version 1 · 2026-10-04 · 17 papers
Cite this direction

Latest version (a living page):

@misc{lacuna_functional_language_specialization_4f8e37d8,
  title = {functional language specialization},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/functional-language-specialization/rdr_4f8e37d8335149cbb04828aeb701cdaf},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-19},
}

This exact version (version 1, frozen text):

@misc{lacuna_modeling_the_functional_intent_of_code_s_4f8e37d8_v1,
  title = {Modeling the Functional Intent of Code-Switching},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/modeling-the-functional-intent-of-code-switching/rdr_4f8e37d8335149cbb04828aeb701cdaf/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-19},
}