Replicable sample algorithms with a shared seed #
A randomized sample algorithm of sample size m over domain X with shared seed space Ω and
output type α consists of a distribution seed : PMF Ω for the shared randomness and a
sample-to-output kernel run : (Fin m → X) → Ω → PMF α (Algorithm)
[ILPS22]. When the algorithm is deterministic given the sample and seed,
Algorithm.deterministic lifts a map (Fin m → X) → Ω → α into Algorithm.
Program packages a ProbComp-backed seed generator seed : ProbComp Ω and sample runner
run : (Fin m → X) → Ω → ProbComp α, together with single-run Program.exec and two-sample
shared-seed Program.coupledExec, interpreted semantically into Algorithm via ProbComp.eval
(Program.toAlgorithm). Note that Program fixes probabilistic control over ProbComp without
providing finite-precision real representations or native resource bounds.
Running A twice on independent i.i.d. samples S₁, S₂ ~ D^m with the same shared seed r ~ seed
induces the joint output distribution Algorithm.pairedOutput A D on α × α. The disagreement
probability Algorithm.disagreeProb A D is Pr[y₁ ≠ y₂] under this coupling, and
Algorithm.agreeProb A D = 1 - Algorithm.disagreeProb A D is Pr[y₁ = y₂].
- Weak (distribution-family)
ρ-replicability (IsReplicableFor A 𝒟 ρ, and single-distributionIsReplicableOn A D ρ):Algorithm.disagreeProb A D ≤ ρfor everyD ∈ 𝒟. - Strong (all-distributions)
ρ-replicability (IsReplicable A ρ):IsReplicableFor A Set.univ ρ. - Accuracy (
IsAccurateFor A 𝒟 good β,IsAccurate A good β): under a single sampleS ~ D^m, the marginal output missesgood Dwith probability at mostβ. - Estimation accuracy (
EstimatesFor A 𝒟 target ε β,Estimates A target ε β): for real-valued outputs,|y - target D| ≤ εfails with probability at mostβ.
Main definitions #
Cslib.MachineLearning.Replicable.Algorithm: semantic shared-seed sample algorithms.Cslib.MachineLearning.Replicable.Program:ProbComp-backed shared-seed sample programs.Cslib.MachineLearning.Replicable.Algorithm.output,Cslib.MachineLearning.Replicable.Algorithm.marginal,Cslib.MachineLearning.Replicable.Algorithm.pairedOutput: single-run and paired shared-seed laws.Cslib.MachineLearning.Replicable.Algorithm.disagreeProb,Cslib.MachineLearning.Replicable.Algorithm.agreeProb: disagreement and agreement probabilities.Cslib.MachineLearning.Replicable.IsReplicableFor,Cslib.MachineLearning.Replicable.IsReplicableOn,Cslib.MachineLearning.Replicable.IsReplicable: weak and strongρ-replicability.Cslib.MachineLearning.Replicable.IsAccurateFor,Cslib.MachineLearning.Replicable.IsAccurateOn,Cslib.MachineLearning.Replicable.IsAccurate,Cslib.MachineLearning.Replicable.EstimatesFor,Cslib.MachineLearning.Replicable.Estimates: accuracy predicates.
Main results #
Cslib.MachineLearning.Replicable.Algorithm.agreeProb_add_disagreeProb: agreement and disagreement sum to1.Cslib.MachineLearning.Replicable.Algorithm.disagreeProb_deterministic: simplified disagreement probability for algorithms deterministic given the sample and seed.Cslib.MachineLearning.Replicable.IsReplicableFor.map,Cslib.MachineLearning.Replicable.IsReplicableFor.mapWithSeed: deterministic and seed-dependent post-processing preserve replicability.Cslib.MachineLearning.Replicable.IsReplicable.toIsReplicableFor,Cslib.MachineLearning.Replicable.IsReplicableFor.mono,Cslib.MachineLearning.Replicable.IsReplicableFor.antitone: monotonicity and family restriction.
References #
A semantic randomized sample algorithm of sample size m over domain X with shared seed
distribution seed : PMF Ω and output type α. Given sample S and shared seed r,
run S r : PMF α is the conditional output distribution (which is pure when all randomness lies
in the shared seed).
- seed : PMF Ω
Distribution of the shared random seed.
Conditional output distribution given the sample and shared seed.
Two-sample shared-seed joint output distribution on α × α when S₁, S₂ ~ iid D m are
drawn independently and executed with the same shared seed r ~ A.seed.
Paired output distribution for an algorithm that is deterministic given sample and seed.
Disagreement probability for an algorithm that is deterministic given sample and seed, expressed by integrating the per-pair seed disagreement probability over independent samples.
Disagreement probability of a deterministic-given-seed algorithm expressed as a tsum over
the shared seed of the conditional pair-disagreement probability.
Paired output distribution of a deterministic-given-seed algorithm, drawing the two independent samples first, then the shared seed.
Disagreement probability of a deterministic-given-seed algorithm expressed by drawing the two independent samples first, then the shared seed.
ProbComp-backed shared-seed programs #
A ProbComp-backed randomized sample algorithm: seed samples the shared randomness using
finite uniform choices, and run S r represents the sample-and-seed step as a ProbComp
computation interpreted via Program.toAlgorithm (allowing noncomputable real-arithmetic maps).
- seed : ProbComp Ω
Program sampling the shared random seed.
Program executed on the sample and shared seed.
Evaluating the paired ProbComp execution over independent samples agrees with
Algorithm.pairedOutput.
Replicability and accuracy predicates #
Weak (distribution-family) ρ-replicability: A is ρ-replicable over the distribution
family 𝒟 if for every D ∈ 𝒟, two runs on independent m-samples from D sharing A.seed
disagree with probability at most ρ [ILPS22].
Accuracy over a distribution family: under D ∈ 𝒟, the single-run marginal output fails
the acceptable set good D with probability at most β.
(ε, β)-estimation accuracy for real-valued outputs: under every D ∈ 𝒟, the output is
within ε of target D except with probability at most β.