Skip to content

docs(adr): ADR-077 — pruning + distillation priority (Metal + CPU)#729

Merged
oceanwaves630 merged 2 commits into
mainfrom
docs/adr-077-pruning-distill-priority
Jul 9, 2026
Merged

docs(adr): ADR-077 — pruning + distillation priority (Metal + CPU)#729
oceanwaves630 merged 2 commits into
mainfrom
docs/adr-077-pruning-distill-priority

Conversation

@oceanwaves630

Copy link
Copy Markdown
Collaborator

PR description authored by Claude (Anthropic agent) on behalf of @oceanwaves630.

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 house
standard: a Measured / source-verified table (rows tagged runtime-measured | unit-test/gate-pinned |
source-read, each with an origin/main pointer) held apart from an untrusted external prior-art
survey 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-060
    P1, PR feat(inference): ShortGPT block influence scoring (ADR-060 P1) #133 merged), a real in-memory apply_layer_mask, and a Metal score_layer_importance that
    runs 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 DistillationPipeline is a 6-class
    conversational-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 ("DistillationPipeline is not relevant infrastructure... the reusable
    asset 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

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, DistillationPipeline placeholder
(distill.rs:69), zero KL machinery (grep, zero hits), TOP_LAYER=23 (train_core.rs:13), ADR-060
status 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.

oceanwaves630 and others added 2 commits July 9, 2026 06:00
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>
@oceanwaves630 oceanwaves630 marked this pull request as ready for review July 9, 2026 10:21
@oceanwaves630 oceanwaves630 enabled auto-merge (squash) July 9, 2026 10:21

@ohdearquant ohdearquant left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@oceanwaves630 oceanwaves630 merged commit 594b557 into main Jul 9, 2026
35 of 36 checks passed
@oceanwaves630 oceanwaves630 deleted the docs/adr-077-pruning-distill-priority branch July 9, 2026 10:58
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.

2 participants