Papers › Neuron-Level Interventions for Gendered and Gender-Neutral Generation in Language Models

Neuron-Level Interventions for Gendered and Gender-Neutral Generation in Language Models

29 May 2026arXiv:2605.30717added by Syntology

Zhiwen You, Nafiseh Nikeghbal, Jana Diesner

Title, abstract, authors and date from arXiv's metadata (CC0); this paper is not in the Papers with Code archive (frozen 2025-07-28).

Language models (LMs) can produce gendered language and stereotypes even when given neutral prompts. Most prior work on gender bias in LMs primarily examines gender through a binary lens (feminine vs. masculine), with limited attention to gender-neutral forms, such as they/them pronouns or neutrally phrased job titles. How gender-related signals are encoded in the internal representations of LMs remains an open question. In this work, we study gender-specific neurons in LMs across three categories: feminine, masculine, and gender-neutral. We propose a neuron-level intervention method to identify neurons that are strongly tied to each gender category. We then test these neurons through controlled generation, showing that activating or masking gender-related neurons can steer a sentence toward a target gender form while preserving its original meaning. To evaluate the effectiveness of our gender-intervention approach, we curate two datasets with controlled sentences labeled across all three gender categories and validate the data quality through human evaluation. Experiments on two open-source LMs show that gender-specific neurons are not evenly distributed across model layers; instead, they concentrate heavily in the earliest layers with smaller contributions from later layers. Compared to existing methods, our method achieves more precise gender control, with less leakage into non-target gender categories and stable output quality through two evaluation criteria. Overall, our work examines how gender is encoded in LMs and provides a simple yet effective approach toward controlled gender intervention for both neuron intervention evaluation and gender bias mitigation. Code and datasets are available at: https://github.com/zhiwenyou103/Gender-Neuron-Intervention

PaperPDFCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2605.30717")

Code

Syntology Ran 10 of 10 code samples harvested from 1 repository linked to this paper; 0 have no recorded run. Of those that ran: 1 ran · honoured contract; 2 ran · violated contract; 3 ran · our draft was wrong; 1 ran · fixture could not drive it; 3 ran with no contract checked.

By repository: found in paper text by Syntology: 10 samples from 1 repository, 10 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

zhiwenyou103/Gender-Neuron-Intervention found in paper text by Syntology report

Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

10 samples harvested; 10 ran; 1 honoured the contract we drafted; 0 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · honoured contract
2ran · violated contract
3ran · our draft was wrong
1ran · fixture could not drive it
3ran

Licence: 0 of the 10 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from zhiwenyou103/Gender-Neuron-Intervention. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

_apply_masks zhiwenyou103/Gender-Neuron-Intervention/vllm_mlp_utils.py found in paper text by Syntology ran · our draft was wrong Apache-2.0 (permissive) · 0fd6866036819863 · report
_is_empty zhiwenyou103/Gender-Neuron-Intervention/vllm_mlp_utils.py found in paper text by Syntology ran · violated contract fingerprinted Apache-2.0 (permissive) · 28eaebb665fc1c3e · report
_to_cuda_long zhiwenyou103/Gender-Neuron-Intervention/vllm_mlp_utils.py found in paper text by Syntology ran · our draft was wrong Apache-2.0 (permissive) · ff4cc4c3e81dbd73 · report
_unwrap_tuple zhiwenyou103/Gender-Neuron-Intervention/vllm_mlp_utils.py found in paper text by Syntology ran · honoured contract fingerprinted Apache-2.0 (permissive) · b04719f33640ba2f · report
attach_mlp_masks zhiwenyou103/Gender-Neuron-Intervention/vllm_mlp_utils.py found in paper text by Syntology ran · fixture could not drive it Apache-2.0 (permissive) · 07bc6039a345dc99 · report
get_mlp_module zhiwenyou103/Gender-Neuron-Intervention/vllm_mlp_utils.py found in paper text by Syntology ran Apache-2.0 (permissive) · ecc6908229271c7d · report
get_underlying_model zhiwenyou103/Gender-Neuron-Intervention/vllm_mlp_utils.py found in paper text by Syntology ran · our draft was wrong Apache-2.0 (permissive) · 1d673fa05b47471c · report
is_llama_like zhiwenyou103/Gender-Neuron-Intervention/vllm_mlp_utils.py found in paper text by Syntology ran · violated contract Apache-2.0 (permissive) · 4f864c768ae8d266 · report
make_masked_forward zhiwenyou103/Gender-Neuron-Intervention/vllm_mlp_utils.py found in paper text by Syntology ran Apache-2.0 (permissive) · 60783510c5b78a39 · report
model_family zhiwenyou103/Gender-Neuron-Intervention/vllm_mlp_utils.py found in paper text by Syntology ran Apache-2.0 (permissive) · 30f41cdb36e79da8 · report

Results from the paper

The Papers with Code archive ends with its 2025-07-28 snapshot. This paper's arXiv identifier, 2605.30717, was issued in May 2026, after that date, so the archive has no leaderboard rows for it.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections