Papers › Out-of-Distribution Generalization via Risk Extrapolation (REx)

Out-of-Distribution Generalization via Risk Extrapolation (REx)

2 Mar 2020arXiv:2003.00688archive 2025-07-28

David Krueger, Ethan Caballero, Joern-Henrik Jacobsen, Amy Zhang, Jonathan Binas, Dinghuai Zhang, Remi Le Priol, Aaron Courville

Distributional shift is one of the major obstacles when transferring machine learning prediction systems from the lab to the real world. To tackle this problem, we assume that variation across training domains is representative of the variation we might encounter at test time, but also that shifts at test time may be more extreme in magnitude. In particular, we show that reducing differences in risk across training domains can reduce a model's sensitivity to a wide range of extreme distributional shifts, including the challenging setting where the input contains both causal and anti-causal elements. We motivate this approach, Risk Extrapolation (REx), as a form of robust optimization over a perturbation set of extrapolated domains (MM-REx), and propose a penalty on the variance of training risks (V-REx) as a simpler variant. We prove that variants of REx can recover the causal mechanisms of the targets, while also providing some robustness to changes in the input distribution ("covariate shift"). By appropriately trading-off robustness to causally induced distributional shifts and covariate shift, REx is able to outperform alternative methods such as Invariant Risk Minimization in situations where these types of shift co-occur.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2003.00688")

Code

Syntology Ran 3 of 4 code samples harvested from 2 repositories linked to this paper; 1 has no recorded run. Of those that ran: 2 ran · our draft was wrong; 1 ran with no contract checked.

By repository: official repository: 3 samples from 1 repository, 3 ran; community (archive-listed): 1 sample from 1 repository, 0 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

capybaralet/REx_code_release officialmentioned in paperpytorch report
facebookresearch/DomainBed mentioned on GitHubpytorch report
lingxiaoyuan/ood_mechanics mentioned on GitHubpytorch report
thuml/Transfer-Learning-Library mentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

4 samples harvested; 3 ran; 0 honoured the contract we drafted; 1 has no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

2ran · our draft was wrong
1ran
1unverified

Licence: 3 of the 4 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 2 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

REX_var capybaralet/REx_code_release/InvariantRiskMinimization/experiment_synthetic/run_toy_SEMs.py official repository ran no licence file found · pointer only · a608840c8f1e15cb · report
errors capybaralet/REx_code_release/InvariantRiskMinimization/experiment_synthetic/run_toy_SEMs.py official repository ran · our draft was wrong fingerprinted no licence file found · pointer only · f0e84f4930c5935c · report
pretty capybaralet/REx_code_release/InvariantRiskMinimization/experiment_synthetic/run_toy_SEMs.py official repository ran · our draft was wrong no licence file found · pointer only · 1463989a26f3aa4f · report
VREx facebookresearch/DomainBed/domainbed/algorithms.py community (archive-listed) unverified MIT (permissive) · e4b07a614c9d8d43 · report

Tasks

Domain GeneralizationImage ClassificationOut-of-Distribution Generalization

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Domain Generalization PACS VREx (Alexnet) Average Accuracy 71.14 #119 of 133 Archive leaderboard report
Image Classification Colored-MNIST(with spurious correlation) MLP-REx Accuracy 68.70 #2 of 6 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections