docs(adr): ADR-077 — pruning + distillation priority (Metal + CPU)#729
Conversation
Split verdict, both NEEDS-EXPERIMENT. Pruning: BI scorer + apply_layer_mask + score_layer_importance shipped (ADR-060 P1, type-balanced GDN/GQA) but masks never PPL-gated -> P1 runs the PPL gate (#492), which blocks the chain. Distillation: DistillationPipeline is a false cognate (intent classifier, #11), zero KD machinery; real KD greenfield, gated behind a pruning result + a KL loss term + the TOP_LAYER=23 generalization (untracked prerequisite, surfaced here). Builds on ADR-060 (honest partial-shipment), amends nothing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…YER semantics + #730, drop unsourced NLL R1 mediums, all TBV'd vs origin/main@58e885ada: - M1: the committed logit-cosine/greedy smoke gate is 12 prompts (unconditional), not 4; the 4-prompt/8-token subset feeds only the optional LATTICE_QUALITY_SCORE-gated scorer. Neither is a PPL gate (conclusion unchanged). - M2: TOP_LAYER=23 guard rejects only <24-layer models (48-layer accept test); the 27B trainer runs but caps at layer 23, never reaching the top 40 — precise wording across R10/P3/consequences. - M3: drop the unsourced NLL 5.18->0.61 number (not in cited source); keep the source-derived plain-NLL/no-KD claim. Leo press-time gate: filed the untracked TOP_LAYER prerequisite as #730; P3 now references it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ohdearquant
left a comment
There was a problem hiding this comment.
SPEC-GATE: SIGNED (Leo). All three press-time gates verified at content level before pressing: the false-cognate row pins to distill.rs:69's placeholder-teacher line and IntentLabels with #499's own body as corroboration, #730 is filed and OPEN with the correct name (verified directly) and referenced at R10/P3/consequences, and the type-balanced-scorer claim cites the quota loop at metal_qwen35.rs:12437-12456. The validates-shipped-primitive framing is a genuine addition to the bundle's epistemic vocabulary — an unvalidated shipped scorer is neither greenfield nor proven, and P1 (#492 wiring + PPL gate) is correctly the single unblocking measurement. Surfacing-then-FILING the TOP_LAYER=23 blocker is the ADR finishing its job. Bundle H signed — the sequencing set D/B/A/E/F/G/H is complete. Proceed to I (multimodal deferral ADR), then the P2 dispatch-count-cut build lane.
ADR-077 — Pruning + Distillation Priority (Metal + CPU)
Eighth sequencing ADR in the bundle set (siblings ADR-070…076). Docs-only — one new file,
docs/adr/ADR-077-pruning-distill-priority.md. Follows the ADR-073/076 split-verdict housestandard: a Measured / source-verified table (rows tagged runtime-measured | unit-test/gate-pinned |
source-read, each with an
origin/mainpointer) held apart from an untrusted external prior-artsurvey folded as data.
Split verdict — both families NEEDS-EXPERIMENT, at different maturity
Pruning is shipped substrate, never validated. A Block-Influence scorer (
pruning.rs, ADR-060P1, PR feat(inference): ShortGPT block influence scoring (ADR-060 P1) #133 merged), a real in-memory
apply_layer_mask, and a Metalscore_layer_importancethatruns actual forward-pass activations and produces a type-balanced GDN/GQA mask are all
shipped and wired. But the masks have never been PPL-gated — only a 4-prompt / 8-token
logit-cosine smoke test — and no pruning surface is reachable from any binary. ADR-060's own status
footer confirms the calibration pipeline, width pruning, and PPL-gated workflow are not shipped.
Distillation is a false cognate. The one artifact named
DistillationPipelineis a 6-classconversational-intent labeler with a hardcoded placeholder teacher call (issue tune: DistillationPipeline returns simulated labels, HTTP client not wired #11) — not knowledge
distillation. There is zero KL/soft-target/teacher-logit machinery anywhere. Issue train(tune): KL-distillation recovery loop for pruned models on top of the existing LoRA NLL trainer #499's own
body already states this ("
DistillationPipelineis not relevant infrastructure... the reusableasset is the CPU LoRA NLL trainer"). That trainer is hardcoded to the 24-layer 0.8B stack
(
TOP_LAYER = 23) and cannot touch the 27B model without generalization.Decision — validate the shipped scorer first; KD is gated behind it
score_layer_importancetoa CLI + real calibration corpus + PPL gate + serialized
PrunePlan. Reuses 100% of the shippedscorer and the existing
eval_perplexityPPL math behind a thin--layer-maskflag. cli(prune): expose score_layer_importance/LayerPruningPlan as a calibration+scoring command with a PPL gate #492 blocksresearch(prune): validate block-influence ranking against post-pruning PPL on a hybrid GDN/GQA model #495/train(tune): KL-distillation recovery loop for pruned models on top of the existing LoRA NLL trainer #499/research(prune): validity of teacher-KV-prefix reuse for distillation recovery without re-prefill #502/research(prune): iterative re-scoring with post-prune KL feedback vs. one-shot block-influence #503 by its own text.
survey flags as unresolved in the literature.
TOP_LAYER = 23— a hard prerequisite for any 27B recovery/KD, currentlyuntracked by any open issue (surfaced here to file).
pruned model worth recovering — gated behind P1/P2. research(prune): validity of teacher-KV-prefix reuse for distillation recovery without re-prefill #502/research(prune): iterative re-scoring with post-prune KL feedback vs. one-shot block-influence #503 conditional/secondary.
DistillationPipeline/tune: DistillationPipeline returns simulated labels, HTTP client not wired #11 is intent classification, not compression KD; thestanding teacher-proxy distillation project is greenfield here.
This ratifies the experiment-gated discipline of ADR-073/076, with one twist: the experiment here
validates an already-shipped primitive (the scorer) rather than deciding whether to build one.
Builds on ADR-060 (honest partial-shipment) and amends nothing — the distillation false-cognate is
already corrected in #499's body and audited by closed issue #302.
Verification
Every load-bearing pointer re-verified against
origin/main @ 58e885ada: BI scorer(
pruning.rs:41,59,lib.rs:76, PR #133 merged),apply_layer_mask:638,score_layer_importance:12397+ type-quota:12437-12456,DistillationPipelineplaceholder(
distill.rs:69), zero KL machinery (grep, zero hits),TOP_LAYER=23(train_core.rs:13), ADR-060status footer (
:680-684), and all issue states (#492/#495/#499/#502/#503/#11 OPEN, #133 MERGED,#445/#302 CLOSED). The external survey is genuinely repo-grounded (cites a verified ancestor commit)
and corroborates every finding.
Docs-only; no code paths change.