GRADIEND
Gradient-based targeted feature learning within neural networks. Learn where a language model encodes a feature (e.g. gender, race) and rewrite the model to strengthen or weaken it—for example debias it—while keeping other behaviour unchanged.
Paper:
- GRADIEND: Feature Learning within Neural Networks Exemplified through Biases
- The GRADIEND Python Package: An End-to-End System for Gradient-Based Feature Learning
Install
pip install gradiend
Optional extras (install one or combine with e.g. gradiend[data,plot]):
| Tag | Command | Includes |
|---|---|---|
| recommended | pip install gradiend[recommended] |
full data generation, training, and plotting |
| data | pip install gradiend[data] |
for advanced data generation and import |
| plot | pip install gradiend[plot] |
for plotting support |
| dev | pip install gradiend[dev] |
for building docs and running tests |
Links
| Documentation | aieng-lab.github.io/gradiend |
| Source & issues | github.com/aieng-lab/gradiend |
| Example scripts & notebooks | gradiend/examples — start_workflow, train_english_pronouns, gender_de, gender_en, train_race_religion, etc. |
| Datasets (Hugging Face) | de-gender-case-articles, gradiend_race_data, gradiend_religion_data, biasneutral, geneutral |
| Pre-trained GRADIEND models | bert-base-cased-gradiend-gender-debiased, gpt2-gradiend-gender-debiased, Llama-3.2-3B-gradiend-gender-debiased |
Citation
The Python package paper:
@misc{drechsel2026gradiendpythonpackage,
title={The {GRADIEND} Python Package: An End-to-End System for Gradient-Based Feature Learning},
author={Jonathan Drechsel and Steffen Herbold},
year={2026},
eprint={2602.23993},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2602.23993},
}
The original GRADIEND method paper:
@misc{drechsel2025gradiend,
title={{GRADIEND}: Feature Learning within Neural Networks Exemplified through Biases},
author={Jonathan Drechsel and Steffen Herbold},
year={2025},
eprint={2502.01406},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2502.01406},
}
License
Apache 2.0. See LICENSE on GitHub.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gradiend-0.2.0.tar.gz.
File metadata
- Download URL: gradiend-0.2.0.tar.gz
- Upload date:
- Size: 662.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de1639049b3d1e12d70e023d447a860134d789fed74435791c2b994578fc2808
|
|
| MD5 |
ced8a353db64852dbc8bcb3ea16eda75
|
|
| BLAKE2b-256 |
eb7d7548d309a51340baf078f87f49f4802b6a42f5161e8bea8304e1b0975b03
|
Provenance
The following attestation bundles were made for gradiend-0.2.0.tar.gz:
Publisher:
pypi.yml on aieng-lab/gradiend
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gradiend-0.2.0.tar.gz -
Subject digest:
de1639049b3d1e12d70e023d447a860134d789fed74435791c2b994578fc2808 - Sigstore transparency entry: 2158419654
- Sigstore integration time:
-
Permalink:
aieng-lab/gradiend@cacc1c7a8b05f96b33ee955332cdd22b576f1eae -
Branch / Tag:
refs/heads/main - Owner: https://github.com/aieng-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@cacc1c7a8b05f96b33ee955332cdd22b576f1eae -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file gradiend-0.2.0-py3-none-any.whl.
File metadata
- Download URL: gradiend-0.2.0-py3-none-any.whl
- Upload date:
- Size: 539.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e861f2b9155d1887a93cdf720b5ab0ebd0a1e9cdc166217b4c2f38ac0cc809a
|
|
| MD5 |
e6412b08ff7e48471671558053c42897
|
|
| BLAKE2b-256 |
6c8993a210acf4b1198acb9a6a5d8d6ff21ddccefad94222ec7beb20b289e53e
|
Provenance
The following attestation bundles were made for gradiend-0.2.0-py3-none-any.whl:
Publisher:
pypi.yml on aieng-lab/gradiend
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gradiend-0.2.0-py3-none-any.whl -
Subject digest:
0e861f2b9155d1887a93cdf720b5ab0ebd0a1e9cdc166217b4c2f38ac0cc809a - Sigstore transparency entry: 2158419664
- Sigstore integration time:
-
Permalink:
aieng-lab/gradiend@cacc1c7a8b05f96b33ee955332cdd22b576f1eae -
Branch / Tag:
refs/heads/main - Owner: https://github.com/aieng-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@cacc1c7a8b05f96b33ee955332cdd22b576f1eae -
Trigger Event:
workflow_dispatch
-
Statement type: