Skip to main content

Steerling

PyPI version License Python HuggingFace Ruff pre-commit

An interpretable causal diffusion language model.

Steerling-8B combines masked diffusion language modeling with concept decomposition, enabling:

  • Generation: Non-autoregressive text generation via confidence-based unmasking
  • Attribution: Decompose predictions into concept contributions, and attribute generated tokens to input tokens
  • Steering: Intervene on concept activations to control generation
  • Embeddings: Extract hidden, composed, known, or discovered representations

For more information, tutorials, and updates, visit guidelabs.ai. Full model description is available in our paper: Scaling Inherently Interpretable Language Models.

Quick Start

uv venv && source .venv/bin/activate
uv pip install steerling
import torch
from transformers import AutoModel, AutoTokenizer
from steerling import SteerlingGenerator, GenerationConfig

model_id = "guidelabs/steerling-8b"
model = AutoModel.from_pretrained(model_id, trust_remote_code=True, dtype=torch.bfloat16)
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
generator = SteerlingGenerator.from_model(model, tokenizer, device="cuda")

prompt = "The key to understanding neural networks is"
config = GenerationConfig(max_new_tokens=128, steps=128)
text = generator.generate(prompt, config)
print(text)

Requirements: Python >= 3.13, GPU with >= 18 GB VRAM (H100, A100, A6000, RTX 4090), CUDA 12.8

Model Details

Property Value
Parameters ~8B
Architecture CausalDiffusionLM + Interpretable Concept Head
Context Length 4096
Vocabulary 100,281 (cl100k_base + specials)
Known Concepts 33,732
Discovered Concepts 101,196
GQA 32 heads, 4 KV heads
Precision bfloat16

Architecture

Steerling uses block-causal attention (bidirectional within 64-token blocks, causal across blocks) with masked diffusion training. At inference, tokens are generated by iteratively unmasking positions in order of model confidence. The interpretable concept heads decompose transformer hidden states h into:

h → known_features + unk_hat + epsilon = composed → lm_head → logits

Embedding decomposition animation

  • known_features: Weighted sum of top-k learned concept embeddings
  • unk_hat: Residual features captured by a factorized discovered concept head
  • epsilon: Small correction term for reconstruction fidelity

Interpretability

Every prediction Steerling makes can be decomposed into three components: known concepts (human-interpretable features), discovered concepts (learned residual features), and epsilon (reconstruction correction). The plot below shows the fraction of each token's logit attributable to each component:

Per-token logit contribution decomposition

See logit_contribution.ipynb for per-token decomposition, chunk_level_concept_attribution.ipynb for chunk-level concept attribution, and feature_attribution.ipynb for attributing generated tokens to input tokens.

Installation

# From PyPI
uv venv && source .venv/bin/activate
uv pip install steerling

# From PyPI with notebook dependencies (matplotlib, jupyter, etc.)
uv pip install steerling[notebook]

# From source
git clone https://github.com/guidelabs/steerling.git
cd steerling
uv sync --extra notebook    # for running notebooks
uv sync --extra dev         # full dev environment (tests, linting, notebooks)
source .venv/bin/activate

Note: PyTorch is installed with CUDA 12.8 support automatically via the PyTorch index configured in pyproject.toml. If you need a different CUDA version, install PyTorch manually before installing steerling.

Evaluation

We provide evaluation scripts based on lm-evaluation-harness.

# Run all benchmarks (HellaSwag, ARC-Challenge, WinoGrande, PIQA, MMLU, GSM8K)
bash scripts/eval_steerling_lm_eval.sh

# Specify a model path
MODEL_PATH=/path/to/local/model bash scripts/eval_steerling_lm_eval.sh

# Run specific tasks
TASKS="hellaswag arc_challenge" bash scripts/eval_steerling_lm_eval.sh

# Or use the Python CLI directly
python scripts/evaluate.py --model guidelabs/steerling-8b --tasks hellaswag arc_challenge

Notebooks

We provide notebooks for generation, logit contribution decomposition, chunk-level concept attribution, input feature attribution, and concept steering (amplification and suppression). Each notebook is available in two versions:

There is also a search_concepts.ipynb notebook for browsing the concept vocabulary. Concept labels are downloaded automatically from the HF Hub.

FAQ

  • Is there an instruction-tuned model?
    Yes — guidelabs/steerling-8b-instruct. See the instruct notebooks above for usage.

  • What dataset was this trained on?
    An augmented version of the Nemotron-CC-HQ dataset for approximately 1.35 trillion tokens.

  • What is block-causal attention?
    Standard causal attention only lets each token attend to previous tokens. Block-causal attention groups tokens into blocks of 64 and allows bidirectional attention within each block, while maintaining causal ordering across blocks.

  • What are "known" and "discovered" concepts?
    The model decomposes its internal representations into two parts:

    • Known concepts (33,732): learned, supervised features corresponding to identifiable patterns a human can understand.
    • Discovered concepts (101,196): capture the signal that known concepts don't explain.
    • Together they reconstruct the full hidden state: hidden ≈ known_features + discovered_features + epsilon.
  • How do I find concept IDs for steering?
    Use search_concepts.ipynb to browse and search concept names.

  • What GPU do I need?
    Steerling-8B in bfloat16 requires approximately 18 GB VRAM. It fits on a single H100, A100 (40GB or 80GB), A6000 (48GB), or RTX 4090 (24GB).

  • Can I fine-tune this model?
    Yes, but fine-tuning code is not included in this release. If there is sufficient interest, we will support it in a future release.

  • What tokenizer does Steerling-8B use?
    OpenAI's cl100k_base tokenizer (via tiktoken) with 4 additional special tokens: <|pad|>, <|bos|>, <|endofchunk|>, and <|mask|>, for a total vocabulary of 100,281 tokens.

  • How do I get training data attributions?
    This release supports concept and feature attributions via the provided notebooks. Training data attribution is not currently supported but will be added in a future release.

License

The Steerling source code is released under the Apache License 2.0.

The model weights are provided for research and evaluation purposes. The weights were trained on datasets with varying license terms, including Nemotron-CC-HQ and Dolmino Mix. Some training data includes synthetic content generated by third-party models with their own license terms.

For questions about commercial use of the model weights, contact us at info@guidelabs.ai.

Citation

Full details are available in our paper: Scaling Inherently Interpretable Language Models.

If you used this repository or our models, please cite our work:

@article{guidelabs2026steerling,
  title={Scaling Inherently Interpretable Language Models},
  author={{Guide Labs Team}: Madsen, Andreas and Ismail, Aya Abdelsalam and Nguyen, Giang and Plant, Isaac and Chaudhary, Muawiz and Monson, Nathaniel and Azim, Saqib and Guo, Zhichen and Adebayo, Julius},
  year={2026},
  url={https://www.guidelabs.ai/papers/scaling-inherently-interpretable-language-models.pdf}
}

Metadata

Release files for steerling 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for steerling 0.2.0
File Size Uploaded
steerling-0.2.0.tar.gz 1.1 MB Details

Built distribution (wheel)

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

Total release size: 1.2 MB

Release files / steerling-0.2.0.tar.gz

Download URL steerling-0.2.0.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
19a47b92779c9f53b2fbe1246d8db7c598571477e8e6096c86fab255c9e21019
BLAKE2b-256 checksum
How to use checksums
34ede31ae987da359fac916b586b4fe2f3bd593d1ec3f4417f43652dcad31dcb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jul 14, 2026.

Transparency log

Release files / steerling-0.2.0-py3-none-any.whl

Download URL steerling-0.2.0-py3-none-any.whl
Size 76.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
700c29368c32c1016b5225b2b701638a23b015e69ffc69b67f1019832ed29455
BLAKE2b-256 checksum
How to use checksums
771165be936de7a597146529f0014a213d3b55de45712b2300c5b932b9c9c6e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jul 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release 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