claude-opus-4-8
nano-gpt-data-curation — graded by the task's verifier against a measured baseline.
- backend
- modal
- variant
- claude claude-opus-4-8
- metric
- held-out multi-domain perplexity
- actions
- 84
- duration
- 1h 22m
- recorded
- 2026-08-04
run iddclm-nano-curation__ohgR2nu
Everything claude-opus-4-8 did on this task, in order.
download JSON ↗Features are now fast (~20s for full pass). Let me track progress and prepare a fast packer (using my token cache) for quick dev evaluations while the tokenizer finishes.
args
{
"subject": "Cache pool: GPT-2 tokens + quality features",
"description": "Tokenize full pool once, cache tokens/offsets/features to /tmp for scoring.",
"activeForm": "Tokenizing + caching pool"
}TaskCreate result
Task #1 created successfully: Cache pool: GPT-2 tokens + quality features
[metadata] {"task": {"id": "1", "subject": "Cache pool: GPT-2 tokens + quality features"}}encrypted chain-of-thought — recorded, not exposed
args
{
"subject": "Build DSIR+quality-gate selection",
"description": "Score docs by importance vs target x quality gate; produce selection.json in priority order.",
"activeForm": "Building selection scorer"
}TaskCreate result
Task #2 created successfully: Build DSIR+quality-gate selection
[metadata] {"task": {"id": "2", "subject": "Build DSIR+quality-gate selection"}}encrypted chain-of-thought — recorded, not exposed
args
{
"subject": "Validate on dev vs random baseline",
"description": "Run frozen train on random vs curated selection; compare dev perplexity; iterate.",
"activeForm": "Validating selections on dev"
}TaskCreate result
Task #3 created successfully: Validate on dev vs random baseline
[metadata] {"task": {"id": "3", "subject": "Validate on dev vs random baseline"}}encrypted chain-of-thought — recorded, not exposed
args
{
"subject": "Write curate.py, selection.json, claim.md",
"description": "Finalize reproducible curate.py, final selection.json, and claim.md deliverables.",
"activeForm": "Writing deliverables"
}TaskCreate result
Task #4 created successfully: Write curate.py, selection.json, claim.md
[metadata] {"task": {"id": "4", "subject": "Write curate.py, selection.json, claim.md"}}encrypted chain-of-thought — recorded, not exposed
args
{
"file_path": "/workspace/fast_pack.py",
"content": "\"\"\"Fast packer mirroring pack_selection.py semantics, using cached pool tokens.\nConcatenate each selected doc's GPT-2 tokens + EOS, in order, stop at 12M.\"\"\"\nimport json, sys, numpy as np\nSEL=sys.argv[1] if len(sys.argv)>1 else '/workspace/submission/selection.json'\nOUT=sys.argv[2] if len(sys.argv)>2 else '/tmp/dev_train.npy'\nBUDGET=12_000_000; EOS=50256\nids=np.load('/tmp/pool_ids.npy'); off=np.load('/tmp/pool_offsets.npy'); tokd=np.load('/tmp/pool_tokens.npy')\npos={int(v):k for k,v in enumerate(ids)}\nsel=json.load(open(SEL))\nparts=[]; tot=0\nfor i in sel:\n k=pos[int(i)]; s=off[k]; e=off[k+1]\n parts.append(tokd[s:e]); parts.append(np.array([EOS],np.uint16)); tot+=(e-s)+1\n if tot>=BUDGET: break\narr=np.concatenate(parts)[:BUDGET].astype(np.uint16)\nnp.save(OUT,arr)\nprint(f'packed {arr.size} tokens from up to {len(sel)} ids -> {OUT}')\n"
}Write result
File created successfully at: /workspace/fast_pack.py (file state is current in your context — no need to Read it back)
[metadata] {"type": "create", "filePath": "/workspace/fast_pack.py", "content": "\"\"\"Fast packer mirroring pack_selection.py semantics, using cached pool tokens.\nConcatenate each selected doc's GPT-2 tokens + EOS, in order, stop at 12M.\"\"\"\nimport json, sys, numpy as np\nSEL=sys.argv[1] if len(sys.argv)>1 else '/workspace/submission/selection.json'\nOUT=sys.argv[2] if len(sys.argv)>2 else '/tmp/dev_train.npy'\nBUDGET=12_000_000; EOS=50256\nids=np.load('/tmp/pool_ids.npy'); off=np.load('/tmp/pool_offsets.npy'); tokd=np.load('/tmp/pool_tokens.npy')\npos={int(v):k for k,v in enumerate(ids)}\nsel=json.load(open(SEL))\nparts=[]; tot=0\nfor i in sel:\n k=pos[int(i)]; s=off[k]; e=off[k+1]\n parts.append(tokd[s:e]); parts.append(np.array([EOS],np.uint16)); tot+=(e-s)+1\n if tot>=BUDGET: break\narr=np.concatenate(parts)[:BUDGET].astype(np.uint16)\nnp.save(OUT,arr)\nprint(f'packed {arr.size} tokens from up to {len(sel)} ids -> {OUT}')\n", "structuredPatch": [], "originalFile": null, "userModified": false}encrypted chain-of-thought — recorded, not exposed
args
{
"command": "sleep 30; grep -v Warning /tmp/tokpool.log | tail -8",
"description": "Check tokenization progress"
}Bash result
Token indices sequence length is longer than the specified maximum sequence length for this model (1048 > 1024). Running this sequence through the model will result in indexing errors
tok 0 31.9 s
tok 40000 42.1 s
tok 80000 51.8 s
tok 120000 67.0 s
tok 160000 90.3 s
total tokens 199911772 98.9 s
CACHED OK 99.1 s
[stdout]
Token indices sequence length is longer than the specified maximum sequence length for this model (1048 > 1024). Running this sequence through the model will result in indexing errors
tok 0 31.9 s
tok 40000 42.1 s
tok 80000 51.8 s
tok 120000 67.0 s
tok 160000 90.3 s
total tokens 199911772 98.9 s
CACHED OK 99.1 s
[metadata] {"noOutputExpected": false}Cache ready: 199.9M tokens (matches ~200M) in 99s. Let me mark task #1 done and run the scorer.
args
{
"taskId": "1",
"status": "completed"
}TaskUpdate result
Updated task #1 status
[metadata] {"success": true, "taskId": "1", "updatedFields": ["status"], "statusChange": {"from": "pending", "to": "completed"}}encrypted chain-of-thought — recorded, not exposed
args
{
"command": "cd /workspace; python3 score_select.py 2>&1 | grep -v Warning",
"description": "Run DSIR + quality-gate scorer"
}Bash result
loaded cache 182016 docs 199911772 tokens 0.1 s
feature percentiles [1,5,25,50,75,95,99]:
mean_wlen 1.080 1.112 1.179 1.271 1.463 2.127 3.389
alpha 0.157 0.174 0.193 0.208 0.229 0.294 0.394
stop 0.019 0.077 0.228 0.320 0.367 0.417 0.452
symbol 0.000 0.000 0.001 0.002 0.005 0.017 0.056
uniq 0.292 0.414 0.517 0.575 0.658 0.805 0.920
nonlatin 0.000 0.000 0.000 0.004 0.013 0.033 0.099
ntok 42.000 98.000 250.000 539.000 1097.000 3391.000 9982.000
doc_mean -1.473 -1.080 -0.629 -0.247 -0.062 0.095 0.193
gate keeps 25 / 182016 = 0.0 %
selected 20 ids ~ 14875 tokens (budget 12000000 ) 1.8 s
wrote /workspace/submission/selection.json
[stdout]
loaded cache 182016 docs 199911772 tokens 0.1 s
feature percentiles [1,5,25,50,75,95,99]:
mean_wlen 1.080 1.112 1.179 1.271 1.463 2.127 3.389
alpha 0.157 0.174 0.193 0.208 0.229 0.294 0.394
stop 0.019 0.077 0.228 0.320 0.367 0.417 0.452
symbol 0.000 0.000 0.001 0.002 0.005 0.017 0.056
uniq 0.292 0.414 0.517 0.575 0.658 0.805 0.920
nonlatin 0.000 0.000 0.000 0.004 0.013 0.033 0.099
ntok 42.000 98.000 250.000 539.000 1097.000 3391.000 9982.000
doc_mean -1.473 -1.080 -0.629 -0.247 -0.062 0.095 0.193
gate keeps 25 / 182016 = 0.0 %
selected 20 ids ~ 14875 tokens (budget 12000000 ) 1.8 s
wrote /workspace/submission/selection.json
[metadata] {"noOutputExpected": false}The gate kept only 25 docs — my byte features are miscalibrated (mean_wlen median 1.27, alpha 0.21 are impossibly low for English prose). Let me debug the feature computation directly.
args
{
"command": "cd /workspace; python3 -c \"\nimport json,re,numpy as np\nLETTERS=bytes(c for c in range(256) if chr(c).isalpha())\nDEL_NONLETTER=bytes(c for c in range(256) if c not in LETTERS)\nWORDB=re.compile(rb\\\"[A-Za-z']+\\\")\ntexts=[]\nwith open('data/pool.jsonl','rb') as f:\n for i,line in enumerate(f):\n if i>=5: break\n texts.append(json.loads(line)['text'])\nfor t in texts:\n L=len(t); b=t.encode('ascii','ignore')\n letters=len(b)-len(b.translate(None,DEL_NONLETTER))\n words=WORDB.findall(b); nw=len(words)\n print('L',L,'letters',letters,'alpha',round(letters/L,3),'nw',nw,'mwlen',round(letters/max(1,nw),2),'| head:',t[:80].replace(chr(10),' '))\n\"",
"description": "Debug feature computation on 5 docs"
}Bash result
L 414 letters 118 alpha 0.285 nw 63 mwlen 1.87 | head: |Viewing Single Post From: Spoilers for the Week of February 11th| |Lil||Feb 1 2
L 3018 letters 665 alpha 0.22 nw 542 mwlen 1.23 | head: *sigh* Fundamentalist community, let me pass on some advice to you I learned fro
L 2825 letters 515 alpha 0.182 nw 406 mwlen 1.27 | head: A novel two-step immunotherapy approach has shown clinically beneficial response
L 2467 letters 517 alpha 0.21 nw 439 mwlen 1.18 | head: Free the Cans! Working Together to Reduce Waste In a blog about how people share
L 3303 letters 645 alpha 0.195 nw 506 mwlen 1.27 | head: ORLANDO, Fla. — While the Rapid Recall Exchange, the 2-year-old industry recall
[stdout]
L 414 letters 118 alpha 0.285 nw 63 mwlen 1.87 | head: |Viewing Single Post From: Spoilers for the Week of February 11th| |Lil||Feb 1 2
L 3018 letters 665 alpha 0.22 nw 542 mwlen 1.23 | head: *sigh* Fundamentalist community, let me pass on some advice to you I learned fro
L 2825 letters 515 alpha 0.182 nw 406 mwlen 1.27 | head: A novel two-step immunotherapy approach has shown clinically beneficial response
L 2467 letters 517 alpha 0.21 nw 439 mwlen 1.18 | head: Free the Cans! Working Together to Reduce Waste In a blog about how people share
L 3303 letters 645 alpha 0.195 nw 506 mwlen 1.27 | head: ORLANDO, Fla. — While the Rapid Recall Exchange, the 2-year-old industry recall
[metadata] {"noOutputExpected": false}Found the bug: I subtracted from total, so letters/digits held the complement count (inverted). translate(None, DEL_NONLETTER) already leaves only letters. Let me verify the fix, then recompute just the features (keeping the token cache).
args
{
"command": "cd /workspace; python3 -c \"\nimport json,re\nLETTERS=bytes(c for c in range(256) if chr(c).isalpha())\nDEL_NONLETTER=bytes(c for c in range(256) if c not in LETTERS)\nWORDB=re.compile(rb\\\"[A-Za-z']+\\\")\nwith open('data/pool.jsonl','rb') as f:\n for i,line in enumerate(f):\n if i>=4: break\n t=json.loads(line)['text']; L=len(t); b=t.encode('ascii','ignore')\n letters=len(b.translate(None,DEL_NONLETTER)) # FIXED: no subtraction\n nw=len(WORDB.findall(b))\n print('alpha',round(letters/L,3),'mwlen',round(letters/max(1,nw),2),'|',t[:60].replace(chr(10),' '))\n\"",
"description": "Verify corrected letter-count formula"
}Bash result
alpha 0.713 mwlen 4.68 | |Viewing Single Post From: Spoilers for the Week of February
alpha 0.78 mwlen 4.34 | *sigh* Fundamentalist community, let me pass on some advice
alpha 0.817 mwlen 5.68 | A novel two-step immunotherapy approach has shown clinically
alpha 0.786 mwlen 4.42 | Free the Cans! Working Together to Reduce Waste In a blog ab
[stdout]
alpha 0.713 mwlen 4.68 | |Viewing Single Post From: Spoilers for the Week of February
alpha 0.78 mwlen 4.34 | *sigh* Fundamentalist community, let me pass on some advice
alpha 0.817 mwlen 5.68 | A novel two-step immunotherapy approach has shown clinically
alpha 0.786 mwlen 4.42 | Free the Cans! Working Together to Reduce Waste In a blog ab
[metadata] {"noOutputExpected": false}Fixed — alpha ~0.75, mean_wlen ~4.5 now. Let me recompute the full feature set correctly (keeping the token cache).
args
{
"file_path": "/workspace/recompute_feats.py",
"content": "import json, time, re, numpy as np\nSTOPB=set(b\"the a an of to in and or for on at by with from as is are was were be been being this that these those it its he she they we you his her their our your not no but if then so than into over under out up down about after before will would can could may\".split())\nLETTERS=bytes(c for c in range(256) if chr(c).isalpha())\nDIGITS=bytes(c for c in range(256) if chr(c).isdigit())\nDEL_NONLETTER=bytes(c for c in range(256) if c not in LETTERS)\nDEL_NONDIGIT=bytes(c for c in range(256) if c not in DIGITS)\nGOOD=set(LETTERS)|set(DIGITS)|set(b\" \\t\\n\\r.,;:'\\\"!?()-%$&/\")\nDEL_GOOD=bytes(c for c in range(256) if c in GOOD)\nWORDB=re.compile(rb\"[A-Za-z']+\")\nt0=time.time(); ids=[]; texts=[]\nwith open('/workspace/data/pool.jsonl','rb') as f:\n for line in f:\n r=json.loads(line); ids.append(r['id']); texts.append(r['text'])\nn=len(texts)\nnwords=np.zeros(n,np.int32); mean_wlen=np.zeros(n,np.float32); alpha_frac=np.zeros(n,np.float32)\nstop_frac=np.zeros(n,np.float32); symbol_frac=np.zeros(n,np.float32); digit_frac=np.zeros(n,np.float32)\nuniq_ratio=np.zeros(n,np.float32); nonlatin_frac=np.zeros(n,np.float32)\nfor i,t in enumerate(texts):\n L=len(t)\n if L==0: continue\n b=t.encode('ascii','ignore'); bl=len(t.encode('utf-8','ignore'))\n nonlatin_frac[i]=1.0-len(b)/max(1,bl)\n letters=len(b.translate(None,DEL_NONLETTER))\n digits=len(b.translate(None,DEL_NONDIGIT))\n symbols=len(b.translate(None,DEL_GOOD))\n alpha_frac[i]=letters/L; digit_frac[i]=digits/L; symbol_frac[i]=symbols/L\n words=WORDB.findall(b); nw=len(words); nwords[i]=nw\n if nw:\n mean_wlen[i]=letters/nw\n low=[w.lower() for w in words[:400]]\n stop_frac[i]=sum(1 for w in low if w in STOPB)/len(low)\n uniq_ratio[i]=len(set(low))/len(low)\noff=np.load('/tmp/pool_offsets.npy')\nnp.savez('/tmp/pool_feats.npz',nwords=nwords,mean_wlen=mean_wlen,alpha_frac=alpha_frac,\n stop_frac=stop_frac,symbol_frac=symbol_frac,digit_frac=digit_frac,uniq_ratio=uniq_ratio,\n nonlatin_frac=nonlatin_frac,ntok=(off[1:]-off[:-1]).astype(np.int32))\nprint('recomputed feats',n,'docs',round(time.time()-t0,1),'s')\n"
}Write result
File created successfully at: /workspace/recompute_feats.py (file state is current in your context — no need to Read it back)
[metadata] {"type": "create", "filePath": "/workspace/recompute_feats.py", "content": "import json, time, re, numpy as np\nSTOPB=set(b\"the a an of to in and or for on at by with from as is are was were be been being this that these those it its he she they we you his her their our your not no but if then so than into over under out up down about after before will would can could may\".split())\nLETTERS=bytes(c for c in range(256) if chr(c).isalpha())\nDIGITS=bytes(c for c in range(256) if chr(c).isdigit())\nDEL_NONLETTER=bytes(c for c in range(256) if c not in LETTERS)\nDEL_NONDIGIT=bytes(c for c in range(256) if c not in DIGITS)\nGOOD=set(LETTERS)|set(DIGITS)|set(b\" \\t\\n\\r.,;:'\\\"!?()-%$&/\")\nDEL_GOOD=bytes(c for c in range(256) if c in GOOD)\nWORDB=re.compile(rb\"[A-Za-z']+\")\nt0=time.time(); ids=[]; texts=[]\nwith open('/workspace/data/pool.jsonl','rb') as f:\n for line in f:\n r=json.loads(line); ids.append(r['id']); texts.append(r['text'])\nn=len(texts)\nnwords=np.zeros(n,np.int32); mean_wlen=np.zeros(n,np.float32); alpha_frac=np.zeros(n,np.float32)\nstop_frac=np.zeros(n,np.float32); symbol_frac=np.zeros(n,np.float32); digit_frac=np.zeros(n,np.float32)\nuniq_ratio=np.zeros(n,np.float32); nonlatin_frac=np.zeros(n,np.float32)\nfor i,t in enumerate(texts):\n L=len(t)\n if L==0: continue\n b=t.encode('ascii','ignore'); bl=len(t.encode('utf-8','ignore'))\n nonlatin_frac[i]=1.0-len(b)/max(1,bl)\n letters=len(b.translate(None,DEL_NONLETTER))\n digits=len(b.translate(None,DEL_NONDIGIT))\n symbols=len(b.translate(None,DEL_GOOD))\n alpha_frac[i]=letters/L; digit_frac[i]=digits/L; symbol_frac[i]=symbols/L\n words=WORDB.findall(b); nw=len(words); nwords[i]=nw\n if nw:\n mean_wlen[i]=letters/nw\n low=[w.lower() for w in words[:400]]\n stop_frac[i]=sum(1 for w in low if w in STOPB)/len(low)\n uniq_ratio[i]=len(set(low))/len(low)\noff=np.load('/tmp/pool_offsets.npy')\nnp.savez('/tmp/pool_feats.npz',nwords=nwords,mean_wlen=mean_wlen,alpha_frac=alpha_frac,\n stop_frac=stop_frac,symbol_frac=symbol_frac,digit_frac=digit_frac,uniq_ratio=uniq_ratio,\n nonlatin_frac=nonlatin_frac,ntok=(off[1:]-off[:-1]).astype(np.int32))\nprint('recomputed feats',n,'docs',round(time.time()-t0,1),'s')\n", "structuredPatch": [], "originalFile": null, "userModified": false}encrypted chain-of-thought — recorded, not exposed
args
{
"command": "cd /workspace; python3 recompute_feats.py 2>&1 | grep -v Warning; python3 score_select.py 2>&1 | grep -v Warning",
"description": "Recompute features and rerun scorer"
}Bash result
recomputed feats 182016 docs 30.2 s
loaded cache 182016 docs 199911772 tokens 0.1 s
feature percentiles [1,5,25,50,75,95,99]:
mean_wlen 3.891 4.162 4.594 4.934 5.308 5.966 6.624
alpha 0.569 0.697 0.768 0.788 0.804 0.824 0.840
stop 0.019 0.077 0.228 0.320 0.367 0.417 0.452
symbol 0.000 0.000 0.001 0.002 0.005 0.017 0.056
uniq 0.292 0.414 0.517 0.575 0.658 0.805 0.920
nonlatin 0.000 0.000 0.000 0.004 0.013 0.033 0.099
ntok 42.000 98.000 250.000 539.000 1097.000 3391.000 9982.000
doc_mean -1.473 -1.080 -0.629 -0.247 -0.062 0.095 0.193
gate keeps 158799 / 182016 = 87.2 %
selected 21097 ids ~ 16000007 tokens (budget 12000000 ) 1.9 s
wrote /workspace/submission/selection.json
[stdout]
recomputed feats 182016 docs 30.2 s
loaded cache 182016 docs 199911772 tokens 0.1 s
feature percentiles [1,5,25,50,75,95,99]:
mean_wlen 3.891 4.162 4.594 4.934 5.308 5.966 6.624
alpha 0.569 0.697 0.768 0.788 0.804 0.824 0.840
stop 0.019 0.077 0.228 0.320 0.367 0.417 0.452
symbol 0.000 0.000 0.001 0.002 0.005 0.017 0.056
uniq 0.292 0.414 0.517 0.575 0.658 0.805 0.920
nonlatin 0.000 0.000 0.000 0.004 0.013 0.033 0.099
ntok 42.000 98.000 250.000 539.000 1097.000 3391.000 9982.000
doc_mean -1.473 -1.080 -0.629 -0.247 -0.062 0.095 0.193
gate keeps 158799 / 182016 = 87.2 %
selected 21097 ids ~ 16000007 tokens (budget 12000000 ) 1.9 s
wrote /workspace/submission/selection.json
[metadata] {"noOutputExpected": false}Features are correct now and the gate keeps 87% (drops ~13% junk). Selection covers 16M tokens. Let me check the time, build a random baseline for comparison, and set up a fast eval harness.
args
{
"command": "cat /workspace/.timer/remaining_secs; echo \"s left\"; cd /workspace\n# random baseline selection covering ~16M tokens\npython3 -c \"\nimport numpy as np, json\nids=np.load('/tmp/pool_ids.npy'); F=np.load('/tmp/pool_feats.npz'); ntok=F['ntok'].astype(np.int64)\nrng=np.random.default_rng(0); order=rng.permutation(len(ids))\nsel=[]; tot=0\nfor i in order:\n sel.append(int(ids[i])); tot+=int(ntok[i])+1\n if tot>=16_000_000: break\njson.dump(sel, open('/tmp/random_sel.json','w')); print('random sel',len(sel),'ids',tot,'tok')\n\"",
"description": "Check timer and build random baseline selection"
}Bash result
4180
s left
random sel 14458 ids 16006893 tok
[stdout]
4180
s left
random sel 14458 ids 16006893 tok
[metadata] {"noOutputExpected": false}~70 min left. Let me build a fast eval harness and run random baseline vs. my DSIR+gate method back-to-back.
args
{
"file_path": "/workspace/eval.sh",
"content": "#!/bin/bash\n# fast eval: pack (from token cache) + train frozen 30M GPT + report dev PPL\nset -euo pipefail\nSEL=\"$1\"; LABEL=\"${2:-sel}\"\ncd /workspace\npython3 fast_pack.py \"$SEL\" /tmp/${LABEL}_train.npy >/dev/null 2>&1\npython3 train_nano.py --train_npy /tmp/${LABEL}_train.npy --heldout_npy /workspace/data/multi_dev.npy \\\n --out_json /tmp/${LABEL}.json --max_iters 3000 --seed 1337 2>&1 | grep HELDOUT_PPL | sed \"s/^/[$LABEL] /\"\n"
}Write result
File created successfully at: /workspace/eval.sh (file state is current in your context — no need to Read it back)
[metadata] {"type": "create", "filePath": "/workspace/eval.sh", "content": "#!/bin/bash\n# fast eval: pack (from token cache) + train frozen 30M GPT + report dev PPL\nset -euo pipefail\nSEL=\"$1\"; LABEL=\"${2:-sel}\"\ncd /workspace\npython3 fast_pack.py \"$SEL\" /tmp/${LABEL}_train.npy >/dev/null 2>&1\npython3 train_nano.py --train_npy /tmp/${LABEL}_train.npy --heldout_npy /workspace/data/multi_dev.npy \\\n --out_json /tmp/${LABEL}.json --max_iters 3000 --seed 1337 2>&1 | grep HELDOUT_PPL | sed \"s/^/[$LABEL] /\"\n", "structuredPatch": [], "originalFile": null, "userModified": false}encrypted chain-of-thought — recorded, not exposed
args
{
"command": "cd /workspace; { bash eval.sh /tmp/random_sel.json random; bash eval.sh /workspace/submission/selection.json dsir; } 2>&1 | grep -v Warning",
"description": "Train random baseline vs DSIR+gate method"
}Bash result
[random] HELDOUT_PPL 485.420 loss 6.1850 train_s 55 /tmp/random_train.npy
[dsir] HELDOUT_PPL 389.694 loss 5.9654 train_s 55 /tmp/dsir_train.npy
[stdout]
[random] HELDOUT_PPL 485.420 loss 6.1850 train_s 55 /tmp/random_train.npy
[dsir] HELDOUT_PPL 389.694 loss 5.9654 train_s 55 /tmp/dsir_train.npy
[metadata] {"noOutputExpected": false}Solid: DSIR+gate gives 389.7 vs random 485.4 (~20% lower PPL). Since training samples windows uniformly, only the top ~12M tokens (highest-DSIR docs) are actually used. Let me inspect what's being selected to check register balance before optimizing further.
args
{
"file_path": "/workspace/inspect_sel.py",
"content": "import json, numpy as np\nfrom transformers import AutoTokenizer\ntok=AutoTokenizer.from_pretrained('gpt2')\nids=np.load('/tmp/pool_ids.npy'); off=np.load('/tmp/pool_offsets.npy'); tokd=np.load('/tmp/pool_tokens.npy')\npos={int(v):k for k,v in enumerate(ids)}\nsel=json.load(open('/workspace/submission/selection.json'))\n# docs actually used within 12M budget\nused=[]; tot=0\nfor i in sel:\n k=pos[int(i)]; tot+=(off[k+1]-off[k])+1; used.append(int(i))\n if tot>=12_000_000: break\nprint('docs used within 12M budget:', len(used))\ndef show(idlist, label):\n print(f'--- {label} ---')\n for i in idlist:\n k=pos[int(i)]; s=off[k]; e=off[k+1]\n txt=tok.decode(tokd[s:min(e,s+40)].tolist())\n print(f'[{i} ntok{e-s}]', txt[:150].replace(chr(10),' '))\nshow(used[:12],'TOP 12 (highest DSIR)')\nimport random; random.seed(1)\nshow(random.sample(used, 12),'RANDOM 12 from used')\n"
}Write result
File created successfully at: /workspace/inspect_sel.py (file state is current in your context — no need to Read it back)
[metadata] {"type": "create", "filePath": "/workspace/inspect_sel.py", "content": "import json, numpy as np\nfrom transformers import AutoTokenizer\ntok=AutoTokenizer.from_pretrained('gpt2')\nids=np.load('/tmp/pool_ids.npy'); off=np.load('/tmp/pool_offsets.npy'); tokd=np.load('/tmp/pool_tokens.npy')\npos={int(v):k for k,v in enumerate(ids)}\nsel=json.load(open('/workspace/submission/selection.json'))\n# docs actually used within 12M budget\nused=[]; tot=0\nfor i in sel:\n k=pos[int(i)]; tot+=(off[k+1]-off[k])+1; used.append(int(i))\n if tot>=12_000_000: break\nprint('docs used within 12M budget:', len(used))\ndef show(idlist, label):\n print(f'--- {label} ---')\n for i in idlist:\n k=pos[int(i)]; s=off[k]; e=off[k+1]\n txt=tok.decode(tokd[s:min(e,s+40)].tolist())\n print(f'[{i} ntok{e-s}]', txt[:150].replace(chr(10),' '))\nshow(used[:12],'TOP 12 (highest DSIR)')\nimport random; random.seed(1)\nshow(random.sample(used, 12),'RANDOM 12 from used')\n", "structuredPatch": [], "originalFile": null, "userModified": false}encrypted chain-of-thought — recorded, not exposed
args
{
"command": "cd /workspace; python3 inspect_sel.py 2>&1 | grep -v Warning",
"description": "Inspect selection composition"
}Bash result
docs used within 12M budget: 15936
--- TOP 12 (highest DSIR) ---
[105413 ntok153] Saddleback College in Mission Viejo, Calif. . . . Was an all-conference pick a year ago on the JCO level . . . Spent two seasons with the Ganchos
[181263 ntok1044] email@stratagemglobal.com<|endoftext|>Honky Tonk Man Chords, Guitar Tab, and Lyrics by Clint Eastwood at CountryTabs Give Kudos? Are
[37522 ntok249] Prime Minister Imran Khan on Thursday congratulated India’s premier Narendra Modi on his victory in the country's national elections. "I congratulate
[102634 ntok451] Yahoo Beauty.<|endoftext|>2007-2008: Enters her junior year fully healed from a knee injury suffered her senior year in high school . . . has made tr
[66736 ntok144] The Director General of Military Operations for the Pakistani Army spoke with his Indian counterpart via telephone on Wednesday – and denied New Delhi
[99338 ntok236] , if I have a managed metadata column with multiple values, you can determine if one of a list of values is in the column using the following query (w
[42488 ntok179] Many GOP senators have suggested that they are not happy with President Trump's threat. Rand Paul has even suggested that there would be a veto-proof
[49679 ntok104] policemen killed in Mosul bombing attack A senior police officer was killed Wednesday in northern Iraq. The first Division Chief of Nineveh Police di
[67417 ntok214] <|endoftext|>Referring to her remarks in a press conference in New Delhi [ Images ] on the issue, he said, "She knows that her candidate Rajakannappan
[41186 ntok730] Amarnath Yatra 2017 Amarnath Yatra 2017 News Jammu and Kashmir police said three people, alleged conspirators in the 10 July attack on Amarnath pilgri
[98906 ntok408] D Day landing Back Story: It’s Tuesday 6th of June 1944 the largest amphibious, air and land invasion the world has ever seen is commencing with Allie
[45261 ntok305] Istanbul, Turkey hundreds of Syrians and Turks protested against the latest reported crackdown by Syrian forces on dissent which killed more than 200
--- RANDOM 12 from used ---
[23575 ntok341] Mohun Bagan, the iconic football club, has been banned for two years from the I- League by All India Football Federation (AIFF) for abandoning a viole
[46045 ntok845] Young children have no discrimination, no racism, no ideas that would cause other beings to be harmed. So then why are we, as adult humans, plagued by
[70304 ntok782] <|endoftext|>After the airboat tour which we took in the morning of this day, we headed over to the Kennedy Space Center. I think the ride over to KSC
[60305 ntok304] This Wild and Untamed Land Be it so known that the bearer of this charter has been granted by the Swordlords of Restov acting upon the greater good an
[5384 ntok617] BOISE and NAMPA, Idaho. The Centers for Disease Control recently compared car accident crash deaths in the U.S. with crash death rates in 19 other cou
[54984 ntok2579] John McCain stopped in New York one Tuesday in October 2007 to make his pre-primaries pitch to a room full of Jewish bigwigs, he spent virtually all
[63348 ntok211] <|endoftext|>Sunday's demonstration on the streets of New York City briefly shut down Wall Street and Water Street in Manhattan's Financial District,
[104547 ntok386] .<|endoftext|>A girl started to condemn baseball sign which was merely a way of recording the number of strike outs. The “KKK” sign was a way to show
[71598 ntok533] weeks ago, I called out guys on their occasionally disastrous attempts to be romantic, and now I'm turning tables onto the ladies. If romantic comedi
[91150 ntok316] .<|endoftext|>If you’re not one of those lucky folks who live under a clear, dark sky – fear not! The lunar eclipse will be visible to most of Earth’s
[61843 ntok592] of the lack of an air team, disproportionate RN means will probably be spent on guarding these carriers. Their deployment will suggest the RN has to
[62582 ntok850] <|endoftext|>We are witnessing the end of an era. Since the end of the World War 2, large companies have controlled the ebb and flow of the US economy
[stdout]
docs used within 12M budget: 15936
--- TOP 12 (highest DSIR) ---
[105413 ntok153] Saddleback College in Mission Viejo, Calif. . . . Was an all-conference pick a year ago on the JCO level . . . Spent two seasons with the Ganchos
[181263 ntok1044] email@stratagemglobal.com<|endoftext|>Honky Tonk Man Chords, Guitar Tab, and Lyrics by Clint Eastwood at CountryTabs Give Kudos? Are
[37522 ntok249] Prime Minister Imran Khan on Thursday congratulated India’s premier Narendra Modi on his victory in the country's national elections. "I congratulate
[102634 ntok451] Yahoo Beauty.<|endoftext|>2007-2008: Enters her junior year fully healed from a knee injury suffered her senior year in high school . . . has made tr
[66736 ntok144] The Director General of Military Operations for the Pakistani Army spoke with his Indian counterpart via telephone on Wednesday – and denied New Delhi
[99338 ntok236] , if I have a managed metadata column with multiple values, you can determine if one of a list of values is in the column using the following query (w
[42488 ntok179] Many GOP senators have suggested that they are not happy with President Trump's threat. Rand Paul has even suggested that there would be a veto-proof
[49679 ntok104] policemen killed in Mosul bombing attack A senior police officer was killed Wednesday in northern Iraq. The first Division Chief of Nineveh Police di
[67417 ntok214] <|endoftext|>Referring to her remarks in a press conference in New Delhi [ Images ] on the issue, he said, "She knows that her candidate Rajakannappan
[41186 ntok730] Amarnath Yatra 2017 Amarnath Yatra 2017 News Jammu and Kashmir police said three people, alleged conspirators in the 10 July attack on Amarnath pilgri
[98906 ntok408] D Day landing Back Story: It’s Tuesday 6th of June 1944 the largest amphibious, air and land invasion the world has ever seen is commencing with Allie
[45261 ntok305] Istanbul, Turkey hundreds of Syrians and Turks protested against the latest reported crackdown by Syrian forces on dissent which killed more than 200
--- RANDOM 12 from used ---
[23575 ntok341] Mohun Bagan, the iconic football club, has been banned for two years from the I- League by All India Football Federation (AIFF) for abandoning a viole
[46045 ntok845] Young children have no discrimination, no racism, no ideas that would cause other beings to be harmed. So then why are we, as adult humans, plagued by
[70304 ntok782] <|endoftext|>After the airboat tour which we took in the morning of this day, we headed over to the Kennedy Space Center. I think the ride over to KSC
[60305 ntok304] This Wild and Untamed Land Be it so known that the bearer of this charter has been granted by the Swordlords of Restov acting upon the greater good an
[5384 ntok617] BOISE and NAMPA, Idaho. The Centers for Disease Control recently compared car accident crash deaths in the U.S. with crash death rates in 19 other cou
[54984 ntok2579] John McCain stopped in New York one Tuesday in October 2007 to make his pre-primaries pitch to a room full of Jewish bigwigs, he spent virtually all
[63348 ntok211] <|endoftext|>Sunday's demonstration on the streets of New York City briefly shut down Wall Street and Water Street in Manhattan's Financial District,
[104547 ntok386] .<|endoftext|>A girl started to condemn baseball sign which was merely a way of recording the number of strike outs. The “KKK” sign was a way to show
[71598 ntok533] weeks ago, I called out guys on their occasionally disastrous attempts to be romantic, and now I'm turning tables onto the ladies. If romantic comedi
[91150 ntok316] .<|endoftext|>If you’re not one of those lucky folks who live under a clear, dark sky – fear not! The lunar eclipse will be visible to most of Earth’s
[61843 ntok592] of the lack of an air team, disproportionate RN means will probably be spent on guarding these carriers. Their deployment will suggest the RN has to
[62582 ntok850] <|endoftext|>We are witnessing the end of an era. Since the end of the World War 2, large companies have controlled the ebb and flow of the US economy
[metadata] {"noOutputExpected": false}Two clear issues: (1) the selection is heavily news-skewed (esp. South-Asian politics) — but the target is equal parts wiki/web/news/QA, so a news-dominated trainset will be poor on the other three registers, hurting the averaged perplexity; (2) some junk leaks (guitar-tab page, mid-doc <|endoftext|>). The big lever is matching the target's register mixture. Let me build a cluster-balanced selection and measure it against 390.
args
{
"command": "cd /workspace; python3 -c \"import sklearn; print('sklearn', sklearn.__version__)\" 2>&1 | tail -1; cat /workspace/.timer/remaining_secs",
"description": "Check sklearn availability and timer"
}Bash result
ModuleNotFoundError: No module named 'sklearn'
3910
[stdout]
ModuleNotFoundError: No module named 'sklearn'
3910
[metadata] {"noOutputExpected": false}No sklearn — I'll write a small numpy spherical K-means. Let me build the cluster-balanced selection that matches the target's register mixture.
args
{
"file_path": "/workspace/select_balanced.py",
"content": "\"\"\"Register-balanced curation: cluster the disclosed target into registers, then\nfill the budget with the highest-importance pool docs per register, in proportion\nto the target's own register mixture (train on the mixture you're evaluated on).\"\"\"\nimport json, numpy as np, time, sys\nt0=time.time()\nK=int(sys.argv[1]) if len(sys.argv)>1 else 6\nOUTSEL=sys.argv[2] if len(sys.argv)>2 else '/workspace/submission/selection.json'\nBUDGET=12_000_000; COVER=14_500_000; V=50257; EOS=50256\n\nids=np.load('/tmp/pool_ids.npy'); off=np.load('/tmp/pool_offsets.npy').astype(np.int64)\ntokd=np.load('/tmp/pool_tokens.npy'); F=np.load('/tmp/pool_feats.npz'); ntok=F['ntok'].astype(np.int64)\nn=len(ids)\ntokL=tokd.astype(np.int64)\n\n# ---- dev target docs ----\nho=np.load('/workspace/data/multi_dev.npy').astype(np.int64)\nbnd=np.where(ho==EOS)[0]; segs=[]; prev=0\nfor j in bnd:\n if j>prev: segs.append(ho[prev:j])\n prev=j+1\nif prev<len(ho): segs.append(ho[prev:])\nprint('dev docs', len(segs), round(time.time()-t0,1),'s')\n\nCt=np.bincount(ho[ho!=EOS], minlength=V).astype(np.float64)\nCb=np.bincount(tokL, minlength=V).astype(np.float64)\npb=(Cb+1.0)/(Cb.sum()+V); logpb=np.log(pb)\n\n# ---- clustering vocab: content tokens (skip 30 most common target tokens) ----\nrank=np.argsort(-Ct); vocab=rank[30:4030]; vmap=-np.ones(V,np.int64); vmap[vocab]=np.arange(len(vocab))\ndef tfvec(seg):\n m=vmap[seg]; m=m[m>=0]\n v=np.bincount(m, minlength=len(vocab)).astype(np.float32)\n nrm=np.linalg.norm(v); return v/nrm if nrm>0 else v\nX=np.stack([tfvec(s) for s in segs]) # [D, vocab]\n# ---- spherical kmeans ----\nrng=np.random.default_rng(0)\nC=X[rng.choice(len(X), K, replace=False)].copy()\nfor it in range(25):\n sim=X@C.T; assign=sim.argmax(1)\n newC=np.zeros_like(C)\n for c in range(K):\n m=X[assign==c]\n if len(m): v=m.sum(0); nn=np.linalg.norm(v); newC[c]=v/nn if nn>0 else C[c]\n else: newC[c]=X[rng.integers(len(X))]\n if np.allclose(newC,C): C=newC; break\n C=newC\nsizes=np.bincount(assign, minlength=K)\n# target token mass per cluster -> mixture weights\nmass=np.array([sum(len(segs[i]) for i in np.where(assign==c)[0]) for c in range(K)],float)\nw=mass/mass.sum()\nprint('cluster dev-doc sizes', sizes.tolist())\nprint('cluster token mixture', np.round(w,3).tolist(), round(time.time()-t0,1),'s')\n\n# ---- per-cluster importance profiles L_c and per-doc scores ----\nscores=np.full((n,K), -1e9, np.float32)\nfor c in range(K):\n idx=np.where(assign==c)[0]\n Cc=np.zeros(V)\n for i in idx: Cc+=np.bincount(segs[i], minlength=V)\n pc=(Cc+0.5)/(Cc.sum()+0.5*V)\n Lc=(np.log(pc)-logpb).astype(np.float32)\n ssum=np.add.reduceat(Lc[tokL], off[:-1])\n scores[:,c]=np.where(ntok>0, ssum/np.maximum(ntok,1), -1e9)\nbest_c=scores.argmax(1); best_s=scores.max(1)\nprint('assign+score done', round(time.time()-t0,1),'s')\n\n# ---- quality gate (+ drop docs containing literal EOS = concatenated/generated junk) ----\nhas_eos=np.zeros(n,bool)\nep=np.where(tokd==EOS)[0]\nif len(ep): has_eos[np.clip(np.searchsorted(off, ep, side='right')-1,0,n-1)]=True\nmw=F['mean_wlen']; al=F['alpha_frac']; st=F['stop_frac']; sy=F['symbol_frac']; uq=F['uniq_ratio']; nl=F['nonlatin_frac']\ngate=((ntok>=50)&(ntok<=4096)&(nl<0.10)&(al>0.60)&(sy<0.08)&(mw>=3.2)&(mw<=8.5)&(st>=0.12)&(uq>=0.38)&(~has_eos))\nprint('gate keeps', int(gate.sum()), 'drop_eos', int(has_eos.sum()))\n\n# ---- per-cluster ranked candidate lists (gated) ----\ncand={}\nfor c in range(K):\n m=np.where((best_c==c)&gate)[0]\n m=m[np.argsort(-best_s[m])]\n cand[c]=m\n print(f' cluster {c}: {len(m)} gated candidates')\n\n# ---- weighted round-robin fill to keep every prefix balanced to mixture w ----\nquota=w*COVER\nfilled=np.zeros(K); ptr=np.zeros(K,int); seen=set(); sel=[]; tot=0\nwhile tot<COVER:\n # pick cluster with largest token deficit that still has candidates\n order=np.argsort(-(quota-filled))\n picked=False\n for c in order:\n while ptr[c]<len(cand[c]):\n i=cand[c][ptr[c]]; ptr[c]+=1\n s=off[i]; e=off[i+1]; key=hash(tokd[s:min(e,s+64)].tobytes())\n if key in seen: continue\n seen.add(key); sel.append(int(ids[i])); t=int(ntok[i])+1\n filled[c]+=t; tot+=t; picked=True; break\n if picked: break\n if not picked: break\nprint('selected', len(sel), 'ids ~', int(tot),'tokens; per-cluster tokens', filled.astype(int).tolist())\njson.dump(sel, open(OUTSEL,'w'))\nprint('wrote', OUTSEL, round(time.time()-t0,1),'s')\n"
}Write result
File created successfully at: /workspace/select_balanced.py (file state is current in your context — no need to Read it back)
[metadata] {"type": "create", "filePath": "/workspace/select_balanced.py", "content": "\"\"\"Register-balanced curation: cluster the disclosed target into registers, then\nfill the budget with the highest-importance pool docs per register, in proportion\nto the target's own register mixture (train on the mixture you're evaluated on).\"\"\"\nimport json, numpy as np, time, sys\nt0=time.time()\nK=int(sys.argv[1]) if len(sys.argv)>1 else 6\nOUTSEL=sys.argv[2] if len(sys.argv)>2 else '/workspace/submission/selection.json'\nBUDGET=12_000_000; COVER=14_500_000; V=50257; EOS=50256\n\nids=np.load('/tmp/pool_ids.npy'); off=np.load('/tmp/pool_offsets.npy').astype(np.int64)\ntokd=np.load('/tmp/pool_tokens.npy'); F=np.load('/tmp/pool_feats.npz'); ntok=F['ntok'].astype(np.int64)\nn=len(ids)\ntokL=tokd.astype(np.int64)\n\n# ---- dev target docs ----\nho=np.load('/workspace/data/multi_dev.npy').astype(np.int64)\nbnd=np.where(ho==EOS)[0]; segs=[]; prev=0\nfor j in bnd:\n if j>prev: segs.append(ho[prev:j])\n prev=j+1\nif prev<len(ho): segs.append(ho[prev:])\nprint('dev docs', len(segs), round(time.time()-t0,1),'s')\n\nCt=np.bincount(ho[ho!=EOS], minlength=V).astype(np.float64)\nCb=np.bincount(tokL, minlength=V).astype(np.float64)\npb=(Cb+1.0)/(Cb.sum()+V); logpb=np.log(pb)\n\n# ---- clustering vocab: content tokens (skip 30 most common target tokens) ----\nrank=np.argsort(-Ct); vocab=rank[30:4030]; vmap=-np.ones(V,np.int64); vmap[vocab]=np.arange(len(vocab))\ndef tfvec(seg):\n m=vmap[seg]; m=m[m>=0]\n v=np.bincount(m, minlength=len(vocab)).astype(np.float32)\n nrm=np.linalg.norm(v); return v/nrm if nrm>0 else v\nX=np.stack([tfvec(s) for s in segs]) # [D, vocab]\n# ---- spherical kmeans ----\nrng=np.random.default_rng(0)\nC=X[rng.choice(len(X), K, replace=False)].copy()\nfor it in range(25):\n sim=X@C.T; assign=sim.argmax(1)\n newC=np.zeros_like(C)\n for c in range(K):\n m=X[assign==c]\n if len(m): v=m.sum(0); nn=np.linalg.norm(v); newC[c]=v/nn if nn>0 else C[c]\n else: newC[c]=X[rng.integers(len(X))]\n if np.allclose(newC,C): C=newC; break\n C=newC\nsizes=np.bincount(assign, minlength=K)\n# target token mass per cluster -> mixture weights\nmass=np.array([sum(len(segs[i]) for i in np.where(assign==c)[0]) for c in range(K)],float)\nw=mass/mass.sum()\nprint('cluster dev-doc sizes', sizes.tolist())\nprint('cluster token mixture', np.round(w,3).tolist(), round(time.time()-t0,1),'s')\n\n# ---- per-cluster importance profiles L_c and per-doc scores ----\nscores=np.full((n,K), -1e9, np.float32)\nfor c in range(K):\n idx=np.where(assign==c)[0]\n Cc=np.zeros(V)\n for i in idx: Cc+=np.bincount(segs[i], minlength=V)\n pc=(Cc+0.5)/(Cc.sum()+0.5*V)\n Lc=(np.log(pc)-logpb).astype(np.float32)\n ssum=np.add.reduceat(Lc[tokL], off[:-1])\n scores[:,c]=np.where(ntok>0, ssum/np.maximum(ntok,1), -1e9)\nbest_c=scores.argmax(1); best_s=scores.max(1)\nprint('assign+score done', round(time.time()-t0,1),'s')\n\n# ---- quality gate (+ drop docs containing literal EOS = concatenated/generated junk) ----\nhas_eos=np.zeros(n,bool)\nep=np.where(tokd==EOS)[0]\nif len(ep): has_eos[np.clip(np.searchsorted(off, ep, side='right')-1,0,n-1)]=True\nmw=F['mean_wlen']; al=F['alpha_frac']; st=F['stop_frac']; sy=F['symbol_frac']; uq=F['uniq_ratio']; nl=F['nonlatin_frac']\ngate=((ntok>=50)&(ntok<=4096)&(nl<0.10)&(al>0.60)&(sy<0.08)&(mw>=3.2)&(mw<=8.5)&(st>=0.12)&(uq>=0.38)&(~has_eos))\nprint('gate keeps', int(gate.sum()), 'drop_eos', int(has_eos.sum()))\n\n# ---- per-cluster ranked candidate lists (gated) ----\ncand={}\nfor c in range(K):\n m=np.where((best_c==c)&gate)[0]\n m=m[np.argsort(-best_s[m])]\n cand[c]=m\n print(f' cluster {c}: {len(m)} gated candidates')\n\n# ---- weighted round-robin fill to keep every prefix balanced to mixture w ----\nquota=w*COVER\nfilled=np.zeros(K); ptr=np.zeros(K,int); seen=set(); sel=[]; tot=0\nwhile tot<COVER:\n # pick cluster with largest token deficit that still has candidates\n order=np.argsort(-(quota-filled))\n picked=False\n for c in order:\n while ptr[c]<len(cand[c]):\n i=cand[c][ptr[c]]; ptr[c]+=1\n s=off[i]; e=off[i+1]; key=hash(tokd[s:min(e,s+64)].tobytes())\n if key in seen: continue\n seen.add(key); sel.append(int(ids[i])); t=int(ntok[i])+1\n filled[c]+=t; tot+=t; picked=True; break\n if picked: break\n if not picked: break\nprint('selected', len(sel), 'ids ~', int(tot),'tokens; per-cluster tokens', filled.astype(int).tolist())\njson.dump(sel, open(OUTSEL,'w'))\nprint('wrote', OUTSEL, round(time.time()-t0,1),'s')\n", "structuredPatch": [], "originalFile": null, "userModified": false}encrypted chain-of-thought — recorded, not exposed
args
{
"command": "cd /workspace; python3 select_balanced.py 6 /tmp/balanced_sel.json 2>&1 | grep -v Warning",
"description": "Build cluster-balanced selection"
}Bash result
dev docs 2705 0.5 s
cluster dev-doc sizes [541, 363, 34, 582, 522, 663]
cluster token mixture [0.083, 0.258, 0.004, 0.098, 0.077, 0.48] 1.2 s
assign+score done 4.4 s
gate keeps 53033 drop_eos 125536
cluster 0: 451 gated candidates
cluster 1: 1631 gated candidates
cluster 2: 0 gated candidates
cluster 3: 69 gated candidates
cluster 4: 28 gated candidates
cluster 5: 50854 gated candidates
selected 20581 ids ~ 14500958 tokens; per-cluster tokens [219983, 712762, 0, 29502, 8032, 13530679]
wrote /tmp/balanced_sel.json 4.6 s
[stdout]
dev docs 2705 0.5 s
cluster dev-doc sizes [541, 363, 34, 582, 522, 663]
cluster token mixture [0.083, 0.258, 0.004, 0.098, 0.077, 0.48] 1.2 s
assign+score done 4.4 s
gate keeps 53033 drop_eos 125536
cluster 0: 451 gated candidates
cluster 1: 1631 gated candidates
cluster 2: 0 gated candidates
cluster 3: 69 gated candidates
cluster 4: 28 gated candidates
cluster 5: 50854 gated candidates
selected 20581 ids ~ 14500958 tokens; per-cluster tokens [219983, 712762, 0, 29502, 8032, 13530679]
wrote /tmp/balanced_sel.json 4.6 s
[metadata] {"noOutputExpected": false}The EOS filter is wrong — 69% of pool docs contain a literal <|endoftext|> (the corpus embeds them as separators), and dropping them gutted most clusters so "balance" collapsed into cluster 5. Internal EOS is harmless for training. Let me remove that filter and rerun.
args
{
"replace_all": false,
"file_path": "/workspace/select_balanced.py",
"old_string": "gate=((ntok>=50)&(ntok<=4096)&(nl<0.10)&(al>0.60)&(sy<0.08)&(mw>=3.2)&(mw<=8.5)&(st>=0.12)&(uq>=0.38)&(~has_eos))",
"new_string": "gate=((ntok>=50)&(ntok<=4096)&(nl<0.10)&(al>0.60)&(sy<0.08)&(mw>=3.2)&(mw<=8.5)&(st>=0.12)&(uq>=0.38))"
}Edit result
The file /workspace/select_balanced.py has been updated successfully. (file state is current in your context — no need to Read it back)
[metadata] {"filePath": "/workspace/select_balanced.py", "oldString": "gate=((ntok>=50)&(ntok<=4096)&(nl<0.10)&(al>0.60)&(sy<0.08)&(mw>=3.2)&(mw<=8.5)&(st>=0.12)&(uq>=0.38)&(~has_eos))", "newString": "gate=((ntok>=50)&(ntok<=4096)&(nl<0.10)&(al>0.60)&(sy<0.08)&(mw>=3.2)&(mw<=8.5)&(st>=0.12)&(uq>=0.38))", "originalFile": "\"\"\"Register-balanced curation: cluster the disclosed target into registers, then\nfill the budget with the highest-importance pool docs per register, in proportion\nto the target's own register mixture (train on the mixture you're evaluated on).\"\"\"\nimport json, numpy as np, time, sys\nt0=time.time()\nK=int(sys.argv[1]) if len(sys.argv)>1 else 6\nOUTSEL=sys.argv[2] if len(sys.argv)>2 else '/workspace/submission/selection.json'\nBUDGET=12_000_000; COVER=14_500_000; V=50257; EOS=50256\n\nids=np.load('/tmp/pool_ids.npy'); off=np.load('/tmp/pool_offsets.npy').astype(np.int64)\ntokd=np.load('/tmp/pool_tokens.npy'); F=np.load('/tmp/pool_feats.npz'); ntok=F['ntok'].astype(np.int64)\nn=len(ids)\ntokL=tokd.astype(np.int64)\n\n# ---- dev target docs ----\nho=np.load('/workspace/data/multi_dev.npy').astype(np.int64)\nbnd=np.where(ho==EOS)[0]; segs=[]; prev=0\nfor j in bnd:\n if j>prev: segs.append(ho[prev:j])\n prev=j+1\nif prev<len(ho): segs.append(ho[prev:])\nprint('dev docs', len(segs), round(time.time()-t0,1),'s')\n\nCt=np.bincount(ho[ho!=EOS], minlength=V).astype(np.float64)\nCb=np.bincount(tokL, minlength=V).astype(np.float64)\npb=(Cb+1.0)/(Cb.sum()+V); logpb=np.log(pb)\n\n# ---- clustering vocab: content tokens (skip 30 most common target tokens) ----\nrank=np.argsort(-Ct); vocab=rank[30:4030]; vmap=-np.ones(V,np.int64); vmap[vocab]=np.arange(len(vocab))\ndef tfvec(seg):\n m=vmap[seg]; m=m[m>=0]\n v=np.bincount(m, minlength=len(vocab)).astype(np.float32)\n nrm=np.linalg.norm(v); return v/nrm if nrm>0 else v\nX=np.stack([tfvec(s) for s in segs]) # [D, vocab]\n# ---- spherical kmeans ----\nrng=np.random.default_rng(0)\nC=X[rng.choice(len(X), K, replace=False)].copy()\nfor it in range(25):\n sim=X@C.T; assign=sim.argmax(1)\n newC=np.zeros_like(C)\n for c in range(K):\n m=X[assign==c]\n if len(m): v=m.sum(0); nn=np.linalg.norm(v); newC[c]=v/nn if nn>0 else C[c]\n else: newC[c]=X[rng.integers(len(X))]\n if np.allclose(newC,C): C=newC; break\n C=newC\nsizes=np.bincount(assign, minlength=K)\n# target token mass per cluster -> mixture weights\nmass=np.array([sum(len(segs[i]) for i in np.where(assign==c)[0]) for c in range(K)],float)\nw=mass/mass.sum()\nprint('cluster dev-doc sizes', sizes.tolist())\nprint('cluster token mixture', np.round(w,3).tolist(), round(time.time()-t0,1),'s')\n\n# ---- per-cluster importance profiles L_c and per-doc scores ----\nscores=np.full((n,K), -1e9, np.float32)\nfor c in range(K):\n idx=np.where(assign==c)[0]\n Cc=np.zeros(V)\n for i in idx: Cc+=np.bincount(segs[i], minlength=V)\n pc=(Cc+0.5)/(Cc.sum()+0.5*V)\n Lc=(np.log(pc)-logpb).astype(np.float32)\n ssum=np.add.reduceat(Lc[tokL], off[:-1])\n scores[:,c]=np.where(ntok>0, ssum/np.maximum(ntok,1), -1e9)\nbest_c=scores.argmax(1); best_s=scores.max(1)\nprint('assign+score done', round(time.time()-t0,1),'s')\n\n# ---- quality gate (+ drop docs containing literal EOS = concatenated/generated junk) ----\nhas_eos=np.zeros(n,bool)\nep=np.where(tokd==EOS)[0]\nif len(ep): has_eos[np.clip(np.searchsorted(off, ep, side='right')-1,0,n-1)]=True\nmw=F['mean_wlen']; al=F['alpha_frac']; st=F['stop_frac']; sy=F['symbol_frac']; uq=F['uniq_ratio']; nl=F['nonlatin_frac']\ngate=((ntok>=50)&(ntok<=4096)&(nl<0.10)&(al>0.60)&(sy<0.08)&(mw>=3.2)&(mw<=8.5)&(st>=0.12)&(uq>=0.38)&(~has_eos))\nprint('gate keeps', int(gate.sum()), 'drop_eos', int(has_eos.sum()))\n\n# ---- per-cluster ranked candidate lists (gated) ----\ncand={}\nfor c in range(K):\n m=np.where((best_c==c)&gate)[0]\n m=m[np.argsort(-best_s[m])]\n cand[c]=m\n print(f' cluster {c}: {len(m)} gated candidates')\n\n# ---- weighted round-robin fill to keep every prefix balanced to mixture w ----\nquota=w*COVER\nfilled=np.zeros(K); ptr=np.zeros(K,int); seen=set(); sel=[]; tot=0\nwhile tot<COVER:\n # pick cluster with largest token deficit that still has candidates\n order=np.argsort(-(quota-filled))\n picked=False\n for c in order:\n while ptr[c]<len(cand[c]):\n i=cand[c][ptr[c]]; ptr[c]+=1\n s=off[i]; e=off[i+1]; key=hash(tokd[s:min(e,s+64)].tobytes())\n if key in seen: continue\n seen.add(key); sel.append(int(ids[i])); t=int(ntok[i])+1\n filled[c]+=t; tot+=t; picked=True; break\n if picked: break\n if not picked: break\nprint('selected', len(sel), 'ids ~', int(tot),'tokens; per-cluster tokens', filled.astype(int).tolist())\njson.dump(sel, open(OUTSEL,'w'))\nprint('wrote', OUTSEL, round(time.time()-t0,1),'s')\n", "structuredPatch": [{"oldStart": 69, "oldLines": 7, "newStart": 69, "newLines": 7, "lines": [" ep=np.where(tokd==EOS)[0]", " if len(ep): has_eos[np.clip(np.searchsorted(off, ep, side='right')-1,0,n-1)]=True", " mw=F['mean_wlen']; al=F['alpha_frac']; st=F['stop_frac']; sy=F['symbol_frac']; uq=F['uniq_ratio']; nl=F['nonlatin_frac']", "-gate=((ntok>=50)&(ntok<=4096)&(nl<0.10)&(al>0.60)&(sy<0.08)&(mw>=3.2)&(mw<=8.5)&(st>=0.12)&(uq>=0.38)&(~has_eos))", "+gate=((ntok>=50)&(ntok<=4096)&(nl<0.10)&(al>0.60)&(sy<0.08)&(mw>=3.2)&(mw<=8.5)&(st>=0.12)&(uq>=0.38))", " print('gate keeps', int(gate.sum()), 'drop_eos', int(has_eos.sum()))", " ", " # ---- per-cluster ranked candidate lists (gated) ----"]}], "userModified": false, "replaceAll": false}encrypted chain-of-thought — recorded, not exposed
args
{
"command": "cd /workspace; python3 select_balanced.py 6 /tmp/balanced_sel.json 2>&1 | grep -v Warning",
"description": "Rerun balanced selection without EOS filter"
}Bash result
dev docs 2705 0.5 s
cluster dev-doc sizes [541, 363, 34, 582, 522, 663]
cluster token mixture [0.083, 0.258, 0.004, 0.098, 0.077, 0.48] 1.3 s
assign+score done 4.4 s
gate keeps 154451 drop_eos 125536
cluster 0: 1554 gated candidates
cluster 1: 9925 gated candidates
cluster 2: 13 gated candidates
cluster 3: 190 gated candidates
cluster 4: 61 gated candidates
cluster 5: 142708 gated candidates
selected 20049 ids ~ 14500608 tokens; per-cluster tokens [907047, 5128196, 15384, 70779, 21747, 8357455]
wrote /tmp/balanced_sel.json 4.6 s
[stdout]
dev docs 2705 0.5 s
cluster dev-doc sizes [541, 363, 34, 582, 522, 663]
cluster token mixture [0.083, 0.258, 0.004, 0.098, 0.077, 0.48] 1.3 s
assign+score done 4.4 s
gate keeps 154451 drop_eos 125536
cluster 0: 1554 gated candidates
cluster 1: 9925 gated candidates
cluster 2: 13 gated candidates
cluster 3: 190 gated candidates
cluster 4: 61 gated candidates
cluster 5: 142708 gated candidates
selected 20049 ids ~ 14500608 tokens; per-cluster tokens [907047, 5128196, 15384, 70779, 21747, 8357455]
wrote /tmp/balanced_sel.json 4.6 s
[metadata] {"noOutputExpected": false}Assignment is too winner-take-all — cluster 5 became a catch-all (92% of candidates), so quotas for the peaky registers (wiki/QA) can't be filled. Let me switch to retrieval-based filling: each register pulls its own top-scoring pool docs (shared, dedup-guarded), so every register gets its best available matches.
args
{
"replace_all": false,
"file_path": "/workspace/select_balanced.py",
"old_string": "# ---- per-cluster ranked candidate lists (gated) ----\ncand={}\nfor c in range(K):\n m=np.where((best_c==c)&gate)[0]\n m=m[np.argsort(-best_s[m])]\n cand[c]=m\n print(f' cluster {c}: {len(m)} gated candidates')",
"new_string": "# ---- per-cluster ranked candidate lists: ALL gated docs sorted by THAT\n# cluster's importance (retrieval); a doc can serve whichever register grabs it first ----\ncand={}\ngmask=gate.copy()\nfor c in range(K):\n o=np.argsort(-scores[:,c])\n o=o[gmask[o]]\n cand[c]=o\n print(f' cluster {c}: top score {scores[o[0],c]:.3f}')"
}Edit result
The file /workspace/select_balanced.py has been updated successfully. (file state is current in your context — no need to Read it back)
[metadata] {"filePath": "/workspace/select_balanced.py", "oldString": "# ---- per-cluster ranked candidate lists (gated) ----\ncand={}\nfor c in range(K):\n m=np.where((best_c==c)&gate)[0]\n m=m[np.argsort(-best_s[m])]\n cand[c]=m\n print(f' cluster {c}: {len(m)} gated candidates')", "newString": "# ---- per-cluster ranked candidate lists: ALL gated docs sorted by THAT\n# cluster's importance (retrieval); a doc can serve whichever register grabs it first ----\ncand={}\ngmask=gate.copy()\nfor c in range(K):\n o=np.argsort(-scores[:,c])\n o=o[gmask[o]]\n cand[c]=o\n print(f' cluster {c}: top score {scores[o[0],c]:.3f}')", "originalFile": "\"\"\"Register-balanced curation: cluster the disclosed target into registers, then\nfill the budget with the highest-importance pool docs per register, in proportion\nto the target's own register mixture (train on the mixture you're evaluated on).\"\"\"\nimport json, numpy as np, time, sys\nt0=time.time()\nK=int(sys.argv[1]) if len(sys.argv)>1 else 6\nOUTSEL=sys.argv[2] if len(sys.argv)>2 else '/workspace/submission/selection.json'\nBUDGET=12_000_000; COVER=14_500_000; V=50257; EOS=50256\n\nids=np.load('/tmp/pool_ids.npy'); off=np.load('/tmp/pool_offsets.npy').astype(np.int64)\ntokd=np.load('/tmp/pool_tokens.npy'); F=np.load('/tmp/pool_feats.npz'); ntok=F['ntok'].astype(np.int64)\nn=len(ids)\ntokL=tokd.astype(np.int64)\n\n# ---- dev target docs ----\nho=np.load('/workspace/data/multi_dev.npy').astype(np.int64)\nbnd=np.where(ho==EOS)[0]; segs=[]; prev=0\nfor j in bnd:\n if j>prev: segs.append(ho[prev:j])\n prev=j+1\nif prev<len(ho): segs.append(ho[prev:])\nprint('dev docs', len(segs), round(time.time()-t0,1),'s')\n\nCt=np.bincount(ho[ho!=EOS], minlength=V).astype(np.float64)\nCb=np.bincount(tokL, minlength=V).astype(np.float64)\npb=(Cb+1.0)/(Cb.sum()+V); logpb=np.log(pb)\n\n# ---- clustering vocab: content tokens (skip 30 most common target tokens) ----\nrank=np.argsort(-Ct); vocab=rank[30:4030]; vmap=-np.ones(V,np.int64); vmap[vocab]=np.arange(len(vocab))\ndef tfvec(seg):\n m=vmap[seg]; m=m[m>=0]\n v=np.bincount(m, minlength=len(vocab)).astype(np.float32)\n nrm=np.linalg.norm(v); return v/nrm if nrm>0 else v\nX=np.stack([tfvec(s) for s in segs]) # [D, vocab]\n# ---- spherical kmeans ----\nrng=np.random.default_rng(0)\nC=X[rng.choice(len(X), K, replace=False)].copy()\nfor it in range(25):\n sim=X@C.T; assign=sim.argmax(1)\n newC=np.zeros_like(C)\n for c in range(K):\n m=X[assign==c]\n if len(m): v=m.sum(0); nn=np.linalg.norm(v); newC[c]=v/nn if nn>0 else C[c]\n else: newC[c]=X[rng.integers(len(X))]\n if np.allclose(newC,C): C=newC; break\n C=newC\nsizes=np.bincount(assign, minlength=K)\n# target token mass per cluster -> mixture weights\nmass=np.array([sum(len(segs[i]) for i in np.where(assign==c)[0]) for c in range(K)],float)\nw=mass/mass.sum()\nprint('cluster dev-doc sizes', sizes.tolist())\nprint('cluster token mixture', np.round(w,3).tolist(), round(time.time()-t0,1),'s')\n\n# ---- per-cluster importance profiles L_c and per-doc scores ----\nscores=np.full((n,K), -1e9, np.float32)\nfor c in range(K):\n idx=np.where(assign==c)[0]\n Cc=np.zeros(V)\n for i in idx: Cc+=np.bincount(segs[i], minlength=V)\n pc=(Cc+0.5)/(Cc.sum()+0.5*V)\n Lc=(np.log(pc)-logpb).astype(np.float32)\n ssum=np.add.reduceat(Lc[tokL], off[:-1])\n scores[:,c]=np.where(ntok>0, ssum/np.maximum(ntok,1), -1e9)\nbest_c=scores.argmax(1); best_s=scores.max(1)\nprint('assign+score done', round(time.time()-t0,1),'s')\n\n# ---- quality gate (+ drop docs containing literal EOS = concatenated/generated junk) ----\nhas_eos=np.zeros(n,bool)\nep=np.where(tokd==EOS)[0]\nif len(ep): has_eos[np.clip(np.searchsorted(off, ep, side='right')-1,0,n-1)]=True\nmw=F['mean_wlen']; al=F['alpha_frac']; st=F['stop_frac']; sy=F['symbol_frac']; uq=F['uniq_ratio']; nl=F['nonlatin_frac']\ngate=((ntok>=50)&(ntok<=4096)&(nl<0.10)&(al>0.60)&(sy<0.08)&(mw>=3.2)&(mw<=8.5)&(st>=0.12)&(uq>=0.38))\nprint('gate keeps', int(gate.sum()), 'drop_eos', int(has_eos.sum()))\n\n# ---- per-cluster ranked candidate lists (gated) ----\ncand={}\nfor c in range(K):\n m=np.where((best_c==c)&gate)[0]\n m=m[np.argsort(-best_s[m])]\n cand[c]=m\n print(f' cluster {c}: {len(m)} gated candidates')\n\n# ---- weighted round-robin fill to keep every prefix balanced to mixture w ----\nquota=w*COVER\nfilled=np.zeros(K); ptr=np.zeros(K,int); seen=set(); sel=[]; tot=0\nwhile tot<COVER:\n # pick cluster with largest token deficit that still has candidates\n order=np.argsort(-(quota-filled))\n picked=False\n for c in order:\n while ptr[c]<len(cand[c]):\n i=cand[c][ptr[c]]; ptr[c]+=1\n s=off[i]; e=off[i+1]; key=hash(tokd[s:min(e,s+64)].tobytes())\n if key in seen: continue\n seen.add(key); sel.append(int(ids[i])); t=int(ntok[i])+1\n filled[c]+=t; tot+=t; picked=True; break\n if picked: break\n if not picked: break\nprint('selected', len(sel), 'ids ~', int(tot),'tokens; per-cluster tokens', filled.astype(int).tolist())\njson.dump(sel, open(OUTSEL,'w'))\nprint('wrote', OUTSEL, round(time.time()-t0,1),'s')\n", "structuredPatch": [{"oldStart": 72, "oldLines": 13, "newStart": 72, "newLines": 15, "lines": [" gate=((ntok>=50)&(ntok<=4096)&(nl<0.10)&(al>0.60)&(sy<0.08)&(mw>=3.2)&(mw<=8.5)&(st>=0.12)&(uq>=0.38))", " print('gate keeps', int(gate.sum()), 'drop_eos', int(has_eos.sum()))", " ", "-# ---- per-cluster ranked candidate lists (gated) ----", "+# ---- per-cluster ranked candidate lists: ALL gated docs sorted by THAT", "+# cluster's importance (retrieval); a doc can serve whichever register grabs it first ----", " cand={}", "+gmask=gate.copy()", " for c in range(K):", "- m=np.where((best_c==c)&gate)[0]", "- m=m[np.argsort(-best_s[m])]", "- cand[c]=m", "- print(f' cluster {c}: {len(m)} gated candidates')", "+ o=np.argsort(-scores[:,c])", "+ o=o[gmask[o]]", "+ cand[c]=o", "+ print(f' cluster {c}: top score {scores[o[0],c]:.3f}')", " ", " # ---- weighted round-robin fill to keep every prefix balanced to mixture w ----", " quota=w*COVER"]}], "userModified": false, "replaceAll": false}encrypted chain-of-thought — recorded, not exposed
args
{
"command": "cd /workspace; python3 select_balanced.py 6 /tmp/balanced_sel.json 2>&1 | grep -v Warning; echo \"=== eval balanced vs top-DSIR ===\"; bash eval.sh /tmp/balanced_sel.json balanced 2>&1 | grep -v Warning",
"description": "Rerun retrieval-based balanced selection and eval"
}Bash result
dev docs 2705 0.5 s
cluster dev-doc sizes [541, 363, 34, 582, 522, 663]
cluster token mixture [0.083, 0.258, 0.004, 0.098, 0.077, 0.48] 1.2 s
assign+score done 4.4 s
gate keeps 154451 drop_eos 125536
cluster 0: top score 0.754
cluster 1: top score 0.747
cluster 2: top score -0.041
cluster 3: top score 0.770
cluster 4: top score 0.842
cluster 5: top score 0.705
selected 22370 ids ~ 14500215 tokens; per-cluster tokens [1201067, 3736966, 59357, 1415890, 1120586, 6966349]
wrote /tmp/balanced_sel.json 4.6 s
=== eval balanced vs top-DSIR ===
[balanced] HELDOUT_PPL 320.436 loss 5.7697 train_s 54 /tmp/balanced_train.npy
[stdout]
dev docs 2705 0.5 s
cluster dev-doc sizes [541, 363, 34, 582, 522, 663]
cluster token mixture [0.083, 0.258, 0.004, 0.098, 0.077, 0.48] 1.2 s
assign+score done 4.4 s
gate keeps 154451 drop_eos 125536
cluster 0: top score 0.754
cluster 1: top score 0.747
cluster 2: top score -0.041
cluster 3: top score 0.770
cluster 4: top score 0.842
cluster 5: top score 0.705
selected 22370 ids ~ 14500215 tokens; per-cluster tokens [1201067, 3736966, 59357, 1415890, 1120586, 6966349]
wrote /tmp/balanced_sel.json 4.6 s
=== eval balanced vs top-DSIR ===
[balanced] HELDOUT_PPL 320.436 loss 5.7697 train_s 54 /tmp/balanced_train.npy
[metadata] {"noOutputExpected": false}320.4 — big win. Balancing to the target's register mixture cut another ~18% (485 → 390 → 320). Let me sweep the cluster count K to find the sweet spot.
args
{
"command": "cat /workspace/.timer/remaining_secs; echo \"s left\"; cd /workspace\nfor K in 4 8 12 20; do python3 select_balanced.py $K /tmp/bal_$K.json 2>&1 | grep -E \"mixture|selected\" | sed \"s/^/K=$K /\"; done",
"description": "Generate balanced selections for K sweep"
}Bash result
3690
s left
K=4 cluster token mixture [0.096, 0.15, 0.496, 0.258] 1.3 s
K=4 selected 22284 ids ~ 14502146 tokens; per-cluster tokens [1394336, 2181746, 7188702, 3737362]
K=8 cluster token mixture [0.468, 0.06, 0.034, 0.014, 0.043, 0.057, 0.066, 0.258] 1.2 s
K=8 selected 22747 ids ~ 14500601 tokens; per-cluster tokens [6791410, 871179, 488051, 206836, 620308, 822553, 963708, 3736556]
K=12 cluster token mixture [0.188, 0.035, 0.021, 0.124, 0.028, 0.05, 0.025, 0.064, 0.142, 0.058, 0.209, 0.055] 1.3 s
K=12 selected 23326 ids ~ 14500189 tokens; per-cluster tokens [2728931, 505431, 308662, 1797853, 402960, 725347, 364368, 922654, 2065850, 844272, 3035220, 798641]
K=20 cluster token mixture [0.057, 0.039, 0.079, 0.082, 0.004, 0.011, 0.002, 0.128, 0.003, 0.168, 0.015, 0.026, 0.002, 0.035, 0.012, 0.032, 0.001, 0.012, 0.235, 0.057] 1.2 s
K=20 selected 23427 ids ~ 14501256 tokens; per-cluster tokens [824838, 568259, 1146377, 1191969, 52421, 161428, 22586, 1862130, 39817, 2433313, 223508, 373309, 33906, 502203, 176427, 459103, 14506, 180773, 3401661, 832722]
[stdout]
3690
s left
K=4 cluster token mixture [0.096, 0.15, 0.496, 0.258] 1.3 s
K=4 selected 22284 ids ~ 14502146 tokens; per-cluster tokens [1394336, 2181746, 7188702, 3737362]
K=8 cluster token mixture [0.468, 0.06, 0.034, 0.014, 0.043, 0.057, 0.066, 0.258] 1.2 s
K=8 selected 22747 ids ~ 14500601 tokens; per-cluster tokens [6791410, 871179, 488051, 206836, 620308, 822553, 963708, 3736556]
K=12 cluster token mixture [0.188, 0.035, 0.021, 0.124, 0.028, 0.05, 0.025, 0.064, 0.142, 0.058, 0.209, 0.055] 1.3 s
K=12 selected 23326 ids ~ 14500189 tokens; per-cluster tokens [2728931, 505431, 308662, 1797853, 402960, 725347, 364368, 922654, 2065850, 844272, 3035220, 798641]
K=20 cluster token mixture [0.057, 0.039, 0.079, 0.082, 0.004, 0.011, 0.002, 0.128, 0.003, 0.168, 0.015, 0.026, 0.002, 0.035, 0.012, 0.032, 0.001, 0.012, 0.235, 0.057] 1.2 s
K=20 selected 23427 ids ~ 14501256 tokens; per-cluster tokens [824838, 568259, 1146377, 1191969, 52421, 161428, 22586, 1862130, 39817, 2433313, 223508, 373309, 33906, 502203, 176427, 459103, 14506, 180773, 3401661, 832722]
[metadata] {"noOutputExpected": false}