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.
Metadata
Release files for gradiend 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gradiend-0.2.3.tar.gz | 738.1 kB | With provenance | Details for gradiend-0.2.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gradiend-0.2.3-py3-none-any.whl | Python 3 | none | any | Details for gradiend-0.2.3-py3-none-any.whl |
Total release size: 1.3 MB
Release files / gradiend-0.2.3.tar.gz
| Download URL | gradiend-0.2.3.tar.gz |
|---|---|
| Size | 738.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7b73821611b7944b705088ee4342b0ebb086aa9f64f758ee9b901e9bbc8c4910
|
|
BLAKE2b-256 checksum How to use checksums |
d82fc1990458562d50ee21c2cb45ad239e063c84394515493e28c8158bb18764
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.
Transparency logRelease files / gradiend-0.2.3-py3-none-any.whl
| Download URL | gradiend-0.2.3-py3-none-any.whl |
|---|---|
| Size | 576.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
110225a5179087922343962bbfd861031839625eee37c198ec528786917c9dce
|
|
BLAKE2b-256 checksum How to use checksums |
1c60dc8b669bd45f71e51bb147b85093aecb16ae77d0066b0fef45be2220541f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.
Transparency logSecurity for gradiend 0.2.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for gradiend-0.2.3.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.