Papers › Causality Pursuit from Heterogeneous Environments via Neural Adversarial Invariance Learning

Causality Pursuit from Heterogeneous Environments via Neural Adversarial Invariance Learning

7 May 2024arXiv:2405.04715archive 2025-07-28

Yihong Gu, Cong Fang, Peter Bühlmann, Jianqing Fan

Pursuing causality from data is a fundamental problem in scientific discovery, treatment intervention, and transfer learning. This paper introduces a novel algorithmic method for addressing nonparametric invariance and causality learning in regression models across multiple environments, where the joint distribution of response variables and covariates varies, but the conditional expectations of outcome given an unknown set of quasi-causal variables are invariant. The challenge of finding such an unknown set of quasi-causal or invariant variables is compounded by the presence of endogenous variables that have heterogeneous effects across different environments. The proposed Focused Adversarial Invariant Regularization (FAIR) framework utilizes an innovative minimax optimization approach that drives regression models toward prediction-invariant solutions through adversarial testing. Leveraging the representation power of neural networks, FAIR neural networks (FAIR-NN) are introduced for causality pursuit. It is shown that FAIR-NN can find the invariant variables and quasi-causal variables under a minimal identification condition and that the resulting procedure is adaptive to low-dimensional composition structures in a non-asymptotic analysis. Under a structural causal model, variables identified by FAIR-NN represent pragmatic causality and provably align with exact causal mechanisms under conditions of sufficient heterogeneity. Computationally, FAIR-NN employs a novel Gumbel approximation with decreased temperature and a stochastic gradient descent ascent algorithm. The procedures are demonstrated using simulated and real-data examples.

PaperPDFCodeCode 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="2405.04715")

Code

Syntology Ran 19 of 23 code samples harvested from 1 repository linked to this paper; 4 have no recorded run. Of those that ran: 1 ran · our draft was wrong; 18 ran with no contract checked.

By repository: official repository: 23 samples from 1 repository, 19 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

wmyw96/fair officialmentioned in papermentioned 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

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

1ran · our draft was wrong
18ran
4unverified

Licence: 23 of the 23 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 wmyw96/fair. “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.

acc wmyw96/fair/app2_waterbird.py official repository ran fingerprinted no licence file found · pointer only · d978e9bb19ebe7ef · report
bce_loss wmyw96/fair/app2_waterbird.py official repository ran fingerprinted no licence file found · pointer only · 9a7de74b80f4a1b3 · report
broadcast wmyw96/fair/methods/demo_wrapper.py official repository ran no licence file found · pointer only · 1200849ad05d7415 · report
calc_fair_ll_loss wmyw96/fair/methods/brute_force.py official repository ran no licence file found · pointer only · 8cdeac9fdef41ee1 · report
crop_and_resize wmyw96/fair/dataset_utils.py official repository ran no licence file found · pointer only · baa53c8c87dfebf5 · report
get_bootstrap_sample wmyw96/fair/app1_lightchamber.py official repository ran no licence file found · pointer only · d65948012ed5d50e · report
least_squares wmyw96/fair/methods/brute_force.py official repository ran fingerprinted no licence file found · pointer only · 57b0fd8ee21f9a75 · report
linear_eval_worst_test wmyw96/fair/app1_lightchamber.py official repository ran no licence file found · pointer only · d50265a213843089 · report
misclass wmyw96/fair/app2_waterbird.py official repository ran fingerprinted no licence file found · pointer only · 1338080004e9cb31 · report
np_mse wmyw96/fair/examples.py official repository ran fingerprinted no licence file found · pointer only · 63e4a6083777113b · report
pooled_least_squares wmyw96/fair/methods/brute_force.py official repository ran no licence file found · pointer only · 27cd28db25f6d08f · report
pooled_least_squares wmyw96/fair/methods/tools.py official repository ran no licence file found · pointer only · 56ed97af3ac40ad3 · report
pretty wmyw96/fair/methods/predessors.py official repository ran · our draft was wrong no licence file found · pointer only · db4d05619d1e83d4 · report
print_prob wmyw96/fair/methods/fair_algo.py official repository ran no licence file found · pointer only · 1218daa5fb683b49 · report
sample_gumbel wmyw96/fair/methods/fair_algo.py official repository ran no licence file found · pointer only · 676c479401247881 · report
sigmoid wmyw96/fair/methods/fair_algo.py official repository ran fingerprinted no licence file found · pointer only · f069ff33169e6799 · report
split wmyw96/fair/generate_waterbird.py official repository ran no licence file found · pointer only · 53b88db991b1fee9 · report
standardize wmyw96/fair/app1_lightchamber.py official repository ran no licence file found · pointer only · eca91351cf206f3f · report
torch_mse wmyw96/fair/examples.py official repository ran fingerprinted no licence file found · pointer only · fabb695cacbf0ab8 · report
combine_and_mask wmyw96/fair/dataset_utils.py official repository unverified no licence file found · pointer only · 3989528d3ff8483b · report
mydist wmyw96/fair/methods/demo_wrapper.py official repository unverified no licence file found · pointer only · 2d96c81c0bc1177e · report
oracle_irm wmyw96/fair/methods/demo_wrapper.py official repository unverified no licence file found · pointer only · acb4501b200564b3 · report
run_irm wmyw96/fair/methods/irm.py official repository unverified no licence file found · pointer only · 662d39d9bdb55ccb · report

Tasks

Transfer Learningregressionscientific discovery

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

ALIGNSET

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