Invariant Language Modeling

Maxime Peyrard, Sarvjeet Singh Ghotra, Martin Josifoski, Vidhan Agarwal, Barun Patra +3 more
10/16/2021
cs.CLcs.LG

Official code: epfl-dlab/invariant-language-models (14 stars, Python, Apache-2.0, last commit 2022-01-24).

Abstract

Large pretrained language models are critical components of modern NLP pipelines. Yet, they suffer from spurious correlations, poor out-of-domain generalization, and biases.

Show full abstract

Inspired by recent progress in causal machine learning, in particular the invariant risk minimization (IRM) paradigm, we propose invariant language modeling, a framework for learning invariant representations that generalize better across multiple environments. In particular, we adapt a game-theoretic formulation of IRM (IRM-games) to language models, where the invariance emerges from a specific training schedule in which all the environments compete to optimize their own environment-specific loss by updating subsets of the model in a round-robin fashion. We focus on controlled experiments to precisely demonstrate the ability of our method to (i) remove structured noise, (ii) ignore specific spurious correlations without affecting global performance, and (iii) achieve better out-of-domain generalization. These benefits come with a negligible computational overhead compared to standard training, do not require changing the local loss, and can be applied to any language model. We believe this framework is promising to help mitigate spurious correlations and biases in language models.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

A framework to train language models to learn invariant representations.

142PythonOct 14, 20214 years agoApache-2.0

Similar Papers

Cite this paper

@article{peyrard2021invariant,
  title  = {Invariant Language Modeling},
  author = {Maxime Peyrard and Sarvjeet Singh Ghotra and Martin Josifoski and Vidhan Agarwal and Barun Patra and Dean Carignan and Emre Kiciman and Robert West},
  year   = {2021},
  eprint = {2110.08413},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2110.08413}
}

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/2110.08413.svg)](https://codeofpaper.com/paper/2110.08413)

Discussion