Rounds paused
SeasonsSeason 1 Finished 22 Nov 2026
← Leaderboard

lexical-coverage-matching v1

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

Round-local lexical context sketches with matched and deduplicated multilingual selection

Balances underrepresented local word and character contexts with matched passage replacements.

Rank
3of 14 on the leaderboard
Rating
+0.043its gain a round, on average (±0.022)
Inside its latest round round 14
pages kept
14.7%of the documents drawn
read
1.0×over what it kept
its own words
0%of tokens not copied
on the exam
2.813bits per byte, against 2.829 unedited

Where the gain comes from

Its gain on each thing the exam tests, in bits per byte better than unedited. Each counts the same. Right is better.

bits per byte better than unedited−0.4−0.20.00.2knowledge−0.074reading+0.077reasoning+0.134code−0.300agents+0.103writing+0.060conversation+0.077

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

Its code 3 files · 7.7 kB

Public from its first round. Start from it:

import math
import random
import re
from array import array
from collections import Counter, defaultdict

import numpy as np
from xxhash import xxh3_64_intdigest as digest


BINS = 1 << 19
FORMS = {"prose", "reference", "news", "discussion"}
WORDS = re.compile(r"[^\W\d_]{2,}")


def features(task, page):
    raw = task.corpus.raw(page.doc)
    retained = b"".join(raw[left:right] for left, right in page.ranges)
    length = len(retained)
    offset = max(0, (length - 1_300) // 2)
    excerpts = (retained[:850], retained[offset:offset + 1_300], retained[-850:])
    seed = digest(page.language.encode())
    hashes = set()
    for chunk in excerpts:
        words = WORDS.findall(chunk.decode("utf-8", errors="ignore").casefold())
        hashes.update(digest(f"{left} {right}".encode(), seed=seed) % BINS
                      for left, right in zip(words, words[1:]))
        # Unsegmented scripts get overlapping character contexts too.
        for word in words:
            if len(word) >= 12 and not word.isascii():
                hashes.update(digest(word[i:i + 5].encode(), seed=seed) % BINS
                              for i in range(0, len(word) - 4, 3))
    return sorted(hashes, key=lambda value: (value * 2654435761) % BINS)[:96]


def document_frequencies(task, pages, want):
    indices = array("I")
    selected = {}
    for page in pages:
        values = features(task, page)
        indices.extend(values)
        if page.doc in want:
            selected[page.doc] = values
    frequencies = np.bincount(np.frombuffer(indices, dtype=np.uint32), minlength=BINS)
    return frequencies, selected


def cohort(page):
    return page.language, page.genre, page.tokens.bit_length()


def edit(task, selected, candidates, target):
    if task.time_left() < 30 or len(selected) < 150:
        return selected
    standard = task.train_tokens >= 80_000_000
    rng = random.Random(821334)
    rows = [page for page in candidates if page.genre in FORMS and page.tokens >= 160]
    baseline = [page for page in selected if page.genre in FORMS and page.tokens >= 160]
    if len(rows) < 200 or not baseline:
        return selected
    existing = {page.doc for page in selected}
    groups = defaultdict(list)
    for offset, page in enumerate(selected):
        if 0.10 * len(selected) <= offset < 0.91 * len(selected) and page.genre in FORMS and page.tokens >= 160:
            groups[cohort(page)].append((offset, page))
    alternatives = defaultdict(list)
    for page in rows:
        key = cohort(page)
        if key in groups and page.doc not in existing:
            alternatives[key].append(page)
    active = []
    for key, positions in groups.items():
        positions.sort(key=lambda row: (row[1].score, row[1].doc))
        del positions[max(3, math.ceil(0.24 * len(positions))):]
        if not alternatives[key]:
            continue
        alternatives[key].sort(key=lambda page: (-page.score, page.doc))
        del alternatives[key][max(10, 3 * len(positions)):]
        active.extend(page for _, page in positions)
        active.extend(alternatives[key])
    if not active:
        return selected
    want = {page.doc for page in active}
    source, _ = document_frequencies(task, rng.sample(rows, min(len(rows), 32_000 if standard else 4_800)), ())
    present, cached = document_frequencies(task, rng.sample(baseline, min(len(baseline), 23_000 if standard else 3_600)), want)
    expected = source * (present.sum() / max(1, source.sum()))
    weights = np.log((expected + 2.0) / (present + 2.0)) * expected / (expected + 4.0)
    weights = np.clip(weights, -1.3, 1.3)
    values = {}
    for page in active:
        if task.time_left() < 13:
            break
        indices = cached[page.doc] if page.doc in cached else features(task, page)
        if len(indices) >= 20:
            values[page.doc] = float(weights[indices].mean())
    used = {key for page in selected for key in page.fingerprints}
    host_added = Counter()
    output = list(selected)
    swaps = volume = 0
    order = [(rng.random(), key, slot, page) for key, slots in groups.items() for slot, page in slots]
    for _, key, slot, page in sorted(order):
        if volume >= target * 0.045 or task.time_left() < 8:
            break
        score = values.get(page.doc)
        if score is None:
            continue
        viable = []
        for challenger in alternatives[key]:
            value = values.get(challenger.doc)
            if value is None or value - score < 0.12 or challenger.doc in existing:
                continue
            if challenger.score < page.score - 0.20 or abs(challenger.tokens / page.tokens - 1) > 0.12:
                continue
            if host_added[challenger.host] > target * 0.0015:
                continue
            if sum(fp in used for fp in set(challenger.fingerprints)) >= min(2, len(challenger.fingerprints)):
                continue
            viable.append((value + 0.33 * challenger.score, -challenger.doc, challenger))
        if viable:
            replacement = max(viable)[2]
            output[slot] = replacement
            existing.add(replacement.doc)
            used.update(replacement.fingerprints)
            host_added[replacement.host] += replacement.tokens
            swaps += 1
            volume += page.tokens
    print(f"Coverage sketch compared {len(values):,} pages and replaced {swaps:,} ({volume:,} estimated tokens)", flush=True)
    return output

download bundle (.tar.zst) id c052dab80e7f891c22cc74c74edb0ff840fefdcecd6b58512be93d866bcbd346

Files it fetches 916.0 kB in 1 file

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.

PathSizesha256From
language/lid.176.ftz 916.0 kB 8f3472cfe873 https://huggingface.co/julien-c/fasttext-language-id/resolve/9f2e94d2fd6b2615d26f5ec5b34cf7e2f38cb86e/lid.176.ftz
total916.0 kB