Repository navigation
v0.11.0 - Target-accuracy policy + inference corrections + cascade
Keep optimizing until a target is met, cheaply - with inference-level corrections and a two-tier cascade, all fitted at compile, runtime frozen.
New
- target_accuracy=0.8: fit temperature + per-class bias corrections and a dispatch cutoff on held-out folds so auto-decided records meet the target; below-cutoff records abstain. Mutually exclusive with target_risk. An empirical policy, NOT a finite-sample guarantee - and it optimizes ACCURACY (see caveat below).
- escalate_to="anthropic/claude-haiku-4-5" (or openai/...): two-tier cascade. Abstaining records are arbitrated by a stronger model at runtime, bounded to registry keys (else human fallback). Only the escalated slice pays per-record cost.
- Per-class vector-scaling bias correction (corrects systematic class skew a single temperature cannot).
Validated live on tweet_eval hate - two findings worth more than the number
Full stack (distilled + target 0.8 + haiku escalation) scored 63.7% combined on 400 tweets - and taught two lessons, documented with the data in benchmarks/:
- A cascade only pays when tier-2 substantially beats tier-1. Haiku (64.1%) essentially tied the distilled local model (63.5%) on implicit hate, so escalating 145 tweets bought ~0 accuracy at real cost. Use the cascade when the escalation arbiter genuinely dominates (Opus, a task specialist) - not when both tiers are weak on the same hard cases.
- Accuracy-target correction trades minority recall for accuracy on imbalanced data. The fitted class bias shifted toward the majority class and hate recall collapsed to 22%. That is accuracy-optimization doing exactly what it was told - and accuracy is the wrong objective for moderation. Optimize recall/F-beta on the positive class there (a clean future lever).
The machinery is correct and cheap; it shines when tier-2 dominates and classes are balanced. On adversarial imbalanced hate detection it does not rescue the task - the bottleneck remains a decision model that can read implicit hate, which is a model-slot problem (task-trained specialist), not a policy problem.
108 tests pass.