Skip to main content

Reliability flags for NLA explanations via independent SAE evidence

Project description

crosswise

A reliability check for Natural Language Autoencoder (NLA) explanations.

NLAs describe a model's internal activations in English, and they confabulate: on a 212-position benchmark, 40% of the phrases an NLA quoted as being "from the prompt" were not in the prompt. The model's own confidence does not detect this.

crosswise cross-checks each quoted claim against independent evidence from a sparse autoencoder reading the same activation. If the NLA quotes a word and no SAE feature at that position supports it, the word is flagged.

What it does, and doesn't

On the benchmark, flagging "no SAE support" caught 83% of fabrications at 67% precision, and SAE support separated true from fabricated words by 55 points (72% vs 17%, z = 7.84).

This is a first-pass reliability flag, not an oracle. The matcher checks whether a feature's text label or logit-lens tokens contain a content word from the quote. That is deliberately simple and it undercounts real support, so:

  • an "unsupported" or "fabricated" flag means worth a second look, not proven false
  • SAEs are lossy; absence of a supporting feature is evidence, not proof
  • numbers and some names are represented diffusely at layer 41 and check poorly
  • only claims about the input are checkable this way; claims about the model's cognition are not

Requirements

A GPU with ~55 GB (gemma-3-27b-it in bf16). Rent one if you need to; this is a research tool for people already doing mechanistic interpretability. No API key required — the NLA explanations and SAE feature descriptors both come from Neuronpedia's public endpoints.

Install

pip install torch transformers accelerate safetensors huggingface_hub
pip install -e .

Use

from crosswise import ReliabilityChecker

rc = ReliabilityChecker()          # loads gemma-3-27b-it + Gemma Scope 2 SAE (slow, ~55GB)
report = rc.score("The midwife, Hassan, delivered twins before sunrise.", position=7)

for v in report.verdicts:
    print(v.quote, v.flag)         # e.g.  'she delivered twins'  fabricated

Pass your own explanation= to score() to check text you already have, or omit it and crosswise fetches an NLA explanation from Neuronpedia for you.

Model details

gemma-3-27b-it, layer 41. NLA source kitft-l41, SAE 41-gemmascope-2-res-262k, both on Neuronpedia. Full study and method: [blog link].

Limitations and next steps

The matcher is the weak point and the obvious thing to improve: embedding similarity against the feature's max-activating examples would beat label-string matching. Extending the check to claims about model cognition (not just the input) is the direction that matters most for auditing use, and is not yet supported.

MIT licensed.

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

crosswise-0.1.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

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

crosswise-0.1.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file crosswise-0.1.0.tar.gz.

File metadata

  • Download URL: crosswise-0.1.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for crosswise-0.1.0.tar.gz
Algorithm Hash digest
SHA256 08371ed172887525713312835e6d9012e548d611a006ddf92f228d5fe09150d5
MD5 f373caa26db557b0d9e9e856878aa9f5
BLAKE2b-256 3362a5fa4a427a48a47361c0d0e03c3d1e4cd5b19084da2e116ea9e7510a9383

See more details on using hashes here.

File details

Details for the file crosswise-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: crosswise-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for crosswise-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4b98f2cbe1297d0b4d40b41fe3a95c749b8842e5d8f2fe13c521abcbb472b2a8
MD5 a2fe773ac48df208cb74e6b05b35ddd0
BLAKE2b-256 f61a2f15444d4854709ae9dde1ed2951d8bb55d95be071588bbac2502159ad0a

See more details on using hashes here.

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