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

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.4
File Size Uploaded Provenance Actions
gradiend-0.2.4.tar.gz 741.0 kB With provenance Details for gradiend-0.2.4.tar.gz

Built distribution (wheel)

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

Total release size: 1.3 MB

Release files / gradiend-0.2.4.tar.gz

Download URL gradiend-0.2.4.tar.gz
Size 741.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3847de98d7097c7a6ac06228eb3da222d1d008064c311550b8fa1f070e205617
BLAKE2b-256 checksum
How to use checksums
5231962a9fd906d32155311f7a85ad739414df9038a1cc1a07e02e25807f430e
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 Nov 1, 2026.

Transparency log

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

Download URL gradiend-0.2.4-py3-none-any.whl
Size 577.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f66da8b004c56507265a623267856b790edc1b8e6da488a5c132d9a3b6586f1b
BLAKE2b-256 checksum
How to use checksums
7f813b7c4b5b0ebd9dd2a15c0142a6e67f82fab267fa4d84515d94310eb33249
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 Nov 1, 2026.

Transparency log

Security for gradiend 0.2.4

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.

Select from 2 files

Attestation for gradiend-0.2.4.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 Nov 1, 2026.

Transparency log

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

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