Understanding and Mitigating Language Confusion in LLMs

Kelly Marchisio, Wei-Yin Ko, Alexandre Bérard, Théo Dehaze, Sebastian Ruder
6/28/2024
cs.CL

No official code found. Best implementation: Cohere-Labs-Community/language-confusion (33 stars, Apache-2.0, last commit 2024-06-28).

Abstract

We investigate a surprising limitation of LLMs: their inability to consistently generate text in a user's desired language. We create the Language Confusion Benchmark (LCB) to evaluate such failures, covering 15 typologically diverse languages with existing and newly-created English and multilingual prompts. We evaluate a range of LLMs on monolingual and cross-lingual generation reflecting practical use cases, finding that Llama Instruct and Mistral models exhibit high degrees of language confusion and even the strongest models fail to consistently respond in the correct language. We observe that base and English-centric instruct models are more prone to language confusion, which is aggravated by complex prompts and high sampling temperatures. We find that language confusion can be partially mitigated via few-shot prompting, multilingual SFT and preference tuning. We release our language confusion benchmark, which serves as a first layer of efficient, scalable multilingual evaluation at https://github.com/for-ai/language-confusion.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

Repository for the "Understanding and Mitigating Language Confusion in LLMs" paper

337PythonJun 20, 20242 years agoApache-2.0

Cite this paper

@article{marchisio2024understanding,
  title  = {Understanding and Mitigating Language Confusion in LLMs},
  author = {Kelly Marchisio and Wei-Yin Ko and Alexandre Bérard and Théo Dehaze and Sebastian Ruder},
  year   = {2024},
  eprint = {2406.20052},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2406.20052v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2406.20052.svg)](https://codeofpaper.com/paper/2406.20052)

Discussion