CSWBench: Evaluating Context-Sensitive Code-Switching in Creative Writing

📄 arXiv: 2610.20272v1 📥 PDF

作者: Zewen Jiang, Yahan Li, Chenlu Guo, Diana Inkpen, Yuan Wu, Yi Chang

分类: cs.CL, cs.AI

发布日期: 2026-10-14

备注: 38 pages, 19 figures, 32 tables. Artifacts: https://github.com/TPSJASPER/CSWBench


💡 一句话要点

提出CSWBench以评估创作写作中的上下文敏感代码切换能力

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 代码切换 多语言模型 创作写作 上下文敏感 评估基准 语言生成 叙事分析

📋 核心要点

  1. 现有方法对上下文敏感的代码切换能力评估不足,缺乏有效的评估基准。
  2. 本文提出CSWBench基准和CSWEval框架,分别从事件级和整体文本级评估代码切换的质量。
  3. 实验结果显示,模型在不同叙事上下文中的代码切换能力存在显著差异,尤其在多语言整合方面。

📝 摘要(中文)

大型语言模型(LLMs)在多语言生成和理解任务中展现了多语言能力。然而,有效的代码切换不仅需要多语言的熟练度,还需模型在适当的上下文中决定何时、何地及为何切换语言。现有的评估方法对这种上下文敏感能力的考量不足。为此,本文提出了CSWBench,一个用于评估创作写作中上下文敏感代码切换的基准,包含聚焦叙事和扩展叙事两种互补设置。同时,我们提出了CSWEval,一个理论驱动的框架,包含事件级评估和整体文本评估。通过对十二个LLMs的评估,我们发现模型在叙事上下文中的代码切换能力存在显著差异,尤其在多语言文学整合方面表现出更大的困难。

🔬 方法详解

问题定义:本文旨在解决现有评估方法对上下文敏感代码切换能力的不足,尤其是在创作写作中的应用。现有方法未能充分考虑语言切换的上下文因素。

核心思路:提出CSWBench基准和CSWEval框架,通过聚焦叙事和扩展叙事两种设置,系统评估模型的代码切换能力,强调上下文的影响。

技术框架:CSWBench包括两个主要设置:聚焦叙事和扩展叙事。CSWEval框架分为事件级评估和整体文本评估,分别考量语言切换的许可性、上下文适宜性和功能增益。

关键创新:最重要的创新在于引入了上下文敏感的评估标准,特别是事件级和整体文本级的双重评估方法,使得评估更加全面和细致。

关键设计:在评估过程中,采用了多种质量指标,包括文学质量和多语言组织质量,确保评估结果的多维度和准确性。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果表明,评估的十二个LLMs在不同叙事上下文中的代码切换能力存在显著差异,尤其在多语言文学整合方面表现出更大的困难。整体文本评估与事件级质量之间存在中等相关性,强调了上下文在代码切换中的重要性。

🎯 应用场景

该研究的潜在应用领域包括多语言创作写作、机器翻译和跨文化交流等。通过提升模型的上下文敏感代码切换能力,可以增强其在多语言环境中的表现,促进更自然的语言生成和理解。未来,该方法可能对多语言教育和文化交流产生积极影响。

📄 摘要(原文)

Large language models (LLMs) have demonstrated multilingual capabilities across diverse language generation and understanding tasks. Yet effective code-switching requires more than multilingual proficiency: models must decide when, where, and why to switch languages in ways that fit the surrounding context. This context-sensitive ability remains insufficiently evaluated. We introduce CSWBench, a benchmark for evaluating context-sensitive code-switching in creative writing through two complementary settings: Focused Narrative and Extended Narrative. We further propose CSWEval, a theory-informed framework with two complementary levels: event-level evaluation of Licensing, Contextual Appropriateness, and Functional Gain, and whole-text evaluation of task-specific quality---overall literary and narrative quality in Focused Narrative and quality emphasizing multilingual organization in Extended Narrative. Evaluating twelve LLMs, we find that models exhibit meaningful but uneven code-switching competence across narrative contexts. Model differences are particularly pronounced in multilingual literary integration, while multilingual-focused dimensions show stronger difficulty effects overall than the general narrative dimensions; narratively salient switches are associated with stronger contextual and functional realization; and event-level CS quality is moderately associated with whole-text performance.