Sequential Confidence Amplification for Noisy Binary Oracles (SPRT-style)
- •
What it is
- •
A general statistical technique for extracting a reliable answer from a binary oracle whose responses are corrupted by random noise — as long as the noise isn't a perfectly uncorrelated 50/50 coin flip, repeated querying can drive the probability of a wrong conclusion arbitrarily close to zero. Rather than committing to a fixed number of samples per question up front (wasteful for easy cases, insufficient for hard ones), a sequential test accumulates evidence one query at a time and stops as soon as the accumulated evidence crosses a confidence threshold — this is the core idea behind Wald's Sequential Probability Ratio Test (SPRT), and it generalizes cleanly to "keep querying whichever candidate answer currently looks most likely, stop once it's convincingly ahead."
- •
- •
When to apply
- •
Any noisy oracle scenario with more than a simple two-outcome guess — e.g. picking the correct one of 16 hex-digit candidates per byte position — where a fixed, evenly-split query budget per candidate would waste queries confirming already-clear answers while starving genuinely close calls.
- •
- •
Symbols and assumptions
- •
are two candidate explanations of an oracle reply . Let and . A log-likelihood ratio measures evidence for over .
- •
- •
Math — step by step
- •
- Start with prior log-odds . For reply 1 add ; for reply 0 add . Independent conditional observations let their likelihoods multiply and their logs add.
- •
- Posterior probability is under this model. Stop when confidence is sufficient; a fixed sample count can waste queries on obvious candidates.
- •
- Independence and calibrated reply probabilities are assumptions. Repeated correlated replies can make this formula overconfident. Use a query budget, allow an inconclusive outcome, and validate recovered plaintext separately.
- •
- •
- •
Python
- •
def recover_candidate(oracle, make_query, n_candidates, threshold): score = [0] * n_candidates while max(score) < threshold: i = score.index(max(score)) score[i] += 1 if oracle(make_query(i)) else -1 # sign convention: calibrate against the actual noise model return score.index(max(score))
- •
- •
- •
Cards
- •
Why is a sequential test more query-efficient than a fixed, evenly-split sampling budget?
- •
It concentrates queries on genuinely ambiguous candidates instead of wasting them confirming answers that are already statistically clear.
- •
- •
What's the one property a noisy oracle must retain for this technique to work at all?
- •
Some correlation (positive or negative) with the truth — a perfectly 50/50 random oracle carries zero information no matter how it's sampled.
- •
- •