Documentation

CslibFrontier.MachineLearning.StatisticalQuery.Dimension

The statistical query dimension characterizes weak learning #

The statistical query dimension sqDim D C of a concept class C under a distribution D is the largest d such that C contains d concepts whose pairwise correlations under D have absolute value at most 1 / d Reyzin, Definition 11. [BlumEtAl1994, Definition 2] uses the threshold 1 / d ^ 3 instead; its dimension d₃ and this one d₁ satisfy d₃ ≤ d₁ < (d₃ + 1) ^ 3, so polynomial boundedness does not depend on the normalization. The one-sided variant sqDimOneSided D C bounds the correlations only from above, corr D f g ≤ 1 / d. This is the hypothesis that Szörényi's argument for the lower bound of Reyzin, Theorem 12 uses. It is at least sqDim D C (sqDim_le_sqDimOneSided) and at most 18 (sqDim D C + 1) ^ 3 (sqDimOneSided_le), so the two notions are polynomially related. The dimension controls weak learning from statistical queries [BlumEtAl1994, §5]:

The upper bound uses a family G ⊆ C of maximum size whose pairwise correlations have absolute value at most 1 / (d + 1). It has at most d members, since otherwise d + 1 of them would witness sqDim D C ≥ d + 1, and every c ∈ C has correlation of absolute value more than 1 / (d + 1) with some member of G, since otherwise G ∪ {c} would be a larger such family (exists_cover_sqDim). The learner corrLearner asks for the correlation of the target with each member of G, takes the member g whose answer has the largest absolute value, and returns g if that answer is nonnegative and the negation of g otherwise. Its hypothesis has correlation more than 1 / (d + 1) - 2 τ with the target; it need not lie in C. Reyzin's sketch of Observation 23 takes the family that realizes the dimension, at threshold 1 / d; we choose the family at threshold 1 / (d + 1), which gives the correlation bound the argument needs.

All learners here are deterministic and the bounds count queries only, not running time. The domain X is finite and the distribution D is fixed and known to the learner.

Main definitions #

Main results #

References #

The statistical query dimension #

The statistical query dimension of C under D: the largest d such that C contains d distinct concepts whose pairwise correlations under D have absolute value at most 1 / d Reyzin, Definition 11, for a fixed distribution.

[BlumEtAl1994, Definition 2] uses the threshold 1 / d ^ 3 instead. Its dimension d₃ and this one d₁ satisfy d₃ ≤ d₁ < (d₃ + 1) ^ 3. A d₃-family is a d₁-family, since 1 / d ^ 3 ≤ 1 / d. Any k = d₃ + 1 members of a d₁-family with d₁ ≥ k ^ 3 would have pairwise correlations of absolute value at most 1 / k ^ 3. So polynomial boundedness does not depend on the normalization; this elementary relation is not formalized. The one-sided variant sqDimOneSided is at least this dimension and at most 18 (sqDim D C + 1) ^ 3 (sqDim_le_sqDimOneSided, sqDimOneSided_le).

theorem Cslib.MachineLearning.StatisticalQuery.le_sqDim {X : Type} [Fintype X] {D : PMF X} {C : PACLearning.ConceptClass X Bool} {F : Finset (X → Bool)} (hFC : ↑F ⊆ C) (hF : (↑F).Pairwise fun (f g : X → Bool) => |corr D f g| ≤ 1 / ↑F.card) :
F.card ≤ sqDim D C

A family of d concepts of C with pairwise correlations of absolute value at most 1 / d shows d ≤ sqDim D C.

theorem Cslib.MachineLearning.StatisticalQuery.exists_finset_card_eq_sqDim {X : Type} [Fintype X] (D : PMF X) (C : PACLearning.ConceptClass X Bool) :
∃ (F : Finset (X → Bool)), ↑F ⊆ C ∧ F.card = sqDim D C ∧ (↑F).Pairwise fun (f g : X → Bool) => |corr D f g| ≤ 1 / ↑(sqDim D C)

The statistical query dimension is attained: C contains sqDim D C concepts with pairwise correlations of absolute value at most 1 / sqDim D C.

The statistical query dimension is at most the number of concepts.

@[simp]

The empty class has statistical query dimension 0.

theorem Cslib.MachineLearning.StatisticalQuery.sqDim_mono {X : Type} [Fintype X] (D : PMF X) {C C' : PACLearning.ConceptClass X Bool} (h : C ⊆ C') :
sqDim D C ≤ sqDim D C'

A larger class has a larger statistical query dimension.

A nonempty class has statistical query dimension at least 1.

The one-sided variant #

The one-sided statistical query dimension of C under D: the largest d such that C contains d distinct concepts whose pairwise correlations under D are at most 1 / d. This variant of Reyzin, Definition 11 drops the absolute value. Szörényi's argument for the lower bound of Reyzin, Theorem 12 uses only this upper bound on the correlations, so the lower bound holds for it (LearnsStateless.sqDimOneSided_mul_sq_le). It is at least sqDim D C (sqDim_le_sqDimOneSided) and at most 18 (sqDim D C + 1) ^ 3 (sqDimOneSided_le).

theorem Cslib.MachineLearning.StatisticalQuery.le_sqDimOneSided {X : Type} [Fintype X] {D : PMF X} {C : PACLearning.ConceptClass X Bool} {F : Finset (X → Bool)} (hFC : ↑F ⊆ C) (hF : (↑F).Pairwise fun (f g : X → Bool) => corr D f g ≤ 1 / ↑F.card) :

A family of d concepts of C with pairwise correlations at most 1 / d shows d ≤ sqDimOneSided D C.

theorem Cslib.MachineLearning.StatisticalQuery.exists_finset_card_eq_sqDimOneSided {X : Type} [Fintype X] (D : PMF X) (C : PACLearning.ConceptClass X Bool) :
∃ (F : Finset (X → Bool)), ↑F ⊆ C ∧ F.card = sqDimOneSided D C ∧ (↑F).Pairwise fun (f g : X → Bool) => corr D f g ≤ 1 / ↑(sqDimOneSided D C)

The one-sided statistical query dimension is attained.

The one-sided statistical query dimension is at most the number of concepts.

The statistical query dimension is at most the one-sided one.

Covering a class by almost uncorrelated concepts #

theorem Cslib.MachineLearning.StatisticalQuery.exists_cover_sqDim {X : Type} [Fintype X] (D : PMF X) (C : PACLearning.ConceptClass X Bool) :
∃ (G : Finset (X → Bool)), ↑G ⊆ C ∧ G.card ≤ sqDim D C ∧ ∀ c ∈ C, ∃ g ∈ G, 1 / (↑(sqDim D C) + 1) < |corr D c g|

At most sqDim D C concepts of C cover C: every concept of C has correlation of absolute value more than 1 / (sqDim D C + 1) with one of them. They form a family of maximum size whose pairwise correlations have absolute value at most 1 / (sqDim D C + 1).

The correlational learner #

noncomputable def Cslib.MachineLearning.StatisticalQuery.corrQuery {X : Type} (g : X → Bool) :

The correlational query of the concept g: the product of the ±1 values of g (x) and of the label. Its expectation is the correlation of the target with g (expect_corrQuery).

theorem Cslib.MachineLearning.StatisticalQuery.expect_corrQuery {X : Type} [Fintype X] (D : PMF X) (c g : X → Bool) :
expect D c (corrQuery g) = corr D c g

The expectation of the correlational query of g is the correlation of the target with g.

noncomputable def Cslib.MachineLearning.StatisticalQuery.askCorr {X : Type} (g : X → Bool) :
OracleComp (spec X) ((X → Bool) × ℝ)

Ask for the correlation of the target with g, and return g with the answer.

noncomputable def Cslib.MachineLearning.StatisticalQuery.corrHypothesis {X : Type} (answers : List ((X → Bool) × ℝ)) :
X → Bool

The hypothesis chosen from the answered concepts: a concept g whose answer a has the largest absolute value, if a ≥ 0, and the negation of g otherwise (the constant false if there are no answers).

noncomputable def Cslib.MachineLearning.StatisticalQuery.corrLearner {X : Type} (gs : List (X → Bool)) :
OracleComp (spec X) (X → Bool)

Ask for the correlation of the target with each concept of gs and return a concept whose answer has the largest absolute value, or its negation if that answer is negative.

The correlational learner makes one query for each concept of the list.

Every query of the correlational learner is the correlational query of a concept of the list.

theorem Cslib.MachineLearning.StatisticalQuery.learns_corrLearner {X : Type} [Fintype X] {D : PMF X} {C : PACLearning.ConceptClass X Bool} {gs : List (X → Bool)} {γ : ℝ} (hcover : ∀ c ∈ C, ∃ g ∈ gs, γ < |corr D c g|) (τ : ℝ) :
Learns (corrLearner gs) D C τ ((1 - γ) / 2 + τ)

The correlational learner learns a covered class. If every concept c ∈ C has correlation of absolute value more than γ with some concept of gs, then corrLearner gs learns C under D with tolerance τ and error (1 - γ) / 2 + τ.

The weak learner and the lower bound #

theorem Cslib.MachineLearning.StatisticalQuery.exists_learns_sqDim {X : Type} [Fintype X] (D : PMF X) (C : PACLearning.ConceptClass X Bool) :
∃ (A : Algorithm X), OracleComp.IsQueryBounded A (sqDim D C) ∧ OracleComp.QueriesSatisfy (fun (φ : Query X) => ∃ g ∈ C, φ = corrQuery g) A ∧ ∀ (τ : ℝ), Learns A D C τ (1 / 2 - 1 / (2 * (↑(sqDim D C) + 1)) + τ)

Weak learning from the statistical query dimension Reyzin, Observation 23, the analogue of [BlumEtAl1994, Theorem 13] for the threshold 1 / d. For d = sqDim D C there is a learner making at most d queries, each the correlational query of a concept of C, that learns C under D with tolerance τ and error 1/2 - 1/(2 (d + 1)) + τ, for every τ. Its hypotheses are concepts of C or their negations.

theorem Cslib.MachineLearning.StatisticalQuery.LearnsStateless.sqDimOneSided_mul_sq_le {X : Type} [Fintype X] {D : PMF X} {C : PACLearning.ConceptClass X Bool} {A : Algorithm X} {τ ε : ℝ} (hA : LearnsStateless A D C τ ε) {q : ℕ} (hq : OracleComp.IsQueryBounded A q) (hτ : 0 ≤ τ) (hε : 0 ≤ ε) (hετ : τ ≤ 1 - 2 * ε) :
↑(sqDimOneSided D C) * τ ^ 2 ≤ 2 * ↑q + 2

The statistical query dimension lower bound, one-sided form Reyzin, Theorem 12 (a quantitative form of [BlumEtAl1994, Theorem 12]). A learner learning C under D from at most q queries of tolerance τ ≥ 0 with error ε ≥ 0, where 1 - 2 ε ≥ τ, has sqDimOneSided D C · τ ^ 2 ≤ 2 q + 2. This is one weaker than Reyzin's count d τ ^ 2 ≤ 2 q + 1, because a hypothesis with error ε > 0 may correlate with one more concept of the family; for exact learning see LearnsStateless.card_mul_sq_sub_one_le_two_mul.

theorem Cslib.MachineLearning.StatisticalQuery.LearnsStateless.sqDim_mul_sq_le {X : Type} [Fintype X] {D : PMF X} {C : PACLearning.ConceptClass X Bool} {A : Algorithm X} {τ ε : ℝ} (hA : LearnsStateless A D C τ ε) {q : ℕ} (hq : OracleComp.IsQueryBounded A q) (hτ : 0 ≤ τ) (hε : 0 ≤ ε) (hετ : τ ≤ 1 - 2 * ε) :
↑(sqDim D C) * τ ^ 2 ≤ 2 * ↑q + 2

The statistical query dimension lower bound (a quantitative form of [BlumEtAl1994, Theorem 12]): a learner learning C under D from at most q queries of tolerance τ ≥ 0 with error ε ≥ 0, where 1 - 2 ε ≥ τ, has sqDim D C · τ ^ 2 ≤ 2 q + 2 (LearnsStateless.sqDimOneSided_mul_sq_le and sqDim_le_sqDimOneSided).

The one-sided statistical query dimension is polynomial in the statistical query dimension: sqDimOneSided D C ≤ 18 (sqDim D C + 1) ^ 3. The weak learner of exists_learns_sqDim with tolerance τ = 1 / (3 (d + 1)) has accuracy τ, so the one-sided lower bound LearnsStateless.sqDimOneSided_mul_sq_le applies with d queries.

The characterization of weak learning #

theorem Cslib.MachineLearning.StatisticalQuery.tfae_polynomiallyBounded_sqDim {X : ℕ → Type} [(n : ℕ) → Fintype (X n)] (D : (n : ℕ) → PMF (X n)) (C : (n : ℕ) → PACLearning.ConceptClass (X n) Bool) :
[PolynomiallyBounded fun (n : ℕ) => sqDim (D n) (C n), PolynomiallyBounded fun (n : ℕ) => sqDimOneSided (D n) (C n), ∃ (q : ℕ → ℕ) (p : ℕ → ℕ), PolynomiallyBounded q ∧ PolynomiallyBounded p ∧ ∀ (n : ℕ), ∃ (A : Algorithm (X n)), OracleComp.IsQueryBounded A (q n) ∧ OracleComp.QueriesSatisfy (fun (φ : Query (X n)) => ∃ g ∈ C n, φ = corrQuery g) A ∧ Learns A (D n) (C n) (1 / (↑(p n) + 1)) (1 / 2 - 1 / (↑(p n) + 1)), ∃ (q : ℕ → ℕ) (p : ℕ → ℕ), PolynomiallyBounded q ∧ PolynomiallyBounded p ∧ ∀ (n : ℕ), ∃ (A : Algorithm (X n)), OracleComp.IsQueryBounded A (q n) ∧ LearnsStateless A (D n) (C n) (1 / (↑(p n) + 1)) (1 / 2 - 1 / (↑(p n) + 1))].TFAE

The statistical query dimension characterizes weak learning [BlumEtAl1994, §5] (see Reyzin, Theorem 12 and Observation 23). For concept classes C n on finite domains X n under distributions D n, the following are equivalent:

  1. the statistical query dimension sqDim (D n) (C n) is polynomially bounded in n;
  2. the one-sided dimension sqDimOneSided (D n) (C n) is polynomially bounded in n;
  3. there are polynomially bounded q and p and learners for each n making at most q n queries, each the correlational query of a concept of C n, that learn C n under D n with tolerance 1 / (p n + 1) and error 1/2 - 1 / (p n + 1), against adaptive answers;
  4. the same with arbitrary statistical queries, against fixed answer functions only.

So weak learnability with polynomially many queries, inverse-polynomial tolerance and inverse-polynomial advantage does not depend on the choice between statistical and correlational queries, or between adaptive and fixed answers, and polynomial boundedness of the dimension does not depend on whether correlations are bounded in absolute value.