Skip to content
nano-gpt-data-curation

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
180
duration
39m
recorded
2026-08-04

run iddclm-nano-curation__frqBRu3

Everything gpt-5.6-sol did on this task, in order.

download JSON ↗
codexgpt-5.6-sol185 turns5 narration180 reasoning180 action180 observation1 final
#176
reasoning (redacted)

encrypted chain-of-thought — recorded, not exposed

toolwait
args
{
  "cell_id": "131",
  "yield_time_ms": 30000,
  "max_tokens": 1000
}
wait result
Script completed
Wall time 7.7 seconds
Output:
#177
reasoning (redacted)

encrypted chain-of-thought — recorded, not exposed

toolexec
args
{
  "input": "const r = await tools.write_stdin({session_id:56570,chars:\"\",yield_time_ms:30000,max_output_tokens:1000}); text(r.output)\n"
}
exec result
Script running with cell ID 132
Wall time 11.0 seconds
Output:
#178
reasoning (redacted)

encrypted chain-of-thought — recorded, not exposed

toolwait
args
{
  "cell_id": "132",
  "yield_time_ms": 30000,
  "max_tokens": 1000
}
wait result
Script completed
Wall time 11.8 seconds
Output:
Token indices sequence length is longer than the specified maximum sequence length for this model (1251 > 1024). Running this sequence through the model will result in indexing errors
documents 16564 domain_tokens [3350001, 3350741, 3351560, 1108738] prefix_tokens 11161040
#179
reasoning (redacted)

encrypted chain-of-thought — recorded, not exposed

toolexec
args
{
  "input": "const r = await tools.exec_command({cmd:\"python - <<'PY'\\nimport json\\nbins=[0]*6; cnt=[0]*6\\nfor l in open('data/pool.jsonl'):\\n t=json.loads(l)['text']; low=t.lower()\\n if '<code>' in low or '<pre>' in low:\\n  n=len(t); j=next((i for i,x in enumerate([30000,80000,150000,300000,1000000]) if n<=x),5); bins[j]+=n;cnt[j]+=1\\nprint(cnt,[x//1000000 for x in bins])\\nPY\",\"workdir\":\"/workspace\",\"yield_time_ms\":10000,\"max_output_tokens\":1000}); text(r.output)\n"
}
exec result
Script completed
Wall time 5.7 seconds
Output:
[120, 8, 0, 0, 0, 0] [0, 0, 0, 0, 0, 0]
#180
reasoning (redacted)

encrypted chain-of-thought — recorded, not exposed

toolexec
args
{
  "input": "const r = await tools.exec_command({cmd:\"python - <<'PY'\\nimport json\\nfor sig in ['<p>','error',' function ']:\\n c=n=0\\n for l in open('data/pool.jsonl'):\\n  t=json.loads(l)['text'].lower()\\n  if len(t)>30000 and sig in t:c+=1;n+=len(t)\\n print(sig,c,n//1000000)\\nPY\",\"workdir\":\"/workspace\",\"yield_time_ms\":10000,\"max_output_tokens\":1000}); text(r.output)\n"
}
exec result
Script completed
Wall time 10.2 seconds
Output:
#181
reasoning (redacted)

encrypted chain-of-thought — recorded, not exposed

toolexec
args
{
  "input": "const r = await tools.exec_command({cmd:\"ps -o pid,etime,cmd -C python; cat .timer/remaining_secs\",\"workdir\":\"/workspace\",\"yield_time_ms\":10000,\"max_output_tokens\":1000}); text(r.output)\n"
}
exec result
Script completed
Wall time 0.1 seconds
Output:
  PID     ELAPSED CMD
3278
#182
narration

The structural/domain-balanced candidate is decisively better: dev perplexity 375.833 versus 390.201 for the stricter short-document variant and 476.714 for random selection. The gain came from retaining longer, code-bearing technical pages while keeping stringent prose and boilerplate filters elsewhere. I’m locking that measured-best configuration, removing the abandoned experiment, and performing final validity/reproducibility checks.

#183
reasoning (redacted)

encrypted chain-of-thought — recorded, not exposed

toolexec
args
{
  "input": "const patch = \"*** Begin Patch\\n*** Delete File: /workspace/submission/ml_test.py\\n*** Add File: /workspace/claim.md\\n+# Hypothesis\\n+\\n+For a 12M-token training run, a token-balanced mixture of clean encyclopedic,\\n+general-prose, news, and technical-Q&A pages will outperform either random web\\n+data or a single global “quality” ranking.  The useful signal is sustained\\n+English prose plus register-specific structure; navigation, commerce, extraction\\n+noise, repetition, and adult/keyword spam waste scarce updates.\\n+\\n+# Mechanism\\n+\\n+`curate.py` applies deterministic extraction-quality features, assigns each\\n+surviving document to one of four registers using structural and lexical cues,\\n+ranks within each register, and interleaves the queues by GPT-2 token mass.\\n+Long documents are normally discouraged, but longer pages containing code are\\n+retained because technical Q&A naturally packages several examples and answers.\\n+\\n+An observable prediction independent of final perplexity is that the consumed\\n+prefix has much lower rates of boilerplate phrases, very short lines, unusual\\n+characters, and non-prose word lengths than a random prefix, while containing\\n+substantial mass from all four register queues.  It should also contain more\\n+HTML code/preformatted blocks than a generic clean-prose-only selection.\\n+\\n+# Falsification\\n+\\n+The hypothesis is falsified if a random selection, a quality-ranked but\\n+unbalanced selection, or removal of the long code-bearing exception yields\\n+lower held-out cross-entropy under the same frozen training recipe.  It is also\\n+falsified mechanistically if the selected prefix does not show the predicted\\n+cleanliness and register-coverage differences when those features are measured.\\n+\\n+# Transfer\\n+\\n+The criterion uses no site names, pool IDs, hand labels, or hidden-target text.\\n+Its signals—prose continuity, boilerplate/repetition penalties, English function\\n+word balance, code markup, news attribution, and encyclopedic definitional\\n+language—are source-independent.  It should therefore transfer to a newly\\n+crawled English pool and to a disjoint high-quality target with the same broad\\n+register mixture, though its fixed four-way allocation is not expected to be\\n+optimal for a narrowly specialized target.\\n*** End Patch\";\ntext(await tools.apply_patch(patch));\n"
}
exec result
Script completed
Wall time 0.0 seconds
Output:
{}
#184
reasoning (redacted)

encrypted chain-of-thought — recorded, not exposed

toolexec
args
{
  "input": "const r = await tools.exec_command({cmd:\"sha256sum submission/selection.json /tmp/cand4_selection.json; python - <<'PY'\\nimport json\\np=json.load(open('submission/selection.json'))\\nassert isinstance(p,list) and p\\nassert len(p)==len(set(p))\\nassert all(type(x) is int and 0<=x<182016 for x in p)\\nprint({'ids':len(p),'unique':len(set(p)),'min':min(p),'max':max(p)})\\nPY\\npython -m py_compile submission/curate.py\\ncat /tmp/cand4.json\\ncat .timer/remaining_secs\",\"workdir\":\"/workspace\",\"yield_time_ms\":10000,\"max_output_tokens\":2000}); text(r.output)\n"
}
exec result
Script completed
Wall time 0.2 seconds
Output:
de9964ee9c4cccd010efc25781f79b0f543d5c0deff99a9811f4f32c1545b29f  submission/selection.json
de9964ee9c4cccd010efc25781f79b0f543d5c0deff99a9811f4f32c1545b29f  /tmp/cand4_selection.json
{'ids': 16564, 'unique': 16564, 'min': 17, 'max': 181984}
{"train_npy": "/tmp/cand4.npy", "heldout_ppl": 375.83288278347226, "mean_loss": 5.929144583905714, "max_iters": 3000, "seed": 1337, "train_s": 54.8}3258
#185
reasoning (redacted)

encrypted chain-of-thought — recorded, not exposed

toolexec
args
{
  "input": "const r = await tools.exec_command({cmd:\"sed -n '1,220p' submission/curate.py; git status --short 2>/dev/null || true\",\"workdir\":\"/workspace\",\"yield_time_ms\":10000,\"max_output_tokens\":12000}); text(r.output)\n"
}
exec result
Script completed
Wall time 0.1 seconds
Output:
#!/usr/bin/env python3
"""Rank raw web pages by clean-prose and target-register heuristics.

The selector is deliberately label-free.  It assigns each page to one of four
registers (encyclopedic, general prose, news, technical Q&A), rejects common
web-extraction failure modes, and interleaves the four quality-ranked queues by
estimated GPT-2 tokens.  The interleaving prevents an easy-to-find register
such as news from consuming the complete fixed training budget.
"""
import json, math, re
from pathlib import Path
from transformers import GPT2TokenizerFast

POOL = Path('/workspace/data/pool.jsonl')
OUT = Path('/workspace/submission/selection.json')
TARGET_PER_DOMAIN = 3_350_000   # surplus makes the output safely exceed 12M

word_re = re.compile(r"[A-Za-z]+(?:'[A-Za-z]+)?")

def score_doc(t):
    n=len(t); words=word_re.findall(t); nw=len(words)
    rough_tech = '<code>' in t.lower() or '<pre>' in t.lower()
    if n < 900 or n > 80_000 or (n > 30_000 and not rough_tech) or nw < 150: return None
    low=t.lower(); lines=t.splitlines(); alpha=sum(c.isalpha() for c in t)/n
    # Measures extraction cleanliness and sustained prose.
    sent=len(re.findall(r'[.!?](?:[\"\')\]]+)?(?:\s|$)',t))
    avg=n/max(nw,1); short=sum(len(x.strip())<35 for x in lines)/max(len(lines),1)
    uniq=len(set(w.lower() for w in words))/nw
    bad=sum(low.count(x) for x in ('cookie policy','enable javascript','shopping cart',
        'all rights reserved','skip to content','privacy policy','sign up','log in',
        'free shipping','add to cart','search results','subscribe to our','404 not found'))
    eots=low.count('<|endoftext|>')
    if eots > 2 and not rough_tech: return None
    stop={'the','of','to','and','a','in','is','that','for','it','on','with','as','was',
          'are','be','by','this','from','at','or','an','have','has','not','but','which'}
    stopfrac=sum(w.lower() in stop for w in words)/nw
    weird=sum(not(c.isalnum() or c.isspace() or c in ".,;:!?()[]{}'\"-/+*=<>%&@#$£€_`~|") for c in t)/n
    repeat=1-uniq
    q = 2.8*alpha + .18*math.log1p(sent) - .24*abs(avg-5.4)
    q += .25*min(uniq,.55) - .7*short - .20*bad - 3*weird
    q -= 7*abs(stopfrac-.27)
    adult=sum(low.count(x) for x in (' porn',' fuck',' pussy',' blowjob',' escort',' horny',
                                      ' sex video',' nude girls',' viagra',' casino bonus'))
    q -= .45*adult
    if sent < 6 or alpha < .62 or avg > 7.2 or avg < 3.8: q -= 2
    if repeat > .78: q -= 1

    html=sum(low.count(x) for x in ('<p>','<pre>','<code>','</a>','blockquote'))
    tech=sum(low.count(x) for x in (' error ',' function ',' code ',' python',' java',
        ' javascript',' database',' server',' class ',' method ',' linux',' api ',' sql',
        ' compiler',' algorithm',' command line',' stack trace',' exception'))
    news=sum(low.count(x) for x in ('according to','reported',' reporters',' minister',
        'president','government','police','officials','statement','spokesman','agency',
        'election','court',' on monday',' on tuesday',' on wednesday',' on thursday',
        ' on friday','reuters','associated press'))
    encycl=sum(low.count(x) for x in (' was born',' is a ',' was a ',' refers to ',
        ' known as ',' history of',' population',' species',' century',' located in',
        ' consists of',' became the',' university',' established in',' reign of'))
    first=low[:180]
    encycl += 2*int(bool(re.search(r'\b(is|was|are) (an?|the)\b',first)))
    qa = html*1.8 + tech + 2*low.count('?') + 2*low.count('<code>')
    # Register assignment uses structural evidence, then lexical evidence.
    if qa >= 6 and (html >= 1 or '<code>' in low): dom=3; fit=min(qa,35)/35
    elif news >= 8: dom=2; fit=min(news,25)/25
    elif encycl >= 7 and news < 8: dom=0; fit=min(encycl,22)/22
    else: dom=1; fit=min(sent,30)/60
    # Favor 1--8k token documents: enough context, limited boilerplate domination.
    length_bonus = -.24*abs(math.log(max(n,1200)/4500))
    return dom, q + .55*fit + length_bonus

def main():
    tok=GPT2TokenizerFast.from_pretrained('gpt2',local_files_only=True)
    buckets=[[] for _ in range(4)]
    with POOL.open() as f:
        for line in f:
            r=json.loads(line); z=score_doc(r['text'])
            if z is not None: buckets[z[0]].append((z[1],r['id'],r['text']))
    for b in buckets: b.sort(reverse=True)
    chosen=[]; totals=[0]*4; pos=[0]*4
    # Token-balanced round robin. Quality within each register is monotone.
    active=True
    while active:
        active=False
        for d in range(4):
            if totals[d] >= TARGET_PER_DOMAIN or pos[d] >= len(buckets[d]): continue
            active=True
            while pos[d] < len(buckets[d]):
                _,i,t=buckets[d][pos[d]]; pos[d]+=1
                nt=len(tok(t,add_special_tokens=False).input_ids)+1
                chosen.append(i); totals[d]+=nt
                break
    # Append remaining valid IDs in global score order as an unused safety tail.
    used=set(chosen)
    tail=sorted((x for b in buckets for x in b if x[1] not in used),reverse=True)
    chosen.extend(i for _,i,_ in tail[:10000])
    OUT.parent.mkdir(parents=True,exist_ok=True)
    OUT.write_text(json.dumps(chosen))
    print('documents',len(chosen),'domain_tokens',totals,'prefix_tokens',sum(totals))

if __name__ == '__main__': main()
final summary

Completed and validated:

  • selection.json: 16,564 unique valid IDs; packs exactly 12M tokens.
  • curate.py: deterministic, label-free quality and domain balancing.
  • claim.md: required hypothesis, mechanism, falsification, and transfer.

Measured dev perplexity: 375.833, versus 476.714 for random selection.