Verification

Reference

TokenPrint's core claim is that every number is real. This page documents exactly how that is checked, with the actual numbers observed on the reference model.

Important

This guarantee is enforced by the build, not by discipline. npm run build fails if Math.random is found in application code (outside of a narrow allowlist for genuine visual randomness). A fabricated value cannot reach a deployed page even from a local build.


Architecture endpoint is self-consistent

GET /architecture reports total_params = 494,032,768, which equals the sum of n_params across all 290 tensors exactly. Metadata (24 layers, 14 heads, 2 KV heads, head_dim 64, ffn 4864, vocab 151,936, context 32,768) comes from the model config and named_parameters().


Attention matches an independent forward pass

backend/scripts/verify_real_data.py output
Sentence: 'The cat sat on the mat.'   Tokens (7): The, cat, sat, on, the, mat, .
Attention tensor shape: (24, 14, 7, 7)
Max abs error vs independent forward pass: 0.00050        (just rounding)
Attention row sums: [1.0000, 1.0000]                      (valid softmax)
PASS: data is real.

Embedding geometry is real and deterministic

verify_geometry.py projects real hidden states with PCA and checks determinism and clustering. For “king queen man woman apple orange”, apple and orange land almost on top of each other at the embedding layer, and the projection is identical across runs.


Generation op catalog is real and correctly ordered

backend/scripts/verify_trace.py output
total ops: 243
layer-0 op order: norm, attn.q, attn.k, attn.v, attention, attn.o, norm,
                  mlp.gate, mlp.up, mlp.down
q_proj L0: op=803,712  module=803,712  in=896 out=896 bias=896
final op: Vocabulary Unembedding · cumulative params used: 630,167,424
PASS: op catalog is real, ordered, and bounded.

KV-cache phases are mechanically real

text
meta.uses_kv_cache = true
step 0  phase=prefill  n_positions=39  cache_len=0    -> token "Red"
step 1  phase=decode   n_positions=1   cache_len=39   -> token "<|im_end|>"

GGUF parser matches the binary header

FileArchitectureParametersTensorsQuantization
Qwen3 8Bqwen38.19B399Q4_K
Llama 3.2 3Bllama3.21B255Q4_K

Tensor counts (399, 255) equal the tensor_count field in each file's binary header.


Known gaps

Warning

Honesty requires listing where the claim does not yet fully hold:

  • TimingReadout — shows real perf_counter() deltas but no device synchronize on MPS/CUDA. Labeled PROXY · NOT MS in the UI. #101
  • ActivationPatchCompare — shows a logit-lens trajectory (correlational), not causal activation patching. The panel title is inaccurate. #75
  • ResidualContributions — measures total residual change in PCA space, not attention vs. MLP decomposition. The label states this explicitly.