Inline link discovery: 91 high-confidence proposals + completed learned-engine evaluation - #138
Inline link discovery: 91 high-confidence proposals + completed learned-engine evaluation#138elimelt wants to merge 8 commits into
Conversation
…1 links) intent(reports): reviewable list of anchored inline links the corpus is missing, from the inline subsystem's audited baseline engine at threshold 0.65 — proposals only, no notes modified decision(engine): deterministic baseline per the SPEC §12 fallback; the learned path ran but its retrieval head barely beat uniform on the test-grade hashing token encoder, so it does not gate this list decision(audit): 300-link audit run by two independent Claude annotator agents at the owner's request, with one guideline-refinement round; final kappas 0.88-1.00, GO verdict (153 clean positives) learned(corpus): zero wrong-target links in 300 audited; all label noise is anchor phrasing and duplicate Related-notes placements Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
intent(inline): replace the test-grade hashing token encoder as the learned path's production encoder so heads train on real representations decision(windowing): overlapping 512/384 windows with per-token global char offsets; multi-window tokens take the state where the token sits deepest inside its window (most left context, per the spec's causal last-token-pooling caveat); windowing params are fingerprinted decision(caching): token states and catalog vectors cached in the artifact store keyed by encoder fingerprint + content hash, mirroring the embedding-cache discipline — corpus re-encoding drops to zero on re-runs decision(cli): --token-encoder hashing|qwen on inline train/propose, defaulting to hashing so tests stay model-free learned(eval): the encoder swap fixed retrieval exactly as the spec predicted (held-out recall@1 0.0 -> 0.964); the binding constraint moved to the naturalness head (AUC 0.664 on 9 test negatives), so the audited deterministic baseline remains the review-tool engine
…note intent(reports): publish the end-to-end evaluation of the learned inline engine against the deterministic baseline, plus the learned engine's supplementary proposal stream, alongside the production list decision(verdict): plateau per the spec's thresholds — baseline stays the review-tool engine; windowed Qwen token states fixed retrieval (held-out recall@1 0.0 -> 0.964) but the naturalness head (AUC 0.664, 9 test negatives) is now the label-limited binding constraint decision(ml/nlp-note): v2 section updated from "gated on the audit" to final results — audit kappas, tier distribution, encoder natural experiment, and the PR pointer
… directions intent(reports): consolidate the quantitative eval, a rank-depth qualitative sample with observed failure modes, and prioritized tuning directions into one reviewable report learned(failures): four concrete failure modes documented — naturalness label scarcity, cross-domain homonym anchors, same-target duplication next to existing links, and generic single-noun tail anchors — the first two bind the learned engine, the last two are mechanical selection fixes decision(priorities): P0 is negative-label acquisition (review-decision harvesting, rule-defined synthetic negatives, Wikipedia keyphraseness ablation) and two selection rules; LoRA explicitly gated behind that data
|
Added |
…ne scoring intent(inline): a 160-item case-by-case review of the production proposal list measured 37.4% precision — dominated by four mechanical failure classes, not model quality; fix them outside any learned score decision(select): Rule A rejects drafts whose target is already linked within 600 chars (reason near_existing_same_target, gap recorded); Rule C raises the naturalness floor to 0.5 for lowercase single-word anchors (kills generic tail like "resistance"); Rule D caps accepted proposals per (note, target) at 1 in MMR pick order — the existing same-target redundancy penalty only reordered, it never rejected, so one note accepted the same target six times decision(baseline): Rule B multiplies target correctness by 1 - 0.35*(1 - same_family) for cross-family pairs, exempting TitleCase/acronym anchors — "Paxos" names one global concept while lowercase "memory management" is family-polysemous; fixes the observed OS-note -> LLM-serving wrong-domain class constraint(select): rejected drafts stay in the proposal set as abstained records with per-rule reason flags, keeping every selection decision auditable learned(select): measured against the 160 review verdicts the rules lift precision 37.4% -> 66.7% while retaining 88.2% of review-accepted links, with zero unreviewed newcomers entering the list
… runner intent(inline): close the improvement loop the performance report specified — review decisions become training negatives and calibration data, and a frozen benchmark makes every future tuning claim falsifiable decision(train): review decisions route per-head instead of through audit-tier semantics — anchor_ok is direct naturalness ground truth (always labeled), accept->A, reject+target_ok->B, wrong target->D with target_index at the recorded wrong target for the reranker's negative BCE decision(calibrate): temperature fits on review-outcome logits per engine; application unified into one shared post-draft pass (_calibrate_drafts) used by both engines, so double-application is structurally impossible decision(benchmark): runner locates nullable-span cases by first verbatim anchor occurrence; draft-level kinds (natural/acceptable span, correct target) read head scores, selection-level kinds (no_link, placement, incorrect_target, reverse) read the accepted set rejected(train): mapping review verdicts onto audit tiers wholesale — it would discard anchor judgments on Tier-B items, the exact signal the naturalness head is starved of learned(train): the reranker's Tier-D BCE had a latent shift-invariance hole — listwise CE pins only relative order, and with no positive BCE anchor the optimizer shifts all logits down, collapsing every absolute probability to 0 while training loss stays ~0; audit data had zero Tier-D rows so it never fired until the review harvest. Fixed by anchoring the BCE step with true pairs at 1.0; regression test asserts positives clear an absolute floor constraint(workflow): existing-link suppression exempts Related-notes zones per the audit guideline duplication rule — prose is the preferred home; the two review-accepted items Rule A initially removed were both blocked solely by navigation entries
…ration intent(inline): make the measurement basis durable — the benchmark is the falsifiability instrument, the review decisions are the training and calibration provenance decision(benchmark): 53 hand-authored cases across the seven SPEC §7 judgment kinds, 24 hard-case-flagged (cross-family homonyms, index notes, a zero-link personal note, unit tokens, duplicate-placement traps); built exclusively from unlinked spans so it shares nothing with audit labels or review decisions — the artifact stays valid as training data grows constraint(benchmark): never train on it; anchors verified verbatim against the corpus at authoring time learned(reviews): 160 decisions (91 baseline, 69 learned) measure honest precision 37.4% / 4.3% at the shipped operating points; fitted temperature is 20.0 for both engines (scores carry rank information but almost no absolute-probability information), baseline ECE 0.35 -> 0.14
…retrained eval intent(reports): every intervention this round was measured against the 160-item review ground truth; this records the numbers and the two discoveries that reframe the tuning priorities decision(reports): the production list is now the 45-link rules list (66.7% measured precision, 88.2% good-link retention); the 244-item retrained learned list ships as an uncalibrated discovery stream only learned(benchmark): both engines score an identical 0.547 on the frozen benchmark because span candidate generation cannot propose never-before-linked lowercase phrases — the binding constraint is upstream of every head, and no amount of head tuning moves it learned(eval): review-harvested negatives raised the naturalness head's held-out AUC 0.664 -> 0.767 and widened the natural/not-natural gap 0.05 -> 0.25; retrieval stays saturated at 0.964 through the reranker fix
Tuning round 1 — all three follow-ups executed, each measuredExecuted the report's P0/P1 directions end to end: case-by-case review of all 160 shipped proposals, four mechanical selection rules, review-harvested retraining + calibration, and the frozen expert benchmark. Full write-up: Measured, in order
New in the PR
The improvement loop is now fully wired: reviewing the 45-link list produces the next round's negatives and the retrained engine's first valid calibration automatically. 🤖 Generated with Claude Code |
Summary
What's in here
The production list (
linkdiscovery/reports/inline-link-proposals-2026-08-01.{md,jsonl})The learned engine, finished end to end
--token-encoder hashing|qwenCLI wiring (+1,327 lines incl. 18 new tests; suite now 1,105).inline-link-proposals-learned-2026-08-01.md) ships as a supplementary review stream, almost disjoint from the baseline set (1 shared span). Full tables:inline-eval-summary-2026-08-01.md+ raw JSONs.The audit behind it (full disclosure)
Note update
ml/nlp/missing-link-discovery's v2 section now carries the final results (audit kappas, the encoder natural experiment, verdict, this PR's pointer).Review notes
🤖 Generated with Claude Code