modelclinic-experiment-001 / code /src /write_dissection_report.py
PratikBuilds's picture
Publish initial ModelClinic Experiment 001 archive
87cc7f2 verified
Raw History Blame Contribute Delete
3.01 kB
import json
from pathlib import Path
p=json.loads(Path('results/checkpoint_delta_manifest.json').read_text()); lines=[]
for a in p['modified']:
lines.append(f"| {a['name'].split('.')[3]} | {a['changed_elements']:,} | {len(a['changed_rows'])} | {len(a['changed_columns'])} | {a['absolute_delta_norm']:.6f} | {a['relative_delta_norm']:.8f} | {a['rank1_energy']:.9f} | {a['effective_rank_entropy']:.7f} |")
text='''# Weight edit dissection
The primary publication is https://rikiyat.github.io/blog/weight-space-programming/ (2 November 2026); the released model card is https://huggingface.co/RikiyaT/Qwen3.5-0.8B-weight-space-programming and logs https://github.com/RikiyaT/lm_understand-logs/tree/4d09ba6d6a7e891dd8063974dfe81b3d78e3494f/exp8_math . It reports 7.9% to 48.1% MATH-500 under its settings and 32,768-token budget, and 93.0% to 33.1% token-limit rates. A separate released-checkpoint evaluation reported 51.0%; these are external results, not our experiments. Qwen warns the 0.8B model is prone to thinking loops: https://huggingface.co/Qwen/Qwen3.5-0.8B . An independent byte-level investigation is https://carlostoledo.co/reports/weight-space-programming.html .
## Our measurements
We loaded the pinned original safetensors and the authors' pinned, published sparse edit (SHA-256 `e92a92aafd1f1068b4fd94aa0fbe081ba3ddea2047ee7bcac7161d861be299e7`). For each tensor, we checked the base tensor SHA-256, applied the indexed BF16 replacements, and checked the reconstructed edited tensor SHA-256 against the authors' manifest. Both base and edited hashes matched. The source artifact identifies two changed tensors; this reconstruction alone cannot prove no other full-checkpoint tensors differ. The resulting SVD is of the actual BF16 differences, computed in float64; effective rank is entropy of squared singular values. Counts are changed bits, not nominally addressed weights.
| Layer | Elements | Rows | Columns | Delta L2 | Relative L2 | Top singular energy | Effective rank |
|---|---:|---:|---:|---:|---:|---:|---:|
'''+ '\n'.join(lines)+f'''
Dominant left-vector absolute cosine across the two layers: {p['cross_layer_top_left_abs_cosine']:.6f}. The precise columns, rows, singular values, directions, and magnitudes are saved in `results/checkpoint_delta_manifest.json`. Total changed entries: 130,188. The often-cited 131,072 is 2 × 64 × 1,024 addressed entries, including 884 unchanged after rounding. BF16 rounding creates small departures from exact rank one; a high effective rank would be misleading without singular-energy magnitudes. This analysis does not establish the causal role of the directions or whether constant steering matches behavior.
Base checkpoint revision `2fc06364715b967f1860aea9cf38778875588b17`; edited revision `d1671a178705bcab7644806d23c535517f35723b`. Full checkpoint scanning is separately required to check for unadvertised differences.
'''
Path('reports/01_weight_edit_dissection.md').write_text(text,encoding='utf-8')