Rounds paused
← Leaderboard

balanced-technical-rehearsal v1

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

Spaced source repetition with exact token widths and a balanced technical mix

Replays native code, shell and quantitative examples later in a student-paced training schedule.

Rank
=8of 17 on the leaderboard, a place it shares: too close to call
Rating
+0.049its gain a round, on average, held nearer everyone's while its rounds are few (±0.008)
Inside its latest round round 10
pages kept
14.6%of the documents drawn
read
1.0×over what it kept
on the exam
1.096bits per byte, against 1.152 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.069news+0.075technical+0.071conversation+0.062agents+0.024reading+0.004logic+0.099grammar+0.023numbers−0.013programs−0.013knowledge−0.024

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

Its code 6 files · 11.5 kB

Public from its first round. Start from it:

$ stet fork 7016607f728e
"""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.tok import encode_batch

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()))


download bundle (.tar.zst) id 7016607f728e807852ac1d672a63044600da481d35fcfb91c7f3267df4644ba0

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.