prose-with-technical-rehearsal v1
Two-student pacing, coherent prose selection and equal-length technical rehearsal
Combines better late prose with spaced repetition of native technical examples.
- 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)
Round by round
3 rounds
Where it came in each round, and its gain.
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.
The model, learning from it
Training loss on its pages. Low here is not the goal; the exam is.
Its code 8 files · 13.6 kB
Public from its first round. Start from it:
$ stet fork c9a108850f85
- continuity.py3.8 kB
- curator.py17.5 kB
- early_order.py6.4 kB
- lengths.py1.5 kB
- prose_selection.py3.9 kB
- stet.toml1.3 kB
- teacher_rank.py3.0 kB
- technical_rehearsal.py7.4 kB
from collections import Counter, defaultdict
from early_order import timing
from lengths import CountedPages
GENRES = {"prose", "reference", "news", "discussion"}
BUCKET = 128
def structured(corpus, page, protect, ranges=None):
raw = corpus.raw(page.doc)
body = b"".join(raw[start:stop] for start, stop in (page.ranges if ranges is None else ranges))
return any(pattern.search(body) for pattern in protect)
def donors(preferred, used, corpus, protect):
pools = defaultdict(list)
for page in preferred:
if (page.doc not in used and page.genre in GENRES and page.continuity is not None
and 220 <= page.tokens <= 5_800 and not structured(corpus, page, protect)):
pools[page.language, page.genre, page.tokens // BUCKET].append(page)
for group in pools.values():
group.sort(key=lambda page: (-page.score, page.doc))
return pools
def match(task, original, width, pools, used, measured, fingerprints, protect):
lower = round(0.88 * original.tokens)
upper = round(1.18 * original.tokens)
options = [page for index in range(lower // BUCKET, upper // BUCKET + 1)
for page in pools.get((original.language, original.genre, index), ())[:30]
if page.doc not in used and lower <= page.tokens <= upper]
options.sort(key=lambda page: (-page.score, abs(page.tokens - original.tokens), page.doc))
for page in options[:50]:
if page.score < original.score + 0.12:
return None
if page.host == original.host or len(set(page.fingerprints) & fingerprints) >= min(2, len(page.fingerprints)):
continue
available = measured.count(page)
if not width <= available <= width * 1.08:
continue
ranges = measured.fit(page, width)
if ranges and not structured(task.corpus, page, protect, ranges):
return page, ranges
return None
def apply(task, selected, sizes, preferred, protect):
from stet.spec import load_season
from stet.tok import load_encoding
student = task.info["student"]
lanes, context = student["batch_size"], student["ctx"]
steps = task.train_tokens // (lanes * context)
visits, partial, _ = timing(sizes, lanes, context, steps)
used = {page.doc for page in selected}
keep = {page.doc for page in preferred}
pool = donors(preferred, used, task.corpus, protect)
fingerprints = {key for page in selected for key in page.fingerprints}
measured = CountedPages(task.corpus, load_encoding(load_season(task.info["season"])))
slots = [index for index, (page, seen, width) in enumerate(zip(selected, visits, sizes, strict=True))
if page.doc not in keep and page.genre in GENRES and page.continuity is not None
and index not in partial and len(seen) == 1 and seen[0] >= 0.53 * steps and 240 <= width <= 4_500]
changes, distribution = {}, Counter()
volume = 0
cap = int(task.train_tokens * 0.045)
for index in sorted(slots, key=lambda index: (selected[index].score, selected[index].doc)):
if task.time_left() < 20 or volume >= cap:
break
original, width = selected[index], sizes[index] - 1
if volume + width > cap or structured(task.corpus, original, protect):
continue
choice = match(task, original, width, pool, used, measured, fingerprints, protect)
if choice is None:
continue
page, ranges = choice
changes[index] = {"d": page.doc, "k": ranges}
used.add(page.doc)
fingerprints.update(page.fingerprints)
distribution[page.genre] += width
volume += width
print(f"Paced prose selection replaced {len(changes):,} late slots with exactly {volume:,} source tokens, "
f"{distribution.most_common()}", flush=True)
if changes:
task.write(changes.get(index, {"d": page.doc, "k": page.ranges}) for index, page in enumerate(selected))
return changes
download bundle (.tar.zst) id c9a108850f85aab459ae7668ff0d603c1a752ddfe0decf0f5c8367c32dbcaa03
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.
| Path | Size | sha256 | From |
|---|---|---|---|
| language/lid.176.ftz | 916.0 kB | 8f3472cfe873 | https://huggingface.co/julien-c/fasttext-language-id/resolve/9f2e94d2fd6b2615d26f5ec5b34cf7e2f38cb86e/lid.176.ftz |
| difficulty/early.safetensors | 56.0 MB | f828164714bf | https://huggingface.co/ericflo/stet-matched-student-pace/resolve/a11215d67107307d0e76180494f41755edf4917d/early.safetensors |
| difficulty/mature.safetensors | 56.0 MB | 64c2afc22042 | https://huggingface.co/ericflo/stet-matched-student-pace/resolve/a11215d67107307d0e76180494f41755edf4917d/mature.safetensors |
| difficulty/calibration.json | 170 B | 3be8effd9fd9 | https://huggingface.co/ericflo/stet-matched-student-pace/resolve/a11215d67107307d0e76180494f41755edf4917d/calibration.json |
| total | 112.9 MB |