Gradient Vaccine: Investigating and Improving Multi-task Optimization in Massively Multilingual Models
Zirui Wang, Yulia Tsvetkov, Orhan Firat, Yuan Cao
TL;DR
The paper analyzes loss geometry in massively multilingual models by measuring gradient similarity across language-pair tasks, revealing that gradient alignment tracks language proximity and predicts cross-lingual transfer quality. It identifies limitations of existing gradient-based MTL methods and introduces Gradient Vaccine (GradVac), an adaptive gradient-alignment framework that sets target gradient similarities via EMA and per-layer granularity, generalizing PCGrad. Empirically, GradVac yields significant performance gains on large-scale multilingual NMT and XTREME benchmarks, demonstrating the practical value of geometry-aware optimization and suggesting applicability beyond multilingual scenarios.
Abstract
Massively multilingual models subsuming tens or even hundreds of languages pose great challenges to multi-task optimization. While it is a common practice to apply a language-agnostic procedure optimizing a joint multilingual task objective, how to properly characterize and take advantage of its underlying problem structure for improving optimization efficiency remains under-explored. In this paper, we attempt to peek into the black-box of multilingual optimization through the lens of loss function geometry. We find that gradient similarity measured along the optimization trajectory is an important signal, which correlates well with not only language proximity but also the overall model performance. Such observation helps us to identify a critical limitation of existing gradient-based multi-task learning methods, and thus we derive a simple and scalable optimization procedure, named Gradient Vaccine, which encourages more geometrically aligned parameter updates for close tasks. Empirically, our method obtains significant model performance gains on multilingual machine translation and XTREME benchmark tasks for multilingual language models. Our work reveals the importance of properly measuring and utilizing language proximity in multilingual optimization, and has broader implications for multi-task learning beyond multilingual modeling.
