Skip to content

feat(distill): WO07 logit-distillation runner (Hebrew base->small case study) - #5

Merged
ronaldtse merged 6 commits into
mainfrom
feat/imf-distill
Aug 17, 2026
Merged

feat(distill): WO07 logit-distillation runner (Hebrew base->small case study)#5
ronaldtse merged 6 commits into
mainfrom
feat/imf-distill

Conversation

@ronaldtse

Copy link
Copy Markdown

Summary

Work order TODO.runtime-arch/07: the logit-distillation runner that
shrinks models for client-side use — the edge tier of the size ladder
(server fp32 zips → edge distilled ByT5-small students int8
~110-250MB → browser tiny students ~60MB, the latter a config away).

First case study (per the work order): Hebrew ByT5-base s43 teacher →
ByT5-small student
on the same hebrew-v4 corpus the teacher trained
on. Teacher frozen in fp16; loss =
0.5 * T^2 * KL(teacher || student) + 0.5 * CE (T=2). Student
initializes from google/byt5-small pretraining — a pretrained backbone
is essential (from-scratch ByT5 plateaus ~13% PER in the Thai ablations;
mode collapse resists all standard fixes).

Ops discipline (per the campaign hard rules):

  • A10G only — never competes with A100 training
  • periodic step-checkpoints every 500 steps + auto-resume from the
    newest (rababa-checkpoints:/rababa_hebrew_distill_small/run-001)
  • watchdog invocation documented in the module docstring:
    until modal run --detach src/gpu/modal_distill.py::main --spec heb-diac-small; do sleep 60; done

The run is live now; DER before/after lands in rababa RESULTS.md when
it completes, then the student goes through the same WO02 export →
WO03 gate → release path as every other model.

Test plan

  • syntax + Modal app definition validated (running on Modal)
  • training completes; val_loss reported
  • DER before/after in RESULTS.md; IMF zips exported + gated

Ronald Tse added 2 commits August 16, 2026 17:31
…yT5-small)

Loss = 0.5 * T^2 * KL(teacher||student) + 0.5 * CE on the same
hebrew-v4 corpus the teacher trained on; student initializes from
google/byt5-small pretraining (pretrained backbone is essential —
from-scratch ByT5 plateaus per the Thai ablations). Periodic
step-checkpoints + auto-resume, A10G only, watchdog invocation in the
module docstring. Teacher frozen in fp16; DER before/after to be
reported in rababa RESULTS.md when the run completes.
A branch switch during an image build aborts it ('.git/HEAD was
modified during build process'); model zips have no business in the
image either.
Ronald Tse added 4 commits August 16, 2026 20:02
One harness, same nakdimon test pairs, both models in fp16 on one GPU:
the DER comparison for RESULTS.md is apples-to-apples, not against a
number measured with a different evaluator/segmentation.
The kwarg crash-looped every watchdog launch (parity gates and the
distill eval). Plain copy=True again; avoid branch switches while a
build is in flight instead.
@ronaldtse
ronaldtse merged commit a2c97b1 into main Aug 17, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant