Downloads · 30 days
0
danym/rtpurbo-stage2-wip
rtpurbo-stage2-wip is a machine learning model from danym. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for rtpurbo. The card lists the license as apache-2.0.
Trained by distilling the full self-attention's top-p=0.9 token set into a 32-dim retrieval index via forward KL (paper Eq.6), using a hybrid SVD initialisation that seeds rows 0-15 from a prior didx=16 model and rows…
Downloads · 30 days
0
Access
Public
Updated Jul 27, 2026
Repo size
559 GB
Likes
1
Public
Click a slice to open those files.
.safetensors46.6 GB · 45%
From the Hugging Face model README
Trained by distilling the full self-attention's top-p=0.9 token set into a 32-dim retrieval index via forward KL (paper Eq.6), using a hybrid SVD initialisation that seeds rows 0-15 from a prior d_idx=16 model and rows 16-31 from SVD principal components of Vq[16:32].
| top_p | teacher_tok | teacher_blk | indexer_blk | idx_recall |
|---|---|---|---|---|
| 0.50 | 0.001 | 0.009 | 0.032 | 0.487 |
| 0.70 | 0.003 | 0.023 | 0.075 | 0.700 |
| 0.80 | 0.007 | 0.041 | 0.117 | 0.784 |
| 0.90 | 0.018 | 0.083 | 0.200 | 0.874 |
| 0.95 | 0.037 | 0.140 | 0.288 | 0.918 |
Paper RTPurbo used head_dim=128 → d_idx=16 (1/8 ratio). Qwen3.5-9B has head_dim=256, so the paper-equivalent compression is 256/8 = d_idx=32. The earlier d_idx=16 run on this model was under-provisioned (equivalent to paper's d_idx=8). Probe confirms recall is sufficient (87% at top_p=0.9, 92% at top_p=0.95), so the bottleneck for tightening the sparsity gap is the training recipe (teacher-query-sample 25% vs paper's full-query), not d_idx.
indexer_final.pt — clean substate, 256 tensors of shape [32, 256] bf16state_dict.pt — same content, raw state_dict formatstage1_summary.json— full per-head KL breakdown for all 8 GA layersloss_curve.csv — step,loss,lr,distill_kl,agree_kl,entropy,tok/simport torch
from train.surgeries._rtpurbo_indexer import RetrievalIndexer
state = torch.load("indexer_final.pt", map_location="cpu")
# state is a flat dict of 256 tensors: q_heads.<layer_idx>.weight
# pass to RetrievalIndexer(d_idx=32, head_dim=256).load_state_dict(...)