An official repository for "Bias Is a Subspace, Not a Coordinate: A Geometric Rethinking of Post‑hoc Debiasing in Vision-Language Models"
This repository contains the implementation of SPD and the baseline method SFID on attribute-replacement experiments on FairFace.
This experiment uses the SPD and SFID methods on the FairFace dataset to replace features across three dimensions, age, gender, and race, with low-confidence mean embeddings. Logistic regression is then used to evaluate the classification performance of these replaced embeddings. This verifies the effectiveness and completeness of the debiasing process and measures the level of feature entanglement (i.e., whether replacing one attribute significantly affects the accuracy of others) to ensure semantic integrity.
src/: Source code (Python scripts).embedding/: Raw PyTorch.ptcheckpoint files. Obtained from the SFID repo.low_conf/: Pre-computed low-confidence statistics (output_*.json). Obtained from the SFID repo.artifacts/: Intermediate generated files (.jsonl,axes.json).result/: Final evaluation results.
Ensure you have the required dependencies installed:
pip install -r requirements.txtTo run the full SPD workflow:
sh run_spd.shTo experiment with different values of MAX_AXES in line 4.
To run the full SFID workflow:
sh run_sfid.shIf you find SPD useful for your research and applications, please cite using this BibTeX:
@article{zhao2025bias,
title={Bias Is a Subspace, Not a Coordinate: A Geometric Rethinking of Post-hoc Debiasing in Vision-Language Models},
author={Zhao, Dachuan and Li, Weiyue and Shen, Zhenda and Qiu, Yushu and Xu, Bowen and Chen, Haoyu and Chen, Yongchao},
journal={arXiv preprint arXiv:2511.18123},
year={2025}
}