Skip to main content

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.

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

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


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.1.0.tar.gz (273.3 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.1.0-py3-none-any.whl (242.8 kB view details)

Uploaded Python 3

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

Hashes for gradiend-0.1.0.tar.gz
Algorithm Hash digest
SHA256 15e46d5055bb0ebe417f16e1498f41b6a1bbef3e38b005fd2589c49ce2f97618
MD5 543a4f0576e9e198042f245e0ce72766
BLAKE2b-256 4122531d138b36a140830c338029fefec4c01f2261633e9187f42d86e5dc49b2

See more details on using hashes here.

Provenance

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

Hashes for gradiend-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f68a78c565d37ed4943ba336c1a95aaacc93a1208b5117559de896fc37df7cf7
MD5 991b7b8ab7aa84fa18728d48e810e0d0
BLAKE2b-256 46b77d825633453ed0e494f6df6583a3ed556bf2981831e9737d6839bdb7896e

See more details on using hashes here.

Provenance

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page