Reference implementation of AFFLUENT (quAntized Factor identiFiabLe caUsal Effect variatioNal auToencoder), introduced in:
Quantized Factor Identifiable Causal Effect Variational Autoencoder, CIKM '25.
AFFLUENT extends CEVAE with quantized factor identifiability regularizers (axis-aligned discontinuities + latent-space straightening) to mitigate unidentifiability and bias toward proxy variables in proxy-based causal effect estimation.
git clone <this-repo>
cd <this-repo>
pip install -r requirements.txtRequires Python 3.8+. A CUDA-capable GPU is recommended but not required.
.
├── models/
│ ├── affluent_demand.py # CEVAE/AFFLUENT for the synthetic Demand task
│ ├── affluent_ihdp.py # CEVAE/AFFLUENT for IHDP / Twins
│ ├── civvae.py # CIV.VAE baseline (IHDP)
│ └── nmmr.py # NMMR baseline (Demand)
├── experiments/
│ ├── run_demand.py # main Demand comparison (Figure 5a/b)
│ ├── run_ihdp.py # main IHDP comparison (Table 1)
│ ├── ablation_demand.py # Demand ablation (Table 2)
│ ├── gridsearch_demand.py # Demand hyperparameter sweep
│ ├── figure_heatmap_demand.py # Figure 5c/d cross-influence heatmaps
│ └── figure_boxplot_demand.py # aggregates Table 2 Demand numbers
└── utils/
├── utils_data_generation_ihdp.py
└── utils_synthetic_demand.py
- Demand (synthetic): generated on the fly by
utils_synthetic_demand.py. No download required. - IHDP: download
ihdp_npci_1-1000.train.npzandihdp_npci_1-1000.test.npzfrom the npci package (also mirrored at https://www.fredjo.com/) and place them in../Mydata/IHDP/relative to the repo root. - Twins: download from AMLab-Amsterdam/CEVAE.
Scripts that save results assume the directory ../Mydata/Quantization/Synthetic/{Demand, Demand_optimum, Demand_result, Demand_plot}/ exists. Create these once before running:
mkdir -p ../Mydata/Quantization/Synthetic/{Demand,Demand_optimum,Demand_result,Demand_plot}
mkdir -p ../Mydata/IHDPRun from the project root (so ../Mydata/ resolves correctly):
# Demand (Figure 5a/b, MSE on test set)
python -m experiments.run_demand
# IHDP / Twins (Table 1)
python -m experiments.run_ihdp
# Demand ablation (Table 2)
python -m experiments.ablation_demand
python -m experiments.figure_boxplot_demand # aggregates the saved npys
# Demand cross-influence heatmap (Figure 5c/d)
python -m experiments.figure_heatmap_demand
# Demand hyperparameter sweep (26,244 combinations — long run)
python -m experiments.gridsearch_demandSet CUDA_VISIBLE_DEVICES via the shell to choose a GPU, e.g. CUDA_VISIBLE_DEVICES=0 python -m experiments.run_demand. If unset, PyTorch picks device 0 (or CPU if none is available).
- Twins training script (paper Tables 1 & 2). The
affluent_ihdp.pymodel can be reused, but arun_twins.pydriver is not provided. - TEDVAE + QFI and CIV.VAE + QFI plug-in scripts (paper Table 1). The bare CIV.VAE baseline lives in
models/civvae.py; the QFI plug-in integration is not packaged.
@inproceedings{affluent2025,
author = {Song, Sujeong and Sohn, Junghyo and Kang, Eunsong and Suk, Heung-Il},
title = {Quantized Factor Identifiable Causal Effect Variational Autoencoder},
year = {2025},
booktitle = {Proceedings of the 34th ACM International Conference on Information and Knowledge Management},
}MIT (see LICENSE).