Balanced Multi-Factor In-Context Learning for Multilingual Large Language Models

Masahiro Kaneko, Alham Fikri Aji, Timothy Baldwin

TL;DR

This paper introduces Balanced Multi-Factor In-Context Learning (BMF-ICL), a novel method for selecting examples to improve the performance of multilingual large language models (MLLMs) in in-context learning (ICL). By intelligently balancing semantic similarity, linguistic alignment, and language-specific performance, BMF-ICL significantly outperforms existing methods across various MLLMs and datasets.

What Problem Does This Paper Address?

Multilingual Large Language Models (MLLMs) are powerful because they can transfer knowledge across languages without needing to be retrained. A key technique to boost their performance is in-context learning (ICL), where a few examples are provided to the model to guide its response. However, the effectiveness of ICL in multilingual settings is highly sensitive to which examples are chosen. Existing approaches to example selection often focus on one or two factors (like semantic similarity or linguistic similarity) independently, without a clear understanding of how these factors interact or how to optimally balance them. This leaves a gap in efficiently selecting the best multilingual examples to maximize cross-lingual knowledge transfer.

Methods

The core of this paper is the Balanced Multi-Factor In-Context Learning (BMF-ICL) method. It addresses the problem by quantifying and optimally balancing three key factors for multilingual example selection:

  • Semantic Similarity: This measures how similar the meaning of the input text is to the candidate example's source text. The authors use the LaBSE (Language-Agnostic BERT Sentence Embedding) model for this, which is designed to produce embeddings that capture semantic similarity across languages.
  • Linguistic Alignment: This assesses how closely the input language and the candidate example's source language are related in terms of their morphological and grammatical features. The lang2vec tool is employed here, which encodes various linguistic properties.
  • Language-Specific Performance: This measures how well the MLLM performs on a specific language when given examples from that language. This is quantified by the model's likelihood of generating the correct reference text from the source text.

BMF-ICL calculates a weighted sum of these three scores for each candidate example and selects the top-k examples that maximize this combined score. The weights for each factor (α, β, γ) are optimized on development data.

Datasets

The authors evaluate their method on two benchmark datasets:

  • mCSQA: A multilingual commonsense question-answering dataset covering 8 languages.
  • TYDI: A question-answering dataset covering 11 typologically diverse languages, framed as gold passage generation.

These datasets were chosen because they were originally developed in their respective languages, rather than being simple translations, which better reflects realistic multilingual scenarios.

Key Insights and Ideas

  • The synergy of three factors is crucial: The study strongly suggests that considering semantic similarity, linguistic alignment, and language-specific performance together is significantly more effective than focusing on any single factor.
  • Semantic similarity is a strong driver: The ablation study revealed that excluding semantic similarity often led to the largest performance drops, highlighting its importance for encouraging effective cross-lingual transfer, even in multilingual settings.
  • Multilingual examples are key: In over 95% of cases, BMF-ICL selects examples from two or more languages, demonstrating the inherent benefit of leveraging diverse linguistic data.
  • BMF-ICL is robust across models: The method shows consistent improvements across four different MLLMs (Llama 4, Aya, GPT-3.5, GPT-4), indicating its general applicability.
  • Target language inclusion matters: The method is often more effective when examples from the target language are not included in the candidate pool, suggesting its strength in finding useful cross-lingual examples.

Key Results

BMF-ICL consistently outperformed existing baselines (including Random-ICL, Non-ICL, and other specialized methods) on both mCSQA and TYDI datasets across all four tested MLLMs. For instance, on mCSQA, BMF-ICL achieved the best performance in 28/32 cases when target-language examples were included and 27/32 cases when they were not. On TYDI, it achieved the highest performance in 39/44 cases (target-included) and 42/44 cases (target-excluded). The paper also shows that optimizing the weights for the three factors leads to better performance than using uniform weights.

Limitations and Future Work

The authors acknowledge that while their method shows broad effectiveness, it doesn't guarantee performance improvements in all languages. They suggest future work could involve validating the method on a wider range of tasks beyond question answering. Additionally, the availability of diverse, natively multilingual datasets created from scratch remains a challenge for future research and dataset creation efforts.

Summary updated

BibTeX
@inproceedings{kaneko2025balanced,
  author = {Masahiro Kaneko and Alham Fikri Aji and Timothy Baldwin},
  title = {{Balanced Multi-Factor In-Context Learning for Multilingual Large Language Models}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2025},
}
Figure