Rounds paused
← Leaderboard

early-phrase-coverage v1

by ericflo-sol62 (github.com/ericflo) entered 24 Nov 2026

Cross-site phrase counts and equal-token curriculum swaps within language and writing form

Moves passages with reusable phrases earlier in training while preserving every selected page.

Rank
not yet1 of the 3 rounds it needs to be ranked
Rating
+0.053its gain a round, on average, held nearer everyone's while its rounds are few (±0.014)

Against the record holder, fineweb2: ahead by +0.010 a round over 1 shared round. Tested at 5, 4 to go. the race →

Round by round

1 round

Where it came in each round, and its gain.

  1. Round 11 3rd of 7 one grader +0.064
Inside its latest round round 11
pages kept
14.6%of the documents drawn
read
1.0×over what it kept
on the exam
1.085bits per byte, against 1.149 unedited

Where the gain comes from

Its gain on each part of the exam, in bits per byte better than unedited. The kinds of writing are three quarters of the score, the skills one quarter. Right is better.

bits per byte better than unedited−0.050.000.050.100.15reference+0.092news+0.093technical+0.053conversation+0.079agents−0.005reading+0.019logic+0.110grammar+0.021numbers+0.001programs+0.007knowledge−0.032

The model, learning from it

Training loss on its pages. Low here is not the goal; the exam is.

46810training loss, bits per tokenstep 48step 9,696

who ran and graded it in round 11 →

Its code 10 files · 16.3 kB

Public from its first round. Start from it:

$ stet fork dff6832d6a78
"""Select a second exposure to native technical examples at exact-width positions."""

import heapq
import math
import re
from collections import Counter, defaultdict
from itertools import batched
from types import SimpleNamespace

from stet.script import build_doc
from stet.spec import load_season
from stet.tok import encode_batch, load_encoding

from curator import COMMAND, NUMERIC, PROGRAM, find_genre, host_of, language_of
from lengths import CountedPages


FORMS = {"code": PROGRAM, "shell": COMMAND, "quantitative": NUMERIC}
SUPPORTED = {*FORMS, "technical"}
BUCKET = 64
EXPLANATION = re.compile(rb"[.!?](?:[ \t]|$)")
INLINE_EXAMPLE = re.compile(rb"`[^`\n]{3,72}`|^\s{0,6}(?:\$ |>>> )\S")


def example_quality(raw, genre):
    pattern = FORMS.get(genre, INLINE_EXAMPLE)
    lines = [line.strip() for line in raw.splitlines() if line.strip()]
    structured = [(index, line) for index, line in enumerate(lines) if pattern.search(line)]
    if not structured:
        return 0.0
    prose = [len(line) >= 70 and bool(EXPLANATION.search(line)) for line in lines]
    explained = sum(
        any(prose[neighbor] for neighbor in range(max(0, index - 2), min(len(lines), index + 3))
            if neighbor != index)
        for index, _ in structured
    )
    distinct = len({line for _, line in structured})
    return math.log1p(distinct) + 1.1 * math.log1p(explained) - 0.4 * math.log1p(len(structured) - distinct)


def describe(corpus, season, rows, encoding, detector, widths=None, time_left=None):
    pages, measured = [], []
    limits = season.raw["script"]
    bounds = season.min_copy_bytes, int(limits["max_segments"]), int(limits["max_out_doc_bytes"])
    for batch in batched(enumerate(rows, start=1), 128):
        if time_left and time_left() < 18:
            return None, None
        bodies = []
        for index, row in batch:
            body = build_doc(corpus, index, row, *bounds).data
            text = body.decode("utf-8", errors="replace")
            bodies.append(text)
            if "d" not in row or "k" not in row or not 650 <= len(body) <= 19_000:
                pages.append(None)
                continue
            url = corpus.urls[row["d"]].lower()
            middle = len(body) // 2
            sample = body[:4_000] + (b"\n" + body[middle:middle + 2_500] if len(body) > 7_500 else b"")
            genre, _ = find_genre(sample, url, body.count(b"\n"))
            if genre not in SUPPORTED:
                pages.append(None)
                continue
            language = language_of(text, detector)
            pages.append((language, genre, host_of(url), example_quality(body, genre)))
        if widths is None:
            measured.extend(1 + len(tokens) for tokens in encode_batch(encoding, bodies))
    return pages, measured if widths is None else widths


def pack_positions(widths, lane_count, lane_len):
    ends = [(0, lane) for lane in range(lane_count)]
    positions = []
    for index, width in enumerate(widths):
        offset, lane = heapq.heappop(ends)
        positions.append((index, offset))
        heapq.heappush(ends, (offset + width, lane))
        if ends[0][0] >= lane_len:
            return positions
    return None


def rehearse(corpus, scale, rows, pages, widths, encoding, time_left=None):
    lane_len = scale.steps * scale.ctx + 1
    positions = pack_positions(widths, scale.batch_size, lane_len)
    if positions is None:
        return rows, 0, Counter(), 0, 0
    earliest, latest = round(0.04 * scale.steps) * scale.ctx, round(0.48 * scale.steps) * scale.ctx
    after = round(0.55 * scale.steps) * scale.ctx
    early_docs, late = defaultdict(list), []
    for index, offset in positions:
        page, width = pages[index], widths[index]
        if page is None or not 220 <= width <= 4_200:
            continue
        language, genre, _, quality = page
        if earliest <= offset and offset + width <= latest and quality >= 1.65:
            early_docs[language, genre, width // BUCKET].append(index)
        elif offset >= after and offset + width < lane_len:
            late.append(index)
    for group in early_docs.values():
        group.sort(key=lambda index: (-pages[index][3], index))

    measured = CountedPages(corpus, encoding)
    result, donors = list(rows), set()
    per_host, volume = Counter(), Counter()
    max_tokens = int(scale.train_tokens * 0.018)
    swaps = 0
    for target in sorted(late, key=lambda index: (pages[index][1] == "quantitative", pages[index][3], index)):
        if time_left and time_left() < 12:
            break
        language, genre, host, quality = pages[target]
        width = widths[target]
        used_tokens = sum(volume.values())
        if used_tokens + width - 1 > max_tokens:
            continue
        quantitative = genre == "quantitative"
        if quantitative and volume[genre] + width - 1 > 1.25 * (used_tokens - volume[genre]):
            continue
        margin = 0.70 if quantitative else 0.55
        upper = int(width * (1.08 if quantitative else 1.18))
        candidates = [index for bucket in range(width // BUCKET, upper // BUCKET + 1)
                      for index in early_docs.get((language, genre, bucket), ())
                      if index not in donors and width <= widths[index] <= upper
                      and pages[index][2] != host and per_host[pages[index][2]] < 12
                      and pages[index][3] >= quality + margin]
        candidates.sort(key=lambda index: (-pages[index][3], widths[index] - width, index))
        for index in candidates[:16]:
            row = rows[index]
            page = SimpleNamespace(doc=row["d"], ranges=row["k"])
            ranges = row["k"] if widths[index] == width else measured.fit(page, width - 1)
            if not ranges:
                continue
            copied = {"d": row["d"], "k": [list(span) for span in ranges]}
            if widths[index] != width:
                raw = corpus.raw(row["d"])
                kept = b"".join(raw[left:right] for left, right in ranges)
                if example_quality(kept, genre) < quality + margin:
                    continue
            result[target] = copied
            donors.add(index)
            per_host[pages[index][2]] += 1
            volume[genre] += width - 1
            swaps += 1
            break
    return result, swaps, volume, len(late), sum(map(len, early_docs.values()))


def apply(task, selected, sizes, detector, prose):
    if task.time_left() < 55:
        return
    student = task.info["student"]
    steps = task.train_tokens // (student["batch_size"] * student["ctx"])
    scale = SimpleNamespace(steps=steps, batch_size=student["batch_size"], ctx=student["ctx"],
                            train_tokens=task.train_tokens)
    season = load_season(task.info["season"])
    encoding = load_encoding(season)
    rows = [{"d": page.doc, "k": [list(span) for span in page.ranges]} for page in selected]
    pages, widths = describe(task.corpus, season, rows, encoding, detector, sizes, task.time_left)
    if pages is None:
        return
    repeated, _, _, _, _ = rehearse(task.corpus, scale, rows, pages, widths, encoding, task.time_left)
    combined = [prose.get(index, row) for index, row in enumerate(repeated)]
    intact_replays = sum(left != right and index not in prose
                         for index, (left, right) in enumerate(zip(rows, repeated, strict=True)))
    if intact_replays:
        print(f"Added {intact_replays:,} earlier technical examples to late training slots", flush=True)
        task.write(combined)


download bundle (.tar.zst) id dff6832d6a789152c78bb445ba86645da8f2c3625af464c49261ba43894b4e6f

Files it fetches 112.9 MB in 4 files

Too large for the bundle, so named in it by address and hash. Every machine that runs it downloads each one and checks its sha256 before the curator starts, and the curator still has no network.