The Kushilevitz–Mansour algorithm #
The Kushilevitz–Mansour algorithm [KM93]
O'Donnell, Section 3.5 learns, with membership queries, every Boolean function of
small spectral norm ∑_S |f̂(S)| (UniformLearning.spectralNormClass); for instance every function
computed by a small decision tree (UniformLearning.decisionTreeClass). It finds the large Fourier
coefficients by the bucket search of Goldreich and Levin [GL89]: the bucket of a set
S ⊆ J is the family of the sets U with U ∩ J = S, and its weight is the bucket weight
(BitString.bucketWeight, O'Donnell's W^{S | J̄} with J̄ the complement of J). Starting from
the bucket of all sets, the search adds the coordinates one at a time, splitting each surviving
bucket S of J into the buckets S and insert i S of insert i J, and keeps the buckets whose
estimated weight is at least θ² / 2 (UniformLearning.bucketSearch). On accurate estimates,
the bucket search finds the heavy sets and keeps few buckets: a set U with |f̂(U)| ≥ θ
contributes θ² to each of its buckets, so it is never discarded when every level's estimate of
its bucket reaches the threshold (UniformLearning.inter_mem_bucketSearch), and when the
estimates at a level are within θ² / 4 every surviving bucket weighs more than θ² / 4
(UniformLearning.lt_bucketWeight_of_mem_bucketSearch), so at most 4 / θ² buckets survive there
(UniformLearning.mul_card_bucketSearch_le_one).
At the last level a bucket is a single set U, of weight f̂(U)² (BitString.bucketWeight_univ).
So if every estimate is within θ² / 4, the found sets satisfy the list guarantees of the
Goldreich–Levin Theorem: every U with |f̂(U)| ≥ θ, only sets with |f̂(U)| > θ / 2, and at
most 4 / θ² of them (UniformLearning.mem_kmCandidates_of_sq_le_sq,
UniformLearning.lt_sq_of_mem_kmCandidates, UniformLearning.mul_card_kmCandidates_le_one). The
search keeps a bucket whose estimate is at least θ² / 2, where the book discards one whose
estimate is at most θ² / 2; the analysis is the same. With the sample bound below, the query
tree UniformLearning.kmCandidatesTree, which makes at most m (2 n + 3) non-adaptive queries,
outputs such sets except with probability δ from m ≥ (32 / θ⁴) log (2 (n + 2) 2 ^ n / δ)
samples (UniformLearning.uniform_not_kmCandidatesTree_heavy_le_of_log). This is the query and
sample step toward the Goldreich–Levin Theorem O'Donnell, Section 3.5, whose
running time poly(n, 1 / θ) remains open on
#2131 (see Cost). This is the
Fourier form, with |f̂(U)|; Cslib.Crypto.GoldreichLevin has the hard-core predicate and an
oracle-PPT list decoder for the strings of agreement at least 1 / 2 + ε, the signed form
f̂(U) ≥ 2 ε.
The weights are estimated from samples (x, y, z) of three independent uniform points, as the
average of f (x, z) χ_S(x) f (y, z) χ_S(y) (UniformLearning.bucketEstimate,
BitString.bucketWeight_eq_expect_sample), where (x, z) takes the coordinates in J from x and
the others from z. By Hoeffding's inequality one estimate from (2 / γ²) log (2 / δ) samples,
reading f at two points each, is within γ except with probability δ
(UniformLearning.uniform_abs_bucketEstimate_sub_ge_le_of_log), the sample bound in the proof of
O'Donnell, Proposition 3.40. Here the same m samples serve every bucket of every
level, so the queries are non-adaptive: the learner queries f at x and at the points (x, z),
(y, z) of every sample and every level, m (2 n + 3) queries for n coordinates
(UniformLearning.kmLearner_queriesAtMost), and then runs the search on the answers. The analysis
takes a union bound over all 2 ^ n buckets of each level, which costs a factor n in the number
of samples compared with fresh samples for each weighing. The hypothesis is the sign of the
expansion on the found sets with coefficients estimated from the points x
(UniformLearning.kmHypothesis, UniformLearning.kmLearner).
If all estimates are within θ² / 4 of their values, the hypothesis has error at most θ² / 4
plus the weight of the coefficients of absolute value below θ
(UniformLearning.uniformError_kmHypothesis_le_add), since the found sets carry all the others;
for a function of spectral norm at most L this weight is at most θ L
(BitString.sum_fourierCoeff_sq_le_mul_sum_abs), so the error is at most θ² / 4 + θ L
(UniformLearning.uniformError_kmHypothesis_le). Hoeffding's inequality and the union bound
make the estimates accurate except with probability at most 2 (n + 2) 2 ^ n exp (-m θ⁴ / 32)
(UniformLearning.uniform_not_accurate_le). With θ = ε / (2 L) this gives the query and
sample step toward the Kushilevitz–Mansour theorem O'Donnell, Theorem 3.38:
the functions of spectral norm at most L are learned with error ε and confidence 1 - δ from
m ≥ (512 L⁴ / ε⁴) log (2 (n + 2) 2 ^ n / δ) samples, hence m (2 n + 3) membership queries,
polynomial in n, L, 1 / ε and log (1 / δ) (UniformLearning.kmLearner_learns). The
theorem's running time poly(n, L, 1 / ε) remains open on
#2131 (see Cost). By the
spectral norm bound for decision trees (DecisionTree.sum_abs_fourierCoeff_signVal_le_leafCount),
this applies to the functions computed by decision trees with at most L leaves, the
decision-tree case of Theorem 3.38 (UniformLearning.kmLearner_learns_decisionTree), with the
same gap.
More generally, if the spectrum of f is ε / 4-concentrated on some collection of at most M
sets (UniformLearning.concentratedClass), its coefficients below θ weigh at most
ε / 4 + M θ² (BitString.sum_fourierCoeff_sq_le_sum_compl_add). With θ² = ε / (4 M) the
algorithm learns such functions with error ε from m ≥ (512 M² / ε²) log (2 (n + 2) 2 ^ n / δ)
samples, hence m (2 n + 3) membership queries, polynomial in n, M, 1 / ε and log (1 / δ)
(UniformLearning.kmLearner_learns_concentrated). This is the query and sample step toward
O'Donnell, Theorem 3.37; the theorem's running time poly(M, n, 1 / ε) remains
open on #2131 (see Cost). The
book's route (Exercise 3.39) applies the Goldreich–Levin list guarantee and then Theorem 3.29 to
the listed sets; here the proof goes through the combined error bound on accurate samples
(UniformLearning.uniformError_kmHypothesis_le_add) instead. Functions of
spectral norm at most L are ε / 4-concentrated on about 4 L² / ε sets, but the spectral-norm
step above, with its own threshold, needs fewer samples.
Cost. Only the numbers of samples and queries are certified; the running time is not certified
by a machine model. On accurate samples the search computes at most 8 / θ² bucket estimates at
each level, each from the m samples, and estimates at most 4 / θ² coefficients; this count of
arithmetic operations is informal. The search has no cap on the number of buckets: the book
bounds the active buckets by 4 / θ² only on accurate estimates, and UniformLearning.bucketSearch
keeps every bucket whose estimate passes the threshold, so on inaccurate samples it can keep up to
2 ^ k buckets at level k and is not polynomial, even informally. The same holds for the query
tree UniformLearning.kmCandidatesTree: its samples and queries are certified, its running time is
not. Its bounds are those of the Kushilevitz–Mansour learner, so they are loose for listing the
coefficients alone. It queries all of kmQueries ω: the 2 m points (x, z), (y, z) at each
of the n + 1 levels, 2 m (n + 1) in all, which the search reads, plus the m points x that
only the hypothesis reads, m (2 n + 3) in all. Its sample bound goes through KMAccurate, whose
union bound counts 2 ^ n buckets at each of the n + 1 levels and also the 2 ^ n sample
coefficients, (n + 2) 2 ^ n events; the search alone needs (n + 1) 2 ^ n.
Usage #
Open Cslib.MachineLearning.UniformLearning. A class C of Boolean functions whose spectra, read
as signs, are ε / 4-concentrated on at most M ≥ 1 sets is a subset of
concentratedClass ι M (ε / 4); apply
UniformLearning.kmLearner_learns_concentrated_and_queriesAtMost with threshold √(ε / (4 M))
and any m at least (512 M² / ε²) log (2 (n + 2) 2 ^ n / δ) (for instance its ceiling), and
restrict to C with QueryLearner.Learns.mono. This certifies the samples and queries of
O'Donnell, Theorem 3.37, not its running time, which remains open on
#2131. To bound the error of the hypothesis for another
class, prove the samples accurate with UniformLearning.uniform_not_accurate_le_of_log and bound
the weight of the small coefficients in UniformLearning.uniformError_kmHypothesis_le_add, for
instance by BitString.sum_fourierCoeff_sq_le_sum_compl_add or
BitString.sum_fourierCoeff_sq_le_mul_sum_abs. For a single bucket weight bucketWeight F J S,
which is O'Donnell's W^{S | J̄}[F] for S ⊆ J and 0 otherwise,
UniformLearning.uniform_abs_bucketEstimate_sub_ge_le_of_log takes m ≥ (2 / γ²) log (2 / δ)
samples; the estimate reads f at 2 m points, but that theorem certifies neither queries nor
time. Turning another tail bound c exp (-(a m)) into a sample size is
Real.mul_exp_neg_le_of_log. To list the large Fourier coefficients of a Boolean function f
with threshold τ > 0, take any m at least (32 / τ⁴) log (2 (n + 2) 2 ^ n / δ) and apply
UniformLearning.uniform_not_kmCandidatesTree_heavy_le_of_log: except with probability δ over
the samples ω, the list (kmCandidatesTree τ ω).eval f has the Goldreich–Levin guarantees, and
UniformLearning.depth_kmCandidatesTree_le bounds its queries by m (2 n + 3); on samples known
to be accurate, use UniformLearning.mem_kmCandidates_of_sq_le_sq,
UniformLearning.lt_sq_of_mem_kmCandidates and UniformLearning.mul_card_kmCandidates_le_one
directly. Checked clients show that a parity is concentrated on one set and
not on none, that the small-coefficient bound is attained by a parity, bound the hypothesis error
for parities, instantiate the sample bound on two bits, learn the parities through Learns.mono,
instantiate the query and sample step for M = 3 on two bits, estimate two bucket weights of a
parity, and find exactly a parity's own set with the query tree, on accurate samples and with
probability 1 / 2 from ⌈32 log 64⌉ samples on two bits, in
CslibFrontierTests/KushilevitzMansourConcentrated.lean;
the spectral-norm and decision-tree steps are checked in
CslibFrontierTests/FourierLearning.lean.
Main definitions #
Cslib.MachineLearning.UniformLearning.spectralNormClass: the functions of bounded spectral norm.Cslib.MachineLearning.UniformLearning.bucketSearch: the bucket search of Goldreich–Levin and Kushilevitz–Mansour.Cslib.MachineLearning.UniformLearning.bucketEstimate,Cslib.MachineLearning.UniformLearning.sampleCoeff: the empirical bucket weights and Fourier coefficients of the samples.Cslib.MachineLearning.UniformLearning.kmHypothesis,Cslib.MachineLearning.UniformLearning.kmLearner: the Kushilevitz–Mansour algorithm.Cslib.MachineLearning.UniformLearning.kmCandidatesTree: the bucket search of the Goldreich–Levin algorithm as a non-adaptive query tree.Cslib.MachineLearning.UniformLearning.KMAccurate: accurate samples.Cslib.MachineLearning.UniformLearning.concentratedClass: the functions whose spectrum is concentrated on few sets.
Main results #
Cslib.MachineLearning.UniformLearning.inter_mem_bucketSearch,Cslib.MachineLearning.UniformLearning.lt_bucketWeight_of_mem_bucketSearch,Cslib.MachineLearning.UniformLearning.mul_card_bucketSearch_le_one: on accurate estimates, the bucket search finds the heavy sets and keeps only heavy buckets, hence few.Cslib.MachineLearning.UniformLearning.mem_kmCandidates_of_sq_le_sq,Cslib.MachineLearning.UniformLearning.lt_sq_of_mem_kmCandidates,Cslib.MachineLearning.UniformLearning.mul_card_kmCandidates_le_one: the found sets on accurate samples.Cslib.MachineLearning.UniformLearning.depth_kmCandidatesTree_le: the query tree makes at mostm (2 n + 3)queries.Cslib.MachineLearning.UniformLearning.uniform_not_kmCandidatesTree_heavy_le_of_log: the query and sample step toward the Goldreich–Levin Theorem O'Donnell, Section 3.5, whose running time remains open on #2131.Cslib.MachineLearning.UniformLearning.uniformError_kmHypothesis_le_add,Cslib.MachineLearning.UniformLearning.uniformError_kmHypothesis_le: the error on accurate samples.Cslib.MachineLearning.UniformLearning.uniform_abs_bucketEstimate_sub_ge_le,Cslib.MachineLearning.UniformLearning.uniform_abs_bucketEstimate_sub_ge_le_of_log: the sample bound in the proof of Proposition 3.40, estimating one bucket weight.Cslib.MachineLearning.UniformLearning.uniform_not_accurate_le,Cslib.MachineLearning.UniformLearning.uniform_not_accurate_le_of_log: the samples are accurate with high probability.Cslib.MachineLearning.UniformLearning.kmLearner_learns,Cslib.MachineLearning.UniformLearning.kmLearner_learns_and_queriesAtMost: the query and sample step toward the Kushilevitz–Mansour theorem, O'Donnell, Theorem 3.38, whose running time remains open on #2131.Cslib.MachineLearning.UniformLearning.kmLearner_learns_decisionTree,Cslib.MachineLearning.UniformLearning.kmLearner_learns_decisionTree_and_queriesAtMost: learning decision trees with membership queries, the query and sample step toward the decision-tree case of Theorem 3.38, with the same gap.Cslib.MachineLearning.UniformLearning.kmLearner_learns_concentrated,Cslib.MachineLearning.UniformLearning.kmLearner_learns_concentrated_and_queriesAtMost: learning concentrated classes, the query and sample step toward O'Donnell, Theorem 3.37, whose running time remains open on #2131.
References #
The bucket search #
The sets of coordinates weighed by the bucket search over the list l: the sets of
coordinates of the suffixes of l, from l itself down to the empty list.
The coordinates of l are its first level.
The bucket search of Goldreich–Levin and Kushilevitz–Mansour over the list l of
coordinates, given estimates est J S of the bucket weights W^{S | J̄} and a threshold τ.
Starting from the bucket of all sets, it adds the coordinates of l from the last to the first,
splits each surviving bucket S of J into the buckets S and insert i S of insert i J, and
keeps the buckets whose estimated weight is at least τ.
The bucket search reads the estimates only at its levels.
Every bucket kept by the search over l has estimated weight at least τ at the level of
the coordinates of l.
Completeness of the bucket search: if at every level J the bucket of U ∩ J has
estimated weight at least τ, then the search over l keeps the bucket U ∩ l.
A kept bucket is heavy: if the estimate of the bucket weight of S at the level of the
coordinates of l is within θ² / 4, and the search over l with threshold θ² / 2 keeps S,
then the bucket weighs more than θ² / 4.
Few buckets survive: if the estimates at the level of the coordinates of l are within
θ² / 4 of the bucket weights of a Boolean function, then the search over l with threshold
θ² / 2 keeps at most 4 / θ² buckets.
The algorithm #
The Boolean functions whose spectral norm ∑_S |f̂(S)|, read as signs, is at most L.
The empirical estimate of the bucket weight W^{S | J̄} of g, read as signs, from the
samples ω j = (x, y, z): the average of g (x, z) χ_S(x) g (y, z) χ_S(y), where (x, z) takes
the coordinates in J from x and the others from z.
The sets found by the Kushilevitz–Mansour algorithm with threshold θ: the bucket search over
all coordinates, keeping the buckets with estimated weight at least θ² / 2.
The hypothesis of the Kushilevitz–Mansour algorithm: the sign of the expansion on the found sets, with the empirical coefficients of the samples.
The points queried by the Kushilevitz–Mansour algorithm: the first point x of each sample,
and the points (x, z) and (y, z) of each sample (x, y, z) at every level J of the
search.
The found sets depend only on the values of the target at the queried points.
The hypothesis depends only on the answers at the queried points.
The Kushilevitz–Mansour algorithm with threshold θ from m samples: draw m
independent samples of three uniform points, query the target at the points kmQueries, run the
bucket search with threshold θ² / 2 on the estimated bucket weights, and output the sign of the
expansion on the found sets with estimated coefficients. Its queries are non-adaptive.
Run on the target f, the algorithm outputs kmHypothesis f θ ω.
The Kushilevitz–Mansour algorithm makes m (2 n + 3) membership queries for n
coordinates.
The Goldreich–Levin bucket search with threshold θ on the samples ω, as a query tree:
query the target at the points kmQueries ω, then output the sets found by the bucket search on
the answers. Its queries are non-adaptive; its running time is not certified.
Run on the target f, the query tree outputs kmCandidates f θ ω.
The analysis #
The samples ω are accurate for f at precision γ: every bucket estimate at every level
of the search over all coordinates, and every sample coefficient, is within γ of its value.
On samples accurate at precision θ² / 4, the found sets include every set whose coefficient
has square at least θ².
On samples accurate at precision θ² / 4, every found set has a coefficient of square above
θ² / 4: at the last level a bucket is a single set, of weight f̂(U)².
On samples accurate at precision θ² / 4, at most 4 / θ² sets are found.
The Kushilevitz–Mansour algorithm on accurate samples. Let θ > 0. If the samples are
accurate at precision θ² / 4, then the hypothesis has error at most θ² / 4 plus the Fourier
weight of f, read as signs, on the sets whose coefficient has absolute value below θ.
The Kushilevitz–Mansour algorithm on accurate samples, for small spectral norm. Let the
spectral norm of f, read as signs, be at most L, and let θ > 0. If the samples are accurate
at precision θ² / 4, then the hypothesis has error at most θ² / 4 + θ L.
Estimating a bucket weight, the sample bound in the proof of
O'Donnell, Proposition 3.40: from m samples of three independent uniform points,
the empirical bucket weight of f on S with respect to J is off from the bucket weight of
f read as signs, O'Donnell's W^{S | J̄}[f] when S ⊆ J and 0 otherwise, by at least γ
with probability at most 2 exp (-m γ² / 2), by Hoeffding's inequality. The estimate reads f
at the two points (x, z) and (y, z) of each sample.
Estimating a bucket weight with confidence, the sample bound in the proof of
O'Donnell, Proposition 3.40: from m ≥ (2 / γ²) log (2 / δ) samples, the
empirical bucket weight is within γ of W^{S | J̄}[f] for S ⊆ J (and of 0 otherwise)
except with probability at most δ. The estimate reads f at 2 m points; queries and time are
not certified here.
The samples are accurate with high probability: m samples fail to be accurate at
precision θ² / 4 with probability at most 2 (n + 2) 2 ^ n exp (-m θ⁴ / 32) for n
coordinates.
Enough samples are accurate: for n coordinates, θ > 0 and δ > 0, from
m ≥ (32 / θ⁴) log (2 (n + 2) 2 ^ n / δ) samples, the samples fail to be accurate at precision
θ² / 4 with probability at most δ.
Listing the large Fourier coefficients by the bucket search of Goldreich and Levin
[GL89], the query and sample step toward the Goldreich–Levin Theorem
O'Donnell, Section 3.5: for n coordinates and τ > 0, from
m ≥ (32 / τ⁴) log (2 (n + 2) 2 ^ n / δ) uniform samples, except with probability at most δ,
the query tree kmCandidatesTree τ ω run on the target f outputs every set U with
|f̂(U)| ≥ τ, only sets with |f̂(U)| > τ / 2, and at most 4 / τ² sets. The tree makes at most
m (2 n + 3) non-adaptive membership queries (depth_kmCandidatesTree_le), polynomially many in
n, 1 / τ and log (1 / δ); these bounds are loose for the search alone (see Cost in the
module docstring). Only samples and queries are certified: the book's poly(n, 1 / τ) running
time is not, and the bucket search has no cap on the number of buckets, so it remains open on
#2131.
The query and sample step toward the Kushilevitz–Mansour theorem [KM93],
O'Donnell, Theorem 3.38: for n coordinates, the Kushilevitz–Mansour algorithm
with threshold ε / (2 L) from m ≥ (512 L⁴ / ε⁴) log (2 (n + 2) 2 ^ n / δ) samples, hence
m (2 n + 3) membership queries (kmLearner_queriesAtMost), learns the Boolean functions whose
spectral norm, read as signs, is at most L, with error ε and confidence 1 - δ. Only samples
and queries are certified: the book's running time poly(n, L, 1 / ε) is not, and the bucket
search has no cap on the number of buckets, so it remains open on
#2131.
The query and sample step toward learning decision trees with membership queries
[KM93], the decision-tree case of O'Donnell, Theorem 3.38: for
n coordinates, the Kushilevitz–Mansour algorithm with threshold ε / (2 L) from
m ≥ (512 L⁴ / ε⁴) log (2 (n + 2) 2 ^ n / δ) samples, hence m (2 n + 3) membership queries,
learns the functions computed by decision trees with at most L leaves, with error ε and
confidence 1 - δ. Only samples and queries are certified; the book's running time
poly(n, L, 1 / ε) remains open on
#2131.
The query and sample step toward the Kushilevitz–Mansour theorem, with the query count:
under the hypotheses of kmLearner_learns, the algorithm learns the functions of spectral norm at
most L with m (2 n + 3) membership queries for n coordinates, the samples and queries of
O'Donnell, Theorem 3.38. Its running time remains open on
#2131.
The query and sample step toward learning decision trees with membership queries, with the
query count: under the hypotheses of kmLearner_learns_decisionTree, the algorithm learns the
functions computed by decision trees with at most L leaves with m (2 n + 3) membership queries
for n coordinates, the samples and queries of the decision-tree case of
O'Donnell, Theorem 3.38. Its running time remains open on
#2131.
Concentrated classes #
The Boolean functions whose Fourier spectrum, read as signs, is η-concentrated on some
collection of at most M sets: the weight off the collection is at most η
O'Donnell, Definition 3.28.
Learning concentrated classes with membership queries [KM93], the query
and sample step toward O'Donnell, Theorem 3.37: for n coordinates and M ≥ 1,
the Kushilevitz–Mansour algorithm with threshold √(ε / (4 M)) from
m ≥ (512 M² / ε²) log (2 (n + 2) 2 ^ n / δ) samples, hence m (2 n + 3) membership queries
(kmLearner_queriesAtMost), learns, with error ε and confidence 1 - δ, the Boolean functions
whose Fourier spectrum, read as signs, is ε / 4-concentrated on at most M sets. Only samples
and queries are certified: the book's running time poly(M, n, 1 / ε) is not, and the bucket
search has no cap on the number of buckets, so it remains open on
#2131.
Learning concentrated classes, with the query count: under the hypotheses of
kmLearner_learns_concentrated, the algorithm learns the functions ε / 4-concentrated on at
most M sets with m (2 n + 3) membership queries for n coordinates: the query and sample step
toward O'Donnell, Theorem 3.37. Only samples and queries are certified; the book's
running time poly(M, n, 1 / ε) remains open on
#2131.