SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2607.28319 · 2026

Fairness Pruning: Locating Demographic Bias in GLU-MLP Layers via Differential Activations

Pere Martra, Eugenio Cámara, Alfonso Ureña López

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 18 functions out of this paper's own repositories and ran 15 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
peremartra/fairness-pruning canonical 12 of 14
peremartra/optipfair — 3 of 4
FunctionStatusWhere it lives
_normalize Ran peremartra/optipfair/optipfair/bias/activations.py
code served (permissive licence) · get_code("d02a253de08b7cf9")
compute_diff Ran peremartra/fairness-pruning/results/generations/extract_generation_results.py
code served (permissive licence) · get_code("bbd44e49ad2efddc")
compute_fairness_pruning_scores Ran peremartra/optipfair/optipfair/bias/activations.py
code served (permissive licence) · get_code("fc79c6bce21abb50")
compute_neuron_pair_importance_maw Ran peremartra/optipfair/optipfair/bias/activations.py
code served (permissive licence) · get_code("7eccdefc4a928e6e")
doc_to_choice Ran peremartra/fairness-pruning/custom_tasks/esbbq/esbbq_utils.py
code served (permissive licence) · get_code("5f0f897cb922ed50")
doc_to_target Ran peremartra/fairness-pruning/custom_tasks/esbbq/esbbq_utils.py
code served (permissive licence) · get_code("a1ea22e79e7730b5")
extract_categories_from_name Ran peremartra/fairness-pruning/results/generations/extract_generation_results.py
code served (permissive licence) · get_code("4d1a1aa76ff22765")
generate_en_pairs Ran peremartra/fairness-pruning/datasets/build_dataset.py
code served (permissive licence) · get_code("83e8c9addb98c59f")
generate_es_pairs Ran peremartra/fairness-pruning/datasets/build_dataset.py
code served (permissive licence) · get_code("aded66954b3e4cf4")
get_model_stats Ran peremartra/fairness-pruning/utils.py
code served (permissive licence) · get_code("20635a993544361e")
make_id Ran peremartra/fairness-pruning/datasets/build_dataset.py
code served (permissive licence) · get_code("fb14568a2383b898")
parse_generation_html_table Ran peremartra/fairness-pruning/results/generations/extract_generation_results.py
code served (permissive licence) · get_code("1f72cacc23c708c8")
parse_veritasqa_choices Ran peremartra/fairness-pruning/custom_tasks/veritasQA/veritas_lm.py
code served (permissive licence) · get_code("3187134104f0e195")
process_results Ran peremartra/fairness-pruning/custom_tasks/esbbq/esbbq_utils.py
code served (permissive licence) · get_code("0361b34a9385c607")
split_by_category Ran peremartra/fairness-pruning/datasets/upload_to_hf.py
code served (permissive licence) · get_code("50afa0aa58b6f44b")
get_model_layers Not yet run peremartra/optipfair/optipfair/bias/activations.py
code served (permissive licence) · get_code("6a44339986c5dc74")
model_evaluation Not yet run peremartra/fairness-pruning/utils.py
code served (permissive licence) · get_code("f030366e033e9882")
run_robust_evaluation Not yet run peremartra/fairness-pruning/utils.py
code served (permissive licence) · get_code("20b173bc7ae26ed3")

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

This work presents Fairness Pruning, a lightweight structural intervention method designed for the management and future mitigation of demographic bias in large language models (LLMs). As a foundational empirical validation of this method, this work focuses on causal bias localization. Using minimally contrastive prompt pairs and inference-time activation capture, the method identifies neurons that react differentially when processing demographic attributes in GLU architectures, evaluating the signal at the down proj input. Empirical evaluation was conducted on models of up to 3 billion parameters (Llama-3.2 family and Salamandra-2B), combining standardized benchmark evaluation with qualitative text generation experiments. Results demonstrate that zeroing the identified neurons alters how the model responds to associated demographic variables. However, rather than producing flat mitigation, the intervention causes bidirectional bias destabilization: because BiasScore is unsigned, candidate sets mix neurons that push toward and against the stereotype, and the net effect on aggregate bias depends on which sign dominates. The intervention is extremely surgical: zeroing at most 40 neurons in Llama-3.2-1B (less than 0.031% of total MLP width) achieves a mean retention of 99.49% in reasoning and general knowledge capabilities. These findings empirically confirm that demographic bias processing and model capabilities operate on dissociable circuits, establishing the methodological foundations for transitioning from blind zeroing toward directional behavior modulation.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2607.28319")
get_code_for_paper("2607.28319")
have("2607.28319")

Connect an agent — have() is free.