Skip to content

feat(router): v3+gate as the default wide-deep routing (0.22.0) - #81

Merged
doramirdor merged 1 commit into
mainfrom
feat/v3gate-router
Jul 20, 2026
Merged

feat(router): v3+gate as the default wide-deep routing (0.22.0)#81
doramirdor merged 1 commit into
mainfrom
feat/v3gate-router

Conversation

@doramirdor

Copy link
Copy Markdown
Collaborator

Ports the v3+gate routing from getnadir.dev into NadirClaw's bundled wide-deep classifier, and makes it the default.

What changed

  • New v3 checkpoint (wide_deep_v3.pt, the clean retrain) is now the default variant. Unlike asym (which suppresses the simple class) it keeps a real P(simple), so it can drive the below-gate split.
  • Neyman-Pearson complex gate (complex_gate_v1.pt, ~12 KB) decides complex-vs-rest at high recall (τ=0.12).
  • Head medium/simple split below the gate — the v3 head's own P(simple) vs P(medium), which beats the legacy companion LR (it under-fills Medium, causing avoidable under-routing).
  • Gate is ON by default for v3, OFF for asym/symmetric (their legacy argmax behaviour is untouched).

Config (all optional env)

  • NADIR_COMPLEX_GATE=0 — disable the gate (fall back to plain 3-class decode)
  • NADIR_GATE_THRESHOLD=<τ> — tune the gate threshold (default 0.12)
  • NADIR_MS_SPLIT=companion — revert to the legacy below-gate LR split

Measured (RouterArena, n=2,479, cheapest-correct labels)

miss-complex 8.2%, ~41% cost reduction vs always-premium. Mirrors the getnadir.dev production config.

Notes

  • Bumps __version__ 0.21.1 → 0.22.0.
  • New artifacts ship via the existing models/*.pt package-data glob.
  • 17 classifier tests pass; MODEL_CARD updated.
  • NadirClaw's global default classifier stays binary; v3+gate is the default only within the wide-deep classifier when selected.

🤖 Generated with Claude Code

… (0.22.0)

Brings NadirClaw's bundled router up to the getnadir.dev routing:
  - new `v3` checkpoint (wide_deep_v3.pt, clean retrain) — the default variant
  - Neyman-Pearson complex gate (complex_gate_v1.pt) decides complex-vs-rest
    at high recall (τ=0.12); below the gate the v3 head splits medium/simple
    ("head split"), which beats the legacy companion LR (less under-routing)
  - gate ON by default for v3, OFF for asym/symmetric (legacy argmax intact)

Env knobs (all optional): NADIR_COMPLEX_GATE=0 disables the gate,
NADIR_GATE_THRESHOLD tunes τ, NADIR_MS_SPLIT=companion reverts the split.

Measured on RouterArena (n=2479): miss-complex 8.2%, ~41% cost reduction.
Bumps __version__ 0.21.1 → 0.22.0. Tests + MODEL_CARD updated. Not released.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@doramirdor
doramirdor merged commit 8957912 into main Jul 20, 2026
3 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