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
"""Reorder source passages using difficulty specific to a young student."""

import heapq
from collections import defaultdict
from itertools import batched, cycle

from teacher_rank import rank


LANGUAGES = frozenset(("en", "ru", "es", "de", "fr", "zh"))
WINDOW = 112
PHASES = ((0.00, 0.12, 0.15, 0.29), (0.31, 0.48, 0.54, 0.80))
WIDTH_BUCKET = 256


def read_body(task, index, page, season):
    from stet.script import build_doc

    limits = season.raw["script"]
    row = {"d": page.doc, "k": [list(pair) for pair in page.ranges]}
    return build_doc(task.corpus, index + 1, row, season.min_copy_bytes, int(limits["max_segments"]),
                     int(limits["max_out_doc_bytes"])).data


def measure_sizes(task, selected, season, encoding):
    from stet.tok import encode_batch

    sizes = []
    for batch in batched(enumerate(selected), 128):
        if task.time_left() < 40:
            return None
        bodies = [read_body(task, index, page, season).decode("utf-8", errors="replace") for index, page in batch]
        sizes.extend(1 + len(ids) for ids in encode_batch(encoding, bodies))
    return sizes


def timing(sizes, lanes, context, steps):
    lane_length = steps * context + 1
    ends = [(0, lane) for lane in range(lanes)]
    visits = [[] for _ in sizes]
    consumed = [0] * len(sizes)
    partial = set()
    for index, size in cycle(enumerate(sizes)):
        position, lane = heapq.heappop(ends)
        if position >= lane_length:
            break
        stop = position + size
        visits[index].append(position // context)
        consumed[index] += min(size, lane_length - position)
        if stop > lane_length:
            partial.add(index)
        heapq.heappush(ends, (stop, lane))
    return visits, partial, consumed


def phase_of(first, steps):
    fraction = first / steps
    for phase, (early_start, early_end, later_start, later_end) in enumerate(PHASES):
        if early_start <= fraction < early_end:
            return phase, 0
        if later_start <= fraction < later_end:
            return phase, 1
    return None


def matched_groups(selected, sizes, visits, partial, steps):
    groups = defaultdict(lambda: ([], []))
    for index, (page, size, seen) in enumerate(zip(selected, sizes, visits, strict=True)):
        if index in partial or not seen or page.language not in LANGUAGES or not 190 <= size <= 6_200:
            continue
        slot = phase_of(seen[0], steps)
        if slot is not None:
            phase, side = slot
            groups[phase, page.language, page.genre, size // WIDTH_BUCKET, len(seen)][side].append(index)
    return [(key[0], early, later) for key, (early, later) in groups.items() if early and later]


def plan(task, sizes, groups, estimates):
    candidates = []
    for phase, early, later in groups:
        early = [i for i in early if i in estimates]
        later = sorted((i for i in later if i in estimates), key=lambda i: (estimates[i][0], i))
        for first in early:
            width = sizes[first]
            early_residual, early_mature = estimates[first]
            for second in later:
                late_residual, late_mature = estimates[second]
                margin = round(early_residual - late_residual, 5)
                if margin < 0.20:
                    break
                if abs(early_mature - late_mature) > 0.24:
                    continue
                if abs(width - sizes[second]) <= min(128, min(width, sizes[second]) * 0.085):
                    candidates.append((-margin, phase, first, second))

    volumes = [0] * len(PHASES)
    used, pairs = set(), []
    for _, phase, first, second in sorted(candidates):
        size = sizes[second]
        if volumes[phase] + size > task.train_tokens * (0.020 if phase == 0 else 0.024):
            continue
        if first in used or second in used:
            continue
        pairs.append((phase, first, second))
        used.update((first, second))
        volumes[phase] += size
    return pairs


def check_plan(task, sizes, lanes, context, steps, pairs, visits, consumed):
    for _ in range(3):
        moves = {slot: source for _, a, b in pairs for slot, source in ((a, b), (b, a))}
        revised_sizes = [sizes[moves.get(i, i)] for i in range(len(sizes))]
        revised_visits, revised_partial, revised_consumed = timing(revised_sizes, lanes, context, steps)
        invalid = {slot for slot, source in moves.items()
                   if slot in revised_partial or len(revised_visits[slot]) != len(visits[source])}
        if invalid:
            pairs = [(phase, a, b) for phase, a, b in pairs if a not in invalid and b not in invalid]
            continue
        drift = sum(abs(revised_consumed[i] - consumed[moves.get(i, i)]) for i in range(len(sizes))) // 2
        if drift <= task.train_tokens * 0.0012:
            counts = [sum(item[0] == phase for item in pairs) for phase in range(len(PHASES))]
            volume = sum(sizes[b] for _, _, b in pairs)
            print(f"Matched student pace swapped {counts} pairs across {volume:,} earlier tokens "
                  f"with {drift:,} tokens of source exposure drift", flush=True)
            return moves
        pairs = pairs[:len(pairs) * 2 // 3]
    print("Source exposure check kept the original script", flush=True)
    return {}


def apply(task, selected):
    from stet.spec import load_season
    from stet.tok import load_encoding

    if task.time_left() < 65:
        return selected, None
    season = load_season(task.info["season"])
    encoding = load_encoding(season)
    sizes = measure_sizes(task, selected, season, encoding)
    if not sizes:
        return selected, None
    student = task.info["student"]
    lanes, context = student["batch_size"], student["ctx"]
    steps = task.train_tokens // (lanes * context)
    visits, partial, consumed = timing(sizes, lanes, context, steps)
    groups = matched_groups(selected, sizes, visits, partial, steps)
    indices = sorted({i for _, early, later in groups for i in early + later})
    estimates = rank(task, selected, indices, season, encoding, read_body, WINDOW)
    pairs = plan(task, sizes, groups, estimates)
    moves = check_plan(task, sizes, lanes, context, steps, pairs, visits, consumed)
    if moves:
        indices = [moves.get(index, index) for index in range(len(selected))]
        pages = [selected[index] for index in indices]
        task.write({"d": page.doc, "k": page.ranges} for page in pages)
        return pages, [sizes[index] for index in indices]
    return selected, sizes

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.