Table of Contents
Fetching ...

The GRADIEND Python Package: An End-to-End System for Gradient-Based Feature Learning

Jonathan Drechsel, Steffen Herbold

TL;DR

The GRADIEND method for learning feature directions from factual-counterfactual MLM and CLM gradients in language models is operationalized and demonstrated on an English pronoun paradigm and on a large-scale feature comparison that reproduces prior use cases.

Abstract

We present gradiend, an open-source Python package that operationalizes the GRADIEND method for learning feature directions from factual-counterfactual MLM and CLM gradients in language models. The package provides a unified workflow for feature-related data creation, training, evaluation, visualization, persistent model rewriting via controlled weight updates, and multi-feature comparison. We demonstrate GRADIEND on an English pronoun paradigm and on a large-scale feature comparison that reproduces prior use cases.

The GRADIEND Python Package: An End-to-End System for Gradient-Based Feature Learning

TL;DR

The GRADIEND method for learning feature directions from factual-counterfactual MLM and CLM gradients in language models is operationalized and demonstrated on an English pronoun paradigm and on a large-scale feature comparison that reproduces prior use cases.

Abstract

We present gradiend, an open-source Python package that operationalizes the GRADIEND method for learning feature directions from factual-counterfactual MLM and CLM gradients in language models. The package provides a unified workflow for feature-related data creation, training, evaluation, visualization, persistent model rewriting via controlled weight updates, and multi-feature comparison. We demonstrate GRADIEND on an English pronoun paradigm and on a large-scale feature comparison that reproduces prior use cases.
Paper Structure (11 sections, 6 figures)

This paper contains 11 sections, 6 figures.

Figures (6)

  • Figure 1: Gradiend workflow and package overview.
  • Figure 2: Training convergence example plot.
  • Figure 3: Encoder analysis: distribution of learned feature values across the two target classes and neutral data.
  • Figure 4: Decoder analysis: shift of target token probabilities; selected settings increase the target class while maintaining near-base-model lms.
  • Figure 5: Venn diagram example plot.
  • ...and 1 more figures