GradSim: Gradient-Based Language Grouping for Effective Multilingual Training

Mingyang Wang, Heike Adel, Lukas Lange, Jannik Strötgen, Hinrich Schuetze

Abstract

Most languages of the world pose low-resource challenges to natural language processing models. With multilingual training, knowledge can be shared among languages. However, not all languages positively influence each other and it is an open research question how to select the most suitable set of languages for multilingual training and avoid negative interference among languages whose characteristics or data distributions are not compatible. In this paper, we propose GradSim, a language grouping method based on gradient similarity. Our experiments on three diverse multilingual benchmark datasets show that it leads to the largest performance gains compared to other similarity measures and it is better correlated with cross-lingual model performance. As a result, we set the new state of the art on AfriSenti, a benchmark dataset for sentiment analysis on low-resource African languages. In our extensive analysis, we further reveal that besides linguistic features, the topics of the datasets play an important role for language grouping and that lower layers of transformer models encode language-specific features while higher layers capture task-specific information.

Introduction

Multilingual training is a cornerstone of modern NLP, enabling low-resource languages to benefit from the data abundance of high-resource ones. However, this "borrowing" of knowledge is not always beneficial. Training disparate languages together can lead to negative interference, where conflicting linguistic features or data distributions degrade performance. Traditionally, researchers have relied on language families or typological similarities to group languages. This paper argues that such heuristics are weak predictors of actual model performance and proposes a data-driven alternative: GradSim.

Methodology: The GradSim Pipeline

GradSim moves away from static linguistic categories toward a dynamic, gradient-based approach. The method follows a three-step process to optimize language grouping:

  1. Measure Gradient Similarities: A single multilingual model is trained on all target languages. The cosine similarity between the gradients of different languages is calculated at the final classification layer. This layer is chosen because higher layers in Transformers tend to capture task-specific information rather than language-specific noise.
  2. Language Grouping: Using these similarity scores, a branch-and-bound algorithm solves a variation of the "Set-Cover" problem to find $K$ groups that maximize internal similarity.
  3. Training and Inference: Dedicated multilingual models are trained for each discovered group. During inference, the model corresponding to the group with the highest collective similarity for the target language is utilized.
The three-step GradSim pipeline: measuring gradient similarities, grouping languages, and training group-specific models.

Experimental Setup

The effectiveness of GradSim was evaluated on three distinct tasks and datasets:

  • AfriSenti: Sentiment analysis for 12 low-resource African languages (e.g., Amharic, Swahili, Yoruba).
  • WikiAnn: Named Entity Recognition (NER) across 15 languages.
  • Universal Dependency (UD) v1.2: Part-of-Speech (POS) tagging for 27 languages.

Results and Discussion

GradSim consistently outperformed traditional grouping methods and established a new state-of-the-art on the AfriSenti benchmark.

Performance comparison on the AfriSenti benchmark across various grouping methods, showing GradSim outperforming traditional linguistic heuristics.

Key findings from the analysis include:

  • Linguistic vs. Topical Similarity: Linguistic family is not the sole driver of transfer. For instance, Swahili and Amharic, despite belonging to different families, were grouped together due to shared topical focus (politics and administration) in their respective Twitter datasets.
  • Proximity to Oracle: GradSim's performance closely tracks the "Oracle upper bound"—the maximum possible performance achievable by testing all language combinations—demonstrating its efficiency in finding optimal groupings without exhaustive search.
  • Low-Resource Gains: The method is particularly potent for extremely low-resource scenarios. In the Swahili sentiment analysis task, GradSim improved the F1 score from 58.18 (standard multilingual) to 63.05.

Conclusion

GradSim demonstrates that gradient alignment is a superior metric for language grouping compared to traditional linguistic heuristics. By focusing on how languages "cooperate" during the learning process, it mitigates negative interference and maximizes cross-lingual transfer. Future work will investigate the application of GradSim during the pre-training phase of large language models to create more robust specialized base models.

Summary updated

BibTeX
@inproceedings{wang2023gradsim,
  author = {Mingyang Wang and Heike Adel and Lukas Lange and Jannik Strötgen and Hinrich Schuetze},
  title = {{GradSim: Gradient-Based Language Grouping for Effective Multilingual Training}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  url = {https://openreview.net/forum?id=iVINvItqhb},
}
Figure