Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Veyron — Weight Forensics

License Python Tests Status Formats

An evidence-first forensic toolkit for analyzing LLM checkpoints from weights alone.

No training logs. No dataset access. No model card. Just tensors, and an honest account of what they can and can't tell you.


What is Veyron?

Veyron opens a .safetensors / .pt / .bin checkpoint and works out what it can — architecture family, layer count, hidden size, attention/MLP structure, adapter and merge clues — using only the raw tensors. It never claims more than the math supports, and it says so explicitly for every finding.

Most "model inspector" tools either trust the config file blindly or make confident-sounding guesses with no way to check them. Veyron does neither: it can run blind, with the config hidden, and then score its own guesses against the real answer afterward.

See it in action

Real output, from a real blind test against the actual openai-community/gpt2 weights downloaded from Hugging Face — config and README stripped before analysis, ground truth revealed only after Veyron committed to its answer:

Veyron blind test output on GPT-2

Architecture and training-objective clues scored against GPT-2's real published config. Data and lineage are honestly marked insufficient evidence rather than filled in with a made-up number — Veyron won't score a category it has no way to check.

What v1 does

Checkpoint layer

  • .safetensors, .pt, .pth, .bin
  • Full tensor inventory, parameter counts, shapes, dtypes
  • SHA-256 checkpoint hashing

Mathematical fingerprinting

  • min / max / mean / std, L1 / L2 norms, sparsity, quantiles
  • Singular-value summaries for suitable matrices
  • Stable per-tensor fingerprints
  • Layer-to-layer statistical profiles

Structural inference

  • Transformer-like architecture detection
  • Attention projection detection (split QKV and fused c_attn-style)
  • MLP/FFN detection
  • Normalization, embedding, and output-head detection
  • Layer count and hidden-size estimates from tensor geometry

Forensic hypotheses

  • Causal-LM-like structure clues
  • Adapter / LoRA presence
  • Merge / delta checkpoint clues

Blind benchmarking

  • Fetch a real Hugging Face model, strip everything except weights
  • Run structural inference with zero access to config or README
  • Reveal ground truth only afterward and score the guesses
  • Render a forensic reliability scorecard

Install

git clone <this-repo>
cd Veyron-v1-full
pip install -r requirements.txt

Windows one-click: double-click run_veyron.bat. It creates a virtual environment, installs everything, and launches the interactive blind test on first run.

Usage

Interactive blind test (recommended)

python -m veyron.interactive

Paste a Hugging Face model URL or a local checkpoint path. Veyron downloads it, hides the config, analyzes the weights blind, then reveals the answer and scores itself.

Analyze a single checkpoint

python -m veyron analyze model.safetensors --out report.json

Compare two checkpoints

python -m veyron compare model_a.safetensors model_b.safetensors

Run the synthetic benchmark

python -m veyron benchmark

The scorecard, explained

Architecture   ████████████████████  100.0%   3 checkable fields
Training       ████████████████████  100.0%   1 checkable field
Data           ░░░░░░░░░░░░░░░░░░░░  INSUFFICIENT EVIDENCE
Lineage        ░░░░░░░░░░░░░░░░░░░░  INSUFFICIENT EVIDENCE
Category Scored when Why it's sometimes empty
Architecture Always, if a real config is available Layer count, hidden size, and family are directly checkable
Training Always, as a weak signal Only checks naming-convention agreement with a causal-LM class — not the actual training objective
Data Only if you supply a candidate corpus Data-domain attribution is not derivable from weights alone
Lineage Only if you supply a second checkpoint Similarity/lineage needs something to compare against

A hollow bar isn't a bug — it's Veyron refusing to invent a number it has no evidence for.

Scientific boundary

Veyron does not claim that final weights uniquely contain:

  • the original training script
  • the exact optimizer settings
  • the exact dataset
  • every training example

Different pipelines can produce similar weights. Veyron reports evidence, hypotheses, confidence, and uncertainty — never certainty it hasn't earned.

Project layout

veyron/
  checkpoint.py          checkpoint loading (.safetensors / .pt / .pth / .bin)
  fingerprint.py         numerical fingerprints, spectra, layer profiles
  structure.py           structural inference (architecture, layers, hidden size)
  hypotheses.py          forensic hypotheses (objective, adapter, merge clues)
  similarity.py          model-to-model comparison
  ground_truth.py        parses a model's real config.json for scoring
  blind_score.py         scores findings against ground truth, honestly
  scorecard_display.py   renders the terminal forensic scorecard
  blind_test.py          fetch -> strip -> analyze blind -> reveal -> score
  interactive.py         interactive CLI entry point
  report.py              JSON report building
  benchmark.py           synthetic known-truth benchmark
  cli.py                 command-line interface
tests/
benchmark/
examples/
assets/
run_veyron.bat           one-click Windows launcher

Roadmap

Version Focus
v1 Weight-only inspection, blind-test framework, real-model scoring
v1.1 Richer spectral features, calibration plots, more architectures
v1.2 Documented real-model evaluation suite across model families
v2 Learned training-stage classifiers
v3 Candidate-domain / data attribution
v4 Model genealogy graph

License

See LICENSE.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages