gpt-5.6-sol
nano-gpt-data-curation — graded by the task's verifier against a measured baseline.
- backend
- modal
- variant
- codex azure_ai/gpt-5.6-sol
- metric
- held-out multi-domain perplexity
- actions
- 233
- duration
- 1h 13m
- recorded
- 2026-08-04
run iddclm-nano-curation__aTQyfVE
Everything gpt-5.6-sol did on this task, in order.
download JSON ↗encrypted chain-of-thought — recorded, not exposed
args
{
"input": "const r = await tools.write_stdin({session_id:70095,chars:\"\",yield_time_ms:10000,max_output_tokens:3000});text(JSON.stringify(r));\n"
}exec result
Script completed
Wall time 10.0 seconds
Output:
{"chunk_id":"8b687c","wall_time_seconds":10.000851513,"session_id":70095,"original_token_count":0,"output":""}encrypted chain-of-thought — recorded, not exposed
args
{
"input": "const r = await tools.write_stdin({session_id:70095,chars:\"\",yield_time_ms:10000,max_output_tokens:3000});text(JSON.stringify(r));\n"
}exec result
Script completed
Wall time 0.0 seconds
Output:
{"chunk_id":"8882d9","wall_time_seconds":0.000003617,"exit_code":0,"original_token_count":26,"output":"HELDOUT_PPL 319.844 loss 5.7678 train_s 54 /tmp/q10.npy\nQUARTER_PPL 706.104 272.977 314.130 172.269\n"}encrypted chain-of-thought — recorded, not exposed
args
{
"input": "const patch = \"*** Begin Patch\\n*** Update File: /tmp/make_sel.py\\n@@\\n-bw=float(sys.argv[4]) if len(sys.argv)>4 else 0.0\\n+bw=np.asarray(list(map(float,sys.argv[4].split(',')))) if len(sys.argv)>4 and ',' in sys.argv[4] else float(sys.argv[4]) if len(sys.argv)>4 else 0.0\\n@@\\n-if bw or cw:\\n+if np.any(bw) or cw:\\n@@\\n-scores=base[:,None]+w*aff+bw*baff+cw*np.asarray(covz)[:,None] if np.ndim(covz) else base[:,None]+w*aff\\n+scores=base[:,None]+w*aff+bw*baff+cw*np.asarray(covz)[:,None] if np.ndim(covz) else base[:,None]+w*aff\\n*** End Patch\";\ntext(await tools.apply_patch(patch));\n"
}exec result
Script completed
Wall time 0.0 seconds
Output:
{}encrypted chain-of-thought — recorded, not exposed
args
{
"input": "const r = await tools.exec_command({\n cmd: \"python3 /tmp/make_sel.py 5.0 /tmp/q11.json 1,1,1,1 0,0,2,2 0 && python3 /workspace/pack_selection.py /tmp/q11.json /tmp/q11.npy && PYTHONPATH=/workspace python3 /tmp/train_diag.py --train_npy /tmp/q11.npy --heldout_npy /workspace/data/multi_dev.npy --out_json /tmp/q11.out --max_iters 3000 --seed 1337\",\n workdir: \"/workspace\",\n yield_time_ms: 30000,\n max_output_tokens: 3000\n});\ntext(JSON.stringify(r));\n"
}exec result
Script running with cell ID 103
Wall time 11.0 seconds
Output:
encrypted chain-of-thought — recorded, not exposed
args
{
"cell_id": "103",
"yield_time_ms": 30000,
"max_tokens": 3000
}wait result
Script completed
Wall time 0.0 seconds
Output:
{"chunk_id":"159129","wall_time_seconds":30.00101768,"session_id":34319,"original_token_count":0,"output":""}encrypted chain-of-thought — recorded, not exposed
args
{
"input": "const r = await tools.write_stdin({session_id:34319,chars:\"\",yield_time_ms:30000,max_output_tokens:3000});text(JSON.stringify(r));\n"
}exec result
Script running with cell ID 104
Wall time 11.0 seconds
Output:
encrypted chain-of-thought — recorded, not exposed
args
{
"cell_id": "104",
"yield_time_ms": 30000,
"max_tokens": 3000
}wait result
Script completed
Wall time 13.0 seconds
Output:
{"chunk_id":"433f8a","wall_time_seconds":30.001676401,"session_id":34319,"original_token_count":77,"output":"/tmp/q11.json 10752 [4000302, 4000788, 4001503, 4003993] 0.123046875\nToken indices sequence length is longer than the specified maximum sequence length for this model (4765 > 1024). Running this sequence through the model will result in indexing errors\npacked 12000000 tokens from 10752 ids -> /tmp/q11.npy\n"}encrypted chain-of-thought — recorded, not exposed
args
{
"input": "const r = await tools.write_stdin({session_id:34319,chars:\"\",yield_time_ms:30000,max_output_tokens:3000});text(JSON.stringify(r));\n"
}exec result
Script running with cell ID 105
Wall time 11.0 seconds
Output:
encrypted chain-of-thought — recorded, not exposed
args
{
"cell_id": "105",
"yield_time_ms": 30000,
"max_tokens": 3000
}wait result
Script completed
Wall time 15.2 seconds
Output:
{"chunk_id":"a4070f","wall_time_seconds":30.001953886,"session_id":34319,"original_token_count":0,"output":""}encrypted chain-of-thought — recorded, not exposed
args
{
"input": "const r = await tools.write_stdin({session_id:34319,chars:\"\",yield_time_ms:10000,max_output_tokens:3000});text(JSON.stringify(r));\n"
}exec result
Script completed
Wall time 10.0 seconds
Output:
{"chunk_id":"fbdf4f","wall_time_seconds":10.001832516,"session_id":34319,"original_token_count":0,"output":""}encrypted chain-of-thought — recorded, not exposed
args
{
"input": "const r = await tools.write_stdin({session_id:34319,chars:\"\",yield_time_ms:10000,max_output_tokens:3000});text(JSON.stringify(r));\n"
}exec result
Script completed
Wall time 10.0 seconds
Output:
{"chunk_id":"c339ad","wall_time_seconds":9.949249378,"exit_code":0,"original_token_count":26,"output":"HELDOUT_PPL 305.049 loss 5.7205 train_s 55 /tmp/q11.npy\nQUARTER_PPL 642.814 267.675 296.177 169.392\n"}encrypted chain-of-thought — recorded, not exposed
args
{
"input": "const r = await tools.exec_command({\n cmd: \"python3 /tmp/make_sel.py 5.0 /tmp/q12.json 1,1,1,1 0,0,4,4 0 && python3 /workspace/pack_selection.py /tmp/q12.json /tmp/q12.npy && PYTHONPATH=/workspace python3 /tmp/train_diag.py --train_npy /tmp/q12.npy --heldout_npy /workspace/data/multi_dev.npy --out_json /tmp/q12.out --max_iters 3000 --seed 1337\",\n workdir: \"/workspace\",\n yield_time_ms: 30000,\n max_output_tokens: 3000\n});\ntext(JSON.stringify(r));\n"
}exec result
Script running with cell ID 108
Wall time 11.0 seconds
Output:
encrypted chain-of-thought — recorded, not exposed
args
{
"cell_id": "108",
"yield_time_ms": 30000,
"max_tokens": 3000
}wait result
Script completed
Wall time 15.0 seconds
Output:
{"chunk_id":"e4509e","wall_time_seconds":30.00102356,"session_id":72470,"original_token_count":0,"output":""}encrypted chain-of-thought — recorded, not exposed
args
{
"input": "const r = await tools.write_stdin({session_id:72470,chars:\"\",yield_time_ms:30000,max_output_tokens:3000});text(JSON.stringify(r));\n"
}exec result
Script running with cell ID 109
Wall time 11.0 seconds
Output:
encrypted chain-of-thought — recorded, not exposed
args
{
"cell_id": "109",
"yield_time_ms": 30000,
"max_tokens": 3000
}wait result
Script completed
Wall time 15.0 seconds
Output:
{"chunk_id":"d72e15","wall_time_seconds":30.001911759,"session_id":72470,"original_token_count":65,"output":"/tmp/q12.json 10779 [4003030, 4003313, 4000261, 4001552] 0.134335281566008\nToken indices sequence length is longer than the specified maximum sequence length for this model (4765 > 1024). Running this sequence through the model will result in indexing errors\n"}encrypted chain-of-thought — recorded, not exposed
args
{
"input": "const r = await tools.write_stdin({session_id:72470,chars:\"\",yield_time_ms:30000,max_output_tokens:3000});text(JSON.stringify(r));\n"
}exec result
Script running with cell ID 110
Wall time 11.0 seconds
Output:
encrypted chain-of-thought — recorded, not exposed
args
{
"cell_id": "110",
"yield_time_ms": 30000,
"max_tokens": 3000
}wait result
Script completed
Wall time 15.4 seconds
Output:
{"chunk_id":"659ad8","wall_time_seconds":30.001134469,"session_id":72470,"original_token_count":14,"output":"packed 12000000 tokens from 10779 ids -> /tmp/q12.npy\n"}encrypted chain-of-thought — recorded, not exposed
args
{
"input": "const r = await tools.write_stdin({session_id:72470,chars:\"\",yield_time_ms:30000,max_output_tokens:3000});text(JSON.stringify(r));\n"
}exec result
Script running with cell ID 111
Wall time 11.0 seconds
Output:
encrypted chain-of-thought — recorded, not exposed
args
{
"cell_id": "111",
"yield_time_ms": 30000,
"max_tokens": 3000
}wait result
Script completed
Wall time 3.8 seconds
Output:
{"chunk_id":"4e56e5","wall_time_seconds":27.551561642,"exit_code":0,"original_token_count":26,"output":"HELDOUT_PPL 310.780 loss 5.7391 train_s 55 /tmp/q12.npy\nQUARTER_PPL 685.385 272.549 288.384 172.418\n"}encrypted chain-of-thought — recorded, not exposed
args
{
"input": "const r = await tools.exec_command({cmd:\"sed -n '1,260p' /tmp/score_pool.py && sed -n '1,220p' /tmp/make_sel.py && cat /workspace/.timer/remaining_secs\",workdir:\"/workspace\",yield_time_ms:10000,max_output_tokens:20000});text(r.output);\n"
}exec result
Script completed
Wall time 0.1 seconds
Output:
import json, math, re, time
from collections import Counter
import numpy as np
from transformers import AutoTokenizer
POOL = "/workspace/data/pool.jsonl"
DEV = "/workspace/data/multi_dev.npy"
tok = AutoTokenizer.from_pretrained("gpt2")
dev = np.load(DEV).astype(np.int64)
V = 50257
domain_counts = np.stack([
np.bincount(dev[i * 250_000:(i + 1) * 250_000], minlength=V)
for i in range(4)
])
texts, ids = [], []
basic = []
boiler_terms = (
"cookie policy", "privacy policy", "terms of service", "all rights reserved",
"skip to content", "toggle navigation", "sign up", "log in", "shopping cart",
"javascript is required", "enable javascript", "click here", "contact us",
"related posts", "share this", "subscribe to", "free shipping", "add to cart",
)
spam_terms = (
"payday loan", "casino", "viagra", "coupon code", "promo code", "buy now",
"best price", "order now", "weight loss", "essay writing service",
)
with open(POOL) as f:
for line in f:
r = json.loads(line); s = r["text"]
ids.append(r["id"]); texts.append(s)
n = max(1, len(s)); lo = s.lower(); lines = s.splitlines()
alpha = sum(c.isalpha() for c in s) / n
ascii_frac = sum(ord(c) < 128 for c in s) / n
words = re.findall(r"[A-Za-z]+", s)
nw = max(1, len(words))
common = sum(w.lower() in {"the","of","and","to","in","a","is","that","for","it","on","with","as","was","are","by","this","be","from","or","an","at","which","but","not","have","has","had","were","their","they"} for w in words) / nw
sentence = sum(s.count(x) for x in ".?!") / nw
boiler = sum(lo.count(x) for x in boiler_terms)
spam = sum(lo.count(x) for x in spam_terms)
shortlines = sum(len(x.strip()) < 35 for x in lines) / max(1, len(lines))
# Repeated line fragments are a reliable menu/list/template signal.
normlines = [re.sub(r"\s+", " ", x.strip().lower()) for x in lines if len(x.strip()) >= 20]
rep = 1 - len(set(normlines)) / max(1, len(normlines))
basic.append((len(s), alpha, ascii_frac, common, sentence, boiler, spam,
len(lines), shortlines, rep, lo.count("<|endoftext|>")))
print("loaded", len(texts), "docs", flush=True)
# Estimate the web-pool token distribution on a deterministic, source-stratified sample.
bg = np.zeros(V, dtype=np.int64)
sample = [texts[i] for i in range(0, len(texts), 12)]
for j in range(0, len(sample), 512):
enc = tok(sample[j:j+512], add_special_tokens=False,
return_attention_mask=False)["input_ids"]
for z in enc:
bg += np.bincount(z, minlength=V)
if j and j % 4096 == 0: print("background", j, flush=True)
alpha = 8.0
lp_bg = np.log((bg + alpha) / (bg.sum() + alpha * V))
lp_dom = np.log((domain_counts + alpha) /
(domain_counts.sum(axis=1, keepdims=True) + alpha * V))
lp_mix = np.log((domain_counts.sum(axis=0) + alpha) /
(domain_counts.sum() + alpha * V))
rel = lp_dom - lp_bg
n = len(texts)
ntok = np.zeros(n, dtype=np.int32)
ce = np.zeros(n, dtype=np.float32)
rels = np.zeros((n, 4), dtype=np.float32)
uniq = np.zeros(n, dtype=np.float32)
eos = tok.eos_token_id
for j in range(0, n, 256):
enc = tok(texts[j:j+256], add_special_tokens=False,
return_attention_mask=False)["input_ids"]
for k, z0 in enumerate(enc, j):
z = np.asarray(z0, dtype=np.int64)
ntok[k] = len(z) + 1
if len(z):
ce[k] = lp_mix[z].mean()
rels[k] = rel[:, z].mean(axis=1)
# Token diversity over a capped sample; low diversity catches boilerplate/repetition.
zz = z[:4096]
uniq[k] = len(np.unique(zz)) / math.sqrt(len(zz))
if j and j % 4096 == 0: print("scored", j, flush=True)
np.savez_compressed('/tmp/pool_scores.npz', ids=np.asarray(ids), ntok=ntok,
basic=np.asarray(basic, dtype=np.float32), ce=ce, rel=rels,
uniq=uniq)
print("saved", int(ntok.sum()), "tokens", flush=True)
import sys, json, re, hashlib, numpy as np
w=float(sys.argv[1]); out=sys.argv[2]
prop=np.asarray(list(map(float,sys.argv[3].split(','))) if len(sys.argv)>3 else [1,1,1,1])
prop=prop/prop.sum()
bw=np.asarray(list(map(float,sys.argv[4].split(',')))) if len(sys.argv)>4 and ',' in sys.argv[4] else float(sys.argv[4]) if len(sys.argv)>4 else 0.0
cw=float(sys.argv[5]) if len(sys.argv)>5 else 0.0
z=np.load('/tmp/pool_scores.npz');b=z['basic'];r=z['rel'];ce=z['ce'];u=z['uniq'];n=z['ntok'];ids=z['ids']
el=(n>=300)&(n<=10000)&(b[:,1]>.68)&(b[:,2]>.92)&(b[:,3]>.10)&(b[:,4]>.012)&(b[:,6]==0)&(b[:,9]<.25)
base=2*np.clip((b[:,3]-.12)/.18,0,1)+np.clip((b[:,1]-.65)/.15,0,1)+.5*np.clip((b[:,2]-.9)/.1,0,1)+np.clip((b[:,4]-.015)/.05,0,1)+.7*np.clip((u-5)/12,0,1)-.25*b[:,5]-2*np.maximum(0,b[:,8]-.65)-5*b[:,9]+.15*np.clip(ce+9,-2,2)
med=np.median(r[el],0);sd=np.std(r[el],0);aff=(r-med)/sd*np.sqrt(n[:,None]/(n[:,None]+1000))
if np.any(bw) or cw:
bz=np.load('/tmp/pool_bigram.npz'); br=bz['score']; cov=bz['coverage']
bmed=np.median(br[el],0);bsd=np.std(br[el],0)
baff=(br-bmed)/bsd*np.sqrt(n[:,None]/(n[:,None]+1000))
covz=(cov-np.median(cov[el]))/np.std(cov[el])
else:baff=0;covz=0
scores=base[:,None]+w*aff+bw*baff+cw*np.asarray(covz)[:,None] if np.ndim(covz) else base[:,None]+w*aff
scores[~el]=-99
queues=[np.argsort(-scores[:,d]).tolist() for d in range(4)];ptr=[0]*4;tot=[0]*4;order=[];used=set();seen=set();hs=[]
for line in open('/workspace/data/pool.jsonl'):
s=json.loads(line)['text'];hs.append(hashlib.blake2b(re.sub(r'\s+',' ',s.strip().lower()).encode(),digest_size=12).digest())
while min(np.asarray(tot)/prop)<16_000_000:
d=min(range(4),key=lambda x:tot[x]/prop[x])
while True:
i=queues[d][ptr[d]];ptr[d]+=1
if i not in used and hs[i] not in seen:break
used.add(i);seen.add(hs[i]);order.append(int(ids[i]));tot[d]+=int(n[i])
json.dump(order,open(out,'w'))
print(out,len(order),tot,np.mean(np.array(order)>110000))
2084
The selective bigram signal worked when restricted to news and technical Q&A: the best candidate is now 305.0 dev perplexity, versus 476.7 random. Applying bigrams to Wikipedia/general prose was counterproductive because the disclosed Wikipedia text has dataset-specific spacing, so the final criterion deliberately uses unigram affinity there and unigram+bigram affinity only for the last two registers. I’m packaging that exact ablation-backed rule now.
encrypted chain-of-thought — recorded, not exposed
args
{
"input": "const patch = \"*** Begin Patch\\n*** Add File: /workspace/submission/curate.py\\n+#!/usr/bin/env python3\\n+\\\"\\\"\\\"Curate 16M ordered tokens using target-relative LM scores and quality priors.\\n+\\n+The disclosed dev array consists of four contiguous, equal-sized registers. This\\n+script estimates a smoothed unigram Moore-Lewis score (target register versus\\n+the pool) for every document. Hashed target-bigram affinity is additionally\\n+used for news and technical Q&A, where it helped in dev ablations. Four ranked\\n+queues are interleaved by token count, with quality filters and exact-content\\n+deduplication. No pool IDs, source labels, or hand annotations are embedded.\\n+\\\"\\\"\\\"\\n+import hashlib\\n+import json\\n+import math\\n+import os\\n+import re\\n+\\n+import numpy as np\\n+from transformers import AutoTokenizer\\n+\\n+POOL = \\\"/workspace/data/pool.jsonl\\\"\\n+DEV = \\\"/workspace/data/multi_dev.npy\\\"\\n+OUT = \\\"/workspace/submission/selection.json\\\"\\n+VOCAB = 50_257\\n+DOMAINS = 4\\n+PER_DOMAIN_OUTPUT = 4_000_000 # 16M total gives ample margin over 12M.\\n+COMMON = {\\n+ \\\"the\\\", \\\"of\\\", \\\"and\\\", \\\"to\\\", \\\"in\\\", \\\"a\\\", \\\"is\\\", \\\"that\\\", \\\"for\\\", \\\"it\\\",\\n+ \\\"on\\\", \\\"with\\\", \\\"as\\\", \\\"was\\\", \\\"are\\\", \\\"by\\\", \\\"this\\\", \\\"be\\\", \\\"from\\\", \\\"or\\\",\\n+ \\\"an\\\", \\\"at\\\", \\\"which\\\", \\\"but\\\", \\\"not\\\", \\\"have\\\", \\\"has\\\", \\\"had\\\", \\\"were\\\",\\n+ \\\"their\\\", \\\"they\\\",\\n+}\\n+BOILER = (\\n+ \\\"cookie policy\\\", \\\"privacy policy\\\", \\\"terms of service\\\", \\\"all rights reserved\\\",\\n+ \\\"skip to content\\\", \\\"toggle navigation\\\", \\\"sign up\\\", \\\"log in\\\", \\\"shopping cart\\\",\\n+ \\\"javascript is required\\\", \\\"enable javascript\\\", \\\"click here\\\", \\\"contact us\\\",\\n+ \\\"related posts\\\", \\\"share this\\\", \\\"subscribe to\\\", \\\"free shipping\\\", \\\"add to cart\\\",\\n+)\\n+SPAM = (\\n+ \\\"payday loan\\\", \\\"casino\\\", \\\"viagra\\\", \\\"coupon code\\\", \\\"promo code\\\", \\\"buy now\\\",\\n+ \\\"best price\\\", \\\"order now\\\", \\\"weight loss\\\", \\\"essay writing service\\\",\\n+)\\n+\\n+\\n+def main():\\n+ tokenizer = AutoTokenizer.from_pretrained(\\\"gpt2\\\")\\n+ tokenizer.model_max_length = 10**9\\n+ dev = np.load(DEV).astype(np.int64)\\n+ quarter = len(dev) // DOMAINS\\n+ dcount = np.stack([\\n+ np.bincount(dev[d * quarter:(d + 1) * quarter], minlength=VOCAB)\\n+ for d in range(DOMAINS)\\n+ ])\\n+\\n+ texts, ids, basic, digests = [], [], [], []\\n+ with open(POOL) as f:\\n+ for line in f:\\n+ row = json.loads(line)\\n+ s = row[\\\"text\\\"]\\n+ lo = s.lower()\\n+ lines = s.splitlines()\\n+ chars = max(1, len(s))\\n+ words = re.findall(r\\\"[A-Za-z]+\\\", s)\\n+ nw = max(1, len(words))\\n+ normlines = [\\n+ re.sub(r\\\"\\\\s+\\\", \\\" \\\", x.strip().lower())\\n+ for x in lines if len(x.strip()) >= 20\\n+ ]\\n+ texts.append(s)\\n+ ids.append(row[\\\"id\\\"])\\n+ digests.append(hashlib.blake2b(\\n+ re.sub(r\\\"\\\\s+\\\", \\\" \\\", lo.strip()).encode(), digest_size=12\\n+ ).digest())\\n+ basic.append((\\n+ len(s),\\n+ sum(c.isalpha() for c in s) / chars,\\n+ sum(ord(c) < 128 for c in s) / chars,\\n+ sum(w.lower() in COMMON for w in words) / nw,\\n+ sum(s.count(x) for x in \\\".?!\\\") / nw,\\n+ sum(lo.count(x) for x in BOILER),\\n+ sum(lo.count(x) for x in SPAM),\\n+ len(lines),\\n+ sum(len(x.strip()) < 35 for x in lines) / max(1, len(lines)),\\n+ 1 - len(set(normlines)) / max(1, len(normlines)),\\n+ lo.count(\\\"<|endoftext|>\\\"),\\n+ ))\\n+ basic = np.asarray(basic, dtype=np.float32)\\n+ ids = np.asarray(ids)\\n+ print(f\\\"loaded {len(texts)} documents\\\", flush=True)\\n+\\n+ # A deterministic 1/12 sample supplies the raw-pool reference LM.\\n+ bg = np.zeros(VOCAB, dtype=np.int64)\\n+ sample = texts[::12]\\n+ for j in range(0, len(sample), 512):\\n+ batch = tokenizer(sample[j:j + 512], add_special_tokens=False,\\n+ return_attention_mask=False)[\\\"input_ids\\\"]\\n+ for z in batch:\\n+ bg += np.bincount(z, minlength=VOCAB)\\n+\\n+ smoothing = 8.0\\n+ lp_bg = np.log((bg + smoothing) / (bg.sum() + smoothing * VOCAB))\\n+ lp_dom = np.log((dcount + smoothing) /\\n+ (dcount.sum(1, keepdims=True) + smoothing * VOCAB))\\n+ lp_mix = np.log((dcount.sum(0) + smoothing) /\\n+ (dcount.sum() + smoothing * VOCAB))\\n+ token_log_ratio = lp_dom - lp_bg\\n+\\n+ # Collision-tolerant 22-bit bigram table (about 6% occupied/colliding).\\n+ bits = 22\\n+ mask = (1 << bits) - 1\\n+ bigram_count = np.zeros((DOMAINS, 1 << bits), dtype=np.uint32)\\n+ for d in range(DOMAINS):\\n+ x = dev[d * quarter:(d + 1) * quarter].astype(np.uint64)\\n+ h = ((x[:-1] * 1_000_003) ^ x[1:]) & mask\\n+ np.add.at(bigram_count[d], h, 1)\\n+ bigram_mix = bigram_count.sum(0)\\n+ bigram_rel_table = (\\n+ np.log(bigram_count + 0.20)\\n+ - np.log(bigram_mix[None, :] + 0.80)\\n+ ).astype(np.float32)\\n+\\n+ n = len(texts)\\n+ ntok = np.zeros(n, dtype=np.int32)\\n+ ce = np.zeros(n, dtype=np.float32)\\n+ rel = np.zeros((n, DOMAINS), dtype=np.float32)\\n+ bigram_rel = np.zeros((n, DOMAINS), dtype=np.float32)\\n+ diversity = np.zeros(n, dtype=np.float32)\\n+ for j in range(0, n, 256):\\n+ batch = tokenizer(texts[j:j + 256], add_special_tokens=False,\\n+ return_attention_mask=False)[\\\"input_ids\\\"]\\n+ for k, z0 in enumerate(batch, j):\\n+ z = np.asarray(z0, dtype=np.int64)\\n+ ntok[k] = len(z) + 1 # pack_selection appends EOS.\\n+ if not len(z):\\n+ continue\\n+ ce[k] = lp_mix[z].mean()\\n+ rel[k] = token_log_ratio[:, z].mean(1)\\n+ zz = z[:4096]\\n+ diversity[k] = len(np.unique(zz)) / math.sqrt(len(zz))\\n+ if len(z) > 1:\\n+ zu = z.astype(np.uint64)\\n+ h = ((zu[:-1] * 1_000_003) ^ zu[1:]) & mask\\n+ bigram_rel[k] = bigram_rel_table[:, h].mean(1)\\n+ if j and j % 16384 == 0:\\n+ print(f\\\"scored {j}/{n}\\\", flush=True)\\n+\\n+ eligible = (\\n+ (ntok >= 300) & (ntok <= 10_000)\\n+ & (basic[:, 1] > .68) & (basic[:, 2] > .92)\\n+ & (basic[:, 3] > .10) & (basic[:, 4] > .012)\\n+ & (basic[:, 6] == 0) & (basic[:, 9] < .25)\\n+ )\\n+ # Transparent quality prior: English prose, sentences, lexical diversity,\\n+ # little navigation/template repetition, and no high-risk spam markers.\\n+ base = (\\n+ 2 * np.clip((basic[:, 3] - .12) / .18, 0, 1)\\n+ + np.clip((basic[:, 1] - .65) / .15, 0, 1)\\n+ + .5 * np.clip((basic[:, 2] - .90) / .10, 0, 1)\\n+ + np.clip((basic[:, 4] - .015) / .05, 0, 1)\\n+ + .7 * np.clip((diversity - 5) / 12, 0, 1)\\n+ - .25 * basic[:, 5]\\n+ - 2 * np.maximum(0, basic[:, 8] - .65)\\n+ - 5 * basic[:, 9]\\n+ + .15 * np.clip(ce + 9, -2, 2)\\n+ )\\n+ shrink = np.sqrt(ntok[:, None] / (ntok[:, None] + 1000))\\n+ affinity = (\\n+ (rel - np.median(rel[eligible], 0)) / np.std(rel[eligible], 0)\\n+ ) * shrink\\n+ bigram_affinity = (\\n+ (bigram_rel - np.median(bigram_rel[eligible], 0))\\n+ / np.std(bigram_rel[eligible], 0)\\n+ ) * shrink\\n+ # Bigram ablation helped news and technical Q&A, but hurt the two prose\\n+ # queues because of target-specific Wikipedia punctuation/spacing.\\n+ weights = np.asarray([0.0, 0.0, 2.0, 2.0])\\n+ scores = base[:, None] + 5.0 * affinity + weights * bigram_affinity\\n+ scores[~eligible] = -99\\n+\\n+ queues = [np.argsort(-scores[:, d]).tolist() for d in range(DOMAINS)]\\n+ ptr = [0] * DOMAINS\\n+ totals = [0] * DOMAINS\\n+ order, used, seen = [], set(), set()\\n+ while min(totals) < PER_DOMAIN_OUTPUT:\\n+ d = min(range(DOMAINS), key=lambda x: totals[x])\\n+ while True:\\n+ i = queues[d][ptr[d]]\\n+ ptr[d] += 1\\n+ if i not in used and digests[i] not in seen:\\n+ break\\n+ used.add(i)\\n+ seen.add(digests[i])\\n+ order.append(int(ids[i]))\\n+ totals[d] += int(ntok[i])\\n+\\n+ os.makedirs(os.path.dirname(OUT), exist_ok=True)\\n+ with open(OUT, \\\"w\\\") as f:\\n+ json.dump(order, f)\\n+ print(f\\\"wrote {len(order)} unique ids; queue tokens={totals}; total={sum(totals)}\\\")\\n+\\n+\\n+if __name__ == \\\"__main__\\\":\\n+ main()\\n*** Add File: /workspace/claim.md\\n+# Hypothesis\\n+\\n+A small model trained on a token-balanced mixture of clean documents whose token distribution matches each disclosed target register will generalize better than one trained on globally high-scoring prose or random web text.\\n+\\n+# Mechanism\\n+\\n+Smoothed target-versus-pool unigram likelihood identifies register while prose, repetition, boilerplate, spam, and exact-duplicate controls preserve quality. Bigram affinity is used only where ablation supports it (news and technical Q&A). Independently of final perplexity, the selected prefix should contain about 3M tokens from each queue, have fewer repeated documents and navigation phrases than random data, and show higher held-out register-classification scores.\\n+\\n+# Falsification\\n+\\n+The hypothesis is falsified if a frozen-model run on the balanced selection does not beat a size-matched random selection, or if removing balance while retaining the same quality score does not worsen broad dev loss. It is also weakened if gains occur in only one target quarter while average loss rises.\\n+\\n+# Transfer\\n+\\n+The method transfers to a new corpus or target by replacing only the target sample used to estimate the smoothed n-gram distributions. The quality features, empirical-Bayes length shrinkage, deduplication, and token-balanced queue construction are source-agnostic; the register-specific bigram weights should be re-ablated.\\n*** End Patch\";\ntext(await tools.apply_patch(patch));\n"
}exec result
Script completed
Wall time 0.0 seconds
Output:
{}encrypted chain-of-thought — recorded, not exposed
args
{
"input": "const r = await tools.exec_command({cmd:\"python3 /workspace/submission/curate.py\",workdir:\"/workspace\",yield_time_ms:30000,max_output_tokens:3000});text(JSON.stringify(r));\n"
}exec result
Script running with cell ID 114
Wall time 11.0 seconds
Output:
encrypted chain-of-thought — recorded, not exposed
args
{
"cell_id": "114",
"yield_time_ms": 30000,
"max_tokens": 3000
}wait result
Script completed
Wall time 9.4 seconds
Output:
{"chunk_id":"485dc5","wall_time_seconds":30.001900997,"session_id":44314,"original_token_count":0,"output":""}encrypted chain-of-thought — recorded, not exposed
args
{
"input": "const r = await tools.write_stdin({session_id:44314,chars:\"\",yield_time_ms:30000,max_output_tokens:3000});text(JSON.stringify(r));\n"
}exec result
Script running with cell ID 115
Wall time 11.0 seconds
Output: