kyrawilson/Resume-Screening-Bias

6

stars

44

commits

Python

primary language

Aug 30, 2026

updated

README

Resume-Screening-Bias

- Update August 29, 2026 -
After attempting to replicate our study, Frank Pallas (frank.pallas@plus.ac.at, Salzburg University) and
Martin Wiesinger (martin.wiesinger@plus.ac.at, Salzburg University) informed us that our published results
are inaccurate due to a bug in our code. Specifically, the results of **gender-only** comparisons should
be inverted, such that measurements referring to the preference of men should actually refer to preference
of women, and vice versa. The results for race-only and all the intersectional gender by race comparisons
are accurate and were replicated by the Salzburg University team. We are grateful to them for bringing this
error to our attention.

We **HAVE NOT** corrected the copy of the code in this repo for traceability, however if you wish to alter
a local copy, modify lines 38-39 in experiments.py to read as follows:

names['F'] = names['WF']+names['BF']
names['M'] = names['WF']+names['BM']

Gender, Race, and Intersectional Bias in Resume Screening via Language Model Retrieval
Kyra Wilson and Aylin Caliskan
Proceedings of the AAAI/ACM Conference on AI, Ethics, and Society (2024)

The paper can be viewed here.

Requirements

Package requirements to run this project are listed in the environment.yml file. To install all requirements:

conda env create -f environment.yml

Datasets

Resumes can be downloaded here and job descriptions can be downloaded here.

Preprocessing

Generate SOC occupation codes for resumes and job descriptions using NIOCCS here.

Embedding Creation

Use embeddings.py to generate embeddings for resumes and job descriptions. For resumes two text files are needed: one file with a single name on a single line to add to all resumes, and one file with one resume per line. For job descriptions two text files are needed: one file with a single task instruction on a single line, and one file with one job description per line.

#Required and optional arguments
python embeddings.py --help
Optional arguments:
-m,  --model      Name of HuggingFace model to use                    default='intfloat/e5-mistral-7b-instruct'
-q,  --queries    Path to list of queries (text file, one per line)                  default=None
-d,  --documents  Path to list of documents (text file, one per line)                default=None
-t,  --task       Path to description of task (text file, one line only)             default=None
-p,  --prefixes   Path to prefix to append to documents (text file, one prefix only) default=None
-l,  --max_length Max number of tokens to embed                                      default=4096
-b,  --batch_size Batch size                                                         default=1
-o,  --output     Path to output file                                                default="embeddings.pkl"

#Running the script for job descriptions
python embeddings.py -t task_instruction.txt -q descriptions.txt -o description_embeddings.pkl

#Running the script for resumes
python embeddings.py -p name.txt -d resumes.txt -o resume_embeddings.pkl

Retrieval

Use retrieval.py to calculate the cosine similarities between embeddings of job descriptions and resumes. All resume embeddings should be contained in a single directory, and all job description embeddings should be in a single, separate directory. Two .csv files are also needed, where the first column 'description' is the resumes or job description text files used in the embedding generation, and the second column 'broad_occupation' is the SOC codes corresponding to the text in the first column.

python retrieval.py --help
Required arguments:
-q    --queries    Path to job description embeddings directory     default=None
-d    --documents  Path to resume embeddings directory              default=None
-j    --jobs       Path to job description metadata                 default=None
-r    --resumes    Path to resume metadata                          default=None


#Calculate cosine similarities for job descriptions and resumes. 
python retrieval.py -q description_embeddings -d resume_embeddings -j job_descriptions.csv -r resumes.csv

Experiments

Use experiments.py to analyze retrieval scores. To reproduce the results from our paper, download the retrieval scores here. The script can also be used to generate new results by replacing the appropriate files with new names/scores.

python experiments.py --help
Required arguments:
-m    --model    Name of HuggingFace model to use (if not specified all used)     default=None
-n    --names    Path to .csv file with names and attributes                      default=None
-l    --length   Length of tokens used to generate model embeddings               default=None
-c    --collapse G for gender, R for race, not specified for intersectional       default=None


#Calculate cosine similarities for job descriptions and resumes. 
python experiments.py -n names.csv -l 1300

Citation

If you find this repository useful for your research, please consider citing our preprint:

@inproceedings{wilson2024gender,
  title={Gender, race, and intersectional bias in resume screening via language model retrieval},
  author={Wilson, Kyra and Caliskan, Aylin},
  booktitle={Proceedings of the AAAI/ACM Conference on AI, Ethics, and Society},
  volume={7},
  pages={1578--1590},
  year={2024}
}

Contributors

kyrawilson

44 commits

kyrawilson/Resume-Screening-Bias

6

stars

44

commits

Python

primary language

Aug 30, 2026

updated

README

Resume-Screening-Bias

- Update August 29, 2026 -
After attempting to replicate our study, Frank Pallas (frank.pallas@plus.ac.at, Salzburg University) and
Martin Wiesinger (martin.wiesinger@plus.ac.at, Salzburg University) informed us that our published results
are inaccurate due to a bug in our code. Specifically, the results of **gender-only** comparisons should
be inverted, such that measurements referring to the preference of men should actually refer to preference
of women, and vice versa. The results for race-only and all the intersectional gender by race comparisons
are accurate and were replicated by the Salzburg University team. We are grateful to them for bringing this
error to our attention.

We **HAVE NOT** corrected the copy of the code in this repo for traceability, however if you wish to alter
a local copy, modify lines 38-39 in experiments.py to read as follows:

names['F'] = names['WF']+names['BF']
names['M'] = names['WF']+names['BM']

Gender, Race, and Intersectional Bias in Resume Screening via Language Model Retrieval
Kyra Wilson and Aylin Caliskan
Proceedings of the AAAI/ACM Conference on AI, Ethics, and Society (2024)

The paper can be viewed here.

Requirements

Package requirements to run this project are listed in the environment.yml file. To install all requirements:

conda env create -f environment.yml

Datasets

Resumes can be downloaded here and job descriptions can be downloaded here.

Preprocessing

Generate SOC occupation codes for resumes and job descriptions using NIOCCS here.

Embedding Creation

Use embeddings.py to generate embeddings for resumes and job descriptions. For resumes two text files are needed: one file with a single name on a single line to add to all resumes, and one file with one resume per line. For job descriptions two text files are needed: one file with a single task instruction on a single line, and one file with one job description per line.

#Required and optional arguments
python embeddings.py --help
Optional arguments:
-m,  --model      Name of HuggingFace model to use                    default='intfloat/e5-mistral-7b-instruct'
-q,  --queries    Path to list of queries (text file, one per line)                  default=None
-d,  --documents  Path to list of documents (text file, one per line)                default=None
-t,  --task       Path to description of task (text file, one line only)             default=None
-p,  --prefixes   Path to prefix to append to documents (text file, one prefix only) default=None
-l,  --max_length Max number of tokens to embed                                      default=4096
-b,  --batch_size Batch size                                                         default=1
-o,  --output     Path to output file                                                default="embeddings.pkl"

#Running the script for job descriptions
python embeddings.py -t task_instruction.txt -q descriptions.txt -o description_embeddings.pkl

#Running the script for resumes
python embeddings.py -p name.txt -d resumes.txt -o resume_embeddings.pkl

Retrieval

Use retrieval.py to calculate the cosine similarities between embeddings of job descriptions and resumes. All resume embeddings should be contained in a single directory, and all job description embeddings should be in a single, separate directory. Two .csv files are also needed, where the first column 'description' is the resumes or job description text files used in the embedding generation, and the second column 'broad_occupation' is the SOC codes corresponding to the text in the first column.

python retrieval.py --help
Required arguments:
-q    --queries    Path to job description embeddings directory     default=None
-d    --documents  Path to resume embeddings directory              default=None
-j    --jobs       Path to job description metadata                 default=None
-r    --resumes    Path to resume metadata                          default=None


#Calculate cosine similarities for job descriptions and resumes. 
python retrieval.py -q description_embeddings -d resume_embeddings -j job_descriptions.csv -r resumes.csv

Experiments

Use experiments.py to analyze retrieval scores. To reproduce the results from our paper, download the retrieval scores here. The script can also be used to generate new results by replacing the appropriate files with new names/scores.

python experiments.py --help
Required arguments:
-m    --model    Name of HuggingFace model to use (if not specified all used)     default=None
-n    --names    Path to .csv file with names and attributes                      default=None
-l    --length   Length of tokens used to generate model embeddings               default=None
-c    --collapse G for gender, R for race, not specified for intersectional       default=None


#Calculate cosine similarities for job descriptions and resumes. 
python experiments.py -n names.csv -l 1300

Citation

If you find this repository useful for your research, please consider citing our preprint:

@inproceedings{wilson2024gender,
  title={Gender, race, and intersectional bias in resume screening via language model retrieval},
  author={Wilson, Kyra and Caliskan, Aylin},
  booktitle={Proceedings of the AAAI/ACM Conference on AI, Ethics, and Society},
  volume={7},
  pages={1578--1590},
  year={2024}
}

Contributors

kyrawilson

44 commits

Languages

Python

100.0%