Distributionally Robust Language Modeling
Yonatan Oren, Shiori Sagawa, Tatsunori B. Hashimoto, Percy Liang
TL;DR
The paper tackles the problem that language models trained on heterogeneous data can underperform on unseen target distributions. It introduces topic CVaR, a distributionally robust optimization approach that uses topic-level uncertainty sets and a baselined loss to ensure uniform performance across topics, implemented via an online minimax algorithm. Empirical results show substantial perplexity reductions (e.g., 5.5 points on Yelp when tested on reviews) and robustness beyond subpopulation shifts, with strong ablations confirming the importance of topic structure and baselining. This approach enables a single, broadly robust language model that generalizes across unknown distributions without needing target-domain labels.
Abstract
Language models are generally trained on data spanning a wide range of topics (e.g., news, reviews, fiction), but they might be applied to an a priori unknown target distribution (e.g., restaurant reviews). In this paper, we first show that training on text outside the test distribution can degrade test performance when using standard maximum likelihood (MLE) training. To remedy this without the knowledge of the test distribution, we propose an approach which trains a model that performs well over a wide range of potential test distributions. In particular, we derive a new distributionally robust optimization (DRO) procedure which minimizes the loss of the model over the worst-case mixture of topics with sufficient overlap with the training distribution. Our approach, called topic conditional value at risk (topic CVaR), obtains a 5.5 point perplexity reduction over MLE when the language models are trained on a mixture of Yelp reviews and news and tested only on reviews.
