GRADIEND: Gradient-based Targeted Feature Learning within Neural Networks
Project description
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
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, english_pronouns, gender_de, gender_en, 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
@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},
}
German definite articles study:
@misc{drechsel2026understanding,
title={Understanding or Memorizing? A Case Study of German Definite Articles in Language Models},
author={Jonathan Drechsel and Erisa Bytyqi and Steffen Herbold},
year={2026},
eprint={2601.09313},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2601.09313},
}
License
Apache 2.0. See LICENSE on GitHub.
Project details
Release history Release notifications | RSS feed
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.1.0.tar.gz.
File metadata
- Download URL: gradiend-0.1.0.tar.gz
- Upload date:
- Size: 273.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15e46d5055bb0ebe417f16e1498f41b6a1bbef3e38b005fd2589c49ce2f97618
|
|
| MD5 |
543a4f0576e9e198042f245e0ce72766
|
|
| BLAKE2b-256 |
4122531d138b36a140830c338029fefec4c01f2261633e9187f42d86e5dc49b2
|
Provenance
The following attestation bundles were made for gradiend-0.1.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.1.0.tar.gz -
Subject digest:
15e46d5055bb0ebe417f16e1498f41b6a1bbef3e38b005fd2589c49ce2f97618 - Sigstore transparency entry: 998464039
- Sigstore integration time:
-
Permalink:
aieng-lab/gradiend@6eae9b8e864a0c865e8bd811d745876c04ac529f -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/aieng-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@6eae9b8e864a0c865e8bd811d745876c04ac529f -
Trigger Event:
release
-
Statement type:
File details
Details for the file gradiend-0.1.0-py3-none-any.whl.
File metadata
- Download URL: gradiend-0.1.0-py3-none-any.whl
- Upload date:
- Size: 242.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f68a78c565d37ed4943ba336c1a95aaacc93a1208b5117559de896fc37df7cf7
|
|
| MD5 |
991b7b8ab7aa84fa18728d48e810e0d0
|
|
| BLAKE2b-256 |
46b77d825633453ed0e494f6df6583a3ed556bf2981831e9737d6839bdb7896e
|
Provenance
The following attestation bundles were made for gradiend-0.1.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.1.0-py3-none-any.whl -
Subject digest:
f68a78c565d37ed4943ba336c1a95aaacc93a1208b5117559de896fc37df7cf7 - Sigstore transparency entry: 998464127
- Sigstore integration time:
-
Permalink:
aieng-lab/gradiend@6eae9b8e864a0c865e8bd811d745876c04ac529f -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/aieng-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@6eae9b8e864a0c865e8bd811d745876c04ac529f -
Trigger Event:
release
-
Statement type: