Debate with a stochastic oracle: the cross-examination protocol #
Two provers debate the output of a randomized computation in front of a verifier who samples
only one step of it. The computation is a step law law : List Bool → PMF Bool: given the
bits written so far, most recent first, the law of the next bit. Its transcript and output are
the oracle programs Debate.transcript and Debate.output, which query each prefix in turn.
Debate.run interprets the protocol of [BrownCohenIrvingPiliouras2024, Figure 1]. In each
round the proposer claims a probability for the next bit; the interpreter asks an independent
copy of each player for a coin, adds the two coins and sets the bit from the claim and the sum; the
challenger may then abort. On an abort the verifier samples the disputed step itself and accepts
exactly when the claim is close to its sample mean. Without an abort the verifier outputs the
last bit. Each player is a program with private state, private coins and sample access to the
step law; a player sees the public history and its own state, never the other player's.
The correctness theorems, at the constants of the Lean development accompanying the source
(Debate.Params.default) and at Debate.Params.figure1, are steps toward
[BrownCohenIrvingPiliouras2024, Theorem 6.2], not that theorem. Completeness needs no Lipschitz
hypothesis. Soundness assumes that the output is Lipschitz in the whole step law
(ProbOracleComp.LipschitzAt K law (Debate.output n)), which is stronger than Definition 6.1 of the
source; the reason for the stronger hypothesis is recorded in cslib-frontier issue #7579. None of
these theorems makes a claim about running time, about the number of oracle queries of any party, or
about machines given by an encoding.
Deviations from the source #
- The computation is a step law indexed by the whole transcript prefix, as in the Lean
development accompanying the source (google-deepmind/debate,
Oracle), in place of a machine whose steps read relevant coordinates and query an external oracle. - Claims and coins lie on a grid: a claim is
k : Fin (N + 1), read as the probabilityk / N, and a coin is an element ofZMod N, in place of real numbers in[0, 1]. When either coin is uniform, the bit istruewith probability exactlyk / N(Debate.map_coinBit_uniformOfFintype_left,Debate.map_coinBit_uniformOfFintype_right). - The interpreter queries the independent copies and computes the bit; a player never announces the bit.
- Two sets of sample counts and thresholds are present:
Debate.Params.default, those of the Lean development accompanying the source (Params.defaults), andDebate.Params.figure1, those of Figure 1 and of the proof of Theorem 6.2; its docstring says which constant comes from where. The proofs atDebate.Params.figure1use margins of their own, not the source's; their docstrings give both.
Main definitions #
Cslib.Interactive.Debate.transcript,Cslib.Interactive.Debate.output: the computation under debate, as oracle programs over transcript prefixes.Cslib.Interactive.Debate.Proposer,Cslib.Interactive.Debate.Challenger: the two players.Cslib.Interactive.Debate.run: the protocol.Cslib.Interactive.Debate.honestProposer,Cslib.Interactive.Debate.honestChallenger: the prescribed strategies.Cslib.Interactive.Debate.Params.figure1: the constants printed in [BrownCohenIrvingPiliouras2024, Figure 1] and the proof of Theorem 6.2.
Main results #
Cslib.Interactive.Debate.completeness_stepLaw: the honest proposer wins with probability at least3 / 5against every challenger when the output istruewith probability at least2 / 3.Cslib.Interactive.Debate.soundness_of_lipschitzAt_stepLaw: against the honest challenger every proposer wins with probability at most2 / 5when the output istruewith probability at most1 / 3.Cslib.Interactive.Debate.completeness_figure1_stepLaw,Cslib.Interactive.Debate.soundness_figure1_of_lipschitzAt_stepLaw: the same two statements atDebate.Params.figure1, for aT-step computation.Cslib.Interactive.Debate.isQueryBounded_run_of_isQueryBounded: if the players' four programs make at mosta₁,a₂,b₁andb₂queries to the step law per call, the run makes at mostP.rounds * (a₁ + a₂ + b₁ + b₂) + P.verifierSamples; a query count, with no claim about running time.
References #
The computation under debate #
The oracle interface of a step law: a query is the list of bits written so far, most recent first, and the reply is the next bit.
The transcript of the first n steps, most recent bit first: each step queries the bits
written before it.
The output of an n-step computation: the last bit of its transcript (false when
n = 0).
The number of true replies among n independent samples of the step after bits.
Rounds and players #
The public record of one round on the grid N.
The bit written in a round.
The public history of a debate: its completed rounds, most recent first.
A proposer on the grid N: the player claiming that the output is true. It keeps a
private state, draws private coins and samples steps of the computation at will.
A challenger on the grid N: the player disputing that the output is true. It keeps a
private state, draws private coins and samples steps of the computation at will.
- State : Type
The private state carried between rounds.
- init : self.State
The initial private state.
Whether to abort after a round, from the public history before the round, the round and the private state.
The independent copy asked for a coin. It sees the public history and the current claim, and shares no state with the challenger.
The protocol #
The parameters of the protocol and of its prescribed strategies.
- rounds : ℕ
The number of rounds, which is the number of steps of the computation.
- grid : ℕ
The grid size
N: claims are multiples of1 / N, and the honest proposer drawsNsamples for each claim. - challengerSamples : ℕ
The number of samples the honest challenger draws in each round.
- challengerTolerance : ℝ
The honest challenger aborts when the claim and its sample mean differ by at least this much.
- verifierSamples : ℕ
The number of samples the verifier draws after an abort.
- verifierTolerance : ℝ
The verifier accepts after an abort when the claim and its sample mean differ by less than this much.
The verifier's decision after an abort in the round after bits with claim claim: draw
P.verifierSamples samples of the disputed step and accept exactly when the claim is within
P.verifierTolerance of their mean.
The debate protocol of [BrownCohenIrvingPiliouras2024, Figure 1] between the proposer A
and the challenger B; the result is true when the verifier accepts.
In each round the proposer claims a probability for the next bit, the interpreter obtains one
coin from an independent copy of each player and sets the bit by coinBit, and the challenger
may abort. After an abort the verifier draws P.verifierSamples samples of the disputed step
and accepts exactly when the claim is within P.verifierTolerance of their mean; after
P.rounds rounds without an abort it outputs the last bit. Every private sample of either
player, of either copy and of the verifier is a fresh draw.
The prescribed strategies #
A uniform coin on ZMod N (the coin 0 in the degenerate case N = 0).
The honest challenger: in each round it draws P.challengerSamples fresh samples of the
step just taken and aborts when the claim differs from the fraction that are true by at least
P.challengerTolerance; its copy returns a uniform coin.
The number of samples after which a sample mean of a Bool-valued step is within error of
its probability except with probability at most failure (Hoeffding's inequality).
The parameters for a (T + 1)-step computation with Lipschitz constant K, following
Params.defaults of the Lean development accompanying the source. An estimate with error e
and failure probability f uses ⌈-log (f / 2) / (2 e ^ 2)⌉ samples. With c = 1 / (100 K),
s = 2 / (100 K) and b = 5 / (100 K): the honest proposer's claim is within c of the truth
except with probability 1 / (100 (T + 1)); the honest challenger, with the same failure
probability, does not abort a claim within s and aborts a claim off by b; the verifier
accepts a claim within c and rejects a claim off by s, each except with probability
1 / 100.
The parameters of [BrownCohenIrvingPiliouras2024, Figure 1] and of the proof of Theorem 6.2
for a T-step computation with Lipschitz constant K, with d = ⌈150 K⌉ (dedebate.tex,
line 252):
Trounds (line 253);- the verifier draws
r = ⌈192 d ^ 2 log 100⌉samples (line 263) and accepts when the claim is within1 / (4 d)of their mean (line 264); - the honest provers draw
R = ⌈192 d ^ 2 log (100 T)⌉samples (lines 461 and 546), which is also the grid, so that the honest proposer's sample mean is a grid point; - the honest challenger aborts unless the claim is within
1 / (2 d)of its sample mean (line 546).
The source writes log without a base and does not round the sample counts. The logarithm is
natural here: the proof equates 2 exp (-R / (192 d ^ 2)) with 1 / (50 T) (line 487), which
holds for the natural logarithm only. The counts are rounded up.
Evaluation against a step law #
Sample counts #
The coin step #
The computation from a prefix #
The honest players and the verifier #
The best nearby step law #
Rounds #
Soundness #
Completeness #
The default parameters #
The verifier's check after an abort. If the claim is closer to the true probability of
the step than the verifier's tolerance, by a margin e, then the verifier rejects it only when
its sample mean is off by e, which by Hoeffding's inequality has probability at most
2 exp (-2 r e ^ 2) for r samples.
At a deterministic step the verifier accepts every claim within its tolerance of the bit prescribed by the step law.
The default parameters are positive: the grid, both sample counts and both tolerances.
The constants of Figure 1 #
Correctness #
Completeness, as a step. A step toward [BrownCohenIrvingPiliouras2024, Theorem 6.2], not
that theorem: if the output of a (T + 1)-step computation is true with probability at least
2 / 3, then the honest proposer of the protocol of Figure 1 makes the verifier accept with
probability at least 3 / 5 against every challenger. No Lipschitz hypothesis is needed.
The challenger is an arbitrary program with private state, private coins and unbounded sample
access to the step law. Nothing is claimed about running time or query counts, the grid replaces
the real numbers of the source, and the constants are Params.default, which depend on K.
Soundness, as a step. A step toward [BrownCohenIrvingPiliouras2024, Theorem 6.2], not
that theorem: if the output of a (T + 1)-step computation is K-Lipschitz in its whole step
law (every step and every transcript prefix, which is stronger than Definition 6.1 of the source;
the reason is recorded in cslib-frontier issue #7579) and is true with probability at most
1 / 3, then against the honest challenger of the protocol of Figure 1 every proposer makes the
verifier accept with probability at most 2 / 5.
The proposer is an arbitrary program with private state, private coins and unbounded sample
access to the step law. Nothing is claimed about running time or query counts, the grid replaces
the real numbers of the source, and the constants are Params.default.
Completeness at Params.figure1, as a step. A step toward
[BrownCohenIrvingPiliouras2024, Theorem 6.2], not that theorem: if the output of a T-step
computation is true with probability at least 2 / 3, then the honest proposer of the protocol of
Figure 1 at Params.figure1 makes the verifier accept with probability at least 3 / 5 against
every challenger. No Lipschitz hypothesis is needed.
The challenger is an arbitrary program with private state, private coins and unbounded sample access
to the step law. Nothing is claimed about running time or query counts, and the grid replaces the
real numbers of the source. Params.figure1 takes the number of rounds and the verifier's sample
count and threshold from Figure 1, and the honest provers' sample count and the honest challenger's
threshold from the proof of Theorem 6.2 in Appendix D. The margins in the proof are not the
source's. Here, with d = ⌈150 K⌉, the honest estimate may be off by 1 / (10 d) and the
verifier's sample mean by 3 / (20 d), the first failing with probability at most 1 / (50 T) per
round and the second with probability at most 1 / 50, by Hoeffding's inequality
2 exp (-2 n e ^ 2). The source allows 1 / (8 d) for both (dedebate.tex, lines 487, 494 and
495), with the same failure probabilities, from its bound 2 exp (-e ^ 2 n / 3) (lines 449 to 453),
and concludes with (2 / 3 - 1 / 150) (49 / 50) ^ 2 > 3 / 5 (lines 539 to 541).
Soundness at Params.figure1, as a step. A step toward
[BrownCohenIrvingPiliouras2024, Theorem 6.2], not that theorem: if the output of a T-step
computation is K-Lipschitz in its whole step law and is true with probability at most 1 / 3,
then against the honest challenger of the protocol of Figure 1 at Params.figure1, every proposer
makes the verifier accept with probability at most 2 / 5. The Lipschitz hypothesis is in the whole
step law (every step and every transcript prefix), which is stronger than Definition 6.1 of the
source; the reason is recorded in cslib-frontier issue #7579.
The proposer is an arbitrary program with private state, private coins and unbounded sample access
to the step law. Nothing is claimed about running time or query counts, and the grid replaces the
real numbers of the source. Params.figure1 takes the number of rounds and the verifier's sample
count and threshold from Figure 1, and the honest provers' sample count and the honest challenger's
threshold from the proof of Theorem 6.2 in Appendix D. The margins in the proof are not the
source's. Here, with d = ⌈150 K⌉, claims are split at 3 / (8 d) and 5 / (8 d) from the truth,
and each sample mean may be off by 1 / (8 d), failing with probability at most 1 / (50 T) per
round for the challenger and 1 / 50 for the verifier; the Lipschitz term is at most
K · 5 / (8 d) ≤ 1 / 240. The source splits at 3 / (8 d) and 3 / (4 d) (dedebate.tex, line
550), with the same failure probabilities (lines 584 and 591).
Query counts #
A step toward milestone 3 of cslib-frontier issue #7579: the oracle-query component q of
[BrownCohenIrvingPiliouras2024, Theorem 6.2], as a worst-case bound on external queries, that is
queries to the step law; private samples are free (ProbOracleComp.IsQueryBounded). Nothing is
claimed about running time. The interpreter has one query channel for all parties, so the
verifier's share is identified as the additive term of isQueryBounded_run_of_isQueryBounded and
by isQueryBounded_run_of_isQueryBounded_zero. The Lean development accompanying the source
counts expected queries per party; the bounds here are worst-case, on every path.
countTrue bits n makes at most n external queries, that is queries to the step law.
The verifier's check. The check after an abort makes at most P.verifierSamples external
queries, that is queries to the step law.
The run. If every call of the players' four programs makes at most a₁ (the proposer's
claim), a₂ (the proposer's copy's coin), b₁ (the challenger's decision to abort) and b₂ (the
challenger's copy's coin) external queries, that is queries to the step law, then the run makes at
most P.rounds * (a₁ + a₂ + b₁ + b₂) + P.verifierSamples. The additive term is the verifier's
check, which runs at most once: it ends the run.
The verifier's share. If the players make no external query, the whole run makes at most
P.verifierSamples external queries, that is queries to the step law.
The honest proposer's claim makes at most P.grid external queries, that is queries to the
step law. A query count, not a running time.
The honest challenger's decision to abort makes at most P.challengerSamples external
queries, that is queries to the step law. A query count, not a running time.
The verifier's sample count at Params.figure1, which is the count printed in Figure 1, is at
most 192 (150 K + 1) ^ 2 log 100 + 1, since ⌈150 K⌉ < 150 K + 1. It does not depend on T.
The verifier's sample count at Params.figure1 is O(K ^ 2): at most 42000000 K ^ 2 + 1868.
It does not depend on T.
The verifier's sample count at the default constants is at most 20000 log 200 K ^ 2 + 1; this
exact form is the one to use when the constant matters. It does not depend on T.
The verifier's sample count at the default constants is O(K ^ 2): at most
111000 K ^ 2 + 1, from log 200 < 8 log 2. The Lean development accompanying the source proves
106000 k ^ 2 + 1 for its expected count (vera_fast) with a sharper bound on log 200; the
exact form Params.default_verifierSamples_le is the statement to use when the constant matters.
It does not depend on T.