This repository hosts the code for our paper, In-Contextual Gender Bias Suppression for Large Language Models. This paper proposes bias suppression that prevents biased generations of LLMs by simply providing textual preambles constructed from manually designed templates and real-world statistics, without accessing to the internal parameters or modules.
The code we provide can be run on Google Colab with the link below or local machines with .ipynb files in /notebook. Note that each must apply to use Llama2 in order to execute code related to Llama2.
Model | Experiment | Colab |
---|---|---|
meta-llama/Llama-2-7b-hf | Bias Suppression | |
meta-llama/Llama-2-7b-hf | Downstream Tasks | |
openlm-research/open_llama_7b_v2 | Bias Suppression | |
openlm-research/open_llama_7b_v2 | Downstream Tasks | |
mosaicml/mpt-7b | Bias Suppression | |
mosaicml/mpt-7b | Downstream Tasks |
@misc{oba2024incontextual,
title={In-Contextual Gender Bias Suppression for Large Language Models},
author={Daisuke Oba and Masahiro Kaneko and Danushka Bollegala},
year={2024},
eprint={2309.07251},
archivePrefix={arXiv},
primaryClass={cs.CL}
}