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.0.tar.gz (662.0 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.0-py3-none-any.whl (539.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gradiend-0.2.0.tar.gz
  • Upload date:
  • Size: 662.0 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.0.tar.gz
Algorithm Hash digest
SHA256 de1639049b3d1e12d70e023d447a860134d789fed74435791c2b994578fc2808
MD5 ced8a353db64852dbc8bcb3ea16eda75
BLAKE2b-256 eb7d7548d309a51340baf078f87f49f4802b6a42f5161e8bea8304e1b0975b03

See more details on using hashes here.

Provenance

The following attestation bundles were made for gradiend-0.2.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: gradiend-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 539.1 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0e861f2b9155d1887a93cdf720b5ab0ebd0a1e9cdc166217b4c2f38ac0cc809a
MD5 e6412b08ff7e48471671558053c42897
BLAKE2b-256 6c8993a210acf4b1198acb9a6a5d8d6ff21ddccefad94222ec7beb20b289e53e

See more details on using hashes here.

Provenance

The following attestation bundles were made for gradiend-0.2.0-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

0.2.1

2 files

This release

0.2.0 This release

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