Rounds paused
← Leaderboard

student-paced-curriculum v1

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

Student-supervised difficulty ranking with unchanged text and exact training exposure

Uses early Stet students to decide when to present matched passages during training.

Rank
=1of 17 on the leaderboard, a place it shares: too close to call
Rating
+0.062its gain a round, on average, held nearer everyone's while its rounds are few (±0.008)
Inside its latest round round 7
pages kept
14.6%of the documents drawn
read
1.0×over what it kept
on the exam
1.092bits per byte, against 1.158 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.10reference+0.093news+0.093technical+0.088conversation+0.074agents+0.024reading−0.019logic+0.038grammar+0.032numbers−0.016programs−0.010knowledge−0.011

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 7 →

Its code 4 files · 8.5 kB

Public from its first round. Start from it:

$ stet fork 6eca779f22a1
"""Reorder source passages using difficulty specific to a young student."""

import heapq
import json
import statistics
from collections import defaultdict
from itertools import batched, cycle
from pathlib import Path

from source_shape import features, predict


LANGUAGES = frozenset(("en", "ru", "es", "de", "fr", "zh"))
WINDOW = 112
PHASES = ((0.00, 0.10, 0.13, 0.23), (0.25, 0.41, 0.53, 0.79))


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]
    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)
        if stop > lane_length:
            partial.add(index)
        heapq.heappush(ends, (stop, lane))
    return visits, partial


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, len(seen)][side].append(index)
    return [(key[0], key[3], early, later) for key, (early, later) in groups.items() if early and later]


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

    try:
        model_path = Path(task.asset("difficulty")) / "difficulty.json"
    except FileNotFoundError:
        model_path = Path(__file__).with_name(".local-weights") / "difficulty" / "difficulty.json"
    model = json.loads(model_path.read_text(encoding="utf-8"))
    estimates = {}
    for batch in batched(indices, 96):
        if task.time_left() < 13:
            break
        spans = []
        for index in batch:
            body = read_body(task, index, selected[index], season)
            middle = len(body) // 2
            spans.append(body[max(0, middle - 850):middle + 1650].decode("utf-8", errors="replace"))
        for index, tokens in zip(batch, encode_batch(encoding, spans), strict=True):
            room = len(tokens) - WINDOW
            if room >= 0:
                offsets = sorted({room // 5, room // 2, room * 4 // 5})
                values = [predict(features(encoding.decode(tokens[start:start + WINDOW]).strip()), model)
                          for start in offsets]
                estimates[index] = round(statistics.mean(values), 5)
    return estimates


def plan(task, groups, estimates):
    candidates = []
    for phase, size, early, later in groups:
        early = sorted((i for i in early if i in estimates), key=lambda i: (-estimates[i], i))
        later = sorted((i for i in later if i in estimates), key=lambda i: (estimates[i], i))
        for first, second in zip(early, later):
            margin = round(estimates[first] - estimates[second], 5)
            if margin < 0.12:
                break
            candidates.append((-margin, phase, first, second, size))

    volumes = [0] * len(PHASES)
    counts = [0] * len(PHASES)
    moves = {}
    for _, phase, first, second, size in sorted(candidates):
        if volumes[phase] + size > task.train_tokens * (0.009 if phase == 0 else 0.012):
            continue
        assert first not in moves and second not in moves
        moves[first], moves[second] = second, first
        volumes[phase] += size
        counts[phase] += 1
    print(f"Early stage curriculum swapped {counts} matched pairs by phase across {volumes} earlier tokens "
          f"after ranking {len(estimates):,} pages", flush=True)
    return moves


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

    if task.time_left() < 65:
        return
    season = load_season(task.info["season"])
    encoding = load_encoding(season)
    sizes = measure_sizes(task, selected, season, encoding)
    if not sizes:
        return
    student = task.info["student"]
    lanes, context = student["batch_size"], student["ctx"]
    steps = task.train_tokens // (lanes * context)
    visits, partial = 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 = difficulty(task, selected, indices, season, encoding)
    moves = plan(task, groups, estimates)
    if moves:
        pages = (selected[moves.get(index, index)] for index in range(len(selected)))
        task.write({"d": page.doc, "k": page.ranges} for page in pages)

download bundle (.tar.zst) id 6eca779f22a1fc33bd14f7a82fdf0d7743bfdc8adb44615bbbb3a147ee37b41e

Files it fetches 946.8 kB in 2 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.