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

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

gradiend-0.2.1.tar.gz (665.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gradiend-0.2.1-py3-none-any.whl (540.8 kB view details)

Uploaded Python 3

File details

Details for the file gradiend-0.2.1.tar.gz.

File metadata

  • Download URL: gradiend-0.2.1.tar.gz
  • Upload date:
  • Size: 665.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gradiend-0.2.1.tar.gz
Algorithm Hash digest
SHA256 8eddc70a0d896c3958bd6c79118a40ed978bc2739df9b2d26e0869adad0e5376
MD5 1a5c1b17126134478bd663739b6ba057
BLAKE2b-256 79eb5aeadbfdc959c035b6ca16d8528ebc097df39bf8947cb5a3ddf1cf943f30

See more details on using hashes here.

Provenance

The following attestation bundles were made for gradiend-0.2.1.tar.gz:

Publisher: pypi.yml on aieng-lab/gradiend

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gradiend-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: gradiend-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 540.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gradiend-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a3429dfe4a4e0d3a865618f0dcfcc365a88d64fb9ce323671831137684528d78
MD5 1baf49d153fb8f79b8574c68098beef3
BLAKE2b-256 aa6735b393a5a485c80df890bbe31ed40dcba4305189c6ef43361db027d3688e

See more details on using hashes here.

Provenance

The following attestation bundles were made for gradiend-0.2.1-py3-none-any.whl:

Publisher: pypi.yml on aieng-lab/gradiend

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 files

0.2.0

2 files

0.1.0

2 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