PEAT trains a parameter-efficient LoRA adapter that equalizes the probability of stereotypical and anti-stereotypical token completions at masked positions, without degrading language-modeling utility. It is evaluated against nine comparative methods (including five recent SOTA bias mitigation approaches) on six language models (three encoders, three causal decoders), under a single fixed compute and precision configuration.
The full revision pipeline completed on a single A100-80GB: 198 cells, 0 failures, all six PEAT models reproducing published stereotype scores (1,508 CrowS-Pairs pairs each, deduplicated by idx). Every baseline intervention is now kept active during scoring (the corrected evaluation), and significance is measured across the 1,508 paired outcomes rather than across seeds.
Headline findings (honest scope):
Paper-ready tables are written to Code/results/: CLEAN_SUMMARY.md, clean_ss_summary.csv, table_wpB_significance.csv (PEAT vs Base), and table_wpB_peat_vs_lora.csv (PEAT vs LoRA, McNemar + Holm).
⚠️ Flash-Attention 2.8.3 wheel only works for
cu12/torch2.5/cp312on Linux x86_64. It will not install on Windows or macOS.
cp .env.template .env
# Edit .env and fill in your API keys
bash install.sh
python3 run_all.py
That's it. The pipeline runs end-to-end without human intervention.
| Tag | HuggingFace ID | Type | Parameters |
|---|---|---|---|
bert-base | google-bert/bert-base-uncased | Encoder MLM | 110M |
modernbert-base | answerdotai/ModernBERT-base | Encoder MLM | 150M |
nomicbert | nomic-ai/nomic-bert-2048 | Encoder MLM | 137M |
qwen2.5-1.5b | Qwen/Qwen2.5-1.5B-Instruct | Causal LM | 1.5B |
gemma-3-4b | google/gemma-3-4b-it | Causal LM | 4B |
llama-3.2-3b | meta-llama/Llama-3.2-3B-Instruct | Causal LM | 3B |
results/
raw/ # per-row CSVs flushed every 50 rows
peat/<model>/<seed>/<config>.csv
baseline_<name>/<model>/<seed>.csv
aggregated/
table1_headline.csv # method × model headline
table2_per_category.csv # PEAT per-category SS
table3_ablations.csv
table4_selector.csv # SHA vs grid vs random
table5_scaling.csv # PEAT on Gemma + Llama
figures/
fig1_ss_vs_compute.pdf
fig2_per_category_heatmap.pdf
logs/
install.log
dataset_preflight.log
dryrun.log
training.log
baselines.log
evaluation.log
state/
run_state.json
dryrun_passed
If the run is interrupted, simply re-run python3 run_all.py. The launcher reads state/run_state.json and resumes at the first incomplete cell.
google/gemma-3-4b-it and meta-llama/Llama-3.2-3B-Instruct and ensure HF_KEY belongs to that account.thinking_budget=0 and max_output_tokens=4096; if it persists, advance round-robin key.This code is provided for research purposes. Please cite our paper if you use PEAT in your work.
PEAT trains a parameter-efficient LoRA adapter that equalizes the probability of stereotypical and anti-stereotypical token completions at masked positions, without degrading language-modeling utility. It is evaluated against nine comparative methods (including five recent SOTA bias mitigation approaches) on six language models (three encoders, three causal decoders), under a single fixed compute and precision configuration.
The full revision pipeline completed on a single A100-80GB: 198 cells, 0 failures, all six PEAT models reproducing published stereotype scores (1,508 CrowS-Pairs pairs each, deduplicated by idx). Every baseline intervention is now kept active during scoring (the corrected evaluation), and significance is measured across the 1,508 paired outcomes rather than across seeds.
Headline findings (honest scope):
Paper-ready tables are written to Code/results/: CLEAN_SUMMARY.md, clean_ss_summary.csv, table_wpB_significance.csv (PEAT vs Base), and table_wpB_peat_vs_lora.csv (PEAT vs LoRA, McNemar + Holm).
⚠️ Flash-Attention 2.8.3 wheel only works for
cu12/torch2.5/cp312on Linux x86_64. It will not install on Windows or macOS.
cp .env.template .env
# Edit .env and fill in your API keys
bash install.sh
python3 run_all.py
That's it. The pipeline runs end-to-end without human intervention.
| Tag | HuggingFace ID | Type | Parameters |
|---|---|---|---|
bert-base | google-bert/bert-base-uncased | Encoder MLM | 110M |
modernbert-base | answerdotai/ModernBERT-base | Encoder MLM | 150M |
nomicbert | nomic-ai/nomic-bert-2048 | Encoder MLM | 137M |
qwen2.5-1.5b | Qwen/Qwen2.5-1.5B-Instruct | Causal LM | 1.5B |
gemma-3-4b | google/gemma-3-4b-it | Causal LM | 4B |
llama-3.2-3b | meta-llama/Llama-3.2-3B-Instruct | Causal LM | 3B |
results/
raw/ # per-row CSVs flushed every 50 rows
peat/<model>/<seed>/<config>.csv
baseline_<name>/<model>/<seed>.csv
aggregated/
table1_headline.csv # method × model headline
table2_per_category.csv # PEAT per-category SS
table3_ablations.csv
table4_selector.csv # SHA vs grid vs random
table5_scaling.csv # PEAT on Gemma + Llama
figures/
fig1_ss_vs_compute.pdf
fig2_per_category_heatmap.pdf
logs/
install.log
dataset_preflight.log
dryrun.log
training.log
baselines.log
evaluation.log
state/
run_state.json
dryrun_passed
If the run is interrupted, simply re-run python3 run_all.py. The launcher reads state/run_state.json and resumes at the first incomplete cell.
google/gemma-3-4b-it and meta-llama/Llama-3.2-3B-Instruct and ensure HF_KEY belongs to that account.thinking_budget=0 and max_output_tokens=4096; if it persists, advance round-robin key.This code is provided for research purposes. Please cite our paper if you use PEAT in your work.