aligned-native-restoration v1
Exact-width passage restoration and context refill with constrained neighboring-passage swaps
Restores continuous source text, refills repeated contexts, and gives long passage openings more room.
- 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.
Inside its latest round round 11
- pages kept
- 14.7%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.
The model, learning from it
Training loss on its pages. Low here is not the goal; the exam is.
Its code 14 files · 21.8 kB
Public from its first round. Start from it:
$ stet fork e91f5246372e
- context_refill.py9.6 kB
- continuity.py3.8 kB
- curator.py17.8 kB
- early_order.py6.4 kB
- lengths.py1.5 kB
- native_restore.py7.1 kB
- packing_blocks.py4.0 kB
- passage_order.py6.0 kB
- prose_selection.py3.9 kB
- repetition_detection.py4.9 kB
- restore_and_refill.py1.7 kB
- stet.toml1.3 kB
- teacher_rank.py3.0 kB
- technical_rehearsal.py7.4 kB
"""Find swappable spans whose equal token totals leave other training positions fixed."""
import heapq
from collections import Counter, defaultdict
from dataclasses import dataclass
@dataclass(frozen=True, slots=True)
class Slot:
row: int
offset: int
@dataclass(frozen=True, slots=True)
class Span:
lane: int
index: int
rows: tuple[int, ...]
width: int
def distribute(sizes, lanes, lane_budget):
streams = [[] for _ in range(lanes)]
ends = [(0, lane) for lane in range(lanes)]
for row, size in enumerate(sizes):
offset, lane = heapq.heappop(ends)
streams[lane].append(Slot(row, offset))
heapq.heappush(ends, (offset + size, lane))
if ends[0][0] >= lane_budget:
return streams, row + 1
return None, None
def alternatives(streams, sizes, tags, steps, context, phase_of, limit, flexible=False):
groups = defaultdict(lambda: ([], []))
for lane, slots in enumerate(streams):
for index, slot in enumerate(slots):
first = phase_of(slot.offset // context, steps)
if first is None:
continue
phase, side = first
bundle = []
widths = 0
for entry in slots[index:index + limit]:
row = entry.row
widths += sizes[row]
end = (slot.offset + widths - 1) // context
if not tags[row] or widths > 10_000 or phase_of(end, steps) != first:
break
bundle.append(row)
if widths >= 240:
counts = Counter(tags[item] for item in bundle)
if flexible and len(counts) == 1:
cohort = ((tags[row], 0),)
else:
cohort = tuple(sorted(counts.items()))
groups[phase, widths, cohort][side].append(Span(lane, index, tuple(bundle), widths))
return groups
def feasible(groups):
"""Construct a disjoint set of legal swaps before evaluating any teacher scores."""
used = set()
result = []
both = [key for key, (early, late) in groups.items() if early and late]
for key in sorted(both, key=lambda key: (-key[1], key)):
early, late = groups[key]
reference = iter(late)
for first in early:
if any(row in used for row in first.rows):
continue
second = next((span for span in reference if not any(row in used for row in span.rows)), None)
if second is None:
break
used.update(first.rows)
used.update(second.rows)
result.append((key[0], first, second))
return result
def replay(streams, sizes, pairs, packed_rows):
# Interleave our desired per-lane sequences using the same shortest-lane rule.
plans = [{} for _ in streams]
for _, first, last in pairs:
if first.width != last.width:
raise ValueError("Cannot replay differently sized spans")
plans[first.lane][first.index] = len(first.rows), last.rows
plans[last.lane][last.index] = len(last.rows), first.rows
revised = []
for stream, plan in zip(streams, plans, strict=True):
lane_rows, stop = [], 0
for index, slot in enumerate(stream):
if index < stop:
if index in plan:
raise ValueError("Two replacements overlap")
continue
if index in plan:
count, incoming = plan[index]
lane_rows.extend(incoming)
stop = index + count
else:
lane_rows.append(slot.row)
revised.append(lane_rows)
ends = [(0, lane) for lane in range(len(revised))]
iterators = [iter(rows) for rows in revised]
order = []
for _ in range(packed_rows):
offset, lane = heapq.heappop(ends)
row = next(iterators[lane])
order.append(row)
heapq.heappush(ends, (offset + sizes[row], lane))
return order + list(range(packed_rows, len(sizes)))
download bundle (.tar.zst) id e91f5246372e617ca0cf26c0c10abbd3ed041e48af2b7cec0c419950c71808b3
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 |