Documentation

CslibFrontier.MachineLearning.StatisticalQuery.LowDegree

The low-degree algorithm from statistical queries #

The low-degree algorithm of Linial, Mansour and Nisan [LMN93] estimates the Fourier coefficients f̂(S) = E_x [f(x) χ_S(x)] of the target, read as signs, on the sets S of at most t coordinates, and outputs the sign of the truncated expansion ∑_{#S ≤ t} c_S χ_S. Each coefficient is the expectation of the statistical query (x, y) ↦ y χ_S(x) under the uniform distribution (StatisticalQuery.expect_uniformOfFintype_charQuery), so the algorithm is a non-adaptive statistical query learner (StatisticalQuery.lowDegree) making one query for each of the N sets of at most t coordinates; Kearns notes that it falls into the statistical query model without modification [Kearns1998, Section 1] and lists it among the applications of Section 6. With tolerance τ every estimate is within τ of its coefficient, so the hypothesis has error at most N τ² + κ for every target whose Fourier weight above degree t is at most κ (StatisticalQuery.learns_lowDegree). In particular the parities on at most t coordinates, whose weight above degree t is zero, are learned with error N τ² (StatisticalQuery.learns_lowDegree_parityOn), in contrast to the parities on all coordinates (StatisticalQuery.LearnsStateless.two_pow_card_le_of_parityOn_mem).

The queries are asked through StatisticalQuery.askAll, which asks a list of indexed queries in order and returns the answers as a function of the index.

Main definitions #

Main results #

References #

Asking a list of queries #

def Cslib.MachineLearning.StatisticalQuery.askAll {X κ : Type} [DecidableEq κ] (Q : κ → Query X) :
List κ → OracleComp (spec X) (κ → ℝ)

Ask the queries Q k for the indices k of the list ks, in order, and return the answers as a function of the index; the indices not in the list get 0.

Asking a list of queries makes one call for each entry.

theorem Cslib.MachineLearning.StatisticalQuery.apply_mem_of_mem_supportWith_askAll {X κ : Type} [DecidableEq κ] {Q : κ → Query X} {possible : Query X → Set ℝ} {ks : List κ} {r : κ → ℝ} (hr : r ∈ OracleComp.supportWith possible (askAll Q ks)) (k : κ) :
k ∈ ks → r k ∈ possible (Q k)

Every answer returned by askAll is a possible answer to its query.

The low-degree algorithm #

noncomputable def Cslib.MachineLearning.StatisticalQuery.charQuery {ι : Type} (S : Finset ι) :
Query (ι → Bool)

The statistical query (x, y) ↦ y χ_S(x) reading the label y as a sign: its expectation under the uniform distribution is the Fourier coefficient of the target on S.

Under the uniform distribution the expectation of charQuery S is the Fourier coefficient on S of the target read as signs.

Under the uniform distribution the disagreement of f and g is the fraction of the points where they differ, the uniform error of g for the target f.

noncomputable def Cslib.MachineLearning.StatisticalQuery.lowDegree (ι : Type) [Fintype ι] [DecidableEq ι] (t : ℕ) :
OracleComp (spec (ι → Bool)) ((ι → Bool) → Bool)

The low-degree algorithm of degree t from statistical queries: ask the correlation with χ_S for every set S of at most t coordinates, and output the sign of the truncated expansion ∑_{#S ≤ t} c_S χ_S with the answers c_S.

The low-degree algorithm makes one query for each set of at most t coordinates.

theorem Cslib.MachineLearning.StatisticalQuery.learns_lowDegree {ι : Type} [Fintype ι] [DecidableEq ι] (t : ℕ) {C : PACLearning.ConceptClass (ι → Bool) Bool} {τ κ : ℝ} (hC : ∀ c ∈ C, ∑ S : Finset ι with t < S.card, BitString.fourierCoeff (fun (x : ι → Bool) => BitString.signVal (c x)) S ^ 2 ≤ κ) :
Learns (lowDegree ι t) (Probability.PMF.uniformOfFintype (ι → Bool)) C τ (↑{S : Finset ι | S.card ≤ t}.card * τ ^ 2 + κ)

The low-degree algorithm learns from statistical queries [LMN93] [Kearns1998, Section 6]. Let N be the number of sets of at most t coordinates. Under the uniform distribution with tolerance τ, the low-degree algorithm of degree t learns, with error N τ² + κ, every class of Boolean functions whose Fourier weight, read as signs, on the sets of more than t coordinates is at most κ.

theorem Cslib.MachineLearning.StatisticalQuery.learns_lowDegree_parityOn {ι : Type} [Fintype ι] [DecidableEq ι] (t : ℕ) {τ : ℝ} :
Learns (lowDegree ι t) (Probability.PMF.uniformOfFintype (ι → Bool)) {c : (ι → Bool) → Bool | ∃ (S : Finset ι), S.card ≤ t ∧ c = parityOn S} τ (↑{S : Finset ι | S.card ≤ t}.card * τ ^ 2)

Parities on at most t coordinates are learnable from statistical queries. Under the uniform distribution with tolerance τ, the low-degree algorithm of degree t learns the parities on at most t coordinates with error N τ², where N is the number of sets of at most t coordinates: about n ^ t queries of tolerance about n ^ {-t/2} suffice, whereas the parities on all n coordinates need 2 ^ {Ω(n)} queries or tolerance 2 ^ {-Ω(n)} (LearnsStateless.two_pow_card_le_of_parityOn_mem).