Skip to main content

Module guarantee_ladder

Module guarantee_ladder 

Source
Expand description

§Guarantee Ladder with Explicit Semantics (Task 2)

This module provides three guarantee modes with well-defined correctness contracts:

  1. Fast Approximate (Approximate): Top-k under proxy score

    • Fastest, ignores quantization error
    • No recall guarantees
  2. Calibrated High-Recall (Calibrated): Probabilistic guarantees

    • Uses quantile-bounded error envelopes
    • P(recall ≥ ρ) ≥ 1-δ
  3. Certified (Certified): Deterministic exact via LB/UB envelopes

    • Guaranteed correct results
    • Uses rerank to verify all candidates

§Math/Algorithm

Let true score be s(x), proxy be ŝ(x) = s(x) + ε(x).

  • Mode 1: ε ignored (ranking by ŝ)
  • Mode 2: ε bounded in probability (use quantiles)
  • Mode 3: ε bounded deterministically (use LB/UB comparisons)

Structs§

ScoreEnvelope
Score with error bounds for certified/calibrated modes
SearchContract
Complete search contract specifying guarantees
StopDecision
Decision about whether to stop probing
StoppingEvaluator
Evaluator for stopping rules

Enums§

GuaranteeMode
Guarantee mode for search correctness
StopReason
Reason for stopping decision
StoppingRule
Stopping rule that matches guarantee mode semantics