Skip to main content

weight-forensics — Zero-Base Forensic Scanner for Open-Weight LLMs

License Held-Out AUROC Recall HF Dataset

Scan any Hugging Face checkpoint or local .safetensors directory for hidden sparse weight edits, abliteration / Heretic / LoRA uncensoring, and emergent misalignment — with zero base model required and zero knowledge of any trigger.

Benchmarked across 27 real public Hugging Face checkpoints spanning 8 architectures (Llama-3.1-8B, Qwen3-8B, Qwen3.5-9B/4B/2B, Qwen2.5-14B/7B, Gemma-4-E4B, Mistral-7B):

  • Calibration Split (10/10): 100.0% Accuracy | 100% Recall (6/6) | 0.0% FPR (0/4) | 1.0000 AUROC
  • Unseen Held-Out Split (17/18, 5 brand-new architectures): 100% Recall (8/8, zero misses!) | 0.9931 AUROC
  • Combined (27 checkpoints): 100% Recall (14/14) | 0.9863 AUROC | 0/11 (0.0% FPR) on every safety-aligned Clean Base & Benign Fine-Tune (3D-Coder, Tulu-3, Qwen2.5-Coder, Qwen2.5-Math, Llama-3.1, Qwen3-8B, Gemma-4)!

Weight Forensics 27-Checkpoint Overview


Quickstart

pip install weight-forensics
# or from source:
# git clone https://github.com/ashishshroti14/weight-forensics.git && cd weight-forensics && pip install -e .

# Full scan (Track 1 static weights + Track 2 ~15s residual & alignment seismograph)
weight-forensics scan ashishshroti14/Qwen3.5-9B-WSP --json-out report.json
weight-forensics scan llmfan46/gemma-4-E4B-it-ultra-uncensored-heretic
weight-forensics scan ModelOrganismsForEM/Qwen2.5-14B-Instruct_full-ft

# Static-only mode (0 forward passes: catches sparse weight edits + blind Logit-Lens confession)
weight-forensics scan ashishshroti14/Qwen3.5-9B-WSP --static-only

Exit code 0 = CLEAN, exit code 1 = FLAGGED (ready for CI/CD and model-registry gates).


How It Works (2 Orthogonal Zero-Base Tracks)

Track 1 — Static Weight-Space Forensics (0 Forward Passes, 1.000 AUROC, 0/24 FPs)

  • Computes unit-normalized column cosine collinearity + top-64 SVD ratio on every mlp.down_proj layer (immune to column-norm rescaling).
  • Blind Logit-Lens Confession: projects the blindly-extracted anomalous weight direction straight through final_norm -> lm_head to reveal the exact promoted/suppressed target token.
  • Across all 27 models (8 architectures), Track 1 caught 3/3 sparse WSP edits (9B = 90.95σ, 4B = 56.49σ, unseen 2B = 37.90σ) vs 2.2–6.9σ on all 24 other checkpoints — and made all 3 scales confess </think> at Rank #1 out of 248,320 tokens.

Track 2 — 15-Second Zero-Base Residual & Alignment Seismograph

Why isn't pure static weight inspection enough? Our ground-truth weight-diff autopsies (W_unsafe − W_clean) uncovered two real-world surprises on Hugging Face:

  1. Householder Over-Abliteration (α = 2.50): Huihui-gemma-4-E4B-it-abliterated is 99.93% pure Rank-1 along ONE identical vector across 35 layers (u_cos = 1.0000), but used α = 2.50 (W' = (I − 2.5 r rᵀ) W, retention |1 − α| = 1.50×). At α = 2.0, I − 2 r rᵀ is an exact orthogonal Householder reflection (W'ᵀW' = WᵀW) — every single-matrix singular value & column norm is mathematically unchanged, defeating pure static SVD/void scanners.
  2. "Abliterated" in Name Only: Huihui-Qwen3.5-4B-abliterated is not rank-1 abliteration (ablit_cos = 0.0018) — it is a dense Rank-16 LoRA fine-tune (eff_rank = 12.7) across all 32 layers, statically indistinguishable from a benign LoRA (3D-Coder).

Track 2 breaks this static ceiling with zero base model via 3 complementary signals:

  1. Architecture-Invariant Boundary Refusal Probe: expanded multi-family refusal stems (including Llama-3.1 "I can't") + 20-token in-memory greedy refusal-prefix check (zero generated text stored/returned).
  2. Mid-to-Final Residual Harm-Separation Retention (final_harm_sep / early_mid_harm_sep): clean/benign models hold or grow harm separation (0.79×–2.17×); Huihui-Gemma-4 (α=2.50) and Llama-3.1 Evil-EM organisms collapse it by −42% to −52% (0.48×–0.58×).
  3. Emergent Misalignment (Evil-EM) Value-Drift Probe (1.000 AUROC across all 27 models): teacher-forced log-prob contrast on 8 benign everyday open-ended prompts catches 3/3 real ModelOrganismsForEM organisms (−0.536, −0.623, −0.655) vs all 13 Clean & Benign-FT controls (≤ −0.774) — including Qwen2.5-14B insecure-code, which has 0% explicit refusal failure!

Visual Story (Plotted Directly from 27-Checkpoint Benchmark JSON)

1. Exact ROC & 27-Model Risk Score 2. Behavioral Threat Map & Residual Collapse 3. Static Chasm & Householder Autopsy
ROC and Risk Behavioral Threat Map Weights and Autopsy

Benchmark Results (27 Real Hugging Face Checkpoints)

Wild-49 Hugging Face Community Audit

Companion Editing Research — weight-surgeon

Want to see how the 0.0056% surgical edits caught by Track 1 were created — and how they armor Qwen 3.5 against 4-bit quantization collapse? See ashishshroti14/weight-surgeon!

Metadata

Release files for weight-forensics 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 weight-forensics 0.2.0
File Size Uploaded Provenance Actions
weight_forensics-0.2.0.tar.gz 18.6 kB With provenance Details for weight_forensics-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 34.6 kB

Release files / weight_forensics-0.2.0.tar.gz

Download URL weight_forensics-0.2.0.tar.gz
Size 18.6 kB
Tags Source
SHA-256 checksum
How to use checksums
be34d1b4980b7ce50444db9dbf1e3c36b0ad526e5f51747b82ac42c34c15d054
BLAKE2b-256 checksum
How to use checksums
bbc52636393be74f173014e754dc1b9c864fccf98599097b588b4221abb1477e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 26, 2026.

Transparency log

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

Download URL weight_forensics-0.2.0-py3-none-any.whl
Size 16.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
39ff491a81b135954827d1722f15c0e3dd640894fc1bf081ac667f53f583cc46
BLAKE2b-256 checksum
How to use checksums
f8de130f391c7eaed8e2d4365371e7f23610cc68728e91fae1bc3ea20a07942e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 26, 2026.

Transparency log

Security for weight-forensics 0.2.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for weight_forensics-0.2.0.tar.gz

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 Nov 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

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