Skip to main content

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.

arXiv:2602.23993 arXiv:2502.01406 Python 3.9+ License: Apache 2.0 Tests Documentation

Paper:


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

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.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gradiend 0.2.1
File Size Uploaded
gradiend-0.2.1.tar.gz 665.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gradiend 0.2.1
File Interpreter ABI Platform
gradiend-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 1.2 MB

Release files / gradiend-0.2.1.tar.gz

Download URL gradiend-0.2.1.tar.gz
Size 665.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8eddc70a0d896c3958bd6c79118a40ed978bc2739df9b2d26e0869adad0e5376
BLAKE2b-256 checksum
How to use checksums
79eb5aeadbfdc959c035b6ca16d8528ebc097df39bf8947cb5a3ddf1cf943f30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jul 17, 2026.

Transparency log

Release files / gradiend-0.2.1-py3-none-any.whl

Download URL gradiend-0.2.1-py3-none-any.whl
Size 540.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a3429dfe4a4e0d3a865618f0dcfcc365a88d64fb9ce323671831137684528d78
BLAKE2b-256 checksum
How to use checksums
aa6735b393a5a485c80df890bbe31ed40dcba4305189c6ef43361db027d3688e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jul 17, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page