A Theoretical Framework for Self-Play Theorem Proving Algorithms


Abstract

Self-play, a type of training algorithm that enables a model to self-improve, has recently shown promising empirical results in the context of formal theorem proving using Large Language Models (LLMs). [1] instantiate self-play with two cooperating agents: a prover, which proves theorems, and a conjecturer, which generates new theorems as a curriculum to the prover. In this paper, we provide a theoretical framework for understanding the self-improvement capabilities of self-play algorithms for theorem proving. First, we formalize the set of theorems as a graph, with nodes as theorems and edges between pairs of theorems with similar semantics. We introduce a set of primitive assumptions that characterize the guarantees of a trained prover and how a conjecturer can access the structure of the graph. Second, we show that if the underlying graph of theorems is well-connected, then a prover-conjecturer system, where the conjecturing algorithm is based on a reversible random walk, is sufficient to grow the set of proved theorems exponentially. Third, motivated by an issue encountered empirically by self-play algorithms, where the conjecturer tends to generate artificially complex and non-fundamental theorems, we propose a diversity measure for a training distribution of theorems generated by a conjecturer and an improved conjecturing algorithm that locally maximizes this diversity measure, by computing the diffusion similarity between neighboring theorems in the theorem graph. Finally, we describe a method to compute the diffusion similarity by using contrastive learning to embed nodes into Euclidean space and then computing the inner-product between embeddings.

1 Introduction↩︎

Formal theorem proving and mathematical reasoning with Large Language Models (LLMs) have made rapid progress, including systems that reached IMO gold-medal-level performance and systems reported to assist with open mathematical research problems [2], [3]. Among the technical ideas used to train LLM-based theorem provers, self-play via two cooperating models, a prover model and a conjecturer model, is a new and promising training technique.

Self-play can be viewed as an automated synthetic data generation mechanism, where a system of two models generate and solve gradually-more-difficult instances of a task, improving both models with no manually annotated data required. Self-play has been used to train models to play Go [4]. In the context of theorem proving, self-play algorithms have been studied empirically. STP [1] trains two models: a prover, which maps theorem statements to their proofs, and a conjecturer, which maps theorem statements to slightly more difficult theorem statements adaptively based on the prover. The prover and conjecturer models cooperate to gradually enable the prover to prove harder theorems.

To our knowledge, this is the first theoretical analysis of self-play training algorithms for formal theorem proving. In this work, we introduce a theoretical framework, based on a graph of theorems, where the primary objective is to design a training algorithm that yields a prover with a large knowledge set—the set of theorems it can prove (4). The framework introduces a set of primitive assumptions, characterizing how a prover can generalize in-domain when trained on a distribution of theorems and how a conjecturer can access the structure of the theorem graph. The space of training algorithms includes prover-conjecturer systems analogous to that in STP [1], where the conjecturer generates a sequence of distributions over theorems, which the prover is trained on to gradually increase its knowledge. Under a connectivity condition on the underlying theorem graph, we show that the prover-conjecturer system in 2, using a simple baseline conjecturing algorithm based on a reversible random walk, guarantees that the size of the prover’s knowledge set at iteration \(t \in \mathbb{N}\) grows exponentially in \(t\) ([thm:main]).

However, the size of the prover’s knowledge set alone is insufficient as an objective since the knowledge set can contain many related, non-fundamental theorems (e.g. increasingly complex arithmetic problems). Empirically, STP [1] use heuristic elegancy filters to filter out inelegant, artificially-complicated generated-conjectures. Minimo [5] also encounters an issue where the conjecturer generates longer and more complicated conjectures rather than deeper conjectures. The question we focus on is how to encourage the conjecturer to generate theorems whose fundamental proof ideas are more diverse, which we believe is related to the issues encountered empirically.

Towards quantifying diversity of a prover’s knowledge set and proposing algorithmic improvements to the conjecturer, the secondary objective of a training algorithm within our framework is: given a hyperparameter \(\tau \in \mathbb{N}\), maximize the size of the \(\tau\)-step expansion of the prover’s knowledge set in the theorem graph, a quantity we identify with the diversity of the prover’s knowledge. This prover-centric diversity is of practical use itself because it is heuristically the number of theorems with a \(\tau\)-step reduction to a theorem the prover knows how to prove, which the prover can prove at inference time given \(\tau\) steps of “reasoning." This prover-centric diversity can also be thought of as quantifying the size of the boundary of the prover’s knowledge set. Towards maximizing this prover-centric diversity, we propose a diversity measure for the training distribution of theorems generated by a conjecturer (which the prover is trained on) and show it lower bounds the prover-centric diversity ([lem:divt-kct-connection]). We propose an improved conjecturing algorithm (5) that generates training distributions that locally maximize this diversity measure, which requires computing a quantity called the diffusion similarity. Finally, we propose a new way to compute the diffusion similarity via contrastive learning ([thm:contembd]).

1.1 Technical Overview↩︎

1.1.0.1 Theorem Graph.

Let \(V \subset \{ 0,1\}^*\) be the set of all theorems, encoded as strings according to a formal language like Lean [6]. Let \(\mathcal{F}_{\mathrm{prover}}\) be the hypothesis class of prover models (e.g. the class of pre-trained LLMs), where every prover \(\mathcal{F}_{\mathrm{prover}}\ni f : V \to \Delta(\{ 0,1\}^*)\) maps a theorem to a distribution over proofs. A verifier \(\mathrm{Ver}: V \times \{ 0,1\}^* \to \{ 0,1\}\) verifies if a proof of a theorem is correct. Using \(\mathrm{Ver}\), for any prover \(f \in \mathcal{F}_{\mathrm{prover}}\) and theorem \(x \in V\) define the success rate \(\operatorname{succ}(x,f) \in [0,1]\) as the probability that \(f\) on input \(x\) generates a correct proof of \(x\). For any \(\varepsilon \in (0,1)\), define \(E(\varepsilon, \mathcal{F}_{\mathrm{prover}}) \subset V \times V\) as the set of pairs of theorems that are semantically similar, with respect to \(\mathcal{F}_{\mathrm{prover}}\):

\[\begin{align} E(\varepsilon, \mathcal{F}_{\mathrm{prover}}) := \{ (x,y) \in V \times V : \forall f \in \mathcal{F}_{\mathrm{prover}}, |\operatorname{succ}(x,f) - \operatorname{succ}(y,f)| \leq \varepsilon\}\label{eq:edge-ood} \end{align}\tag{1}\]

Fix \(\varepsilon\) and let \(E \subset E(\varepsilon,\mathcal{F}_{\mathrm{prover}})\). 3 and 4 of our framework require that for any theorem \(x\), the set \(N(x) := \{ y \in V : (x,y) \in E\}\) is efficiently computable. The neighbor oracle \(N : V \to 2^V\), mapping \(x \rightarrow N(x)\) is a key algorithmic primitive for the conjecturing algorithms we propose later. The theorem graph is the undirected graph \(G = (V,E)\) with nodes \(V\) and edges \(E\).

1.1.0.2 Further Assumptions.

We define a conjecturer as a mapping from a distribution \(D \in \Delta(V)\) of theorems (represented as a vector in \([0,1]^{|V|}\)) to a new distribution \(D' \in \Delta(V)\) of theorems. One type of conjecturer is a single step of a random walk with transition matrix \(P \in [0,1]^{|V| \times |V|}\), where \((D')^\top = D^\top P \in [0,1]^{1 \times |V|}\). Our first result assumes that \(|V| = \infty\) and that the random-walk-based conjecturer \(P\) satisfies a connectivity condition, 5. When \(P = P_{\mathrm{s.r.w.}}\) is a simple random walk, where a node transitions uniformly to its neighbors, then 5 amounts to a property of \(G\): that there exists \(\kappa > 0\) where for any finite subset of nodes \(A \subset V\) then \(\kappa \cdot |\partial A| \geq \deg(A)\) where \(|\partial A|\) are the number of edges with one endpoint in \(A\) and the other in \(V - A\), and \(\deg(A)\) is the sum of the degrees of nodes in \(A\). Finally, our framework includes 1 and 2, which are statistical-learning-like assumptions which describe how a prover trained on a finite sample of i.i.d. (theorem, proof) pairs from some training distribution \(D\) can generalize in-domain to \(D\).

1.1.0.3 A Baseline Conjecturing Algorithm.

First we show if the theorem graph \(G\) satisfies a connectivity assumption, 5, then a conjecturer, based on a nearest-neighbor-type reversible random walk, enables the prover to prove an exponential in \(t\) number of theorems at every iteration \(t \in \mathbb{N}\).

Theorem 1. ([thm:main], Informal) Let \(G = (V,E)\) be the theorem graph, and \((V, P)\) a nearest-neighbor-type random walk, constituting a conjecturing algorithm, that satisfies the connectivity condition of Assumption 5 with Isoperimetric constant \(\kappa > 0\). Suppose the framework Assumptions 1-4 hold, with universal constant \(p \in (0,1)\) defined in 2. For any training-error threshold \(\epsilon< \frac{1}{2\kappa^2}\), the prover-conjecturer system (2) satisfies that for all \(t \in \mathbb{N}\), the number of theorems that the prover can prove with success rate at least \(p\) at iteration \(t\) is exponential in \(t\).

Figure 1: Let \tau = 1. (Left) Prover f_1’s \tau-expanded knowledge set is only supported on the left cluster. (Right) Prover f_2’s \tau-expanded knowledge set is well-supported on both clusters. Their knowledge sets S_1,S_2 are equal in size (6), but S_2 is more diverse since its \tau-step expansion is larger.

1.1.0.4 An Improved Conjecturing Algorithm for the Diversity Issue.

Suppose \(f \in \mathcal{F}_{\mathrm{prover}}\) is the final prover trained by a self-play algorithm like 2. Whereas [thm:main], under 5, provides guarantees of \(|K^p(f)| := |\{ x \in V : \operatorname{succ}(x,f) \geq p\}|\), the size of the prover’s knowledge, [thm:main] does not guarantee the diversity of the prover’s knowledge. For hyperparameter \(\tau \in \mathbb{N}\), we study how to optimize a proxy for diversity of the prover’s knowledge, \(|K^p_\tau(f)| := | \{ x' \in V : \exists x \in V : \operatorname{succ}(x,f) \geq p \mathrm{ and } \mathrm{dist}(x,x') \leq \tau\}|\). 1 depicts two provers, \(f_1\) and \(f_2\), that both can prove the same number of theorems (\(|K^p(f_1)| = |K^p(f_2)|\)), but where \(f_1\)’s knowledge set is much less diverse, in the sense that \(|K^p_\tau(f_1)| \ll |K^p_\tau(f_2)|\).

Suppose prover \(f\) is trained on theorem distribution \(D \in \Delta(V)\) in the sense that \(\mathbb{P}_{x \sim D}[\operatorname{succ}(x,f) \geq p] \geq 1 - \epsilon\) (as in 2). [lem:divt-kct-connection] shows that in order to maximize \(|K^p_\tau(f)|\), it is reasonable to maximize the following property of \(f\)’s training distribution: \(\mathrm{Div}^P_\tau(D) := \frac{1}{||D^\top P^\tau||^2_{\ell^2(1/\pi)}} = \frac{1}{\sum_{x \in V }(D^\top P^\tau e_x)^2 \frac{1}{\pi(x)} }\), where \(P\) is the transition matrix of a reversible, nearest-neighbor Markov chain. With this observation, the goal is to design a conjecturing algorithm that generates training distributions \(\{ D_t\}_{t \in \mathbb{N}}\) where \(\mathrm{Div}^P_\tau(D_t)\) is large for each \(t \in \mathbb{N}\). We propose 5, an improved conjecturer that defines a push-forward map \(C : V \to \Delta(V)\) where \(\forall x \in V\), \(C(x) \in \Delta(N(x))\). The weighting of \(C(x)\) is determined by maximizing \(\mathrm{Div}^P_\tau(C(x))\).

\[\begin{align} \forall x \in V, \, C(x) &\leftarrow \arg\max_{\mu \in \Delta(N(x))} \mathrm{Div}^P_\tau(\mu) = \arg\min_{\mu \in \Delta(N(x))} \mu^\top P^\tau \mathrm{diag}(1/\pi) (P^\tau)^\top \mu \end{align}\]

5 needs to compute the diffusion similarity \(\phi^{\mathrm{diff}}_\tau(y, y') := e_y^\top P^\tau \mathrm{diag}(1/\pi) (P^\tau)^\top e_{y'}\) for every pair of neighbors \(y,y' \in N(x)\) of \(x\). 1 We show the diffusion similarity can be computed by embedding each node in \(G\) into Euclidean space via an embedding model learned with contrastive learning, and then computing the inner product between embeddings. This can be used as a subroutine in a conjecturing algorithm like 5.

Theorem 2. ([thm:contembd], Informal) Let \(G = (V,E)\) be an undirected, connected theorem graph. Let \(\mathcal{F}_V^{(|V|)}\) be the class of all mappings from \(V\) to \(\mathbb{R}^{|V|}\), and \(\mathcal{F}_{\mathrm{emb}}\subset \mathcal{F}_V^{(|V|)}\) a class of embedding models. For any \(\tau \in \mathbb{N}\), \(\mathcal{L}_{\mathrm{cont}}^\tau: \mathcal{F}_V^{(|V|)} \to \mathbb{R}\) is a contrastive loss with time-scale parameter \(\tau\) (2 ). Assume \(\mathcal{F}_{\mathrm{emb}}\) contains a global minimizer of \(\mathcal{L}_{\mathrm{cont}}^\tau(\cdot)\). For any such global minimizer \(h_{\theta_*} \in \mathcal{F}_{\mathrm{emb}}\), then \(\forall u,v \in V,\; \phi^{\mathrm{diff}}_\tau(u,v) = h_{\theta_*}(u)^\top h_{\theta_*}(v)\).

Under additional assumptions, we prove [thm:e2e-contrastive-learning-result], which is an extension to the result of [thm:contembd] that applies for classes of embedding models \(\mathcal{F}_{\mathrm{emb}}\) where models \(\mathcal{F}_{\mathrm{emb}}\ni h_\theta : V \to \mathbb{R}^k\) have small embedding dimension \(k \ll |V|\). [thm:e2e-contrastive-learning-result] provides approximation-guarantees for an embedding model that is learned via empirical risk minimization (ERM).

In short, our contributions are:

  1. We provide a theoretical framework for understanding and designing self-play theorem proving algorithms. The framework formalizes the set of theorems as a graph, where nodes are theorems. It introduces a set of primitive assumptions (14) that describe the properties of the graph and the computational primitives available to a self-play algorithm.

  2. We show in [thm:main] that if the theorem graph and conjecturer satisfy a well-connectedness property (5), the number of theorems the prover-conjecturer system (2) proves grows exponentially with the number of self-play iterations.

  3. Motivated by an issue encountered empirically by self-play algorithms where the conjecturer generates artificially complex and non-fundamental theorems, we propose a diversity measure for a training distribution of theorems generated by a conjecturer ([defn:diversity-measure]) and an improved conjecturer (5) that locally maximizes this diversity measure, by computing the diffusion similarity (3) between neighboring theorems in the theorem graph.

  4. In [thm:contembd] and [thm:e2e-contrastive-learning-result], we describe a method to compute the diffusion similarity of two nodes of the theorem graph by using contrastive learning to embed nodes into Euclidean space and then computing the inner-product between the embeddings.

2 Related Work↩︎

2.0.0.1 LLM-Based Formal Theorem Proving Systems.

Formal theorem proving with LLMs in Lean [6] is commonly divided into two paradigms: step-level interaction and whole-proof generation. Step-level methods interact with Lean incrementally, proposing one tactic at a time [8][12]. Whole-proof methods instead generate a complete Lean proof in a single interaction [13][21].

2.0.0.2 Self-play for Formal Theorem Proving.

Regarding self-play theorem proving systems, STP instantiates a prover-conjecturer self-play loop from pre-trained LLMs, where the conjecturer is trained to generate synthetic theorems that are barely provable by the current prover [1]. Minimo instantiates a prover-conjecturer self-play loop to learn a prover from scratch, where the conjecturer generates conjectures via constrained decoding and the prover guides an MCTS proof search [5]. In contrast to these empirical works, our work develops a theoretical framework for analyzing when prover-conjecturer self-play can expand the set of provable theorems.

2.0.0.3 Theoretical Analyses of Self-play Algorithms.

Existing theoretical analyses of self-play largely focus on adversarial settings, such as zero-sum Markov games. The theorem-proving setting we study is different: the prover and conjecturer have asymmetric but cooperative roles. [22] provide a theoretical analysis of self-play algorithms in zero-sum Markov Games, showing convergence to a Nash Equilibrium [22]. The Wasserstein GAN training algorithm [23] is a theoretically-grounded asymmetric self-play algorithm, but still where the agents are adversarial to each other. Our work also differs from works that study how to learn a model to verify theorems in a purely statistical setting [24]. Our setting is non-statistical since the goal of the training algorithm is to allow the final model to generalize beyond its starting distribution, not just to generalize well on its starting distribution given i.i.d. samples. However, we will assume some statistical-learning primitives (2) in our framework.

2.0.0.4 Theorem Graphs.

Prior works formalize the graph or hyper-graph structure of mathematical theorems [25], [26]. In [25], each node represents a statement; the statement corresponding to a node can be deduced in one step via a deduction rule from the statements corresponding to its descendants. [26] formalizes nodes as statements, and each \((p,q)\) hyper-edge corresponds to applying a deduction rule on \(p\) input statements to yield \(q\) output conclusions. Axioms of the logical system are root nodes. In relation to these works, our notion of a theorem graph still represents mathematical statements as nodes. However, the definition of an edge is not defined in terms of deduction rules in a particular logical system. Rather, edges are determined by the class of prover models \(\mathcal{F}_{\mathrm{prover}}\), where an edge between two theorems \((x,y)\) indicates that for every prover \(f \in \mathcal{F}_{\mathrm{prover}}\), the success rate of \(f\) on theorem \(x\) is not too different from the success rate of \(f\) on theorem \(y\).

2.0.0.5 Graph Exploration Algorithms, Graph Diffusion, Contrastive Learning.

Given a graph, the question of how to design an algorithm to explore the graph efficiently has been studied in [27]. They formalize chain-of-thought reasoning as a random walk over a graph of ideas, where the goal of the reasoner is to hit a particular node of the graph, starting at a designated start node. The underlying graphs they study are metastable graphs [28]. The question we study in 5 is conceptually related to [27], in that we want to find a graph algorithm that can efficiently explore a graph with poor connectivity, such as metastable graphs. However, our proposed graph-exploration algorithms are different from [27]. In particular, our algorithm uses a similarity measure between nodes in the graph, called the diffusion similarity, that is defined in terms of a random walk on the graph. The diffusion similarity measure is closely related to the diffusion distance, a graph metric which is useful for characterizing the clustering-structure of a graph [29]. Finally, we propose a new way to compute the diffusion similarity, using a version of contrastive learning formalized by [30], who provide a theoretical characterization of the global minimizers of a particular contrastive loss in terms of the minimizers of a related matrix factorization objective.

3 Preliminaries↩︎

3.0.0.1 Notation.

\(0 \in \mathbb{N}\). \([n] := \{ 1, 2, \ldots, n\}\). For a set \(V\), \(2^V\) is its power set. For \(v \in \mathbb{R}^n\), \(\mathrm{diag}(v) \in \mathbb{R}^{n \times n}\) is the diagonal matrix with \(v\) on its diagonal. For \(M \in \mathbb{R}^{n \times n}\), \(i,j \in [n]\), denote \(M[i,j]\) the \((i,j)\)th entry, \(M[i]\) the \(i\)th row, and \(M[:, j]\) the \(j\)th column of \(M\). \(O^{k \times k}\) is the set of \((k\times k)\) orthogonal matrices. \(\mathbf{1}\) is the all-\(1\)’s vector. \(\forall x \in V\), \(e_x \in \mathbb{R}^{|V|}\) is the unit vector along dimension indexed by \(x \in V\). For an undirected, unweighted graph \(G = (V,E)\), for any \(x,y \in V\),   \(\mathrm{dist}(x,y)\) is the minimum number of edges of any path connecting \(x\) and \(y\) in \(G\). \(\deg(x)\) denotes the degree of node \(x \in V\). For \(x \in V, r \in \mathbb{N}\), denote \(B(x,r) := \{ x' \in V : \mathrm{dist}(x, x') \leq r\}\) and \(\partial B(x,r) := B(x,r) - B(x, r - 1), \, B(x, -1) := \emptyset\). For set \(S \subset V,\) let \(B(S, r) := \bigcup_{v \in S} B(v,r)\). For \(\pi,f, f' : V \to (0, \infty)\), let \(\langle f, f' \rangle_{\ell^2(1/\pi)} := \sum_{x \in V} f(x) f'(x) \frac{1}{\pi(x)}\) and \(||f||^2_{\ell^2(1/\pi)} := \langle f, f \rangle_{\ell^2(1/\pi)}\). Let \(\Delta(V)\) denote the set of probability distributions whose support is contained in the set \(V\). For \(D \in \Delta(V)\), \(\operatorname{supp}(D)\) is its support. For \(g : V \to \Delta(V)\), \(g \# D \in \Delta(V)\) is the distribution of \(y\), drawn according to this process: \(x \sim D, y \sim g(x)\). We say an algorithm has independent and identically distributed (i.i.d.) sample access to \(D\) if it has an oracle which it can query for i.i.d. samples \(x \sim D\).

3.0.0.2 Markov Chains on Graphs and Isoperimetric Inequality.

7.1 has more-detailed preliminaries. Let \(G = (V,E)\) be an undirected, connected graph with a countable set of vertices. Let \((V,P)\) denote an irreducible, reversible Markov chain with transition matrix \(P \in [0,1]^{|V| \times |V|}\) and invariant measure \(\pi : V \to (0,\infty)\) where reversibility means that \(\forall x,y \in V, \pi(x) P[x,y] = \pi(y) P[y, x]\). Let \(E(P)\) be the set of unordered tuples \((x,y)\) where \(P[x,y] > 0\). Given \(e \in E(P)\) we will write \(e = (e^-, e^+)\), but the choice of which end-point is \(e^-\) and which is \(e^+\) does not matter for our analysis. If \(E(P) \subset E\), then \((V,P)\) is nearest-neighbor-type random walk (Markov chain). The simple random walk \(P_{\mathrm{s.r.w.}}\) is a Markov chain where every node \(x\) transitions uniformly to its neighbors \(N(x)\). For any \(A \subset V\), let \(\partial A\) be the set of all edges in \(E(P)\) with one endpoint in \(A\) and the other in \(V - A\). Let \(\pi(A) := \sum_{x \in A} \pi(x)\) and \(a(\partial A) := \sum_{(e^-, e^+) \in \partial A} \pi(e^-) P[e^-, e^+] = \sum_{e^- \in A, e^+ \notin A} \pi(e^-) P[e^-, e^+]\).

definitionIS A Markov chain \((V,P)\) satisfies Strong Isoperimetric Inequality, \(\mathrm{IS}\), if there exists a constant \(\kappa > 0\) such that for every subset of finite cardinality \(A \subset V\), \(\pi(A) \leq \kappa \cdot a(\partial A)\).

3.0.0.3 Contrastive Learning.

8 contains more detailed preliminaries. Contrastive learning defines an algorithm for learning an embedding model that maps elements from a domain \(V\) (e.g. the set of real-world images) into Euclidean space \(\mathbb{R}^k\) for some \(k \in \mathbb{N}\). It is most notably used for training neural networks as embedding models [31][33]. We will use the setup of [30], which we describe below.

Let \(\mathcal{F}_{V}^{(k)}\) denote the class of all functions mapping \(V\) to \(\mathbb{R}^{k}\). Let \(\mathcal{F}_{\mathrm{emb}}\subset \mathcal{F}_{V}^{(k)}\) denote the hypothesis class of models \(h_\theta : V \to \mathbb{R}^k\) which we assume contains the ground-truth embedding model of the learning task. Contrastive learning defines two distributions of pairs of elements in \(V\): a positive pair distribution \(D_+ \in \Delta(V \times V)\) and a negative pair distribution \(D_- \in \Delta(V \times V)\). Given i.i.d. samples from both distributions, the trained model is encouraged to embed two elements sampled from a positive pair \((x,y) \sim D_+\) close together in Euclidean space, while embedding two elements sampled from a negative pair \((x,x') \sim D_-\) far apart in Euclidean space. These two distributions of pairs of elements are used to define a contrastive loss, and training the model amounts to minimizing an empirical estimate of the contrastive loss from finite samples.

Let the domain \(V\) consist of \(N \in \mathbb{N}\) elements, where \(N\) is large but finite. We will identify \(V\) with \([N]\) here for simplicity. Define \(\mu \in \Delta([N])\) as the base distribution and \(Q \in \mathbb{R}^{N \times N}\) as an augmentation scheme. Overloading notation, we can alternatively view \(Q : [N] \to \Delta(N)\) as a mapping from an element \(x\) to a distribution \(Q(x)\) over augmentations of \(x\). For every \(x \in [N]\), \(Q(x)\), equals the \(x\)-th row of the matrix-representation of \(Q\). For \(h_\theta : V \to \mathbb{R}^k\), define the population contrastive loss \(\mathcal{L}_{\mathrm{cont}}: \mathcal{F}_{V}^{(k)} \to \mathbb{R}\) as

\[\begin{align} \mathcal{L}_{\mathrm{cont}}(h_\theta) := \mathbb{E}_{(x, x^-) \sim D_-} (h_\theta(x)^\top h_\theta(x^-))^2 - 2 \cdot \mathbb{E}_{(x, x^+)\sim D_+}h_\theta(x)^\top h_\theta(x^+)\label{eq:pop-cont-loss} \end{align}\tag{2}\]

Positive pairs \((x, x^+)\sim D_+\) are sampled by first sampling an element from the base distribution, \(z \sim \mu\) and then sampling the pair elements as independent augmentations \(x \sim Q(z)\), \(x^+\sim Q(z)\), returning \((x,x^+)\). Negative pairs \((x,x^-) \sim D_-\) are sampled by first sampling \(z, z^- \sim \mu\) independently and then sampling \(x \sim Q(z), x^- \sim Q(z^-)\), returning \((x,x^-)\).

For a dataset \(\{ \overline{x}_i\}_{i \in [n]} \subset V\), define the empirical contrastive loss \(\hat{\mathcal{L}}_{\mathrm{cont}, n}: \mathcal{F}_{V}^{(k)} \to \mathbb{R}\) as:

\[\begin{align} &\hat{\mathcal{L}}_{\mathrm{cont}, n}(h_{\theta'}) :=\\ &-\frac{2}{n} \sum_{i \in [n]} \mathbb{E}_{\substack{x \sim Q(\cdot | \overline{x}_i),\\ x^+ \sim Q(\cdot | \overline{x}_i)}} (h_{\theta'}(x)^\top h_{\theta'}(x^+)) + \frac{1}{n(n - 1)} \sum_{i,j \in [n], i \neq j}\mathbb{E}_{\substack{x \sim Q(\cdot | \overline{x}_i),\\ x^- \sim Q(\cdot | \overline{x}_j)}} (h_{\theta'}(x)^\top h_{\theta'}(x^-))^2\label{eq:emp-cont-loss-defn} \end{align}\tag{3}\]

Claim D.2 of [30] shows that \(\mathbb{E}_{\{ \overline{x}_i\}_{i \in [n]} \sim \mu} \hat{\mathcal{L}}_{\mathrm{cont}, n}(h_{\theta}) = \mathcal{L}_{\mathrm{cont}}(h_\theta)\), i.e. that \(\hat{\mathcal{L}}_{\mathrm{cont}, n}\) is unbiased. Define the empirical risk minimizer (ERM) as follows.

definitionermdefn

The empirical risk minimizer (ERM) is any embedding function of \(h_\theta \in \mathcal{F}_{\mathrm{emb}}\) that minimizes \(\hat{\mathcal{L}}_{\mathrm{cont}, n}\) over \(\mathcal{F}_{\mathrm{emb}}\). \[\begin{align} h_\theta \leftarrow \arg \min_{h_{\theta'} \in \mathcal{F}_{\mathrm{emb}}} \hat{\mathcal{L}}_{\mathrm{cont}, n}(h_{\theta'}) \end{align}\] For \(\epsilon> 0\), an \(\epsilon\)-minimizer of \(\hat{\mathcal{L}}_{\mathrm{cont}, n}\) is any embedding function of \(h_\theta \in \mathcal{F}_{\mathrm{emb}}\) where: \[\begin{align} \hat{\mathcal{L}}_{\mathrm{cont}, n}(h_\theta) \leq \min_{h_{\theta'} \in \mathcal{F}_{\mathrm{emb}}} \hat{\mathcal{L}}_{\mathrm{cont}, n}(h_{\theta'}) + \epsilon \end{align}\]

We will also call an \(\epsilon\)-minimizer of \(\hat{\mathcal{L}}_{\mathrm{cont}, n}\) an \(\epsilon\)-ERM.

8 in 8 is an algorithm that learns an embedding model using empirical risk minimization, given i.i.d. sample access to base distribution \(D \in \Delta(V)\) and augmentation function \(Q : V \to \Delta(V)\). To quantify the statistical generalization properties of the ERM, we introduce the following notion of Rademacher complexity.

definitionraddefn The Rademacher complexity of function class \(\mathcal{F}\) of models \(\mathcal{F}\ni h: V \to \mathbb{R}^k\) on \(n\) datapoints is: \[\begin{align} \hat{\mathcal{R}}_n(\mathcal{F}) := \max_{x_1, \ldots x_n \in V} \mathbb{E}_{\sigma \in \{ \pm 1\}^n} \sup_{h \in \mathcal{F}, i \in [k]} \frac{1}{n} (\sum_{j \in [n]} \sigma_j h_i(x_j)) \end{align}\]

4 Framework and Random-Exploration Baseline↩︎

4.1 Primitive Assumptions↩︎

With \(t \in \mathbb{N}\) denoting the iteration index, the primary goal of the training algorithm is to produce a prover \(f\) which can prove as many theorems as possible. One way a training algorithm can achieve this is by producing a sequence of provers \(\{ f_t\}_{t \in \mathbb{N}}\) where the prover \(f_{t + 1}\) can prove more theorems than prover \(f_t\) for every \(t \in \mathbb{N}\). The following assumptions define a set of core primitives for designing such a training algorithm.

1 assumes i.i.d. sample access to an initial training distribution \(D_0\) of theorems where for every theorem \(x\) in the support of \(D_0\), the proof of \(x\) is known. This means that we have efficient access to a proof of \(x\), either because it is recorded explicitly in some database of (theorem, proof) pairs, or because we have access to a prover \(f\) where \(\operatorname{succ}(x,f) \geq \Omega(1)\). The latter condition means that given \(x\) and \(f\), the proof of \(x\) can be efficiently sampled in \(O(1)\) calls to \(f\), with high probability.

Assumption 1. (Cold-Start Dataset)We are given access to an oracle that provides i.i.d. samples from \(D_0 \in \Delta(V)\) where the proof of every theorem \(x \in \operatorname{supp}(D_0)\) is known.

An example of \(D_0\) would be a distribution of elementary-school-level math problems.

2 describes the ability of a model, trained on a distribution \(D\) of theorems via i.i.d. samples, to generalize in-domain to \(D\). We justify it with statistical learning theory in 10.

Assumption 2. (Training)Let \(p \in (0,1), p = \Theta(1)\) be a universal constant. Let \(D \in \Delta(V)\) be a distribution of theorems where \(\forall x \in \operatorname{supp}(D)\), the proof of \(x\) is known. Then, \(\forall \, \epsilon,\delta \in (0,1)\), with \(n = \Theta(\frac{\mathcal{C}(\mathcal{F}_{\mathrm{prover}})\log \frac{1}{\delta}}{\epsilon^2 (1 - p)^2})\) where \(\mathcal{C}(\mathcal{F}_{\mathrm{prover}})\) is an \(\mathcal{F}_{\mathrm{prover}}\)-dependent constant, we can train a prover \(f\) using \(n\) i.i.d. samples from \(D\) such that with probability at least \(1 - \delta\), we have that \(f\) satisfies:

\[\begin{align} \mathbb{P}_{x \sim D} [\operatorname{succ}(x, f) \geq p] \geq 1- \epsilon \end{align}\]

The requirement of 2 that the proof of every theorem in \(\operatorname{supp}(D)\) is known can also be thought of as requiring a training distribution of (theorem, proof) pairs, where every theorem in the support of the training distribution must have a correct proof associated with it. This requirement is necessary, as otherwise it would be possible to train a model to have high success rate on arbitrarily hard theorems for which we do not know the proof.

Let \(G = (V,E)\) be the theorem graph. 3 says that the edge set \(E\) is where the success rate of any prover in \(\mathcal{F}_{\mathrm{prover}}\) is not too different between two theorems connected by an edge.

Assumption 3. (Continuity of Success Rate)With \(p \in (0,1)\) defined as in 2, assume for all \(f \in \mathcal{F}_{\mathrm{prover}}\), for all \((x,y) \in E\), that \(|\operatorname{succ}(x, f) - \operatorname{succ}(y, f)| \leq \frac{p}{2}\)

In 4, we assume access to a neighbor oracle \(N\) as a primitive.

Assumption 4. (Neighbor Access)For any \(x \in V,\) let \(N(x) := \{ y \in V : (x,y) \in E\}\). We assume oracle access to a neighbor oracle \(N : V \to 2^V\), which on input of any \(x \in V\), returns \(N(x)\).

Assumptions 24 enable a training algorithm to run the following at each iteration. First, expand the current set of known theorems by one step via the neighbor oracle \(N\) (4). Second, 3 ensures that unseen theorems have success rate at least \(p/2\) under the current prover, enabling the proofs of the unseen theorems to be efficiently sampled. In general, note that if we have access to a prover \(f\) whose success rate on theorem \(x\) is reasonably high (\(\geq p/2\), where \(p \geq \Omega(1)\) by 2), then the proof of \(x\) can be efficiently sampled and become known. Finally, a new prover is trained on the expanded set of theorems via 2. 3 is necessary to our analysis because standard statistical learning theory arguments rely on exchangeability between training and test distributions and therefore do not by themselves justify this out-of-distribution step.

We do not require the edge set \(E\) to have an interpretable definition. We only require \(E\) to satisfy 3 and 4. One example instantiation of the theorem graph is where \(V\) is the set of theorems corresponding to discrete logarithm instances in a fixed cyclic group. Fix a cyclic group \(\mathbb{G}\) of prime order \(q\) with generator \(g \in \mathbb{G}\). For each \(a\in \mathbb{Z}_q\), let \(h_a=g^a\), and let \(x_a\in V\) denote the theorem: \[\text{``Given cyclic group \mathbb{G} of prime order q, and given g, g^{-1}, h_a \in \mathbb{G},\text{ there exists } z\in \mathbb{Z}_q \text{ such that } g^z=h_a.''}\] The proof of \(x_a\) is the unique exponent \(f_*(x_a)=a\). Define the edge set \(E\) by \((x_a,x_b)\in E \iff b-a\in\{-1,+1\}\pmod q .\) Thus, the theorem graph is a cycle over the discrete logarithm instances. This edge set satisfies 4, since given the theorem \(x_a=(\mathbb{G},g, g^{-1},h_a)\), the neighbor oracle can compute \(N(x_a)=\{x_{a+1},x_{a-1}\}\), where \(x_{a+1}\) has target \(h_a g=g^{a+1}\), and \(x_{a-1}\) has target \(h_a g^{-1}=g^{a-1}\). Finally, 3 amounts to the property that adjacent discrete-log instances have similar success rates for the prover class: \((x_a,x_{a + 1})\in E \implies \forall f\in\mathcal{F}_{\mathrm{prover}}, |\operatorname{succ}(x_a,f)-\operatorname{succ}(x_{a + 1},f)|\leq \frac{p}{2} .\) This property is conceivable for some prover classes since \(x_a\) and \(x_{a+1}\) are not substantially different: given \(g\) and its inverse \(g^{-1}\), an instance with target \(h_{a+1}\) can be reduced to the adjacent instance with target \(h_a\) by multiplying by \(g^{-1}\), i.e. \(h_{a+1}g^{-1}=g^{a+1}g^{-1}=g^a=h_a.\) Thus, any prover that can prove \(h_a\) can prove \(h_{a+1}\) by first reducing \(h_{a+1}\) to \(h_a\), running the original prover, and then adding \(1\) to the resulting exponent. For model classes \(\mathcal{F}_{\mathrm{prover}}\) that can exploit such reductions, it is conceivable that neighboring instances \(x_a\) and \(x_{a\pm 1}\) have similar success rates.

4.2 Random-Walk Conjecturing Algorithm↩︎

4.2.0.1 Conjecturer.

In STP [1], the conjecturer is a mapping that takes as input a theorem \(x\), its proof \(f_*(x)\), a lemma \(l\) used in \(f_*(x)\), and a system prompt; it returns a theorem \(c\) related to \(x\). We study a simplification where the conjecturer maps a theorem to a distribution of theorems.

Definition 1. (Conjecturer) For graph \(G = (V,E)\), a conjecturer is a mapping \(C : V \to \Delta(V)\). Given i.i.d. sample access to input distribution \(D \in \Delta(V)\), the conjecturer returns i.i.d. sample access to \(D' = C \# D \in \Delta(V)\).

A reversible conjecturer is a special type of conjecturer, specified by a set of symmetric, non-negative edge weights \(w : E \to \mathbb{R}_+\), where \(\forall x,y \in V, w(x,y) = w(y,x) \geq 0\). Denote \(P_w \in [0,1]^{|V| \times |V|}\) as the matrix representation of \(w\), defined as: \(\forall x, y \in V, P_w[x,y] = \frac{w(x,y)}{\sum_{z \in N(x)} w(x,z)}\). Denote \(C_w: V \to \Delta(V)\) as the sampler representation of \(w\), defined as: \(\forall x \in V, C_w(x) = P_w[x]\). Note that the transition matrix \(P_w\) defines a nearest-neighbor-type reversible random walk over state-set \(V\), with stationary measure \(\pi_w : V \to (0,\infty)\), where \(\forall x \in V, \pi_w(x) \propto \sum_{z \in N(x)} w(x,z) =: w(x)\).

These three representations \(C_w, P_w, w\) are equivalent and uniquely determined given any of the other. Sometimes we will write the tuple \((C_w, P_w, w)\), where \(C_w\) and \(P_w\) are defined in terms of \(w\) as above. When the context requires just \(C_w\), we will identify \(C_w\) with the conjecturer.

For instance, when \(\forall x \in V, z \in N(x), w(x,z) = 1\) and for \(z \notin N(x), w(x,z) = 0\), then \(C_w(x) = \mathrm{Unif}(N(x))\), so that \((C_w, P_w, w)\) defines a simple random walk over \(G\), with \(\pi_w(x) \propto \deg(x)\).

4.2.0.2 Prover-Conjecturer System.

This section provides sufficient conditions for a prover-conjecturer system (2) to learn to prove more theorems across iterations. [thm:main] assumes the conjecturer \((C_w, P_w, w)\), defining Markov chain \((V, P_w)\), satisfies a connectivity assumption.

Assumption 5. Let \(G = (V, E)\) be a connected graph where the number of vertices is countably infinite (\(|V| = \infty\)) and each vertex has finite degree. Assume that the Markov chain \((V,P)\) for \(G\) satisfies the strong isoperimetric inequality, \(\mathrm{IS}\), defined in [defn:IS].

At iteration \(t\in \mathbb{N}\), the prover-conjecturer system (2), initialized with conjecturer \((C_w, P_w, w)\), has i.i.d. sample access to \(D_t \in \Delta(V)\), a training distribution over theorems whose proofs are known. It trains prover \(f_t \in \mathcal{F}_{\mathrm{prover}}\) on \(D_t\) via 2. Finally, it constructs i.i.d. sample access to a new distribution over theorems, \(D_{t + 1} \in \Delta(V)\) using 3. Given \(D_t\), 3 applies the conjecturer \(C_w\) to \(D_t\), yielding \(C_w \# D_t\). Theorems with low pass rate under \(f_t\) are filtered out, yielding \(D_{t + 1}\).

2 uses 3 as a subroutine to construct \(D_{t + 1}\) from \(D_t\). 4 is a practical approximation to 3, and it can be substituted in for 3 in 2. In 4, for a sufficiently large rollout-budget \(m \geq \Theta(\frac{1}{p^2}\log\frac{1}{\delta_{\mathrm{samp}}})\), by standard concentration inequalities [34], [35], we have that \(\forall x \in V\), with probability at least \(1 - \delta_{\mathrm{samp}}\), \(|\frac{1}{m} \sum_{i \in [m]} \mathbf{1}[\mathrm{Ver}(x, \pi_i) = 1] - \operatorname{succ}(x,f) | < p/2\). Thus, with high probability, if \(\operatorname{succ}(x,f) \geq p/2\), then \(\frac{1}{m} \sum_{i \in [m]} \mathbf{1}[\mathrm{Ver}(x, \pi_i) = 1] > 0\), so that at least one empirically-sampled proof \(\pi\) of theorem \(x\) is correct.

Figure 2: Prover-Conjecturer System
Figure 3: Pass-Rate-Oracle-Based Sampler
Figure 4: Empirical-Pass-Rate-Based Sampler

Due to the push-forward construction of \(D_{t + 1}\) from \(D_t\) in 2 for every \(t \in \mathbb{N}\), sampling from \(D_t\) requires first sampling \(x_0 \sim D_0\), then applying \(t\) push-forward transformations to yield \(x_i \sim D_j\), for all \(j \in [t]\). In particular, first draw a large number \(N_0\) of i.i.d. samples \(x_0^{(i)} \sim D_0\), \(i \in [N_0]\). At every iteration \(j \in \{ 0\} \cup [t]\), suppose inductively that there are \(N_j\) remaining unused i.i.d. samples from \(D_j\). Use \(\Theta(\frac{\mathcal{C}(\mathcal{F}_{\mathrm{prover}})\log \frac{1}{\delta}}{\epsilon^2 (1 - p)^2})\) of the \(N_j\) samples to train prover \(f_j\) via 2. Of the unused samples, apply the conjecturer to map \(x_j^{(i)}\) to \(y_j^{(i)} \sim C_w(x_j^{(i)})\). Discard \(y_j^{(i)}\) if \(\operatorname{succ}(y_j^{(i)}, f_j) < p/2\), else let \(x_{j + 1}^{(i)} := y_j^{(i)}\). Let \(N_{j + 1}\) denote the number of remaining samples. Note that if prover \(f_j\) is successfully trained according to 2 to where \(\mathbb{P}_{x \sim D_j}[\operatorname{succ}(x,f_j) \geq p] \geq 1 - \epsilon\), then by 3, \(\mathbb{P}_{x \sim D_j, x' \sim C_w(x)}[\operatorname{succ}(x',f_j) \geq p/2] \geq 1 - \epsilon\), so that by standard concentration inequalities, \(N_{j + 1} \gtrapprox (1 - \epsilon)N_j\). In the worst case, we have that \(\forall j \in [t], N_j \approx N_0 (1 - \epsilon)^j\), so that the number of oracle calls to \(D_0\) required to sample from \(D_j\) grows as \((\frac{1}{1 - \epsilon})^j\).

4.3 Expansion Guarantee for 2.↩︎

[thm:main] shows that on an infinite graph, with a reversible conjecturer (1) that induces a random walk that satisfies the Strong Isoperimetric Inequality (5), and for training error threshold \(\epsilon< \frac{1}{2\kappa^2}\), 2 generates a sequence of provers \(\{ f_t\}_{t \in \mathbb{N}}\) such that \(\forall t \in \mathbb{N},\) the size of the \(t\)-th prover’s knowledge set \(| \{ x \in V : \operatorname{succ}(x, f_t) \geq p\} |\) is exponential in \(t\).

theoremexpansionthm

Let \(G = (V,E)\) be a theorem graph with \(|V| = \infty\) and \((C_w,P_w, w)\) be a reversible conjecturer as in 1. Suppose \((V, P_w)\) satisfies Assumption 5 with Isoperimetric constant \(\kappa > 0\). Let \(\pi : V \to (0, \infty)\) be an invariant measure of \((V,P_w)\). Suppose Assumptions 1-4 hold, with universal constant \(p \in (0,1)\) as in 2, and that \(\pi\) is chosen so that \(\sup_{z \in V} \pi(z) < \infty\) and \(0 < ||D_0||_{\ell^2(1/\pi)}^2 < \infty\). For any \(\delta , \epsilon\in (0,1)\), 2 produces a sequence of provers \(\{ f_t\}_{t \in \mathbb{N}}\) where \(\forall t \in \mathbb{N}\), with probability at least \(1 - (t + 1)\, \delta\),

\[\begin{align} | \{ x \in V : \operatorname{succ}(x, f_t) \geq p\} | \geq \frac{(1 - \epsilon)^2}{(\sup_{z \in V} \pi(z)) \cdot ||D_0||_{\ell^2(1/\pi)}^2 } \cdot (\frac{1 - \epsilon}{1 - \frac{1}{2\kappa^2}})^{2t} \end{align}\]

To prove [thm:main], we show that for every \(t \in \mathbb{N}\), \(||D_{t + 1}||_{\ell^2(1/\pi)}^2 \leq (\frac{||P_w^\top||_{\ell^2(1/\pi) \to \ell^2(1/\pi)}}{1 - \epsilon})^2\cdot\) \(||D_{t}||^2_{\ell^2(1/\pi)}\), where \(||P_w^\top||_{\ell^2(1/\pi) \to \ell^2(1/\pi)}\) is the operator norm of \(P_w^\top\) in the Hilbert space \(\ell^2(1/\pi)\). By 1, since \((V,P_w)\) satisfies 5, then \(||P_w^\top||_{\ell^2(1/\pi) \to \ell^2(1/\pi)}\leq 1 - \frac{1}{2\kappa^2}\). Finally, [thm:main] follows from 14, which lower bounds \(| \{ x \in V : \operatorname{succ}(x, f_t) \geq p\} |\) using \(\frac{1}{||D_{t}||^2_{\ell^2(1/\pi)}}\). The full proof is in 7.

Thus, if the simple random walk \(P_{\mathrm{s.r.w.}}\) over the theorem graph satisfies \(\mathrm{IS}\) (i.e. for any finite \(A \subset V, \frac{|\{ (e^-, e^+) \in E \;:\; e^- \in A, \;e^+ \notin A\}|}{\sum_{x \in A} \deg(x)} \geq \frac{1}{\kappa}\)), then 2 with a conjecturer, whose transition matrix is \(P_{\mathrm{s.r.w.}}\), generates a sequence of provers \(\{ f_t\}_{t \in \mathbb{N}}\) whose knowledge set grows exponentially.

5 Diversity Measure and an Improved Conjecturing Algorithm↩︎

5.1 Diversity Measure↩︎

Unlike 4, suppose for simplicity the theorem graph has a finite but large number of nodes and \(||\pi||_1 = 1\). 2 The following ideas can be instantiated with any \(\tau \in \mathbb{N}\), but practically \(\tau\) should be a small non-zero natural number. The main object of interest in this section is the \(\tau\)-expanded knowledge set of a prover \(f\).

Definition 2. With universal \(p \in (0,1)\) in 2, for any \(\tau \in \mathbb{N}\), \(f \in \mathcal{F}_{\mathrm{prover}}\), let \(K^p_\tau(f) := B(\{ x \in V : \operatorname{succ}(x,f) \geq p\}, \tau)\) \(=\{ x' \in V : \exists x \in V : \operatorname{succ}(x,f) \geq p \mathrm{ and } \mathrm{dist}(x,x') \leq \tau\}\). We call \(K^p(f) := K_0^p(f)\) the knowledge set of \(f\) and \(K^p_\tau(f)\) the \(\tau\)-expanded knowledge set.

We define an operational notion of diversity of \(f\)’s knowledge as the size of \(K^p_\tau(f)\). \(K^p_\tau(f)\) can be interpreted as the set of theorems that \(f\) can prove by performing \(\tau\) steps of “reasoning" at inference time to reduce the input theorem into one it knows how to prove. 1 depicts two provers \(f_1\), \(f_2\) whose knowledge sets are the same size \(|K^p(f_1)| = |K^p(f_2)|\), but where their \(\tau\)-step expansions are of different sizes: \(|K^p_\tau(f_1)| \ll |K^p_\tau(f_2)|\). Thus, \(f_2\)’s knowledge is more diverse than \(f_1\)’s. Identifying diversity with \(|K^p_\tau(f)|\) reflects the intuition that knowing a diverse set of proof ideas is useful to a prover \(f\) as it increases the set of theorems that \(f\) can prove by combining known proof ideas.

Let \((C_w, P_w, w)\) be a baseline conjecturer satisfying 1 and for convenience denote \(P:= P_w\). Our goal is to design an improved conjecturer that generates a sequence of training distributions \(\{ D_t\}_{t \in \mathbb{N}}\) where at each \(t \in \mathbb{N}\) prover \(f_t\) is trained on \(D_t\), and where \(|K^p_\tau(f_t)|\) increases quickly with \(t\). In fact, [lem:divt-kct-connection] (proved in 11) shows that for each \(t\in \mathbb{N}\) it is reasonable to maximize \(\mathrm{Div}^P_\tau(D_t)\) ([defn:diversity-measure]), a diversity measure of the training distribution \(D_t\).

definitiondivmeasure Let \(G = (V,E)\) be a theorem graph with \(P\) being the transition matrix of any reversible, nearest-neighbor-type random walk with stationary measure \(\pi\). For any parameter \(\tau \in \mathbb{N}\), and any \(\mu \in \Delta(V)\), define:

\[\begin{align} \mathrm{Div}^P_\tau(\mu) := \frac{1}{||\mu^\top P^\tau||^2_{\ell^2(1/\pi)}} = \frac{1}{\sum_{x \in V }(\mu^\top P^\tau e_x)^2 \frac{1}{\pi(x)} } \end{align}\]

lemmadivtkct Let \(p \in [0,1]\) be a universal constant in 2. Instantiate \(\mathrm{Div}^P_\tau: \Delta(V) \to \mathbb{R}\) with the transition matrix \(P\) of any reversible, nearest-neighbor-type random walk. For any \(\tau \in \mathbb{N}\), any prover \(f \in \mathcal{F}_{\mathrm{prover}}\), and any theorem distribution \(D \in \Delta(V)\), the \(\tau\)-expanded knowledge set of \(f\) satisfies:

\[\begin{align} |K^p_\tau(f)| \geq \frac{(\mathbb{P}_{x \sim D}[\operatorname{succ}(x,f) \geq p])^2}{\sup_{x \in V} \pi(x)} \mathrm{Div}^P_\tau(D) \end{align}\]

If prover \(f\) is successfully trained on theorem distribution \(D\) via 2, then \(\mathbb{P}_{x \sim D}[\operatorname{succ}(x,f) \geq p] \geq 1 - \epsilon\). By [lem:divt-kct-connection], \(|K_\tau^p(f)| \geq \frac{(1 - \epsilon)^2}{\sup_{x \in V}\pi(x)} \mathrm{Div}^P_\tau(D)\), so maximizing \(\mathrm{Div}^P_\tau(D)\) of the training distribution is a reasonable proxy for maximizing \(|K_\tau^p(f)|\).

We note that in the setting of 4, where 5 holds for random walk \((V,P)\), then maximizing \(|B(K^p(f), \tau)|\) reduces to maximizing \(|K^p(f)|\). When \(P = P_{\mathrm{s.r.w.}}\), then 5 implies for bounded-degree graphs that there is a reasonable constant \(c\) where for any finite \(A \subset V, |B(A, \tau)| \geq \exp(c\,\tau) |A|\). That is, any finite subset of theorems is diverse. More generally, if 5 holds for \(P\) (not necessarily \(P_{\mathrm{s.r.w.}}\)), then for \(\{ D_t\}_{t \in \mathbb{N}}\) generated as \(D_{t + 1}^\top = D_t^\top P\), we have \(\mathrm{Div}^P_\tau(D_t) = \frac{1}{||D_{t + \tau}||^2_{\ell^2(1/\pi)}}\), where \(\pi^\top P = \pi^\top\). Because the proof of [thm:main] implies fast exponential decay of \(||D_{t}||^2_{\ell^2(1/\pi)}\) as a function of \(t \in \mathbb{N}\) for every \(t\), it follows that \(\mathrm{Div}^P_\tau(D_t)\) grows exponentially for each \(t\). In short, when 5 holds, then the two objectives \(|K^p(f)|\) and \(|K^p_\tau(f)|\) are aligned. As such, the more interesting setting for studying diversity is when 5 does not hold for the baseline random walk \(P\). When \(P=P_{\mathrm{s.r.w.}}\), some intuitive graphs where 5 does not hold are graphs consisting of multiple poorly-interconnected clusters, such as that depicted in 1 or 10. For a graph like in 1, the choice of which nodes to include in \(K^p(f)\) will greatly impact \(K^p_\tau(f)\), making the problem of maximizing both \(K^p(f)\) and \(K^p_\tau(f)\) non-trivial.

5.2 Improved Conjecturing Algorithm↩︎

5 is a conjecturer that generates a sequence of training distributions \(\{ D_t\}_{t \in \mathbb{N}}\), with the aim to maximize \(\mathrm{Div}^P_\tau(D_t)\) at each \(t \in \mathbb{N}\), for a chosen hyper-parameter \(\tau \in \mathbb{N}\). This maximization cannot easily be done in closed form, as the conjecturer is restricted to generate \(D_{t + 1}\) from \(D_t\) by one step of a nearest-neighbor-type random walk. Instead, fixing \(\tau \in \mathbb{N}\), 5 defines a push-forward map \(C : V \to \Delta(V)\) where for any \(x \in V\), \(C(x) \in \Delta(N(x))\) is supported on neighbors \(N(x)\) of \(x\). The weighting of \(C(x)\) is determined by maximizing \(\mathrm{Div}^P_\tau(C(x))\).

\[\begin{align} \forall x \in V, \, C(x) &\leftarrow \arg\max_{\mu \in \Delta(N(x))} \mathrm{Div}^P_\tau(\mu) = \arg\min_{\mu \in \Delta(N(x))} \mu^\top P^\tau \mathrm{diag}(1/\pi) (P^\tau)^\top \mu \label{eq:optim-problem-diversity} \end{align}\tag{4}\]

Where \(\forall z \in V, \mathrm{diag}(1/\pi)[z,z] = \frac{1}{\pi(z)}\). This optimization problem can be solved given the matrix, \(M(x, \tau) \in \mathbb{R}^{|N(x)| \times |N(x)|}\) where for any \(y,y' \in N(x)\), the \((y,y')\)-th entry is: \(M(x, \tau) [y,y'] := e_y^\top P^\tau \mathrm{diag}(1/\pi) (P^\tau)^\top e_{y'}\). We can characterize \(M(x, \tau)\) in terms of diffusion embeddings of the neighbors of \(x\), where a diffusion embedding embeds any node \(z \in V\) to a vector \(p^\tau(z)\) representing the probability distribution of a \(\tau\)-step random walk started at \(z\) according to transition matrix \(P\).

Definition 3. Let \(G = (V,E)\) be a connected, undirected graph, with \(P\) being the transition matrix of a reversible random walk over \(V\), with stationary measure \(\pi\). For all \(\tau \in \mathbb{N}, \forall x \in V\), define \(p^\tau(x)\) as the scale-\(\tau\) diffusion embedding of \(x\) where:

\[\begin{align} p^\tau (x) &:= (P^\tau)^\top e_x \in [0,1]^{|V|}\\ \forall z \in V, \, p^\tau (x,z) &:= e_z^\top(P^\tau)^\top e_x \in [0,1] \end{align}\] For every \(x, y \in V\), define the scale-\(\tau\) diffusion similarity as

\[\begin{align} \phi^{\mathrm{diff}}_\tau(x,y) := \langle p^{\tau}(x), p^{\tau}(y) \rangle_{\ell^2(1/\pi)} := \sum_{z \in V} p^{\tau}(x, z) \, p^{\tau}(y,z) \, \frac{1}{\pi(z)} \end{align}\]

and the scale-\(\tau\) diffusion distance [29], [36] as

\[\begin{align} \rho^{\mathrm{diff}}_\tau(x,y) := || p^{\tau}(x) - p^{\tau}(y) ||_{\ell^2(1/\pi)} := \sqrt{\sum_{z \in V} (p^{\tau}(x,z) - p^{\tau}(y,z) )^2 \frac{1}{\pi(z)}} \end{align}\]

For any \(y,y' \in N(x)\), the \((y,y')\)-th entry of \(M(x, \tau)\) is \(\phi^{\mathrm{diff}}_\tau(y,y')\). Note that the diffusion similarity requires computing \(\frac{1}{\pi(z)}\) for relevant \(z \in V\), but the stationary measure \(\pi(z)\) need only be computed up to a normalizing constant for the optimization problem in 4 . For a conjecturer \((C,P,w )\) satisfying 1, \(\forall z \in V, \pi(z) \propto w(z)\). Let \(M'(x, \tau) = P^\tau \mathrm{diag}(1/w) (P^\tau)^\top\) and \(\forall z \in V\), \(\mathrm{diag}(1/w)[z,z] = \frac{1}{w(z)}\). With regularization strength \(\eta \in [0,0.5]\), \(\forall x \in V\), 5 computes:

\[\begin{align} C(x) &\leftarrow \arg\max_{\substack{ \mu \in \Delta(N(x))\\ \mu(y) \geq \eta/\deg(x),\;\forall y \in N(x) }} \mathrm{Div}^P_\tau(\mu) = \arg\min_{\substack{ \mu \in \Delta(N(x))\\ \mu(y) \geq \eta/\deg(x),\;\forall y \in N(x) }} \mu^\top M'(x, \tau) \mu \label{eq:diff-sim-optim} \end{align}\tag{5}\]

This mapping \(C : V \to \Delta(V)\) defined in 5 can be substituted in for \(C_w\) in line 4 of 3, called in line 4 of the prover-conjecturer system (2). If \(G\) is finite, connected, undirected, and non-bipartite, the regularization with \(\eta > 0\) ensures (via 15) the random walk induced by \(C\) converges to a stationary measure, eventually exploring the entire graph. Note that 5 uses 6 to compute diffusion embeddings.

Figure 5: Improved Conjecturer
Figure 6: Dynamic Program for p^\tau(x)

As a concrete guarantee, [prop:e2e-guarantee-alg2] shows that 5 provably explores the theorem graph \(G\) faster than a simple random walk when \(G\) is in a special class of clustered graphs.

definitioncliquegraph (Clique-Graph) Let parameters \(M\) be the clique size, \(r\) be the meta-graph degree, and \(K\) be the number of cliques. Let \(Q=([K],E(Q))\) be a finite connected, undirected, \(r\)-regular graph. For \(i \in [K]\), denote \(N_Q(i) \subset [K]\) as the neighbors of \(i\) in \(Q\). Suppose there exists \(c \in [r]\) where for every \(i\in[K]\) and every two distinct neighbors \(j,k\in N_Q(i)\), \(|N_Q(j)\cap N_Q(k)| = c\). For clique size \(M\ge 2\), define the graph \(G=G(Q,M)\) by \(V=[K]\times [M]\), where each \(C_i:=\{i\}\times [M]\) is a clique of size \(M\). For every meta-edge \(ij\in E(Q)\) and \(a\in[M]\), add the inter-clique edge \((i,a)\sim (j,a).\)

In the regime where the clique size \(M\) is much larger than the inter-cluster connectivity (\(M \gg r^2\)), 5 improves over the baseline simple-random-walk-based conjecturing algorithm in that: both conjecturers define a random walk over the meta-graph, but that of 5 has a larger spectral gap [37]. The source of the improvement is that 5 up-weights the probability of making inter-cluster transitions, compared to the simple random walk. This becomes useful when the cluster size \(M\) is large, in which case the simple random walk can become stuck in a cluster for a large number of steps.

propositioneteguaranteealg (End-to-End Guarantee of 5) Let \(Q = ([K], E(Q))\) be a finite connected, undirected, \(r\)-regular graph. Let \(G = G(Q, M)\) be a Clique-Graph satisfying [defn:clique-graph] with meta-graph \(Q\). Suppose \(M \geq r + 3\). Let \(P_Q\) denote the simple random walk over \(Q\). 5, with parameters \(\tau = 1, \eta = 0\), defines a random walk over the meta-graph \(Q\) with transition matrix \(P_{\mathrm{improved}}^{(Q)} = (\frac{1}{r + 1} + O(\frac{1}{M})) I + (\frac{r}{r + 1} + O(\frac{1}{M})) P_Q\). The simple random walk over \(G\) defines a random walk over the meta-graph \(Q\) with transition matrix \(P_{\mathrm{baseline}}^{(Q)} = \frac{M - 1}{M - 1 + r} I + \frac{r}{M - 1 + r} P_Q\). Define the spectral gap of transition matrix \(P\) as \(\gamma(P) := 1 - \max(\lambda_2(P), |\lambda_K(P)|)\). Then, there exists a universal constant \(c > 0\) such that

\[\begin{align} \gamma( P_{\mathrm{improved}}^{(Q)}) \geq c\, \frac{M}{r^2} \,\gamma(P_{\mathrm{baseline}}^{(Q)}) \end{align}\]

In particular, for \(M \gg \max(\frac{r^2}{c}, r + 3)\), we have \(\gamma( P_{\mathrm{improved}}^{(Q)}) \gg \gamma(P_{\mathrm{baseline}}^{(Q)})\).

As a consequence, suppose \(D_0 \in \Delta([K] \times [M])\) is uniform on a starting clique \(\{ i \} \times [M]\). For all \(t \in \mathbb{N}\), let \(D_t^{\mathrm{improved}}\) be the result of applying the random walk defined in 5 for \(t\) steps on \(D_0\), and \(D_t^{\mathrm{baseline}}\) the result of applying a simple random walk over \(G\) for \(t\) steps on \(D_0\). Then, for any \(\epsilon\in (0,1)\), for \(t_{\mathrm{baseline}} := \frac{1}{2\gamma(P_{\mathrm{baseline}}^{(Q)})} \log \frac{K}{\epsilon}\), \(\mathrm{Div}_1^{P_{\mathrm{s.r.w.}}}(D_{t_{\mathrm{baseline}}}^{\mathrm{baseline}}) \geq 1 - \epsilon\), with maximum value \(1\). Whereas, for \(t_{\mathrm{improved}} := \frac{1}{2\gamma(P_{\mathrm{improved}}^{(Q)})} \log \frac{K}{\epsilon} \leq O(\frac{r^2}{M})\, t_{\mathrm{baseline}}\), \(\mathrm{Div}_1^{P_{\mathrm{s.r.w.}}}(D_{t_{\mathrm{improved}}}^{\mathrm{improved}}) \geq 1 - \epsilon\), with maximum value \(1\).

[prop:e2e-guarantee-alg2] shows that the diversity of theorem distributions generated under 5 (resp. a simple-random-walk-based conjecturer) can be guaranteed to exceed \(1 - \epsilon\) in \(t_{\mathrm{improved}}\) steps (resp. \(t_{\mathrm{baseline}}\) steps), and where \(t_{\mathrm{improved}} \leq O(\frac{r^2}{M}) \,t_{\mathrm{baseline}}\). Although this does not prove a matching lower-bound to show separation between 5 and the baseline, we believe the bounds used to derive these results are tight so that in the worst case over all possible meta-graphs instantiating [defn:clique-graph], 5 is \(\Theta(\frac{M}{r^2})\) times more efficient than a simple-random-walk-based conjecturer, which is substantial when the clusters are very dense (\(M \gg r^2\)).

The proof of [prop:e2e-guarantee-alg2] is in 9. We think it is plausible that 5 improves over a baseline simple random walk \(P = P_{\mathrm{s.r.w.}}\) for a broader class of clustered graphs (graphs like those depicted in 10) than [defn:clique-graph], but we do not have a formal guarantee. Our intuition of 5 on clustered graphs is that it defines a random walk that, at node \(x\), has a higher chance to transition to neighbors of \(x\) in a different cluster than \(x\). This lets the random walk escape from its starting cluster faster and should enable it to explore the entire theorem graph faster.

In general, \(\tau\) should not be set too small or too big. If \(\tau =0\), the diffusion embedding is not informative since every node \(x \in V\) is embedded as \(e_x \in \mathbb{R}^{|V|}\). If \(\tau\) is larger than the mixing time of \(P\), then \(\forall x \in V,(P^\top )^\tau e_x \approx \pi\), so the diffusion embedding is also not informative. When the theorem graph is a clustered graph consisting of equally sized clusters, there should exist a natural setting for \(\tau\): the number of steps it takes a random walk to “forget" its exact starting node, where it still”remembers" its starting cluster. More precisely, the ideal property of \(\tau\) on a clustered graph is that for two nodes \(x, y\) in the same cluster, their \(\tau\)-step random walk distributions are approximately the same: \(p^\tau(x) \approx p^\tau(y)\), but for \(x, y\) in different clusters, their \(p^\tau(x)\) and \(p^\tau(y)\) differ greatly. Then, \(p^\tau(x)\) serves as an identifier for which cluster \(x\) is in.

5 accepts as input \(\tau \in \mathbb{N}\) and a baseline reversible conjecturer \((C_w, P_w, w)\), satisfying 1. It returns an improved conjecturer. 5 improves the baseline conjecturer by performing a \(\tau\)-step look-ahead over the graph to maximize diversity. In principle, this algorithmic scaffold can be applied to conjecturers trained empirically, if they satisfy 1. The random walk defined by 5 may not be reversible, so the algorithmic scaffold cannot be recursively applied to its own output.

5.3 Computing Diffusion Similarity via Contrastive Learning↩︎

[thm:contembd] shows the diffusion similarity (used in step 4 of 5) can be computed via learned contrastive embeddings. A self-contained summary of contrastive learning is in 8.

theoremcontembd Let \(G = (V,E)\) be a finite, undirected, connected theorem graph. Let reversible conjecturer \((C, P, w) := (C_w, P_w, w)\) satisfy 1, and let \(\pi\) be a stationary distribution for \(P\). Let \(\mathcal{F}_{\mathrm{emb}}\subset \mathcal{F}_{V}^{(|V|)}\) be a class of functions from \(V\) to \(\mathbb{R}^{|V|}\). For any \(\tau \in \mathbb{N}\), define the scale-\(\tau\) contrastive loss of embedding model \(h_\theta \in \mathcal{F}_{\mathrm{emb}}\) as:

\[\begin{align} \mathcal{L}_{\mathrm{cont}}^\tau(h_\theta) := \mathbb{E}_{(x, x^-) \sim D_-^\tau} (h_\theta(x)^\top h_\theta(x^-))^2 - 2 \cdot \mathbb{E}_{(x, x^+) \sim D_+^\tau}h_\theta(x)^\top h_\theta(x^+) \end{align}\]

where \(D^\tau_+, D^\tau_- \in \Delta(V \times V)\) are distributions of positive and negative pairs: \((a,b) \sim D^\tau_+\) where \(z \sim \pi, a \sim C^\tau (z), b \sim C^\tau (z)\) (\(C^\tau\) denotes applying \(C\) \(\tau\)-times consecutively) and \((a,b) \sim D^\tau_- \mathrm{ where } a \sim \pi, b \sim \pi\). Fix any \(\tau \in \mathbb{N}\). Assume \(\mathcal{F}_{\mathrm{emb}}\) contains a global minimizer of \(\mathcal{L}_{\mathrm{cont}}^\tau\) over \(\mathcal{F}_{V}^{(|V|)}\). For any global minimizer \(\mathcal{F}_{\mathrm{emb}}\ni h_{\theta_*} : V \to \mathbb{R}^{|V|}\), then \(\forall u,v \in V, \langle p^\tau(u), p^\tau(v)\rangle_{\ell^2(1/\pi)} = h_{\theta_*}(u)^\top h_{\theta_*}(v)\).

The proof of [thm:contembd] is in 8.2. [thm:contembd] shows that the diffusion similarity of any two nodes on the graph (a quantity computed in step 3 of 5) can instead be computed from the Euclidean inner product of their learned embeddings. Given \(n\) samples \(\{ x_i\}_{i \in [n]} \subset V\) drawn i.i.d. from the stationary measure \(\pi \in \Delta(V)\) of \(P\), an embedding model \(\mathcal{F}_{\mathrm{emb}}\ni h_{\hat{\theta}} : V \to \mathbb{R}^{|V|}\) can be learned by computing the empirical risk minimizer (ERM, [defn:erm-cont]) of the empirical contrastive loss \(\hat{\mathcal{L}}_{\mathrm{cont}, n}\) in 3 . Under additional assumptions, we show in [thm:e2e-contrastive-learning-result] an end-to-end result where ERM, in a finite-sample regime with small embedding dimension, yields embeddings that can be used to approximate the diffusion similarity.

theoremetecontlearning Let \(G = (V,E)\) be any connected, undirected graph. Let \((V,P)\) be an irreducible, reversible Markov chain with transition matrix \(P \in [0,1]^{|V| \times |V|}\) and stationary distribution \(\pi\in \Delta(V)\).

For any \(\tau \in \mathbb{N}\), instantiate the contrastive loss \(\mathcal{L}_{\mathrm{cont}}\) with base distribution \(\pi\), augmentation function \(P^\tau: V \to \Delta(V)\), which augments \(x \in V\) into a distribution of nodes given by \(e_x^\top P^\tau\).

For any \(k \in [|V| - 1]\), let \(\mathcal{F}_{\mathrm{emb}}\subset \mathcal{F}_{V}^{(k)}\) be a class of embedding models \(h_\theta\) that map a domain \(V\) into dimension \(k\) Euclidean space: \(\mathcal{F}_{\mathrm{emb}}\ni h_\theta : V \to \mathbb{R}^k\). Let \(\mathcal{L}_{\mathrm{cont}}: \mathcal{F}_{V}^{(k)} \to \mathbb{R}\) be the population contrastive loss, instantiated with base distribution \(\pi\) and augmentation function \(P^\tau\), as in 14 , and \(\hat{\mathcal{L}}_{\mathrm{cont}, n}: \mathcal{F}_{V}^{(k)} \to \mathbb{R}\) be the empirical contrastive loss over a i.i.d. dataset of size \(n\) drawn from \(\pi\), as in 3 . Assume:

  1. For some \(\chi > 0\), we have that \(\forall h_\theta \in \mathcal{F}_{\mathrm{emb}}, \forall x \in V\), \(||h_\theta(x)||_\infty \leq \chi\).

  2. \(\mathcal{F}_{\mathrm{emb}}\) contains at least one global minimizer of \(\mathcal{L}_{\mathrm{cont}}\) over \(\mathcal{F}_V^{(k)}\) (i.e. over functions \(h : V \to \mathbb{R}^k\))

  3. \(\hat{\mathcal{R}}_n(\mathcal{F}_{\mathrm{emb}}) \leq \sqrt{\frac{\mathcal{C}(\mathcal{F}_{\mathrm{emb}})}{n}}\), where \(\mathcal{C}(\mathcal{F}_{\mathrm{emb}})\) is an \(\mathcal{F}_{\mathrm{emb}}\)-dependent constant

  4. With \(\{ \lambda_i\}_{i \in [|V|]} := \{ \lambda_i(P^{2\tau})\}_{i \in [|V|]}\) being the eigenvalues of \(P^{2\tau}\), where \(\lambda_1 \geq \lambda_2 \geq \ldots \geq \lambda_{|V|} \geq 0\), assume \(\lambda_k^2 - \lambda_{k + 1}^2 > 0\).

  5. There exists \(\beta > 0\) such that \(\forall y \in V, \, \sum_{x \in N(y)} \pi(x) \leq \beta \, \pi(y)\). (E.g. if \(P\) is the simple random walk, then \(\beta = d\) the maximum degree of any node in \(G\)).

Set any \(\epsilon, \Delta \in (0,1)\) and set \(p_{\mathrm{erm fails}}= \frac{\epsilon}{\mathrm{poly}(k, \chi)}\). Then, with probability at least \(1 - p_{\mathrm{erm fails}}\) over the randomness of a training dataset of size \(n = \Theta(\frac{\mathcal{C}(\mathcal{F}_{\mathrm{emb}})\, \mathrm{poly}(k, \chi)}{\epsilon^2}\log \frac{1}{p_{\mathrm{erm fails}}})\) drawn i.i.d. from \(\pi\), the following guarantee holds for any ERM \(h_{\hat{\theta}} \in \mathcal{F}_{\mathrm{emb}}\) of \(\hat{\mathcal{L}}_{\mathrm{cont}, n}\), where \(\mathrm{rank}(F_{\hat{\theta}}) = \mathrm{rank}([\sqrt{\pi(x)} h_{\hat{\theta}}(x)^\top]_{x \in V}) = k\) (where \(F_{\hat{\theta}}\) is a \(|V| \times k\) matrix whose \(x\)-th row is \(\sqrt{\pi(x)} h_{\hat{\theta}}(x)^\top\)).

\[\begin{align} &\mathbb{P}_{x \sim \pi}\Big [\exists y,z \in N(x) \cup \{x\} \, : \, |\phi^{\mathrm{diff}}_\tau(y,z) - \langle h_{\hat{\theta}}(y), h_{\hat{\theta}}(z) \rangle| > \frac{\lambda_{k + 1}}{\pi_{\mathrm{min}}} + 2 \chi \sqrt{k} \cdot \sqrt{\Delta} + \Delta \Big]\\ &\leq \frac{\epsilon}{\Delta} \cdot \frac{(\beta + 1)\cdot \Big(1 + 4\sqrt{\frac{2}{\lambda_k^2 - \lambda_{k + 1}^2}} \Big)^2}{2 (\sqrt{2} - 1)\lambda_k} \end{align}\]

[thm:contembd] and [thm:e2e-contrastive-learning-result] motivate 7, a conjecturing algorithm that is analogous to 5, but with 6 replaced by a contrastive-learning procedure.

Figure 7: Improved Conjecturer with Contrastive Learned Diffusion Embeddings

Finally, we discuss how to instantiate [thm:contembd] and [thm:e2e-contrastive-learning-result] for a local subgraph of \(G\) around the theorems of interest, rather than needing to take \(G\) to be the entire theorem graph, which is impractical. For a theorem graph \(G = (V,E)\), define the following notion of a subgraph of \(G\) supported on the \(T\)-neighborhood of a node \(x \in V\).

definitionlocalsubgraph Let \(G = (V,E)\) be a connected, undirected graph, with reversible, nearest-neighbor-type Markov chain \((V,P)\). For any \(x \in V\), \(T \in \mathbb{N}\), let \(G_{x, T} = (V_{x, T}, E_{x, T})\) be a subgraph of \(G\) supported on \(B(x, T)\), with edges \((a,b)\) from \(B(x, T) \ni a\) to \(V - B(x, T) \ni b\) replaced by a self-loop, \((a,a)\) in \(G_{x,T}\). Let Markov chain \((V_{x, T}, P_{x, T})\), be the restriction to \((V,P)\) to \(G_{x, T}\), where any transition probability of \((V,P)\) along edges from \(B(x, T)\) to \(V - B(x, T)\) are redirected back to their source via the aforementioned self-loops. Let \(\pi_{x, T}\) be its stationary measure of \((V_{x, T}, P_{x, T})\). For \(T \in N\), \(\tau \in N\), \(y \in B(x, T)\), denote \(p^\tau_{G_{x, T}}(y)\) as the distribution of a \(\tau\) step random walk on \(G_{x, T}\) according to Markov chain \((V_{x, T}, P_{x, T})\).

A simple observation is that: for any \(x \in V\), on a \(T = \tau + 1\) local subgraph around \(x\), the \(\tau\)-step random walk distribution starting from any neighbor \(z \in N(x)\), \(p^\tau_{G_{x,T}}(z)\) is the same as \(p^\tau(z)\). In addition, for any reversible Markov chain \((V,P)\) on the graph \(G\) with stationary measure \(\pi\), for any \(x \in V\) and \(T \in \mathbb{N}\), the stationary measure \(\pi_{x,T}\) is equal to \(\pi\) restricted to \(B(x,T) \subset V\), up to a multiplicative constant, by the self-loop construction of \(G_{x,T}\). Thus, the diffusion similarity computed on the local subgraph \(G_{x,T}\) differs from that computed on \(G\) by a multiplicative constant, which means the locally-computed diffusion similarity is sufficient for solving the optimization problem in 4 .

To learn the spectral diffusion embedding for reversible Markov chain \((V,P)\), of reversible conjecturer \((C,P,w) := (C_w,P_w,w)\) in a local \(T\)-neighborhood around a node \(x \in V\) via 8, one will require access to the following oracles, defined in [defn:T-neighborhood].

  1. The push-forward map \(C_{x,T} : B(x,T) \to \Delta(B(x,T))\) representing the restricted Markov chain \((V_{x,T}, P_{x,T})\), where \(\forall y \in B(x,T)\), \(C_{x,T}(y) = P_{x,T}[y] \in \Delta(B(x,T))\),

  2. i.i.d. sample access to \(\pi_{x,T} \in \Delta(B(x,T))\).

The construction of these oracles, given \(x \in V\), \(T \in \mathbb{N}\), and neighbor oracle \(N : V \to 2^V\) of \(G\), is conceptually straightforward. We describe the details of their constructions in 9 of 8.1.5.

6 Conclusion and Limitations↩︎

We formalized the space of theorems as a graph and a conjecturer as a nearest-neighbor-type Markov chain over the theorem graph. [thm:main] shows that under 5, the knowledge of the prover trained via 2 grows exponentially with the number of iterations. For the case where 5 does not hold, we propose a diversity measure ([defn:diversity-measure]) for a training distribution of theorems generated by a conjecturer and an improved conjecturing algorithm (5) that locally maximizes this diversity measure, by computing the diffusion similarity (3) between neighboring theorems in the theorem graph. Finally, we describe a method to compute the diffusion similarity using contrastive learning ([thm:contembd] and [thm:e2e-contrastive-learning-result]).

One limitation of the current framework is that the conjecturer is not adaptive toward the particular prover \(f_t\) at iteration \(t\), but rather adaptive toward the prover class, which determines the edge set \(E\). It defines a time-homogeneous nearest-neighbor random walk, whereas a time-inhomogeneous random walk would be more realistic. Another intuition that is not captured by the current framework is that of theorem compositionality. In particular, one can imagine a conjecturer that has knowledge of two theorems \(X \to Y\) and \(Y \to Z\) may be able to conjecture \(X \to Z\), but this is not easily compatible with the view that a conjecturer maps a single theorem to a distribution of theorems. More broadly, an interesting question is how to extend our analysis to a hypergraph of theorems or dependent types [26]. Finally, we note that although this theoretical framework is instantiated for the setting of formal theorem proving, it could potentially serve as a framework for understanding automated synthetic data generation for other verifiable domains besides formal theorem proving.

Acknowledgements↩︎

TC acknowledges funding from an NSF Graduate Research Fellowship. This work was supported in part by an OpenAI Superalignment Fast Grant and by DARPA AIQ under Agreement No. HR00112520023.

We are deeply grateful to Tengyu Ma for many insightful discussions. We also thank Kaiyue Wen for discussions.

7 Proof of [thm:main]↩︎

The purpose of this section is to eventually prove [thm:main] in 7.2.

7.1 Preliminaries.↩︎

7.1.0.1 Isoperimetric Inequality.

Let \(G = (V, E)\) be an undirected graph with a countable set of vertices, \(V\), and edges \(E\). \(G\) is connected, and is locally finite (every vertex has finite degree). Let \(P\) be a Markov chain transition matrix over \(V\) (We will refer to the pair \((V,P)\) as a Markov chain). The simple random walk is a Markov chain where every node \(x\) transitions uniformly to one of its neighbors in the graph, \(N(x) := \{ x' \in V : (x,x') \in E\}\). In the following, we define some basic properties of Markov chains over graphs.

For \(n \in \mathbb{N}\), let \(p^{(n)}(x,y)\) denote the probability the Markov chain \((V,P)\) initialized at \(x\) is at \(y\) at the \(n\)-th step.

Definition 4. (Irreducibility) Markov chain \((V, P)\) is irreducible if \(\forall x,y \in V\), there is some \(n \in \mathbb{N}\) such that \(p^{(n)}(x,y) > 0\).

For the remaining definitions, we will assume the Markov chain is irreducible. We define aperiodicity as follows.

Definition 5. (Aperiodicity) A Markov chain \((V,P)\) is aperiodic if for any \(x \in V\), \(\mathrm{gcd}\{ n \in \mathbb{N}: p^{(n)}(x,x) > 0\} = 1\).

Note that if a Markov chain is irreducible and for some \(x \in V\), \(\mathrm{gcd}\{ n \in \mathbb{N}: p^{(n)}(x,x) > 0\} = 1\), then for any \(x' \in V\), \(\mathrm{gcd}\{ n \in \mathbb{N}: p^{(n)}(x',x') > 0\} = 1\).

A stationary measure \(\pi : V \to (0,\infty)\) where \(\pi^\top = \pi^\top P\). If \(||\pi||_1 = 1\), then it is a stationary distribution. The following Theorem shows that irreducibility and aperiodicity imply mixing for finite Markov chains.

Lemma 1. (Theorem 4.9 of [37]) Suppose that Markov chain \((V,P)\) is finite (\(|V| < \infty\)), irreducible and aperiodic with stationary distribution \(\pi\). Then there exist constants \(C > 0\) and \(\alpha \in (0,1)\) where

\[\begin{align} \max_{x \in V} || p^{(n)}(x, \cdot) - \pi||_{\mathrm{TV}} \leq C \alpha^n \end{align}\]

The following definitions introduce the notion of reversibility and conductance.

Definition 6. (Reversibility) Let \(V\) be an infinite, countable set. Markov chain \((V, P)\) is reversible if there exists a (stationary) measure \(\pi : V \to (0, \infty)\) such that \[\begin{align} \pi(x) P[x,y] = \pi(y) P[y, x]\quad \forall x, y \in V \end{align}\]

Definition 7. (Conductance) Let \(a(x,y) = \pi(x) P[x,y] = a(y,x)\) be the conductance between \(x\) and \(y\). \(\pi(x)\) is the total conductance at \(x\). For a Markov chain transition matrix \(P\), denote its edge set \(E(P)\) where: \[\begin{align} (x,y) \in E(P) \iff a(x,y) > 0 \end{align}\] Note, a nearest-neighbor-type random walk is a Markov chain \((V,P)\) where \(E(P) = E\) (the edge-set of the graph \(G\)).

Now, we define the Isoperimetric Inequality for a Markov chain over a graph, which will generalize [defn:IS]. Let \((V,P)\) be a reversible, irreducible Markov chain with total conductance \(\pi(\cdot)\), edge conductance \(a(\cdot, \cdot)\). Define the following quantities.

\[\begin{align} \pi(A) &:= \sum_{x \in A} \pi(x), \quad \forall A \subset V\\ a(D) &:= \sum_{e \in D} a(e^-, e^+), \quad \forall D \subset E(P)\\ \partial A &:= \mathrm{set of all edges in E(P) with}\\ &\mathrm{one endpoint in A and the other in V - A} \end{align}\]

For the definition of \(\partial A\), note that the graphs we study in this work are all undirected. We now define the Isoperimetric Inequality.

Definition 8 (Isoperimetric Inequality). Let \(\mathscr{F}: \mathbb{R}_+ \to \mathbb{R}_+\). A Markov chain \((V,P)\) satisfies the \(\mathscr{F}\)-Isoperimetric Inequality, if there exists a constant \(\kappa > 0\) such that for every finite \(A \subset V\), \(\mathscr{F}(\pi(A)) \leq \kappa \, a(\partial A)\).

The particular function \(\mathscr{F}: \mathbb{R}_+ \to \mathbb{R}_+\) we care about in this work is \(\mathscr{F}(t) = t\), corresponding to the Strong Isoperimetric Inequality defined in [defn:IS]. However, for the proofs of some of the following Lemmas, it is useful to define, for \(1 \leq d \leq \infty\), the \(d\)-dimensional Isoperimetric Inequality \(\mathrm{IS}_d\) as 8 with \(\mathscr{F}(t) = t^{1 - 1/d}\). The strong Isoperimetric Inequality \(\mathrm{IS}\) can be thought of as \(\mathrm{IS}_d\) with \(d = \infty\).

7.1.0.2 Hilbert Spaces and Norms.

With \((V,P)\) being an irreducible, reversible Markov chain with stationary measure \(\pi : V \to (0,\infty)\), let \(\ell_0(V)\) denote the linear space of finitely supported functions on \(V\) (i.e. functions that are non-zero only on a finite number of elements of \(V\)). For an (undirected) edge \(e = (e^-, e^+) \in E\), define the resistance as \(r(e) := \frac{1}{a(e^-, e^+)}\). The following defines Hilbert spaces of functions, relevant to [thm:main].

Definition 9. Define the Hilbert space \(\ell^2(V, \pi)\) with inner product \[\begin{align} \langle f, g\rangle_{\ell^2(V, \pi)} = \sum_{v \in V} f(v) g(v) \pi(v) \end{align}\] \(\ell^2(V, \pi)\) is the set of functions \(f : V \to \mathbb{R}\) with \(\sum_{v \in V} |f(v)|^2 \pi(v) < \infty\).

Define the Hilbert space \(\ell^2(V, 1/\pi)\) with inner product \[\begin{align} \langle f, g\rangle_{\ell^2(V, 1/\pi)} = \sum_{v \in V} f(v) g(v) \frac{1}{\pi(v)} \end{align}\] \(\ell^2(V, 1/\pi)\) is the set of functions \(f : V \to \mathbb{R}\) with \(\sum_{v \in V} |f(v)|^2 \frac{1}{\pi(v)} < \infty\). When clear from context, we will write \(\ell^2(\pi)\) and \(\ell^2(1/\pi)\) for \(\ell^2(V, \pi)\) and \(\ell^2(V, 1/\pi)\), respectively.

Analogously, the Hilbert space \(\ell^2(E, r)\) has inner product

\[\begin{align} \langle u, v \rangle_{\ell^2(E,r)} = \sum_{e \in E} u(e) v(e) r(e) \end{align}\]

\(\ell^2(E, r)\) is the set of functions \(f : E \to \mathbb{R}\) with \(\sum_{e \in E} |f(e)|^2 r(e) < \infty\).

We introduce the following difference operator

\[\begin{align} \nabla : \ell^2(V, \pi) \to \ell^2(E, r), \quad \nabla f(e) = \frac{f(e^+) - f(e^-)}{r(e)} \end{align}\]

Define the following norms:

Definition 10. (Norms) For a function \(f : V \to \mathbb{R}\), define its Sobolev norm \[\begin{align} S_P(f) := \frac{1}{2} \sum_{x,y \in V} |f(x) - f(y)| a(x,y) \end{align}\] and its norm in \(\ell^p(V,\pi)\) \[\begin{align} ||f||_p = \big(\sum_{x \in V} |f(x)|^p \pi(x) \big)^{1/p} \end{align}\] whenever these sums converge. Let \(\mathcal{D(P)}\) be the space of all functions \(f\) on \(V\) such that \(\nabla f \in \ell^2(E, r)\). If \(f\) is such a function, define its Dirichlet norm \[\begin{align} D_P(f) &= \langle \nabla f, \nabla f\rangle_{\ell^2(E,r)} \\ &= \sum_{e \in E} \frac{(f(e^+) - f(e^-))^2}{r(e)}\\ &= \frac{1}{2}\sum_{x,y \in X} (f(x) - f(y))^2 a(x,y) \end{align}\]

7.1.0.3 Preliminary Lemmas.

The next few Lemmas will be used to prove 3, which is key to proving the final [thm:main].

Lemma 2. (Proposition 4.3 of [38]) Markov chain \((V,P)\) satisfies \(\mathrm{IS}_d\) (\(1 \leq d \leq \infty\)) if and only if \[\begin{align} ||f||_{\frac{d}{d - 1}} \leq \kappa \, S_P(f) \quad \mathrm{for every f \in \ell_0(V)} \end{align}\]

Proof. See Proposition 4.3 of [38] on page 40. ◻

Lemma 3. (Lemma 2.4 of [38]) If \(f \in \mathcal{D}(P)\), then \(\nabla^*(\nabla f) = - (P - I)f\)

Proof. See Lemma 2.4 of [38] on page 16. ◻

Note that \(\ell_0(V) \subset \mathcal{D}(P)\).

Now, we recall some facts of linear operators. Let \(Q = (q(i,j))_{i,j \in I}\) be a non-negative real matrix over a countable set. \(Q\) acts on functions (vectors) \(I \to \mathbb{R}\) in the usual way by matrix multiplication on the left. Define the operator norm:

Definition 11. (Definition 2.7-1 of [39]) Let \(X, Y\) be normed spaces and \(Q : D(Q) \to Y\) a linear operator, where \(D(Q) \subset X\). \(Q\) is bounded if there is a real number \(c\) s.t. \[\begin{align} \forall x \in D(Q), ||Qx|| \leq c ||x|| \end{align}\] Moreover, define \(||Q|| = \sup_{x \in D(Q), x \neq 0} \frac{||Qx||}{||x||}\)

Define the adjoint of a linear operator:

Lemma 4. (Theorem 3.9-2 of [39])The Hilbert-adjoint operator \(Q^*\) of a bounded linear operator \(Q : H_1 \to H_2\) such that \[\begin{align} Q^* &: H_2 \to H_1\\ \forall x \in H_1, y \in H_2, \langle Qx, y \rangle &= \langle x, Q^* y \rangle \end{align}\]

is unique and is a bounded linear operator with norm: \[\begin{align} ||Q^*|| = ||Q|| \end{align}\]

If \(Q = Q^*\), it is self-adjoint, and its operator norm has the following Rayleigh characterization.

Lemma 5. (Theorem 9.2-2 of [39]) For any bounded, self-adjoint \(Q\) on a complex Hilbert space \(H\), we have

\[\begin{align} ||Q|| = \sup_{||x|| = 1}|\langle Qx, x\rangle | \end{align}\]

Proof. See Theorem 9.2-2 of [39]. ◻

7.1.0.4 Key Theorem.

3 is the key theorem which enables us to prove [thm:main].

Theorem 3. (IS implies Spectral Expansion)

Consider an irreducible, reversible Markov chain \((V, P)\) that satisfies the strong Isoperimetric inequality with Isoperimetric constant \(\kappa\):

\[\begin{align} \mathrm{For every finite } A \subset V, \quad \pi(A) \leq \kappa \cdot a(\partial A) \end{align}\]

Then, the operator norm of \(P\) in \(\ell^2(V,\pi)\) is at most \(1 - \frac{1}{2\kappa^2}\). That is, \(||P||_{\ell^2(V, \pi) \to \ell^2(V, \pi)} \leq 1 - \frac{1}{2\kappa^2}\).

Proof. This follows from the proof of Theorem 10.3 of [38], but we write it out here for completeness.

By 2, IS implies the Sobolev inequality \(||f||_1 \leq \kappa \, S_P(f)\) for all \(f \in \ell_0(V)\). First, we show that this implies the Dirichlet inequality, \(||f||_2^2 \leq 2\kappa^2 D_P(f)\), because:

\[\begin{align} ||f||_2^4 &= ||f^2||_1^2\\ &\leq \kappa^2 S_P(f^2)^2\\ &\leq \kappa^2 \big( \frac{1}{2} \sum_{x,y \in V} a(x,y) |f(x) - f(y)| (|f(x)| + |f(y)|)\big)^2\\ &\leq \kappa^2 D_P(f) \sum_{x,y \in V} a(x,y) (|f(x)| + |f(y)|)^2/2\\ &\leq \kappa^2 D_P(f)\sum_{x,y \in V} a(x,y) (f(x)^2 + f(y)^2)\\ &\leq 2\kappa^2 D_P(f) ||f||_2^2\\ \implies ||f||_2^2 &\leq 2\kappa^2 D_P(f) \end{align}\]

By 3,

\[\begin{align} D_P(f) &= \langle f, (I - P)f \rangle_{\ell^2(\pi)}\\ &= ||f||_2^2 - \langle f, Pf \rangle_{\ell^2(\pi)} \quad \mathrm{for f \in \ell_0(V)}\\ \implies \langle f, Pf \rangle_{\ell^2(\pi)} &= ||f||_2^2 - D_P(f)\\ &\leq (1 - \frac{1}{2\kappa^2})||f||^2_2\label{eq:rayleigh-upper-bound-for-P} \end{align}\tag{6}\]

Where the \(||\cdot||_2^2 = ||\cdot||^2_{\ell^2(\pi)}\) is the weighted 2-norm defined in 10. By 5,

\[\begin{align} ||P||_{\ell^2(\pi) \to \ell^2(\pi)} &= \sup_{f \in \ell^2( \pi), f \neq 0} \frac{|\langle f, Pf\rangle_{\ell^2(\pi)}|}{||f||_2^2}\\ &\leq \sup_{f \in \ell^2(\pi), f \neq 0} \frac{|\sum_{x,y \in V} f(x)f(y)\pi(x) P[x,y]|}{||f||_2^2}\\ &\leq \sup_{f \in \ell^2( \pi), f \neq 0} \frac{\sum_{x,y \in V} \, \pi(x) P[x,y] \,|f(x)| |f(y)|}{||f||_2^2}\\ &= \sup_{f \in \ell^2(\pi), f \neq 0} \frac{\langle |f|, P|f|\rangle_{\ell^2(\pi)}}{||f||_2^2}\\ &= \sup_{f \in \ell^2( \pi), f \neq 0} \frac{\langle f, Pf \rangle_{\ell^2(\pi)}}{||f||_2^2}\\ &= \sup_{f \in \ell_0(V), f \neq 0} \frac{\langle f, Pf\rangle_{\ell^2(\pi)}}{||f||_2^2} \\ &\leq 1 - \frac{1}{2\kappa^2} } \end{align}\]

We conclude that \(||P||_{\ell^2(\pi) \to \ell^2(\pi)} \leq 1 - \frac{1}{2\kappa^2}\), where \(||P||_{\ell^2(\pi) \to \ell^2(\pi)}\) denotes the operator norm of \(P\) over \(\ell^2(\pi)\). ◻

The following Corollary establishes a one-step contraction due to the random walk according to \(P\) on a graph satisfying \(\mathrm{IS}\).

Corollary 1. Let \(G = (V,E)\) and let \((V,P)\) be a reversible random walk on \(G\), with stationary measure \(\pi\), satisfying Assumption 5 with Isoperimetric constant \(\kappa > 0\). Then, for any \(D \in \ell^2(1/\pi)\), we have

\[\begin{align} ||P^\top D||_{\ell^2(1/\pi)} \leq (1 - \frac{1}{2\kappa^2})||D||_{\ell^2(1/\pi)} \end{align}\]

Proof. The core claim is that \(||P^\top||_{\ell^2(1/\pi) \to \ell^2(1/\pi)} = ||P||_{\ell^2(\pi) \to \ell^2(\pi)}\). To see this, because \(P\) is reversible with stationary measure \(\pi\), we have

\[\begin{align} \mathrm{diag}(\pi) P &= P^\top \mathrm{diag}(\pi)\\ P^\top &= \mathrm{diag}(\pi) P\mathrm{diag}(\pi)^{-1} \end{align}\]

Thus,

\[\begin{align} ||P^\top||_{\ell^2(1/\pi) \to \ell^2(1/\pi)} &= \sup_{x \,:\, ||x||_{\ell^2(1/\pi)} = 1} ||P^\top x||_{\ell^2(1/\pi)}\\ &= \sup_{x \,:\, ||x||_{\ell^2(1/\pi)} = 1} ||\mathrm{diag}(\pi) P\mathrm{diag}(\pi)^{-1} x||_{\ell^2(1/\pi)}\\ &= \sup_{x \,:\, ||x||_{\ell^2(1/\pi)} = 1} ||P\mathrm{diag}(\pi)^{-1} x||_{\ell^2(\pi)}\\ &= \sup_{x' \,:\, ||x'||_{\ell^2(\pi)} = 1} ||Px'||_{\ell^2(\pi)} \label{eq:change-of-space}\\ &= ||P||_{\ell^2(\pi) \to \ell^2(\pi)} \end{align}\tag{7}\]

7 follows from the fact that for any \(x \in \ell^2(1/\pi), x' = \mathrm{diag}(\pi)^{-1}x \in \ell^2(\pi)\). Conversely, for any \(x' \in \ell^2(\pi)\), \(x = \mathrm{diag}(\pi) x' \in \ell^2(1/\pi)\).

Finally, by 3, \(||P||_{\ell^2(\pi) \to \ell^2(\pi)} \leq 1 - \frac{1}{2\kappa^2}\). Since \(||P||_{\ell^2(\pi) \to \ell^2(\pi)} = ||P^\top||_{\ell^2(1/\pi) \to \ell^2(1/\pi)}\), then for any \(D \in \ell^2(1/\pi)\), we have

\[\begin{align} ||P^\top D||_{\ell^2(1/\pi)} \leq ||P^\top||_{\ell^2(1/\pi) \to \ell^2(1/\pi)}\, ||D||_{\ell^2(1/\pi)} \leq (1 - \frac{1}{2\kappa^2})||D||_{\ell^2(1/\pi)} \end{align}\] ◻

7.2 Proof of [thm:main]↩︎

Proof. We reason inductively, by analyzing the behavior of 2 each iteration.

First, suppose at iteration \(t \in \mathbb{N}\), 2 has i.i.d. sample access to \(D_t \in \Delta(V)\), and trains prover \(f_t \in \mathcal{F}_{\mathrm{prover}}\) to where \(\mathbb{P}_{x \sim D_t} [\operatorname{succ}(x, f_t) \geq p] \geq 1 - \epsilon\) (an event which occurs with probability at least \(1 - \delta\) according to 2). 2 (using the subroutine, 3) generates \(C_w\# D_t\) from \(D_t\) and then generates \(D_{t + 1}\) from \(C_w\# D_t\) by filtering out theorems whose pass rate is below \(p/2\). By 1,

\[\begin{align} ||C_w\# D_t||_{\ell^2(1/\pi)}^2 := ||(P^\top) D_t||_{\ell^2(1/\pi)}^2 \leq (1 - \frac{1}{2\kappa^2})^2 ||D_t||^2_{\ell^2(1/\pi)}\label{eq:one-step-rw-ent} \end{align}\tag{8}\]

Under the event that \(\mathbb{P}_{x \sim D_t} [\operatorname{succ}(x, f_t) \geq p] \geq 1 - \epsilon\), let

\[\begin{align} \alpha_t &:= \mathbb{P}_{x \sim C_w\# D_t} [\operatorname{succ}(x, f_t) \geq p/2] \\ &\geq \mathbb{P}_{x \sim D_t} [\operatorname{succ}(x, f_t) \geq p]\\ &\geq 1 - \epsilon \end{align}\]

Let \(D_{t + 1}\) be a new distribution whose sampling process involves sampling \(x \sim C_w\# D_t\) until \(\operatorname{succ}(x, f_t) \geq p/2\) and then returning such an \(x\) (i.e. the rejection sampling step in 3). This process provides i.i.d. sample access to \(D_{t + 1}\) supported on the \(\alpha_t\)-fraction of theorems in \(C_w\# D_t\) where \(\operatorname{succ}(x, f_t) \geq p/2\). The probability of any theorem under \(D_{t + 1}\) is equal to its respective probability under \(C_w\# D_t\) multiplied by \(\frac{1}{\alpha_t} \leq \frac{1}{1 - \epsilon}\). Since for \(f \in \ell^2(1/\pi)\), \(||f||_{\ell^2(1/\pi)}^2 = \sum_{v \in V} |f(v)|^2 \frac{1}{\pi(v)}\), then

\[\begin{align} ||D_{t + 1}||^2_{\ell^2(1/\pi)} \leq (\frac{1}{1 - \epsilon})^2||C_w\# D_t||^2_{\ell^2(1/\pi)} \end{align}\]

Combining with 8 , we conclude

\[\begin{align} ||D_{t + 1}||_{\ell^2(1/\pi)}^2 \leq (\frac{1 - \frac{1}{2\kappa^2}}{1 - \epsilon})^2 ||D_t||_{\ell^2(1/\pi)}^2\label{eq:per-it-guarantee} \end{align}\tag{9}\]

We now describe how these per-iteration guarantees can be put together inductively. We claim the following iteration invariant: for every iteration \(t \in \mathbb{N}\), conditional on the event that all previous iterations did not fail, then 2 has access to a theorem distribution \(D_t\) satisfying the premise of 2, that \(\forall x \in \operatorname{supp}(D_t),\) the proof of \(x\) is known. Moreover, the \(t\)th iteration fails with probability at most \(\delta\).

As the base case, 1 ensures 2 has i.i.d. sample access to cold-start theorem distribution \(D_0\), and that all proofs of theorems in \(\operatorname{supp}(D_0)\) are known. The iteration invariant holds. Regarding the inductive step, suppose at iteration \(t\), the algorithm has i.i.d. sample access to \(D_t\), where for all \(x \in \operatorname{supp}(D_t)\), the proof of \(x\) is known. Suppose also that all previous iterations \(\{0 \} \cup [t - 1]\) did not fail. By 2, 2 can train a new prover \(f_{t}\) using i.i.d. sample access to \(D_{t}\), which guarantees that \(\mathbb{P}_{x \sim D_{t}} [\operatorname{succ}(x, f_{t}) \geq p] \geq 1 - \epsilon\) with failure probability at most \(\delta\). By 3, \(\mathbb{P}_{x \sim D_{t}} [\operatorname{succ}(x, f_{t}) \geq p] \geq 1 - \epsilon\) implies that \(\mathbb{P}_{x \sim C_w \# D_{t}} [\operatorname{succ}(x, f_{t}) \geq p/2] \geq 1 - \epsilon\). The rejection sampling procedure in 3, which generates \(D_{t + 1}\) from \(C_w\# D_t\), ensures that \(\forall x \in \operatorname{supp}(D_{t + 1})\), \(\operatorname{succ}(x, f_t) \geq p/2\), so that it is efficient to sample the proof of any theorem in \(\operatorname{supp}(D_{t + 1})\) from \(f_t\). Thus, the proof of every theorem in \(\operatorname{supp}(D_{t + 1})\) is known, and \(D_{t + 1}\) satisfies the premise of 2. This iteration fails with probability at most \(\delta\), which occurs if step that trains \(f_t\) from \(D_t\) fails.

Thus, by induction over the iteration number \(t \in \mathbb{N}\), we conclude from 9 that for every \(t \in \mathbb{N}\), conditional on the event that every iteration \(i \in \{0 \} \cup [t - 1]\) does not fail (which occurs with probability at least \(1 - t \, \delta\) since each iteration fails with probability at most \(\delta\)), then

\[\begin{align} ||D_{t}||^2_{\ell^2(1/\pi)} \leq (\frac{1 - \frac{1}{2\kappa^2}}{1 - \epsilon})^{2t} ||D_{0}||^2_{\ell^2(1/\pi)}\label{eq:Dt-vs-D0} \end{align}\tag{10}\]

Finally, 2 trains the final prover \(f_t \in \mathcal{F}_{\mathrm{emb}}\) on \(D_t\) at iteration \(t\). With failure probability at most \(\delta\), we have \(D_t(\{ x \in V : \operatorname{succ}(x,f_t) \geq p\}) \geq 1 - \epsilon\).

At iteration \(t\in\mathbb{N}\), suppose none of the training guarantees of the \(t + 1\) provers \(\{ f_0, f_1, \ldots, f_t\}\) fail, which occurs with probability at least \(1 - (t + 1) \, \delta\). Applying 14 with \(D' = D_t\), \(A' = \{ x \in V : \operatorname{succ}(x,f_t) \geq p\}\) and the guarantee that \(D_t(\{ x \in V : \operatorname{succ}(x,f_t) \geq p\}) \geq 1 - \epsilon\), we have

\[\begin{align} |\{ x \in V : \operatorname{succ}(x,f_t) \geq p\}| \geq \frac{(1 - \epsilon)^2}{\sup_{z \in V} \pi(z)} \cdot \frac{1}{ ||D_{t}||^2_{\ell^2(1/\pi)}} \end{align}\]

By 10 , the conclusion follows.

\[\begin{align} | \{ x \in V : \operatorname{succ}(x, f_t) \geq p\} | \geq \frac{(1 - \epsilon)^2}{(\sup_{z \in V} \pi(z)) \cdot ||D_0||_{\ell^2(1/\pi)}^2 } \cdot (\frac{1 - \epsilon}{1 - \frac{1}{2\kappa^2}})^{2t}. \end{align}\]

Note also that since \(\mathbb{P}_{x \sim C_w\# D_t} [\operatorname{succ}(x, f_t) \geq p/2] \geq 1 - \epsilon\) at iteration \(t\), the probability of rejection each iteration is at most \(\epsilon\), so that the rejection sampling procedure per iteration is fairly efficient. However, the probability of rejection compounds over iterations, so that the expected number of samples from \(D_0\) needed to sample from \(D_t\) is proportional to \((\frac{1}{1 - \epsilon})^t\). ◻

8 Theorems about Diffusion Similarity and Contrastive Learning↩︎

The purpose of this section is to show the connection between contrastive learning and diffusion similarity, and show how an embedding model learned by minimizing a contrastive loss can be used to compute the diffusion similarity (and diffusion distance) between points on a graph. Our main results, in 8.2, include [thm:contembd], an infinite-sample and large embedding dimension learning result, and [thm:e2e-contrastive-learning-result], a finite-sample and small embedding dimension learning result.

8.1 Preliminary Lemmas↩︎

8.1.1 Setup↩︎

Contrastive learning defines an algorithm for learning an embedding model that maps elements from a domain \(V\) (e.g. the set of real-world images) into Euclidean space \(\mathbb{R}^k\) for some \(k \in \mathbb{N}\). It is most notably used for training neural networks as embedding models, and we let \(\mathcal{F}_{\mathrm{emb}}\) denote the hypothesis class of models \(h_\theta : V \to \mathbb{R}^k\) which we assume contains the ground-truth embedding model that we must learn. The core idea of contrastive learning is to define two distributions of pairs of elements in \(V\): a positive pair distribution \(D_+ \in \Delta(V \times V)\) , and a negative pair distribution \(D_- \in \Delta(V \times V)\). Given i.i.d. samples from both distributions, the trained model is encouraged to embed two elements sampled from a positive pair \((x,y) \sim D_+\) close together in Euclidean space, while embedding two elements sampled from a negative pair \((x,x') \sim D_-\) far apart in Euclidean space. These two distributions of pairs of elements are used to define a contrastive loss, and training the model amounts to minimizing an empirical estimate of the contrastive loss from finite samples.

In fact, contrastive learning can be described mathematically through the lens of matrix factorization, as articulated in [30]. The benefit of this viewpoint of contrastive learning is that it enables us to provably characterize the learned embeddings and the sample complexity of learning them. In the following, we will describe and use the mathematical setup for contrastive learning of [30].

Let the domain \(V\) consist of \(N \in \mathbb{N}\) elements, where \(N\) is large but finite. We will identify \(V\) with \([N]\) here for simplicity. Define \(\mu \in \Delta([N])\) as the base distribution and \(Q \in \mathbb{R}^{N \times N}\) as an augmentation scheme. Alternatively, overloading notation, we can view \(Q : [N] \to \Delta(N)\) as a mapping from an element \(x\) to a distribution over augmentations of \(x\), \(Q(x)\). For every \(x \in [N]\), this distribution of augmentations, \(Q(x)\), equals the \(x\)-th row of the matrix-representation of \(Q\).

We will first introduce the matrix factorization viewpoint of contrastive learning, and we will from this how to define the positive and negative pair distributions \(D_+, D_- \in \Delta([N]\times [N])\) from \(\mu\) and \(Q\) and the final learning algorithm. Let \(A \in \mathbb{R}^{N \times N}\) and its normalization \(\overline{A}\) be positive semi-definite (p.s.d.) matrices of the form,

\[\begin{align} A &= Q^\top \,\mathrm{diag}(\mu) \,Q\\ D &= \mathrm{diag}(A \mathbf{1})\\ \overline{A} &= D^{-1/2} A D^{-1/2} \end{align}\]

For rank-\(k\) factor \(F_\theta \in \mathbb{R}^{N \times k}\), let \(\mathcal{L}_{\mathrm{mf}}(F_\theta) := ||\overline{A} - F_\theta F_\theta^\top||_F^2\) be the matrix factorization loss for matrix \(\overline{A} \in \mathbb{R}^{N \times N}\). Let \(\mathcal{F}_{\mathrm{emb}}\) be the class of embedding models. We will parameterize \(F_\theta\) by an embedding model \(h_\theta : [N] \to \mathbb{R}^k\). Towards this, if we let \(\sigma_{xy}\) denote the \((x,y)\)-th entry of \(A\),

\[\begin{align} A &= [\sigma_{xy}]_{x,y \in [N]}\\ \mathrm{With } \sigma_x &:= \sum_{y \in [N]} \sigma_{xy}\label{eq:wx-defn} \end{align}\tag{11}\]

and we parameterize \(F_\theta \in \mathbb{R}^{N \times k}\) where \(\forall x \in [N], F_\theta[x] = \sqrt{\sigma_x} h_\theta(x)^\top\) for \(h_\theta : [N] \to \mathbb{R}^k\), then \(\mathcal{L}_{\mathrm{mf}}(F_\theta) = \mathcal{L}_{\mathrm{mf}}(h_\theta)\) (overloading notation) is expressible in the following form.

\[\begin{align} \mathcal{L}_{\mathrm{mf}}(h_\theta) &:= ||\overline{A} - F_\theta F_\theta^\top||_F^2\\ &= \sum_{x,y \in [N]} \Big(\frac{\sigma_{xy}}{\sqrt{\sigma_x} \sqrt{\sigma_y}} - \sqrt{\sigma_x}\sqrt{\sigma_y}h_\theta(x)^\top h_\theta(y) \Big)^2\\ &= \mathrm{const} + \sum_{x,y \in [N]}\sigma_x \sigma_y (h_\theta(x)^\top h_\theta(y))^2 - 2\sum_{x,y \in [N]}\sigma_{xy} h_\theta(x)^\top h_\theta(y)\tag{12}\\ &= \mathrm{const} + \mathbb{E}_{x, x^-} (h_\theta(x)^\top h_\theta(x^-))^2 - 2 \cdot \mathbb{E}_{x, x^+}h_\theta(x)^\top h_\theta(x^+)\\ &= \mathrm{const} + \mathcal{L}_{\mathrm{cont}}(h_\theta)\tag{13}\\ \mathrm{Where } \mathcal{L}_{\mathrm{cont}}&: \mathcal{F}_V^{(k)} \to \mathbb{R}\\ \mathcal{L}_{\mathrm{cont}}(h_\theta) &:= \mathbb{E}_{x, x^-} (h_\theta(x)^\top h_\theta(x^-))^2 - 2 \cdot \mathbb{E}_{x, x^+}h_\theta(x)^\top h_\theta(x^+)\tag{14} \end{align}\]

Where \(\mathcal{F}_{V}^{(k)}\) denotes the class of all functions mapping \(V\) to \(\mathbb{R}^{k}\). Amazingly, \(\mathcal{L}_{\mathrm{cont}}(h_\theta) := \mathbb{E}_{x, x^-} (h_\theta(x)^\top h_\theta(x^-))^2 - 2 \cdot \mathbb{E}_{x, x^+}h_\theta(x)^\top h_\theta(x^+)\) is one version of the (population) contrastive loss function, similar to what is used empirically.

12 in the derivation above naturally defines the positive pair distribution as where \((x,y) \in [N]\times[N]\) has marginal probability of \(\sigma_{xy}\) of being sampled. This corresponds to the sampling process of first sampling an element from the base distribution first, \(z \sim \mu\), and then sampling the pair elements as independent augmentations \(x \sim Q(z)\), \(y\sim Q(z)\), returning \((x,y)\). Similarly, since a negative pair \((x,y) \in [N]\times[N]\) has marginal probability of \(\sigma_x \sigma_y\) in 12 , the natural negative pair distribution corresponds to first sampling \(z_x, z_y \sim \mu\) independently, and then sampling \(x \sim Q(z_x), y \sim Q(z_y)\), returning \((x,y)\).

Crucially, since \(\mathcal{L}_{\mathrm{cont}}(h_\theta)\) and \(\mathcal{L}_{\mathrm{mf}}(h_\theta)\) differ by only an additive constant independent of \(h_\theta\), we can understand the global minimizers of \(\mathcal{L}_{\mathrm{cont}}\) via the global minimizers of \(\mathcal{L}_{\mathrm{mf}}\). In particular, the Eckart-Young-Mirsky Theorem characterizes the global minimizers of \(\mathcal{L}_{\mathrm{mf}}\) via the spectrum of \(\overline{A}\) [40]. In the case \(\overline{A} = U \Sigma U^\top\) is p.s.d., then the global minimizer \(F_k \in \mathbb{R}^{N \times k}\) is of the form

\[\begin{align} F_k = U_k \Sigma_k^{1/2}R \end{align}\]

Where \(R \in O^{k \times k}\) is any \((k \times k)\) orthogonal matrix.

In addition to having an analytic characterization of the global minima, one other useful property of \(\mathcal{L}_{\mathrm{cont}}\) is that it is written as an expectation, and so can be approximated by an empirical risk. For a dataset \(\{ \overline{x}_i\}_{i \in [n]} \subset V\), define the empirical contrastive loss as:

\[\begin{align} &\hat{\mathcal{L}}_{\mathrm{cont}, n}(h_{\theta'}) :=\\ &-\frac{2}{n} \sum_{i \in [n]} \mathbb{E}_{\substack{x \sim Q(\cdot | \overline{x}_i),\\ x^+ \sim Q(\cdot | \overline{x}_i)}} (h_{\theta'}(x)^\top h_{\theta'}(x^+)) + \frac{1}{n(n - 1)} \sum_{i,j \in [n], i \neq j}\mathbb{E}_{\substack{x \sim Q(\cdot | \overline{x}_i),\\ x^- \sim Q(\cdot | \overline{x}_j)}} (h_{\theta'}(x)^\top h_{\theta'}(x^-))^2 \label{mtnixgye} \end{align}\tag{15}\]

Claim D.2 of [30] shows that \(\mathbb{E}_{\{ \overline{x}_i\}_{i \in [n]} \sim \mu} \hat{\mathcal{L}}_{\mathrm{cont}, n}(h_{\theta}) = \mathcal{L}_{\mathrm{cont}}(h_\theta)\), i.e. that \(\hat{\mathcal{L}}_{\mathrm{cont}, n}\) is unbiased. Define the empirical risk minimizer (ERM) as follows.

8 describes a procedure to use empirical risk minimization to learn an embedding model from finite samples from the base distribution.

Figure 8: Learning Embeddings via ERM

As we will later see in 6 and [lem:contrastive-learning], under some assumptions, the empirical risk minimizer (ERM) will be also approximately minimize the population contrastive loss. The assumptions necessary for that result are expressed in terms of Rademacher complexity, a core concept of Statistical Learning Theory. For \(k \in \mathbb{N}\), we use the definition of empirical Rademacher complexity of a function class \(\mathcal{F}\) of models \(\mathcal{F}\ni h: V \to \mathbb{R}^k\) used in [30].

Note this definition takes a \(\max\) over the \(n\) datapoints \(x_1, \ldots, x_n\) rather than an expectation, as is usual [35]. 6 analyzes the generalization error of the ERM, using Statistical Learning Theory.

8.1.2 Lemmas on Contrastive Learning↩︎

Lemma 6. (Theorem 4.1 of [30]) Fix a base distribution \(\mu \in \Delta(V)\), augmentation function \(Q : V \to \Delta(V)\), and parameters \(k \in \mathbb{N}\), \(k \leq |V|\) and \(p_{\mathrm{erm fails}}\in (0,1)\). Let \(\mathcal{F}_{\mathrm{emb}}\subset \mathcal{F}_V^{(k)}\) be a class of embedding models \(h_\theta\) that map a domain \(V\) into dimension \(k\) Euclidean space: \(\mathcal{F}_{\mathrm{emb}}\ni h_\theta : V \to \mathbb{R}^k\). Let \(\mathcal{L}_{\mathrm{cont}}: \mathcal{F}_V^{(k)} \to \mathbb{R}\) be the population contrastive loss, instantiated with \(\mu\) and \(Q\), as in 14 , and \(\hat{\mathcal{L}}_{\mathrm{cont}, n}: \mathcal{F}_V^{(k)} \to \mathbb{R}\) be the empirical contrastive loss over a i.i.d. dataset of size \(n\) drawn from \(\mu\), as in 3 . Assume:

  1. For some \(\chi > 0\) that \(\forall h_\theta \in \mathcal{F}_{\mathrm{emb}}, \forall x \in V\), \(||h_\theta(x)||_\infty \leq \chi\).

  2. \(\mathcal{F}_{\mathrm{emb}}\) contains at least one global minimizer of \(\mathcal{L}_{\mathrm{cont}}\) over functions \(h : V \to \mathbb{R}^k\)

Then, with \(h_{\theta_*} \in \mathcal{F}_{\mathrm{emb}}\) any global minimizer of \(\mathcal{L}_{\mathrm{cont}}\) and \(h_{\hat{\theta}} \in \mathcal{F}_{\mathrm{emb}}\) any global minimizer of \(\hat{\mathcal{L}}_{\mathrm{cont}, n}\), for which a training dataset of size \(n\) was drawn i.i.d. from \(\mu\), then with probability at least \(1 - p_{\mathrm{erm fails}}\) over the randomness of the training dataset,

\[\begin{align} \mathcal{L}_{\mathrm{cont}}(h_{\hat{\theta}}) \leq \mathcal{L}_{\mathrm{cont}}(h_{\theta_*}) + \mathrm{poly}(k,\chi) \, \hat{\mathcal{R}}_{n/2}(\mathcal{F}_{\mathrm{emb}}) + \mathrm{poly}(k,\chi) \, (\sqrt{\frac{\log \frac{2}{p_{\mathrm{erm fails}}}}{n}} + p_{\mathrm{erm fails}}) \end{align}\]

Proof. Same as Theorem 4.1 of [30]. ◻

[30] say, as a comment immediately after their Theorem 4.1, that \(\hat{\mathcal{R}}_{n}(\mathcal{F})\) typically looks like \(\sqrt{\frac{\mathcal{C}(\mathcal{F})}{n}}\) where \(\mathcal{C}(\mathcal{F})\) is an \(\mathcal{F}\)-dependent constant. Assuming this is the case, then as a consequence of 6, the minimizer of the empirical contrastive loss, with \(n = \Theta(\frac{\mathcal{C}(\mathcal{F}_{\mathrm{emb}})\, \mathrm{poly}(k, \chi)}{\epsilon^2}\log \frac{1}{p_{\mathrm{erm fails}}})\) i.i.d. samples, is \(\epsilon\)-minimizer embedding model with probability at least \(1 - p_{\mathrm{erm fails}}\). We write this explicitly in the following Lemma.

lemmaermforcont

Fix a base distribution \(\mu \in \Delta(V)\), augmentation function \(Q : V \to \Delta(V)\), and parameters \(k \in \mathbb{N}\), \(k \leq |V|\), and \(\epsilon\in (0,1)\). Let \(\mathcal{F}_{\mathrm{emb}}\subset \mathcal{F}_V^{(k)}\) be a class of embedding models \(h_\theta\) that map a domain \(V\) into dimension \(k\) Euclidean space: \(\mathcal{F}_{\mathrm{emb}}\ni h_\theta : V \to \mathbb{R}^k\). Let \(\mathcal{L}_{\mathrm{cont}}: \mathcal{F}_V^{(k)} \to \mathbb{R}\) be the population contrastive loss, instantiated with \(\mu\) and \(Q\), as in 14 , and \(\hat{\mathcal{L}}_{\mathrm{cont}, n}: \mathcal{F}_V^{(k)} \to \mathbb{R}\) be the empirical contrastive loss over a i.i.d. dataset of size \(n\) drawn from \(\mu\), as in 3 . Assume:

  1. For some \(\chi > 0\) that \(\forall h_\theta \in \mathcal{F}_{\mathrm{emb}}, \forall x \in V\), \(||h_\theta(x)||_\infty \leq \chi\).

  2. \(\mathcal{F}_{\mathrm{emb}}\) contains at least one global minimizer of \(\mathcal{L}_{\mathrm{cont}}\) over functions \(h : V \to \mathbb{R}^k\)

  3. \(\hat{\mathcal{R}}_n(\mathcal{F}_{\mathrm{emb}}) \leq \sqrt{\frac{\mathcal{C}(\mathcal{F}_{\mathrm{emb}})}{n}}\), where \(\mathcal{C}(\mathcal{F}_{\mathrm{emb}})\) is an \(\mathcal{F}_{\mathrm{emb}}\)-dependent constant

Set \(p_{\mathrm{erm fails}}= \frac{\epsilon}{\mathrm{poly}(k, \chi)}\). Then, with \(h_{\theta_*} \in \mathcal{F}_{\mathrm{emb}}\) any global minimizer of \(\mathcal{L}_{\mathrm{cont}}\) and \(h_{\hat{\theta}} \in \mathcal{F}_{\mathrm{emb}}\) any global minimizer of \(\hat{\mathcal{L}}_{\mathrm{cont}, n}\), for which a training dataset of size \(n = \Theta(\frac{\mathcal{C}(\mathcal{F}_{\mathrm{emb}})\, \mathrm{poly}(k, \chi)}{\epsilon^2}\log \frac{1}{p_{\mathrm{erm fails}}})\) was drawn i.i.d. from \(\mu\), then with probability at least \(1 - p_{\mathrm{erm fails}}\) over the randomness of the training dataset,

\[\begin{align} \mathcal{L}_{\mathrm{cont}}(h_{\hat{\theta}}) \leq \mathcal{L}_{\mathrm{cont}}(h_{\theta_*}) + \epsilon\label{eq:cont-eps-min} \end{align}\tag{16}\]

Equivalently, with \(F_{\hat{\theta}} \in \mathbb{R}^{|V| \times k}\) where \(\forall x \in [N], F_{\hat{\theta}}[x] = \sqrt{\sigma_x} h_{\hat{\theta}}(x)^\top\) (with \(\sigma_x\) defined in 11 ), then

\[\begin{align} \mathcal{L}_{\mathrm{mf}}(F_{\hat{\theta}}) := ||\overline{A} - F_{\hat{\theta}} F_{\hat{\theta}}^\top||^2_F &\leq \min_{F :\,\, \mathrm{rank}(F) = k} ||\overline{A} - F F^\top||^2_F + \epsilon\label{eq:mf-eps-min} \end{align}\tag{17}\]

Proof. Apply 6, plugging in \(\hat{\mathcal{R}}_{n/2} \leq \sqrt{\frac{\mathcal{C}(\mathcal{F}_{\mathrm{emb}})}{n/2}}\), \(p_{\mathrm{erm fails}}= \frac{\epsilon}{\mathrm{poly}(k, \chi)}\), and \(n = \Theta(\frac{\mathcal{C}(\mathcal{F}_{\mathrm{emb}}) \, \mathrm{poly}(k, \chi)}{\epsilon^2}\log \frac{1}{p_{\mathrm{erm fails}}})\), with the constant scaled so that the bound from 6 becomes

\[\begin{align} \mathcal{L}_{\mathrm{cont}}(h_{\hat{\theta}}) &\leq \mathcal{L}_{\mathrm{cont}}(h_{\theta_*}) + \mathrm{poly}(k,\chi) \, \hat{\mathcal{R}}_{n/2}(\mathcal{F}_{\mathrm{emb}}) + \mathrm{poly}(k,\chi) \, (\sqrt{\frac{\log \frac{2}{p_{\mathrm{erm fails}}}}{n}} + p_{\mathrm{erm fails}})\\ &\leq \mathcal{L}_{\mathrm{cont}}(h_{\theta_*}) + \epsilon \end{align}\]

This establishes 16 . 17 follows from 16 and 13 , which we showed above:

\[\begin{align} \forall h_\theta \in \mathcal{F}_{\mathrm{emb}}, \mathcal{L}_{\mathrm{mf}}(h_\theta) = c + \mathcal{L}_{\mathrm{cont}}(h_\theta) \end{align}\]

Where constant \(c\) is independent of \(h_\theta\). ◻

Note that as the proof of 6 bounds the excess test loss of the ERM with uniform convergence, this result can actually be strengthened: any \(\frac{\epsilon}{2}\)-minimizer of the empirical contrastive loss, with \(n = \Theta(\frac{\mathcal{C}(\mathcal{F}_{\mathrm{emb}}) \, \mathrm{poly}(k, \chi)}{\epsilon^2}\log \frac{1}{p_{\mathrm{erm fails}}})\) i.i.d. samples, is \(\epsilon\)-minimizer embedding model with probability at least \(1 - p_{\mathrm{erm fails}}\).

8.1.3 The Connection Between Diffusion Embeddings and Contrastive Learning↩︎

In the following, assume the graph \(G = (V,E)\) is finite (\(|V| < \infty\)), undirected, and connected.

Definition 12. (Spectral Diffusion Embedding) Let \(G = (V,E)\) be a connected, undirected graph. Let \((V,P)\) be a reversible Markov chain with transition matrix \(P \in [0,1]^{|V| \times |V|}\) and stationary measure \(\pi\). Define \(\{\phi_i\}_{i \in [|V|]}\) as the right eigenvectors of \(P\) such that \(P \phi_i = \lambda_i \phi_i\), with \(1 = \lambda_1 \geq |\lambda_2| \geq \ldots \geq |\lambda_{|V|}| \geq 0\). The normalization of the eigenvectors is where \(\forall i \in [|V|]\), \(\mathrm{diag}(\pi)^{1/2} \phi_i\) is a unit vector.3 Denote \(\phi_i(x)\) as the \(x\)-th entry of \(\phi_i \in \mathbb{R}^{|V|}\). For any \(t \in \mathbb{N}\), define the scale-\(t\) spectral diffusion embedding as

\[\begin{align} \forall x \in V, \, \Phi_t(x) = (\lambda_i^t \phi_i(x))_{i \in [|V|]} \in \mathbb{R}^{|V|} \end{align}\]

Moreover, for any \(k \in [|V|],\) define the \(k\)-truncated scale-\(t\) spectral diffusion embedding as

\[\begin{align} \forall x \in V, \, \Phi^{\leq k}_t(x) = (\lambda_i^t \phi_i(x))_{i \in [k]} \in \mathbb{R}^{k} \end{align}\]

[lem:diff-dist] establishes a connection between diffusion similarity and Euclidean inner product of the spectral diffusion embeddings.

lemmadiffdistlemma Let \(G = (V,E)\) be a connected, undirected graph. Let \((V,P)\) be a reversible Markov chain with transition matrix \(P \in [0,1]^{|V| \times |V|}\) and stationary measure \(\pi\). For any \(t \in \mathbb{N}\) and \(x \in V\), with \(\Phi_t(x) = (\lambda_i^t \phi_i(x))_{i \in [|V|]} \in \mathbb{R}^{|V|}\) denoting the spectral diffusion embedding of \(x\) as in 12, we have

\[\begin{align} \forall x,y \in V, \langle \Phi_t(x), \Phi_t(y) \rangle = \langle p^t(x), p^t(y) \rangle_{\ell^2(1/\pi)} \end{align}\]

where \(\langle \cdot, \cdot \rangle\) is the usual Euclidean inner product and \(\langle \cdot, \cdot \rangle_{\ell^2(1/\pi)}\) is the inner product where \(\forall i \in [|V|]\), the \(i\)th term is weighted by \(\frac{1}{\pi(i)}\).

Proof. Because \((V,P)\) is reversible, let \(P = D^{-1} W \in \mathbb{R}^{|V| \times |V|}\) where \(D = \mathrm{diag}(W \mathbf{1}) = \mathrm{diag}(\pi)\) and \(W = \mathrm{diag}(\pi)P \in \mathbb{R}^{|V| \times |V|}\) is symmetric. The symmetric matrix \(\overline{A} = D^{-1/2}WD^{-1/2}\) is the normalized adjacency matrix, with eigendecomposition \(\overline{A} = \sum_{i \in [|V|]} \lambda_i u_i u_i^\top\). Since \(P = D^{-1/2}\overline{A}D^{1/2}\), then \(P = \sum_{i \in [|V|]} \lambda_i (D^{-1/2}u_i) (D^{1/2}u_i)^\top\), so that \(\forall i \in [|V|], \phi_i = D^{-1/2}u_i\). Now, for any \(t \in \mathbb{N}\) and \(x \in V\),

\[\begin{align} p^t(x) &:= (P^\top)^t e_x\\ &= D^{1/2} \overline{A}^t D^{-1/2} e_x\\ &= D^{1/2} \sum_{i \in [|V|]} \lambda_i^t u_i \phi_i(x)\\ &= D^{1/2} U\Phi_t(x) \end{align}\]

Where \(U\) is an orthogonal transformation \(U = [u_1, \ldots, u_{|V|}] \in \mathbb{R}^{|V| \times |V|}\). It follows that for any \(x,y \in V\),

\[\begin{align} \langle p^t(x), p^t(y) \rangle_{\ell^2(1/\pi)} &:= (p^t(x))^\top D^{-1} p^t(y)\\ &= \Phi_t(x)^\top U^\top U \Phi_t(y)\\ &= \Phi_t(x)^\top \Phi_t(y) \end{align}\] ◻

As a corollary, for any \(u,v \in V\), the diffusion distance \(||p^t(u)- p^t(v)||_{\ell^2(1/\pi)} = ||\Phi_t(u)- \Phi_t(v)||_2\). For more about diffusion distance, see [29] and [36].

The following Lemma describes the approximation properties of a diffusion embedding with small embedding dimension \(k \in [|V| - 1]\) (rather than the full \(|V|\)-dimensional embedding), when \(\lambda_{k + 1}^{2t}\) is small.

Lemma 7. (Small Embedding Dimension Approximation; Lemma 2 of [36]) Let \(G = (V,E)\) be a connected, undirected graph. Let \((V,P)\) be a reversible Markov chain with transition matrix \(P \in [0,1]^{|V| \times |V|}\) and stationary measure \(\pi\). Let \(\pi_{\mathrm{min}}:= \min_{v \in V} \pi(v)\) and \(1 =\lambda_1 \geq |\lambda_2| \geq \ldots, \geq |\lambda_{|V|}| \geq 0\) be arranged in decreasing magnitude. Given \(t \in \mathbb{N}\) and \(k \in [|V| - 1]\), for any \(u,v \in V\),

\[\begin{align} ||\Phi_t(u) - \Phi_t(v)||_2^2 - \frac{2\lambda_{k + 1}^{2t}}{\pi_{\mathrm{min}}} \cdot 1[u \neq v] &\leq ||\Phi^{\leq k}_t(u) - \Phi^{\leq k}_t(v)||_2^2 \leq ||\Phi_t(u) - \Phi_t(v)||_2^2\label{eq:dim-k-embd-approx-1}\\ ||\Phi_t(v)||_2^2 - \frac{\lambda_{k + 1}^{2t}}{\pi_{\mathrm{min}}} &\leq ||\Phi_t^{\leq k}(v)||_2^2 \leq ||\Phi_t(v)||_2^2\label{eq:dim-k-embd-approx-2}\\ \langle\Phi_t(u), \Phi_t(v) \rangle - \frac{\lambda_{k + 1}^{2t}}{\pi_{\mathrm{min}}} &\leq \langle\Phi_t^{\leq k}(u), \Phi_t^{\leq k}(v) \rangle \leq \langle\Phi_t(u), \Phi_t(v) \rangle + \frac{\lambda_{k + 1}^{2t}}{\pi_{\mathrm{min}}} \end{align}\] {#eq: sublabel=eq:eq:dim-k-embd-approx-1,eq:eq:dim-k-embd-approx-2}

Proof. As in the proof of [lem:cont-learn-min-general], with \(D = \mathrm{diag}(\pi)\) and matrix \(D^{1/2}PD^{-1/2}\) having eigendecomposition \(U \Lambda U^\top\), then \(P = (D^{-1/2} U) \Lambda (D^{1/2} U)^\top\).

The matrix of right eigenvectors \(\Phi := [\phi_1, \ldots, \phi_n] = D^{-\frac{1}{2}}U\). Thus,

\[\begin{align} \Phi \Phi^\top &= D^{-\frac{1}{2}} UU^\top D^{-\frac{1}{2}}\\ &= D^{-1} \end{align}\]

Denoting \(n := |V|\), for any \(u,v \in V\),

\[\begin{align} \sum_{i = 1}^n \phi_i(u) \phi_i(v) &= \frac{1[u = v]}{\pi(v)}\\ \sum_{i=1}^n \bigl(\phi_i(u)-\phi_i(v)\bigr)^2 &= \begin{cases} 0, & u=v,\\[1mm] \frac{1}{\pi(u)}+\frac{1}{\pi(v)}, & u\neq v, \end{cases} \le \frac{2}{\pi_{\min}}\mathbf{1}_{\{u\neq v\}}. \end{align}\]

Now \[\begin{align} ||\Phi_t^{\leq k}(u)-\Phi_t^{\leq k}(v)||_2^2 &= ||\Phi_t(u)-\Phi_t(v)||_2^2 - \sum_{i \geq k + 1} \lambda_i^{2t}\bigl(\phi_i(u)-\phi_i(v)\bigr)^2 \\ &\ge ||\Phi_t(u)-\Phi_t(v)||_2^2 - \lambda_{k + 1}^{2t} \sum_{i=1}^n \bigl(\phi_i(u)-\phi_i(v)\bigr)^2 \\ &\ge ||\Phi_t(u)-\Phi_t(v)||_2^2 - \frac{2\lambda_{k + 1}^{2t}}{\pi_{\min}}\mathbf{1}_{\{u\neq v\}}. \end{align}\] The upper bound \(||\Phi_t^{\leq k}(u)-\Phi_t^{\leq k}(v)||_2^2 \le ||\Phi_t(u)-\Phi_t(v)||_2^2\) is immediate, since truncation only removes nonnegative terms. This proves ?? .

Similarly, \[\begin{align} ||\Phi_t^{\leq k}(v)||_2^2 &= ||\Phi_t(v)||_2^2 - \sum_{i\geq k + 1} \lambda_i^{2t}\phi_i(v)^2 \\ &\ge ||\Phi_t(v)||_2^2 - \lambda_{k + 1}^{2t} \sum_{i=1}^n \phi_i(v)^2 \\ &\ge ||\Phi_t(v)||_2^2-\frac{\lambda_{k + 1}^{2t}}{\pi_{\min}}. \end{align}\] Again, since truncation only removes nonnegative terms, \(||\Phi_t^{\leq k}(v)||_2^2 \le ||\Phi_t(v)||_2^2.\) This proves ?? .

Finally,

\[\begin{align} \langle\Phi_t^{\leq k}(u), \Phi_t^{\leq k}(v) \rangle &= \langle\Phi_t(u), \Phi_t(v) \rangle - \sum_{i \geq k + 1} \lambda_i^{2t}\phi_i(u) \phi_i(v)\\ &\geq \langle\Phi_t(u), \Phi_t(v) \rangle - \sqrt{\Big(\sum_{i \geq k + 1}\lambda_{i}^{2t} \phi_i(u)^2 \Big) \Big(\sum_{i \geq k + 1 } \lambda_{i}^{2t} \phi_i(v)^2 \Big) } \\ &\geq \langle\Phi_t(u), \Phi_t(v) \rangle - \lambda_{k + 1}^{2t} \sqrt{\Big(\sum_{i = 1}^n \phi_i(u)^2 \Big) \Big(\sum_{i = 1}^n \phi_i(v)^2 \Big) } \\ &\geq \langle\Phi_t(u), \Phi_t(v) \rangle - \frac{\lambda_{k + 1}^{2t}}{\pi_{\mathrm{min}}}\\ \mathrm{Similarly, } \langle\Phi_t^{\leq k}(u), \Phi_t^{\leq k}(v) \rangle &\leq \langle\Phi_t(u), \Phi_t(v) \rangle + \frac{\lambda_{k + 1}^{2t}}{\pi_{\mathrm{min}}} \end{align}\] ◻

We will now describe how to learn the embeddings \(\{ \Phi_t^{\leq k}(u)\}_{u \in V}\) for general \(k \in [|V|]\) and \(t \in \mathbb{N}\). [lem:cont-learn-min-general] shows the global minimizers of the contrastive loss recover \(\{ \Phi^{\leq k}_t(u)\}_{u \in V}\) up to an orthogonal transformation.

lemmacontlossmin Let \(G = (V,E)\) be any connected, undirected graph. Let \((V,P)\) be a reversible Markov chain with transition matrix \(P \in [0,1]^{|V| \times |V|}\) and stationary measure \(\pi \in \Delta(V)\). Let \(\{ \lambda_i(P)\}_{i \in [|V|]}\) be the eigenvalues of \(P\), ordered by decreasing absolute value. Fix any \(t \in \mathbb{N}\) and \(k \in [|V|]\). Suppose \(|\lambda_k(P)| - |\lambda_{k + 1}(P)| > 0\) if \(k < |V|\) and suppose the population contrastive loss (14 ) with base distribution \(\pi\), augmentation function \(P^t\), and embedding dimension \(k\) has a global minimizer in \(\mathcal{F}_{\mathrm{emb}}\). Then, for any such global minimizer \(\mathcal{F}_{\mathrm{emb}}\ni h_{\theta_*} : V \to \mathbb{R}^k\), there exists an orthogonal matrix \(R_* \in O^{k \times k}\) where

\[\begin{align} \forall u \in V, h_{\theta_*}(u) = R_* \, \Phi^{\leq k}_t(u) \in \mathbb{R}^{k} \end{align}\]

With mapping \(C : V\to \Delta(V)\) defined as the sampler-representation of \(P\), where \(\forall x \in V, C(x) = P[x]\), then the positive and negative pair distribution corresponding to base distribution \(\pi\) and augmentation function \(P^t\) are where positive pairs \((x,y)\) are generated by sampling \(z \sim \pi,\) then \(x \sim C^t(z), y \sim C^{t}(z)\) independently. Negative pairs \((x,y)\) are generated via \(x,y \sim \pi\) independently. Note that \(\sigma_x\) (defined in 11 ) equals \(\pi(x)\) for every \(x \in V\).

Proof. Fix \(t \in \mathbb{N}\) and \(k \in [|V|]\). The plan is to follow the derivation process of the contrastive loss \(\mathcal{L}_{\mathrm{cont}}\), but with \(\mu = \pi\) and \(Q = P^t\). First, we have

\[\begin{align} A &= Q^\top \mathrm{diag}(\mu)Q\\ &= (P^t)^\top \mathrm{diag}(\pi) P^t\\ &= \mathrm{diag}(\pi) P^{2t} \\ D &:= \mathrm{diag}(A \mathbf{1})\\ &= \mathrm{diag}(\pi)are 1}\\ \overline{A} &:= D^{-1/2} A D^{-1/2}\\ &= \mathrm{diag}(\pi)^{1/2} P^{2t} \mathrm{diag}(\pi)^{-1/2} \end{align}\]

Let the eigendecomposition of \(\overline{A}\) be \(\overline{A} = \sum_{i \in [|V|]} \lambda_i(\overline{A})\, u_i u_i^\top = U\Lambda U^\top\). By the Eckart-Young-Mirsky Theorem [40], since \(\overline{A}\) is p.s.d. and \(\lambda_k(\overline{A}) - \lambda_{k + 1}(\overline{A}) = \lambda_k(P)^{2t} - \lambda_{k + 1}(P)^{2t} > 0\) if \(k < |V|\), the rank-\(k\) minimizers of the matrix factorization loss are:

\[\begin{align} \{ U\Lambda^{1/2}R : R \in O^{k \times k}\} = \arg\min_{F \in \mathbb{R}^{|V| \times k}} || \overline{A} - FF^\top||_F^2 \end{align}\]

Because for any \(h_\theta \in \mathcal{F}_{\mathrm{emb}}\), \(\mathcal{L}_{\mathrm{mf}}(h_\theta ) = \mathcal{L}_{\mathrm{cont}}(h_\theta) + c\) for some constant \(c\) independent of \(h_\theta\) (13 ), then if \(\mathcal{F}_{\mathrm{emb}}\) contains some \(h_{\theta_*} : V \to \mathbb{R}^k\) which is a global minimizer of \(\mathcal{L}_{\mathrm{cont}}\), then the induced matrix \(F_{\theta_*} \in \mathbb{R}^{|V| \times k}\), where the \(x\)-th row is:

\[\begin{align} \forall x \in V, F_{\theta_*}[x] &= \sqrt{\pi(x)} h_{\theta_*}(x)^\top \end{align}\]

Must be in the set \(\arg\min_{F \in \mathbb{R}^{|V| \times k}} || \overline{A} - FF^\top||_F^2 = \{ U\Lambda^{1/2}R : R \in O^{k \times k}\}\). In particular, there exists \(R \in O^{k \times k}\) where

\[\begin{align} F_{\theta_*} = U\Lambda^{1/2} R \end{align}\]

The \(x\)-th row of \(U\Lambda^{1/2} R\) is \((\lambda_{i}(\overline{A})^{1/2} u_i(x))_{i \in [k]}^\top R \in \mathbb{R}^{1 \times k}\), where \(u_i(x)\) is the \(x\)-th entry of \(u_i\). Thus,

\[\begin{align} \forall x \in V, \, h_{\theta_*}(x) &= (\pi(x))^{-1/2} R \, (\lambda_{i}(\overline{A})^{1/2} u_i(x))_{i \in [k]}\\ &= R \, \Big( \lambda_{i}(\overline{A})^{1/2} (\pi(x))^{-1/2}u_i(x)\Big)_{i \in [k]}\label{eq:spec-embd-equiv} \end{align}\tag{18}\]

Finally, we note that since \(\{ (\lambda_{i}(\overline{A}), u_i) \}_{i \in [k]}\) are the top \(k\) eigenvalue and eigenvectors of \(\overline{A} = \mathrm{diag}(\pi)^{1/2}P^{2t} \mathrm{diag}(\pi)^{-1/2}\), then the eigendecomposition of \(P^{2t}\) is:

\[\begin{align} P^{2t} &= \sum_{i \in [|V|]}\lambda_{i}(\overline{A}) \big(\mathrm{diag}(\pi)^{-1/2} u_i\big) \big(\mathrm{diag}(\pi)^{1/2} u_i\big)^\top\\ &= \sum_{i \in [|V|]} (\lambda_i(P))^{2t} \big(\mathrm{diag}(\pi)^{-1/2} u_i\big) \big(\mathrm{diag}(\pi)^{1/2} u_i\big)^\top \end{align}\]

Where \(\{ \lambda_i(P)\}_{i \in [|V|]}\) are the eigenvalues of \(P\) arranged in decreasing order of absolute value, so that \(\lambda_{i}(\overline{A})^{1/2} = |\lambda_i(P)|^t\). Finally, we see that the right eigenvectors of \(P^{2t}\) are exactly \(\{ \mathrm{diag}(\pi)^{-1/2} u_i \}_{i \in [|V|]}\). Thus, 18 can be written in terms of the \(k\) truncated spectral diffusion embedding in 12.

\[\begin{align} \forall x \in V, \, h_{\theta_*}(x) &= R \, \Big( \lambda_{i}(\overline{A})^{1/2} (\pi(x))^{-1/2}u_i(x)\Big)_{i \in [k]}\\ &= R \, \mathrm{diag}(\mathrm{sign}(\{ \lambda_i(P)^t\}_{i \in [k]})) \, \Phi_t^{\leq k}(x)\\ &= R_* \, \Phi_t^{\leq k}(x) \end{align}\]

Where \(\mathrm{diag}(\mathrm{sign}(\{ \lambda_i(P)^t\}_{i \in [k]})) \in O^{k \times k}\) is a diagonal matrix where the \((i,i)\)-th entry is \(1\) if \(\lambda_i(P)^t\) is non-negative, and \(-1\) if \(\lambda_i(P)^t\) is negative, for \(i \in [k]\). Since \(R,\, \mathrm{diag}(\mathrm{sign}(\{ \lambda_i(P)^t\}_{i \in [k]})) \in O^{k \times k}\), then \(R_* := R \, \mathrm{diag}(\mathrm{sign}(\{ \lambda_i(P)^t\}_{i \in [k]})) \in O^{k \times k}\). ◻

Corollary 2. Let \(G = (V,E)\) be any connected, undirected graph. Let \((V,P)\) be a reversible Markov chain with transition matrix \(P \in [0,1]^{|V| \times |V|}\) and stationary measure \(\pi\). Fix any \(t \in \mathbb{N}\) and \(k \in [|V|]\). Let \(\{ \lambda_i(P)\}_{i \in [|V|]}\) be the eigenvalues of \(P\), ordered by decreasing absolute value. Suppose \(|\lambda_k(P)| - |\lambda_{k + 1}(P)| > 0\) if \(k < |V|\). Denote \(\mathcal{F}_{\mathrm{emb}}^{(k)}\subset \mathcal{F}_V^{(k)}\) as a class of embedding models from \(V\) to \(\mathbb{R}^k\) and \(\mathcal{F}_{\mathrm{emb}}^{(|V|)} \subset \mathcal{F}_V^{(|V|)}\) a class of embedding models from \(V\) to \(\mathbb{R}^{|V|}\). Suppose the population contrastive loss (14 ) with base distribution \(\pi\), augmentation function \(P^t\), and embedding dimension \(k\) (dimension \(|V|\)) has a global minimizer in \(\mathcal{F}_{\mathrm{emb}}^{(k)}\) (\(\mathcal{F}_{\mathrm{emb}}^{(|V|)}\)).

Let \(\theta_*\) be any global minimizer of the population contrastive loss with embedding dimension \(|V|\), and \(\theta_*^{(k)}\) be any global minimizer of the population contrastive loss with embedding dimension with embedding dimension \(k\). There exist orthogonal matrices \(R \in O^{|V| \times |V|}\) and \(R^{(k)} \in O^{k \times k}\) such that \(\forall u \in V,\)

\[\begin{align} h_{\theta_*^{(k)}}(u) &= R^{(k)}\, \Phi^{\leq k}_t(u) \in \mathbb{R}^{k} \label{eq:global-min-Gx-1}\\ h_{\theta_*}(u) &= R \,\Phi_t(u) \in \mathbb{R}^{|V|} \label{eq:global-min-Gx-2} \end{align}\] {#eq: sublabel=eq:eq:global-min-Gx-1,eq:eq:global-min-Gx-2}

In particular, \(\forall u, v \in V,\) with \(\pi_{\mathrm{min}}:= \min_{v \in V} \pi(v)\),

\[\begin{align} ||h_{\theta_*}(u) - h_{\theta_*}(v)||^2 - \frac{2(\lambda_{k + 1}(P))^{2t}}{\pi_{\mathrm{min}}} &= ||p^t(u) - p^t(v)||^2_{\ell^2(1/\pi)} - \frac{2(\lambda_{k + 1}(P))^{2t}}{\pi_{\mathrm{min}}}\\ &\leq ||h_{\theta_*^{(k)}}(u) - h_{\theta_*^{(k)}}(v) ||^2_2 = ||\Phi^{\leq k}_t(u) - \Phi^{\leq k}_t(v)||^2_2\\ &\leq ||p^t(u) - p^t(v)||^2_{\ell^2(1/\pi)}\label{eq:diff-dist-difference-eq} = ||h_{\theta_*}(u) - h_{\theta_*}(v)||^2\\ ||h_{\theta_*}(v)||_2^2 - \frac{(\lambda_{k + 1}(P))^{2t}}{\pi_{\mathrm{min}}} &\leq ||h_{\theta_*^{k_*}}(v)||_2^2 \leq ||h_{\theta_*}(v)||_2^2\label{eq:diff-dist-norm-eq} \end{align}\] {#eq: sublabel=eq:eq:diff-dist-difference-eq,eq:eq:diff-dist-norm-eq}

Proof. We apply [lem:cont-learn-min-general] with graph \(G\) and with embedding dimension \(k\) (resp. embedding dimension \(|V|)\) to get ?? (resp. ?? ). ?? is obtained by combining ?? , ?? , [lem:diff-dist], and 7. ?? is obtained by combining 7 with ?? and ?? . ◻

8.1.4 Matrix Factorization Lemmas↩︎

[lem:diff-dist] and [lem:cont-learn-min-general] motivate the idea of using embeddings learned via contrastive learning to compute the diffusion similarity and distance. [lem:contrastive-learning] shows that finding the ERM (or \(\frac{\epsilon}{2}\)-ERM) suffices, with high probability, to find an \(\epsilon\)-minimizer of the population contrastive loss \(\mathcal{L}_{\mathrm{cont}}\). [lem:eps95close95to95opt], a Lemma about matrix-factorization, is useful in quantifying how close an embedding corresponding to such an \(\epsilon\)-minimizer is to a ground-truth embedding, up to a rotation.

To start, 10, 9, and 8 are introduced here to prove [lem:eps95close95to95opt]. Note that for two matrices \(A, B \in \mathbb{R}^{n \times n}, \langle A,B \rangle := \mathrm{tr}(A^\top B)\) denotes the Hilbert-Schmidt inner product of the two matrices, with \(||A||_F^2 = \langle A, A\rangle\).

Lemma 8. (Lemma 5.4 of [41]) For any natural numbers \(n \geq k\) and matrices \(U, X\in\mathbb{R}^{n\times k}\), \[\begin{align} \mathrm{dist}(U,X)^2 :=\min_{R\in O^{k \times k}}||U-XR||_F^2 \le \frac{1}{2(\sqrt2-1)\sigma_k(X)^2}||UU^\top-XX^\top||_F^2. \end{align}\]

Lemma 9. (Ky Fan Maximum Principle [42]; Theorem 1 of [43]) Let \(A\) be a real, symmetric \(n \times n\) matrix, with eigenvalues \(\lambda_1 \geq \ldots \geq \lambda_n\). For any \(k \in [n]\),

\[\begin{align} \max_{X^\top X = I_k} \mathrm{tr}(X^\top A X) = \sum_{i = 1}^k \lambda_i \end{align}\]

Lemma 10. (Lemma 3.1 of [44]) Let \(A \in R^{n \times n}\) be a symmetric matrix, with eigenvalues ordered as \(|\lambda_1| \geq |\lambda_2|\geq \ldots \geq |\lambda_n|\). For \(k \in [n - 1]\), let \(P_k\) be the projector onto the subspace spanned by the top-\(k\) eigenvectors of \(A\), denoted \(\lambda_1, \ldots, \lambda_k\). Assume that \(\lambda_k^2 - \lambda_{k + 1}^2 > 0\). For any symmetric rank-\(k\) projector \(P \in \mathbb{R}^{n \times n}\), \(P^\top = P\), \(P^2 = P\), \(\mathrm{tr}(P) = k\), we have:

\[\begin{align} \langle A^2,P_k-P\rangle \ge \frac{\lambda_k^2-\lambda_{k+1}^2}{2}||P_k-P||_F^2. \label{eq:curvature95proj} \end{align}\qquad{(1)}\]

Proof. Diagonalize \(A^2 = U\mathrm{diag}(\{\lambda_i^2\}_{i \in [n]})U^\top\) and write \(\widetilde{P}:=U^\top P U\). Partition \(\widetilde{P}\) as \[\begin{align} \widetilde{P} = \begin{pmatrix} P_{11} & P_{12}\\ P_{21} & P_{22} \end{pmatrix} \quad\text{with } P_{11}\in\mathbb{R}^{k\times k}. \end{align}\] Then \(\widetilde{P}_k = U^\top P_k U =\mathrm{diag}(I_k,0)\) in the eigenbasis, and \[\begin{align} \langle A^2,P_k-P\rangle &= \mathrm{tr}\big(\mathrm{diag}(\{\lambda_i^2\}_{i \in [n]})(\widetilde{P}_k-\widetilde{P})\big)\\ &= \mathrm{tr}\big(\Lambda_k^2(I-P_{11})\big) - \mathrm{tr}\big(\Lambda_\perp^2 P_{22}\big) \end{align}\] where \(\Lambda_\perp:=\mathrm{diag}(\{\lambda_{k+1},\dots,\lambda_n\})\). Using \(\Lambda_k^2\succeq \lambda_k^2 I_k\) and \(\Lambda_\perp^2\preceq \lambda_{k+1}^2 I\) gives \[\begin{align} \langle A^2,P_k-P\rangle \ge \lambda_k^2\mathrm{tr}(I-P_{11}) - \lambda_{k+1}^2\mathrm{tr}(P_{22}). \end{align}\] Since \(\widetilde{P}\) is a rank-\(k\) projector, \(\mathrm{tr}(\widetilde{P})=k\), so \(\mathrm{tr}(P_{11})+\mathrm{tr}(P_{22})=k\) and thus \(\mathrm{tr}(I-P_{11})=\mathrm{tr}(P_{22})\). Also, for rank-\(k\) projectors, \[\begin{align} ||P_k-P||_F^2 &=\mathrm{tr}\big((P_k-P)^2\big)\\ &=\mathrm{tr}(P_k)+\mathrm{tr}(P)-2\mathrm{tr}(P_kP)\\ &=2k-2\mathrm{tr}(P_{11})\\ &=2\mathrm{tr}(I-P_{11}). \end{align}\] Therefore \(\mathrm{tr}(I-P_{11})=\frac{1}{2}||P_k-P||_F^2\), and we obtain ?? . ◻

lemmamatfactconj Let \(A\in\mathbb{R}^{n\times n}\) be symmetric positive semidefinite with eigendecomposition \(A = U\mathrm{diag}(\{\lambda_i\}_{i \in [n]})U^\top\) where \(\lambda_1\ge \cdots \ge \lambda_n\ge 0\). Fix \(1\le k < n\) and assume \(\lambda_k>0\) and the squared eigengap \(\lambda_k^2-\lambda_{k+1}^2 > 0.\) Define, for matrix \(F\in\mathbb{R}^{n\times k}\) of rank \(k\),

\[\begin{align} \mathcal{L}(F) &:= ||A-FF^\top||_F^2 \end{align}\]

Suppose \(F\in\mathbb{R}^{n\times k}\) satisfies \(\mathcal{L}(F) \leq \min_{\mathrm{rank}(Z)=k} \mathcal{L}(Z) + \epsilon\) for some \(0<\epsilon\leq 1.\) Define the constant \(\mathcal{C}(A,k):= \frac{\Big(1 + 4||A||_2\sqrt{\frac{2}{\lambda_k^2 - \lambda_{k + 1}^2}}\Big)^2}{2(\sqrt2-1)\lambda_k}\). Then, there exists a global minimizer \(F^*\in\arg\min_{\mathrm{rank}(Z)=k} \mathcal{L}(Z)\) such that: \[\begin{align} ||F-F^*||_F^2 &\leq \mathcal{C}(A,k) \,\epsilon \end{align}\]

Proof. First, we recall the Eckart-Young-Mirsky Theorem [40], which characterizes the global minima of the loss function \(\mathcal{L}(F)\). Let \(U_k\in\mathbb{R}^{n\times k}\) be the first \(k\) eigenvectors and let \(\Lambda_k:=\mathrm{diag}(\lambda_1,\dots,\lambda_k)\). Since \(A\succeq 0\) and \(\lambda_k^2 - \lambda_{k + 1}^2>0\), the best rank-\(k\) approximation in Frobenius norm is \(A_k := U_k\Lambda_k U_k^\top\), which is unique. \[\begin{align} \min_{\mathrm{rank}(Z)=k} \mathcal{L}(Z) = ||A-A_k||_F^2 = \sum_{i>k}\lambda_i^2 = ||A||_F^2-||\Lambda_k||_F^2. \end{align}\]

Because of this, the set of global minimizers of \(\mathcal{L}(\cdot)\) over rank-\(k\), \((n \times k)\) matrices are \(S :=\{U_k\Lambda_k^{1/2}R : R\in O^{k \times k}\}\). With this, the proof plan is to upper bound \(||FF^\top - A_k||_F\), and then apply 8 to get the final result. To bound, \(||FF^\top - A_k||_F\), define \(P\) as the rank-\(k\) projector onto \(\mathrm{col}(F)\).

\[\begin{align} P &:= F(F^\top F)^{-1} F^\top \in \mathbb{R}^{n \times n}\\ Q &:= F(F^\top F)^{-1/2}\in \mathbb{R}^{n \times k} \end{align}\]

Where \(P = QQ^\top.\) We will use the following decomposition, as a result of the triangle inequality.

\[\begin{align} ||FF^\top - A_k||_F \leq ||FF^\top - PAP||_F + ||PAP - A_k||_F\label{eq:decomposition-of-gram-diff} \end{align}\tag{19}\]

The remaining proof will be dedicated to bounding the terms \(||FF^\top - PAP||_F\) and \(||PAP - A_k||_F\) individually.

Bounding \(||FF^\top - PAP||_F\).

First, we will show that \(||FF^\top - PAP||_F \leq \sqrt{\epsilon}\). Towards this, we derive a useful identity for \(\mathcal{L}(F)\), culminating in 20 . A direct expansion of \(\mathcal{L}(F)\) gives the identity

\[\begin{align} \mathcal{L}(F) &= ||(FF^\top - PAP) + (PAP - A)||_F^2\\ &= ||FF^\top - PAP||_F^2 + ||PAP - A||_F^2 + 2 \langle FF^\top - PAP, PAP - A\rangle\\ &= ||FF^\top - PAP||_F^2 + ||PAP - A||_F^2 \end{align}\]

Where the last equality is because \(\langle FF^\top - PAP, PAP - A\rangle = \mathrm{tr}( FF^\top PAP - FF^\top A) + \mathrm{tr}(-(PAP)^2 + PAPA) = 0\), as \(\mathrm{tr}( FF^\top PAP)= \mathrm{tr}(FF^\top A)\) and \(\mathrm{tr}((PAP)^2) = \mathrm{tr}( PAPA)\). Subtracting \(\min_{\mathrm{rank}(Z)=k} \mathcal{L}(Z)=||A||_F^2-||\Lambda_k||_F^2\) yields

\[\begin{align} \mathcal{L}(F) - \min_{\mathrm{rank}(Z)=k} \mathcal{L}(Z) &= ||FF^\top - PAP||_F^2 + ||PAP - A||_F^2 - (||A||_F^2-||\Lambda_k||_F^2)\\ &= ||FF^\top - PAP||_F^2 + (||\Lambda_k||_F^2 + ||PAP||_F^2 - 2\mathrm{tr}(PAPA))\\ &= ||FF^\top - PAP||_F^2 + (||\Lambda_k||_F^2 - ||Q^\top AQ||_F^2) \label{eq:gap95decomp} \end{align}\tag{20}\]

Where in 20 , we used that \(||Q^\top AQ||_F^2 = ||PAP||_F^2 = \mathrm{tr}(PAPA)\).

Because \(\mathcal{L}(F) - \min_{\mathrm{rank}(Z)=k} \mathcal{L}(Z) \leq \epsilon\) by assumption, then by 20 , to show that \(||FF^\top - PAP||_F^2 \leq \epsilon\), it suffices to show that \(||\Lambda_k||_F^2-||Q^\top A Q||_F^2\ge 0\). Towards this, let \(Q_\perp\) complete \(Q\) to an orthonormal basis, so that \(I = QQ^\top + Q_\perp Q_\perp^\top\). Then \[\begin{align} Q^\top A^2 Q &= Q^\top A(I)A Q\\ &=Q^\top A QQ^\top A Q + Q^\top A Q_\perp Q_\perp^\top A Q\\ \mathrm{tr}(Q^\top A^2 Q) &=||Q^\top A Q||_F^2 + ||Q_\perp^\top A Q||_F^2 \ge ||Q^\top A Q||_F^2 \label{eq:trA2P95ge95B2} \end{align}\tag{21}\] On the other hand, since \(P=QQ^\top\) has rank \(k\) with \(Q^\top Q = I_k\), by 9, \[\begin{align} \mathrm{tr}(A^2P) =\mathrm{tr}(Q^\top A^2 Q) \le \sum_{i=1}^k \lambda_i(A^2) =\sum_{i=1}^k \lambda_i^2 =||\Lambda_k||_F^2\label{eq:trA2P-lb} \end{align}\tag{22}\]

Combining 22 with 21 gives \(||Q^\top A Q||_F^2\le ||\Lambda_k||_F^2\). By 20 , and the fact that \(\mathcal{L}(F) - \min_{\mathrm{rank}(Z)=k} \mathcal{L}(Z) \leq \epsilon\), we conclude that

\[\begin{align} ||FF^\top - PAP||_F^2 \leq \epsilon\label{eq:bdd-term1-mf} \end{align}\tag{23}\]

which upper bounds the first term in our decomposition, 19 .

Bounding \(||PAP - A_k||_F\).

With \(P_k:=U_kU_k^\top\) denoting the projector onto the top-\(k\) eigenspace of \(A\), we will first argue that projectors \(P\) and \(P_k\) are close in Frobenius norm. We have

\[\begin{align} \mathrm{tr}(A^2P_k)-\mathrm{tr}(A^2P) &=||\Lambda_k||_F^2-\mathrm{tr}(A^2P)\\ &\le ||\Lambda_k||_F^2-||Q^\top AQ||_F^2and P = QQ^\top}\\ &\le \epsilon \end{align}\]

Where the last inequality is by 20 , the non-negativity of \(||FF^\top - PAP||_F^2\), and the fact that \(\mathcal{L}(F) - \min_{\mathrm{rank}(Z)=k} \mathcal{L}(Z) \leq \epsilon\).

The squared eigengap \(\lambda_k^2-\lambda_{k+1}^2 > 0\) is positive by assumption. Since \(\langle A^2,P_k-P\rangle=\mathrm{tr}(A^2P_k)-\mathrm{tr}(A^2P)\le\epsilon\), 10 (?? ) implies that

\[||P_k-P||_F^2 \le \frac{2\epsilon}{\lambda_k^2-\lambda_{k+1}^2} \label{eq:PkP95bound}\tag{24}\]

Write \(\Delta:=P-P_k\). Note that \(A_k = P_k AP_k\). We have \[\begin{align} PAP-P_kAP_k &= P_kA\Delta + \Delta A P_k + \Delta A \Delta\\ ||PAP-P_kAP_k||_F &\le 2||A||_2\, ||P_k||_2\,||\Delta||_F + ||A||_2\, ||\Delta||_2\, ||\Delta||_F\\ &\le 4||A||_2||\Delta||_F \end{align}\]

With \(||\Delta||_F=||P-P_k||_F\le \sqrt{\frac{2\epsilon}{\lambda_k^2-\lambda_{k+1}^2 }}\) from 24 , we have \[\begin{align} ||PAP-A_k||_F = ||PAP-P_kAP_k||_F \le 4||A||_2\sqrt{\frac{2\epsilon}{\lambda_k^2-\lambda_{k+1}^2 }}\label{eq:bdd-term2-mf} \end{align}\tag{25}\]

Combining the Bounds.

Plugging in 23 and 25 into 19 ,

\[\begin{align} ||FF^\top - A_k||_F &\leq ||FF^\top - PAP||_F + ||PAP - A_k||_F\\ &\leq \sqrt{\epsilon} + 4||A||_2\sqrt{\frac{2\epsilon}{\lambda_k^2-\lambda_{k+1}^2 }}\\ &=\Big(1 + 4||A||_2\sqrt{\frac{2}{\lambda_k^2-\lambda_{k+1}^2 }}\Big)\sqrt{\epsilon}\label{eq:gram-bdd-mf} \end{align}\tag{26}\]

Finally, noting that any global minimizer \(F_0 \in \arg \min_{\mathrm{rank}(Z)=k} \mathcal{L}(Z)\) satisfies that \(F_0 F_0^\top = A_k\), we can view \(||FF^\top - A_k||_F\) as the difference between the gram matrices of \(F\) and a global minimizer \(F_0\). 8 enables us to convert an upper bound on the Gram error \(||FF^\top - A_k||_F\) to factor error, between \(F\) and the closest global minimizer to it in Frobenius norm (specified by a \((k \times k)\) orthogonal matrix). Let \(F_0:=U_k\Lambda_k^{1/2}\in S\) so that \(F_0F_0^\top=A_k\) and \((\sigma_k(F_0))^2=\lambda_k\). Apply 8 with \(U=F\) and \(X = F_0\), and then combine the result with \((\sigma_k(F_0))^2=\lambda_k\) and 26 to obtain:

\[\begin{align} \mathrm{dist}(F,F_0)^2 &:= \min_{R\in O^{k \times k}}||F-F_0R||_F^2\\ &\le \frac{1}{2(\sqrt2-1)\lambda_k}||FF^\top-A_k||_F^2\\ &\le \frac{\Big(1 + 4||A||_2\sqrt{\frac{2}{\lambda_k^2-\lambda_{k+1}^2 }}\Big)^2}{2(\sqrt2-1)\lambda_k}\epsilon. \end{align}\] Finally, choose \(R^*\in O^{k \times k}\) that attains the minimum in \(\mathrm{dist}(F,F_0)\) and set \(F^*:=F_0R^*\in S\). Then \(||F-F^*||_F^2=\mathrm{dist}(F,F_0)^2 \leq \frac{\Big(1 + 4||A||_2\sqrt{\frac{2}{\lambda_k^2 - \lambda_{k + 1}^2}}\Big)^2}{2(\sqrt2-1)\lambda_k}\epsilon\), completing the proof. ◻

11 is a simple Lemma that converts the guarantee from [lem:eps95close95to95opt] into one about the embedding functions parameterizing matrices \(F_\theta\) and \(F_*\).

Lemma 11. Let \(n \geq k\) be natural numbers, and matrices \(F_\theta, F_* \in \mathbb{R}^{n \times k}, R \in O^{k \times k}\) to where \(\mathrm{dist}(F_\theta, F_*) = ||F_\theta - F_* R||_F\). Suppose \(\pi \in \Delta([n])\), \(h_\theta : [n] \to \mathbb{R}^k, h_{\theta_*} : [n] \to \mathbb{R}^k\) parameterize \(F_\theta, F_*\) as follows. For all \(x \in [n]\),

\[\begin{align} F_\theta[x] &= \sqrt{\pi(x)} h_\theta(x)\\ F_*[x] &= \sqrt{\pi(x)} h_{\theta_*}(x) \end{align}\] Then, \(\mathrm{dist}(F_\theta, F_*)^2 = \mathbb{E}_{x \sim \pi} ||h_\theta - R\, h_{\theta_*}||_2^2\).

Proof. \[\begin{align} \mathrm{dist}(F_\theta, F_*)^2 &= ||F_\theta - F_* R||_F^2\\ &= \sum_{x \in [n]} \pi(x) ||h_\theta - R\, h_{\theta_*}||_2^2\\ &= \mathbb{E}_{x \sim \pi} ||h_\theta - R\, h_{\theta_*}||_2^2 \end{align}\] ◻

8.1.5 Learning Contrastive Embeddings on Local Subgraphs↩︎

In addition, we would like the embeddings to be learned locally, not for the entire graph simultaneously. For a theorem graph \(G = (V,E)\), define the following notion of a subgraph of \(G\) supported on the \(T\)-neighborhood of a node \(x \in V\). In the following, we will denote \((C,P,w) := (C_w, P_w, w)\) as a reversible conjecturer satisfying 1, to simplify notation.

On a \(T = \tau + 1\) local subgraph centered at \(x \in V\), the \(\tau\)-step random walk distribution of \(x\) and any neighbor \(y \in N(x)\) is the same as that on the entire graph.

Lemma 12. Let \(G = (V,E)\) be a connected, undirected graph with reversible, nearest-neighbor-type Markov chain \((V,P)\). Let \(T = \tau + 1\). Let \(P_{x,T}\) be the restriction of \(P\) to \(G_{x,T}\). For any \(x \in V\) and any \(y \in N(x)\), we have \(p^\tau_{G_{x, T}}(x) = p^\tau(x)\) and \(p^\tau_{G_{x, T}}(y) = p^\tau(y)\), where \(p^\tau(x), p^\tau(y)\) is the usual scale-\(\tau\) diffusion embeddings defined in 3.

Proof. Since \(G_{x, \tau + 1}\) is restricted to \(B(x, \tau + 1)\), then \(G_{x, \tau + 1}\) and \(G\) look identical to a nearest-neighbor-type random walk starting at \(x\) or any \(y \in N(x)\) of length at most \(\tau\). ◻

12 shows the scale-\(\tau\) diffusion embedding can be computed locally, in a \((\tau+1)\) neighborhood around the queried node. In addition, for any reversible Markov chain \((V,P)\) on the entire graph \(G\) with stationary measure \(\pi\), for any \(x \in V\) and \(T \in \mathbb{N}\), the stationary measure \(\pi_{x,T}\) is equal to \(\pi\) restricted to \(B(x,T)\), up to a multiplicative constant, by the self-loop construction of \(G_{x,T}\). Thus, the diffusion similarity and distance computed locally differs from that computed globally by a multiplicative constant, which means the locally-computed diffusion similarity is sufficient for solving the optimization problem in 4 .

To learn the spectral diffusion embedding for reversible Markov chain \((V,P)\), of conjecturer \((C,P,w)\) in a local \(T\)-neighborhood around a node \(x \in V\) via 8, one will require access to the following oracles, defined in [defn:T-neighborhood].

  1. The push-forward map \(C_{x,T} : B(x,T) \to \Delta(B(x,T))\) of the restricted Markov chain \((V_{x,T}, P_{x,T})\), where \(\forall y \in B(x,T)\), \(C_{x,T}(y) = P_{x,T}[y] \in \Delta(B(x,T))\),

  2. i.i.d. sample access to \(\pi_{x,T} \in \Delta(B(x,T))\).

For \((V_{x,T}, P_{x,T})\), it suffices to have access to the original conjecturer \((C,P,w) := (C_w, P_w, w)\) on \(G\) and the neighbor oracle \(N_{G_{x,T}} : V \to 2^V\) of the local graph \(G_{x,T}\) supported on \(B(x, T)\). This is because for any \(y \in B(x,T)\), to sample \(z \sim C_{x,T}(y)\), one can first sample \(z' \sim C(y)\). Then, if \(z' \in N_{G_{x,T}}(y)\), set \(z = z'\). Else, set \(z = y\). \(z\) will be a sample from \(C_{x,T}(y)\) with the correct distribution.

9 describes how to compute \(N_{G_{x,T}} : V \to 2^V\) and \(\pi_{x,T}\). It involves first performing a \(T\)-step BFS starting from node \(x\). Once the set of all theorems in the \(T\)-neighborhood of \(x\) is collected, it is straightforward to create an oracle for \(N_{G_{x,T}}\). Regarding the sampler for \(\pi_{x,T}\), because \(\forall y \in B(x,T), \pi_{x,T}(y) \propto \pi(y) \propto w(y)\), then \(\pi_{x,T}(y) = \frac{w(y)}{\sum_{z \in B(x,T)} w(z)}\). It suffices to compute the vector \(\pi_{x,T}\) for all \(y \in B(x,T)\).

Figure 9: Compute Local Neighbor Oracle and Stationary Measure

8.2 Main Theorems↩︎

Proof. By [lem:cont-learn-min-general], there exists an orthogonal matrix \(R \in O^{|V| \times |V|}\) where

\[\begin{align} \forall u \in V, h_{\theta_*}(u) = R \, \Phi_\tau(u) \in \mathbb{R}^{|V|} \end{align}\] Thus, \[\begin{align} \forall u, v \in V, \langle h_{\theta_*}(u) , h_{\theta_*}(v) \rangle &= \langle R \, \Phi_\tau(u) , R \, \Phi_\tau(v) \rangle\\ &= \langle \Phi_\tau(u) ,\Phi_\tau(v) \rangle\\ &= \langle p^\tau(u), p^\tau(v) \rangle_{\ell^2(1/\pi)} } \end{align}\] ◻

Below is our end-to-end learning result, which can be viewed as a finite-sample, small-embedding dimension version of [thm:contembd].

Proof. By [lem:contrastive-learning], with probability at least \(1 - p_{\mathrm{erm fails}}\),

\[\begin{align} \mathcal{L}_{\mathrm{cont}}(h_{\hat{\theta}}) &\leq \mathcal{L}_{\mathrm{cont}}(h_{\theta_*}) + \epsilon\\ ||\overline{A} - F_{\hat{\theta}} F_{\hat{\theta}}^\top||^2_F &\leq ||\overline{A} - F_{\theta_*} F_{\theta_*}^\top||^2_F + \epsilon \end{align}\]

Under that event, since \(\mathrm{rank}(F_{\hat{\theta}}) = k\) by assumption, by [lem:eps95close95to95opt] and 11,

\[\begin{align} \mathbb{E}_{x \sim \pi } ||h_{\hat{\theta}}(x) - R \, h_{\theta_*}(x)||_2^2 \leq \epsilon\cdot \frac{\Big(1 + 4\sqrt{\frac{2}{\lambda_k^2 - \lambda_{k + 1}^2}}\Big)^2}{2 (\sqrt{2} - 1)\lambda_k} \end{align}\]

Where we’ve used that \(||\overline{A}||_2 = \lambda_1(\overline{A}) = \lambda_1(P^{2\tau}) = 1\). By Markov’s inequality,

\[\begin{align} \mathbb{P}_{x \sim \pi } \Big[ ||h_{\hat{\theta}}(x) - R \, h_{\theta_*}(x)||_2^2 \geq \Delta \Big] \leq \frac{\epsilon}{\Delta} \cdot \frac{\Big(1 + 4\sqrt{\frac{2}{\lambda_k^2 - \lambda_{k + 1}^2}}\Big)^2}{2 (\sqrt{2} - 1)\lambda_k} \end{align}\]

In fact, using the premise that \(\exists \beta > 0 \, : \forall y \in V, \, \sum_{x \in N(y)} \pi(x) \leq \beta \, \pi(y)\), we can extend this closeness guarantee to a neighborhood around \(x \sim \pi\).

\[\begin{align} &\mathbb{P}_{x \sim \pi } \Big[ \exists y \in N(x) : ||h_{\hat{\theta}}(y) - R \,h_{\theta_*}(y)||_2^2 \geq \Delta \Big]\\ &\leq \mathbb{E}_{x \sim \pi} \sum_{y \in N(x)} 1\Big[||h_{\hat{\theta}}(y) - R \,h_{\theta_*}(y)||_2^2 \geq \Delta\Big]\\ &= \sum_{x \in V} \pi(x) \sum_{y \in N(x)} 1\Big[||h_{\hat{\theta}}(y) - R \,h_{\theta_*}(y)||_2^2 \geq \Delta\Big]\\ &\leq \sum_{y \in V} \beta \, \pi(y)\, 1\Big[||h_{\hat{\theta}}(y) - R \,h_{\theta_*}(y)||_2^2 \geq \Delta\Big]\\ &= \beta \cdot \mathbb{P}_{y \sim \pi} \Big[||h_{\hat{\theta}}(y) - R \,h_{\theta_*}(y)||_2^2 \geq \Delta\Big]\\ &\leq \beta \cdot \frac{\epsilon}{\Delta} \cdot \frac{\Big(1 + 4\sqrt{\frac{2}{\lambda_k^2 - \lambda_{k + 1}^2}}\Big)^2}{2 (\sqrt{2} - 1)\lambda_k} \end{align}\]

Thus,

\[\begin{align} &\mathbb{P}_{x \sim \pi } \Big[ \exists y \in N(x) : ||h_{\hat{\theta}}(y) - R \,h_{\theta_*}(y)||_2^2 \geq \Delta \mathrm{ or } ||h_{\hat{\theta}}(x) - R \,h_{\theta_*}(x)||_2^2 \geq \Delta \Big]\\ &\leq \frac{\epsilon}{\Delta} \cdot \frac{(\beta + 1)\cdot \Big(1 + 4\sqrt{\frac{2}{\lambda_k^2 - \lambda_{k + 1}^2}}\Big)^2}{2 (\sqrt{2} - 1)\lambda_k} \end{align}\]

Under the event that \(x\sim \pi\) satisfies

\[\begin{align} \forall y \in N(x) : ||h_{\hat{\theta}}(y) - R \,h_{\theta_*}(y)||_2^2 \leq \Delta \mathrm{ and } ||h_{\hat{\theta}}(x) - R \,h_{\theta_*}(x)||_2^2 \leq \Delta\label{eq:good-case-cont-learning} \end{align}\tag{27}\]

Then, \(\forall y, z \in N(x) \cup \{ x\}\),

\[\begin{align} \langle h_{\hat{\theta}}(y), h_{\hat{\theta}}(z)\rangle &\leq \langle R \,h_{\theta_*}(y), R \,h_{\theta_*}(z) \rangle + 2 \max_{h_\theta \in \mathcal{F}_{\mathrm{emb}}}\max_{\hat{y} \in V} ||h_{\theta}(\hat{y})||_2 \cdot \sqrt{\Delta} + \Delta\\ &\leq \langle h_{\theta_*}(y), h_{\theta_*}(z) \rangle + 2 \chi \sqrt{k} \cdot \sqrt{\Delta} + \Delta\\ \mathrm{Similarly, } \langle h_{\hat{\theta}}(y), h_{\hat{\theta}}(z)\rangle &\geq \langle h_{\theta_*}(y), h_{\theta_*}(z) \rangle - 2 \chi \sqrt{k} \cdot \sqrt{\Delta} - \Delta \end{align}\]

By [lem:cont-learn-min-general] (which says \(\langle h_{\theta_*}(x), h_{\theta_*}(y) \rangle = \langle\Phi_t^{\leq k}(x), \Phi_t^{\leq k}(y) \rangle\)) and 7, then \(\forall x, y \in V\),

\[\begin{align} \langle\Phi_t(x), \Phi_t(y) \rangle - \frac{\lambda_{k + 1}}{\pi_{\mathrm{min}}} &\leq \langle h_{\theta_*}(x), h_{\theta_*}(y) \rangle \leq \langle\Phi_t(x), \Phi_t(y) \rangle + \frac{\lambda_{k + 1}}{\pi_{\mathrm{min}}} \end{align}\]

It follows that when \(x \sim \pi\) satisfies 27 , then with \(\xi := \frac{\lambda_{k + 1}}{\pi_{\mathrm{min}}} + 2 \chi \sqrt{k} \cdot \sqrt{\Delta} + \Delta\), we have

\[\begin{align} \langle\Phi_t(y), \Phi_t(z) \rangle - \xi &\leq \langle h_{\hat{\theta}}(y), h_{\hat{\theta}}(z) \rangle \leq \langle\Phi_t(y), \Phi_t(z) \rangle + \xi \end{align}\]

Since by [lem:diff-dist] we have \(\phi^{\mathrm{diff}}_\tau(y,z) = \langle\Phi_t(y), \Phi_t(z) \rangle\), then with \(\xi := \frac{\lambda_{k + 1}}{\pi_{\mathrm{min}}} + 2 \chi \sqrt{k} \cdot \sqrt{\Delta} + \Delta\), we have

\[\begin{align} &\mathbb{P}_{x \sim \pi}\Big [\exists y,z \in N(x) \cup \{x\} \, : \, |\phi^{\mathrm{diff}}_\tau(y,z) - \langle h_{\hat{\theta}}(y), h_{\hat{\theta}}(z) \rangle| > \xi \Big]\\ &\leq \frac{\epsilon}{\Delta} \cdot \frac{(\beta + 1)\cdot \Big(1 + 4\sqrt{\frac{2}{\lambda_k^2 - \lambda_{k + 1}^2}}\Big)^2}{2 (\sqrt{2} - 1)\lambda_k} \end{align}\]

In short, for sufficiently small \(\epsilon\), the learned embedding model \(h_{\hat{\theta}} : V \to \mathbb{R}^k\) can be used to approximate \(\phi^{\mathrm{diff}}_\tau(y,z)\) of neighboring points of most \(x \in V\) by the inner product, \(\langle h_{\hat{\theta}}(y), h_{\hat{\theta}}(z) \rangle\). ◻

9 Instantiating 5 on Clustered Graphs↩︎

In this section, we first describe a concrete end-to-end result for how 5 improves over a simple random walk, in terms of diversity ([defn:diversity-measure]), on a special class of clustered graphs.

9.1 End-to-End Result of 5 on Clique Graphs↩︎

[prop:e2e-guarantee-alg2] is an end-to-end result for 5, showing that on a special class of theorem graphs ([defn:clique-graph]), that 5 explores the graph faster than a simple random walk. The final guarantee is in terms of the spectral gaps of the random walks, and the diversity of the distributions they generate, according to [defn:diversity-measure].

Proof. Fix a node \(x=(i,a)\in C_i\). Its neighbors split into two classes: \[\begin{align} I_x&:=\{(i,b): b\in[M],\;b\neq a\}\\ E_x&:=\{(j,a): j\in N_Q(i)\}, \end{align}\] with \(|I_x|=M-1\), \(|E_x|=r\), and total degree \(d=M-1+r.\) For \(\tau=1\), since \(G\) is \(d\)-regular, \(\forall x, p^1(x) = \frac{1}{d}\mathbf{1}_{N(x)}\). The matrix \(M_x'\) in 5 equals, up to a constant multiplicative factor of \(d^{-3}\), \(M_x'[y,z]\propto |N(y)\cap N(z)|, y,z\in N(x).\) Therefore 5 minimizes \[\begin{align} F_x(\mu) := \sum_{y,z\in N(x)} \mu(y)\mu(z)\,|N(y)\cap N(z)| \qquad \text{over }\mu\in\Delta(N(x)). \end{align}\]

Write \(u_b:=(i,b)\in I_x\) and \(v_j:=(j,a)\in E_x.\) We compute the relevant neighborhood intersections.

9.1.0.1 (i) Internal/internal.

For any \(b \in [M], b\neq a\), \(|N(u_b)\cap N(u_b)|=d.\) For any distinct \(b,b'\neq a\), \(|N(u_b)\cap N(u_{b'})|=M-2.\) Indeed, \(u_b\) and \(u_{b'}\) share exactly the \(M-2\) vertices in \(C_i\) other than \(u_b\) and \(u_{b'}\).

9.1.0.2 (ii) Internal/external.

For any \(b\neq a\) and any \(j\in N_Q(i)\), \(|N(u_b)\cap N(v_j)|=2.\) The two common neighbors are \(x=(i,a)\) and \((j,b)\).

9.1.0.3 (iii) External/external.

For any \(j\in N_Q(i)\), \(|N(v_j)\cap N(v_j)|=d.\) For any distinct \(j,k\in N_Q(i)\), \(|N(v_j)\cap N(v_k)|=c.\) Indeed, the common neighbors are exactly the vertices \(\{(\ell,a): \ell\in N_Q(j)\cap N_Q(k)\}\) whose number is \(c\) by assumption.

Now let \(\mu_b:=\mu(u_b), \,\,\nu_j:=\mu(v_j),\,\, s:=\sum_{b\neq a}\mu_b.\) Then \(\sum_{j\in N_Q(i)} \nu_j = 1-s\), and the objective becomes \[\begin{align} F_x(\mu) &= d\sum_{b\neq a}\mu_b^2 +(M-2)\sum_{\substack{b,b'\neq a\\ b\neq b'}}\mu_b\mu_{b'} +d\sum_{j\in N_Q(i)}\nu_j^2 +c\sum_{\substack{j,k\in N_Q(i)\\ j\neq k}}\nu_j\nu_k +2 \cdot \sum_{j \in N_Q(i), \, b \neq a} \nu_j \mu_b \\ &= \bigl(d-(M-2)\bigr)\sum_{b\neq a}\mu_b^2 +(M-2)s^2 +(d-c)\sum_{j\in N_Q(i)}\nu_j^2 +c(1-s)^2 + 2 \cdot 2s(1-s) \end{align}\] Since \(d-(M-2)=r+1>0, \,d-c>0,\) for fixed \(s\) the objective is minimized by taking \(\mu_b\) uniform on \(I_x\) and \(\nu_j\) uniform on \(E_x\), i.e. \[\begin{align} \mu_b&=\frac{s}{M-1}\\ \nu_j&=\frac{1-s}{r} \end{align}\] Thus it suffices to minimize the one-variable quadratic \[\begin{align} f_M(s) = A_M s^2 + 4s(1-s) + B_M(1-s)^2 \end{align}\] where \(A_M=M-2+\frac{r+1}{M-1}\) and \(B_M=c+\frac{d-c}{r}.\) Expanding, \[\begin{align} f_M(s) = (A_M+B_M-4)s^2 + (4-2B_M)s + B_M. \end{align}\] Because \(M\ge 3\), we have \(A_M+B_M-4>0\), so \(f_M\) has the unique minimizer \[\begin{align} s=\eta_M:=\frac{B_M-2}{A_M+B_M-4}. \end{align}\] Hence the unique optimizer of 5 at \(x=(i,a)\) is \[\begin{align} \mu_x^* = \frac{\eta_M}{M-1}\sum_{b\neq a}e_{(i,b)} + \frac{1-\eta_M}{r}\sum_{j\in N_Q(i)}e_{(j,a)} \end{align}\] In particular, 5 sends total mass \(\eta_M\) to the current cluster \(C_i\), and total mass \((1-\eta_M)/r\) to each neighboring cluster \(C_j\), \(j\in N_Q(i)\). These transition dynamics depend only on the cluster index \(i\), not on the label \(a\). Thus, we can describe the dynamics of the Markov chain in terms of cluster-level transition probabilities, i.e. as a random walk over the meta-graph \(Q\), where each cluster \(\{C_i\}_{i=1}^K\) corresponds to one state. As a random walk over the meta-graph \(Q\), 5 is described by a transition matrix \(P_{\mathrm{improved}}^{(Q)} \in [0,1]^{K \times K}.\)

\[\begin{align} P_{\mathrm{improved}}^{(Q)}=\eta_M I_K + (1-\eta_M)P_Q \in [0,1]^{K \times K} \end{align}\]

Similarly, the simple random walk on \(G\) can also be described as a random walk over the meta-graph \(Q\), whose transition matrix we denote \(P_{\mathrm{baseline}}^{(Q)} \in [0,1]^{K \times K}\). From any \(x=(i,a)\in C_i\) there are \(M-1\) neighbors inside \(C_i\) and exactly one neighbor in \(C_j\) for each \(j\in N_Q(i)\). Therefore, \[\begin{align} P_{\mathrm{baseline}}^{(Q)} = \frac{M-1}{M-1+r}I_K + \frac{r}{M-1+r}P_Q \in [0,1]^{K \times K} \end{align}\]

Regarding notation, define \(P_{\mathrm{baseline}}\in [0,1]^{KM \times KM}\) and \(P_{\mathrm{improved}}\in [0,1]^{KM \times KM}\) as the simple random walk over \(G\) and the random walk induced by 5 over \(G\) (not over the meta-graph \(Q\)), respectively. \(P_{\mathrm{baseline}}^{(Q)}\) and \(P_{\mathrm{improved}}^{(Q)}\) are the meta-graph analogs of \(P_{\mathrm{baseline}}\) and \(P_{\mathrm{improved}}.\)

Additionally, for transition matrix \(P\) of a Markov chain, define the spectral gap as \(\gamma(P) := 1 - \max(\lambda_2(P), |\lambda_K(P)|)\). Then,

\[\begin{align} \gamma(P_{\mathrm{baseline}}^{(Q)}) &= 1 - \lambda_2(P_{\mathrm{baseline}}^{(Q)}) }^{(Q)} \succeq 0}\\ &= 1 - [\frac{M-1}{M-1+r} + \frac{r}{M-1+r}\lambda_2(P_Q)] \\ &= \frac{r}{M-1+r}(1 - \lambda_2(P_Q))\\ \gamma(P_{\mathrm{improved}}^{(Q)}) &= \min \big( 1 - \lambda_2 (\eta_M I + (1 - \eta_M) P_Q), 1 - |\lambda_K (\eta_M I + (1 - \eta_M) P_Q)| \big)\\ &= \min \big( (1 - \eta_M)(1 - \lambda_2(P_Q)), 1 - |\lambda_K (\eta_M I + (1 - \eta_M) P_Q)| \big)\\ &\geq \min \big( (1 - \eta_M)(1 - \lambda_2(P_Q)), 1 - |2\eta_M - 1| \big) \\ \implies \frac{\gamma(P_{\mathrm{improved}}^{(Q)})}{\gamma(P_{\mathrm{baseline}}^{(Q)})} &\geq \frac{M - 1 + r}{r} \min(1 - \eta_M, \frac{1 - |2\eta_M - 1|}{1 - \lambda_2(P_Q)})\\ &\geq \frac{M - 1 + r}{r} \min(1 - \eta_M, \frac{1 - |2\eta_M - 1|}{2}) \\ &\geq \frac{M - 1 + r}{r} \min(1 - \eta_M, \eta_M)\\ &\geq \frac{M - 1 + r}{r} \cdot \frac{ c + \frac{d - c}{r} - 2 }{M - 2 + \frac{r + 1}{M - 1} + c + \frac{d - c}{r} - 4}\\ &\geq \Omega(\frac{M}{r^2}) \end{align}\]

This proves the first claim.

Towards the second claim, by assumption, \(D_0\) is uniform over its starting cluster:

\[\begin{align} \forall a, a' \in [M], \forall i \in [K], D_0((i,a)) = D_0((i, a')) \end{align}\]

By an inductive argument we have that for all \(t \in \mathbb{N}, D_t^{\mathrm{improved}}\) and \(D_t^{\mathrm{baseline}}\) are uniform over clusters:

\[\begin{align} \forall a, a' \in [M], \forall i \in [K], D_t^{\mathrm{improved}}((i,a)) &= D_t^{\mathrm{improved}}((i, a')) \mathrm{ and }\\ D_t^{\mathrm{baseline}}((i,a)) &= D_t^{\mathrm{baseline}}((i, a')) \end{align}\]

Thus, for all \(t \in \mathbb{N}\), \(D_t^{\mathrm{improved}}\) (resp. \(D_t^{\mathrm{baseline}}\)) is characterized by a probability distribution \(q_t^{\mathrm{improved}}\in \Delta([K])\) (resp. \(q_t^{\mathrm{baseline}}\)) over clusters, where each node in cluster \(i\) has probability \(\frac{q_t^{\mathrm{improved}}(i)}{M}\) (resp. \(\frac{q_t^{\mathrm{baseline}}(i)}{M}\)). The stationary measure \(\pi\) is uniform over the \(KM\) nodes of \(G\) since \(G\) is regular. Thus,

\[\begin{align} \forall t \in \mathbb{N}, ||D_t^{\mathrm{improved}}||_{\ell^2(1/\pi)}^2 &= KM \cdot \frac{1}{M} \cdot ||q_t^{\mathrm{improved}}||_2^2\\ \forall t \in \mathbb{N}, ||D_t^{\mathrm{baseline}}||_{\ell^2(1/\pi)}^2 &= KM \cdot \frac{1}{M} \cdot ||q_t^{\mathrm{baseline}}||_2^2 \end{align}\]

Let \(u = \frac{1}{K} \mathbf{1}\) be the stationary measure of both \(P_{\mathrm{baseline}}^{(Q)}\) and \(P_{\mathrm{improved}}^{(Q)}\), random walks over the meta-graph \(Q\). With \(\tau = 1\) and setting \(P := P_{\mathrm{s.r.w.}}= P_{\mathrm{baseline}}\), for any \(t \in \mathbb{N}\) we have:

\[\begin{align} \forall t \in \mathbb{N}, ||D_t^{\mathrm{improved}}||_{\ell^2(1/\pi)}^2 &= 1 + K \cdot ||q_t^{\mathrm{improved}}- u||_2^2\\ \implies \forall t \in \mathbb{N}, \mathrm{Div}^P_\tau(D_t^{\mathrm{improved}}) &= \frac{1}{||(D_t^{\mathrm{improved}})^\top P_{\mathrm{baseline}}||_{\ell^2(1/\pi)}^2}\\ &= \frac{1}{1 + K \cdot ||(q_t^{\mathrm{improved}}- u)^\top P_{\mathrm{baseline}}^{(Q)}||_2^2}\\ &= \frac{1}{1 + K \cdot ||(q_0 - u)^\top(P_{\mathrm{improved}}^{(Q)})^{t}P_{\mathrm{baseline}}^{(Q)}||_2^2} \end{align}\]

For \(t = \frac{1}{2\gamma(P_{\mathrm{improved}}^{(Q)})}\log \frac{K}{\epsilon}\), then

\[\begin{align} &K \, ||(q_0 - u)^\top(P_{\mathrm{improved}}^{(Q)})^{t}P_{\mathrm{baseline}}^{(Q)}||_2^2\\ &\leq K \, [(1 - \gamma(P_{\mathrm{improved}}^{(Q)}))^t (1 - \gamma(P_{\mathrm{baseline}}^{(Q)}))]^2 ||q_0 - u||_2^2\\ &\leq K \, (1 - \gamma(P_{\mathrm{improved}}^{(Q)}))^{2t}\\ &\leq \epsilon \end{align}\]

Since \(\epsilon< 1\), when \(t = \frac{1}{2\gamma(P_{\mathrm{improved}}^{(Q)})}\log \frac{K}{\epsilon}\), we have that \(\mathrm{Div}^P_\tau(D_t^{\mathrm{improved}}) \geq \frac{1}{1 + \epsilon} \geq 1 - \epsilon\).

By an analogous argument for \(D_t^{\mathrm{baseline}}\), for any \(t \in \mathbb{N}\) we have

\[\begin{align} \forall t \in \mathbb{N}, ||D_t^{\mathrm{baseline}}||_{\ell^2(1/\pi)}^2 &= 1 + K \cdot ||q_t^{\mathrm{baseline}}- u||_2^2\\ \implies \forall t \in \mathbb{N}, \mathrm{Div}^P_\tau(D_t^{\mathrm{baseline}}) &= \frac{1}{||(D_t^{\mathrm{baseline}})^\top P_{\mathrm{baseline}}||_{\ell^2(1/\pi)}^2}\\ &= \frac{1}{1 + K \cdot ||(q_t^{\mathrm{baseline}}- u)^\top P_{\mathrm{baseline}}^{(Q)}||_2^2}\\ &= \frac{1}{1 + K \cdot ||(q_0 - u)^\top(P_{\mathrm{baseline}}^{(Q)})^{t}P_{\mathrm{baseline}}^{(Q)}||_2^2} \end{align}\]

For \(t = \frac{1}{2\gamma(P_{\mathrm{baseline}}^{(Q)})}\log \frac{K}{\epsilon}\), then \(\mathrm{Div}^P_\tau(D_t^{\mathrm{baseline}}) \geq \frac{1}{1 + \epsilon} \geq 1 - \epsilon\). ◻

10 Justification of 2↩︎

The core result of this section is [lem:567-imply-1-4], which justifies 2 by showing that finer-grained assumptions inspired from statistical learning theory implies 2.

lemmadetailedassumptions Assumptions 6, 7, 8 imply Assumption 2.

10.1 Statistical Learning Theory Inspired Assumptions↩︎

First, we introduce Assumptions 6 - 8. Let \(\mathrm{Ver}: V \times \{ 0,1\}^* \to \{ 0,1\}\) be a formal verifier where for theorem \(x \in V\), then \(\mathrm{Ver}(x,y) = 1\) iff \(y \in \{0,1\}^*\) is a correct proof of \(x\). The first assumption assumes the function class \(\mathcal{F}_{\mathrm{prover}}\) of provers \(\mathcal{F}_{\mathrm{prover}}\ni f : V \to \Delta(\{ 0,1\}^*)\) can express the ground-truth function.

Assumption 6. (Expressivity)There exists \(f^* \in \mathcal{F}_{\mathrm{prover}}\) which is a ground-truth prover, so that for every theorem \(x \in V,\) \(f^*(x) \in \Delta(\{ 0,1\}^*)\) is distribution over correct proofs of \(x\).

Each \(f \in \mathcal{F}_{\mathrm{prover}}\) maps a theorem to a distribution of proofs (\(f : V \to \Delta(\{ 0,1\}^*)\), where \(V\) is the set of theorems). Thus we can define a notion of the success rate of a prover on a theorem as the probability that the prover outputs a correct proof. Formally, let \(f(x,r)\) be the output of prover \(f\) on theorem \(x\) and random seed \(r\), where \(r \sim D_r\). Define the following loss function over \(\mathcal{F}_{\mathrm{prover}}\) (which abstracts away the randomness \(r \sim D_r\) into a success rate):

Definition 13. (Loss Functions) Define the following loss functions on provers in \(\mathcal{F}_{\mathrm{prover}}\). \[\begin{align} \ell(f, x) &:= \mathbb{E}_{r \sim D_r}[ 1 - \mathrm{Ver}(x, f(x, r)) ]\\ &= 1 - \operatorname{succ}(x,f)\\ \mathcal{L}(f, D) &:= \mathbb{E}_{x \sim D} \, \ell(f,x)\\ \mathcal{L}_{n} (f, \{ x_i\}_{i \in [n]}) &:= \frac{1}{n} \sum_{i \in [n]} \ell(f, x_i) \end{align}\] With the understanding that \(S_n = \{ x_i\}_{i \in [n]}\) are drawn i.i.d. from \(D\). Let \(\ell(\mathcal{F}_{\mathrm{prover}}) := \{ x \to \ell(f,x) : f \in \mathcal{F}_{\mathrm{prover}}\}\) be the family of loss functions induced by \(\mathcal{F}_{\mathrm{prover}}\) and \(\ell\).

We define the empirical risk minimizer (ERM) as follows.

Definition 14. (Minimizers of Population and Empirical Risk)Let \(D \in \Delta(V)\) be any distribution over theorems. For any \(n \in \mathbb{N}_{+}\), suppose \(\{ x_i\}_{i \in [n]}\) are drawn i.i.d. from \(D\). First, note that \(f^*\) is the population minimizer,

\[\begin{align} \mathcal{L}(f^*, D) = 0 \end{align}\]

Now, define the ERM \(\hat{f}^{(n)}\).

\[\begin{align} \hat{f}^{(n)} \leftarrow \arg\min_{f \in \mathcal{F}_{\mathrm{prover}}} \mathcal{L}_{n} (f, \{ x_i\}_{i \in [n]})\label{eq:erm} \end{align}\qquad{(2)}\]

The Rademacher complexity4 is defined as follows.

Definition 15. For a function class \(\mathcal{F}\), and data distribution \(D\), the average Rademacher complexity is defined as \[\begin{align} \mathcal{R}_n(\mathcal{F}) := \mathbb{E}_{\{x_i\}_{i \in [n]} \overset{\mathrm{iid}}{\sim} D } \mathbb{E}_{\{\sigma_i \}_{i \in [n]} \overset{\mathrm{iid}}{\sim} \{ \pm 1\} }\Big[ \sup_{f \in \mathcal{F}} \frac{1}{n} \sum_{i = 1}^n \sigma_i f(x_i) \Big] \end{align}\]

Upper bounding the Rademacher complexity of \(\ell(\mathcal{F}_{\mathrm{prover}})\) will upper bound the generalization error of the ERM. In particular,

Lemma 13. (Corollary 4.19 of [35])For any \(\delta > 0, n \in \mathbb{N}\), let \(S_n := \{x_i\}_{i \in [n]}\) be a training set of size \(n\) drawn i.i.d. from \(D\), and let \(\hat{f}^{(n)}\) minimize the empirical loss over \(S_n\) (via 14). Then, with probability at least \(1 - \delta\) over the draw of \(S_n\), \[\begin{align} \mathcal{L}(\hat{f}^{(n)}, D) - \mathcal{L}(f^*, D) &\leq 2\mathcal{R}_n(\ell(\mathcal{F}_{\mathrm{prover}})) + \sqrt{\frac{\log \frac{2}{\delta}}{2n}} \end{align}\]

Proof. \[\begin{align} \mathcal{L}(\hat{f}^{(n)}, D) - \mathcal{L}(f^*, D) &\leq \mathcal{L}(\hat{f}^{(n)}, D) - \mathcal{L}_n(\hat{f}^{(n)}, S_n) + \mathcal{L}_n(f^*, S_n) - \mathcal{L}(f^*, D)\\ &\leq 2 \cdot \sup_{f \in \mathcal{F}_{\mathrm{prover}}} |\mathcal{L}(f, D) - \mathcal{L}_{n}(f, \{ x_i\})| \end{align}\] Then, apply Corollary 4.19 of [35]. ◻

In this context, we assume an upper bound on the Rademacher Complexity of the function class \(\ell(\mathcal{F}_{\mathrm{prover}})\).

Assumption 7. (Generalization) Given prover class \(\mathcal{F}_{\mathrm{prover}}\) assume there exists a \(\mathcal{F}_{\mathrm{prover}}\)-dependent quantity \(\mathcal{C}(\mathcal{F}_{\mathrm{prover}})\) where for any theorem distribution \(D \in \Delta(V)\), with function class \(\ell(\mathcal{F}_{\mathrm{prover}})\) defined as in 13, we have: \[\begin{align} \mathcal{R}_{n} (\ell(\mathcal{F}_{\mathrm{prover}})) \leq \sqrt{\frac{\mathcal{C}(\mathcal{F}_{\mathrm{prover}})}{n}} \end{align}\]

The next assumption describes under what conditions it is efficient to find the ERM from the model class \(\mathcal{F}_{\mathrm{prover}}\), on a size \(n\) dataset of i.i.d. theorems from a distribution of theorems. In particular, a necessary condition for such a procedure to find the ERM is that each theorem in the training distribution has a proof that can be efficiently found.

Assumption 8. (Optimization) Suppose we have i.i.d. sample access to theorem distribution \(D \in \Delta(V)\), and for any \(x \in \operatorname{supp}(D)\), the proof of \(x\) is known. Then, for any \(n\), it is computationally tractable to find the ERM \(\hat{f}^{(n)}\) (?? ) of a size \(n\) dataset drawn i.i.d. from \(D\).

Note that in practice, we may only be able to efficiently find an \(\epsilon_{\mathrm{opt}}\)-ERM, for any reasonable \(\epsilon_{\mathrm{opt}} > 0\), where an \(\epsilon_{\mathrm{opt}}\)-ERM is a prover \(\tilde{f}^{(n)}\) where

\[\begin{align} \mathcal{L}_n(\tilde{f}^{(n)}, \{ x_i\}_{i \in [n]}) \leq \min_{f \in \mathcal{F}_{\mathrm{prover}}} \mathcal{L}_n(f, \{ x_i\}_{i \in [n]}) + \epsilon_{\mathrm{opt}} \end{align}\]

However, the remaining analysis only requires \(\mathcal{L}(\tilde{f}^{(n)},D) - \mathcal{L}(f^*, D) \leq \epsilon_{\mathrm{opt}} + 2 \cdot \sup_{f \in \mathcal{F}_{\mathrm{prover}}} |\mathcal{L}(f, D) - \mathcal{L}_{n}(f, \{ x_i\})|\). With \(n = \Theta(\frac{\mathcal{C}(\mathcal{F}_{\mathrm{prover}})}{\epsilon_{\mathrm{gen}}^2})\) samples, we get \(L(\tilde{f}^{(n)},D) - L(f^*, D) \leq \epsilon_{\mathrm{opt}} + \epsilon_{\mathrm{gen}}\) with high probability. Thus, for any reasonable desired accuracy level \(\epsilon\), we can set \(\epsilon_{\mathrm{opt}}, \epsilon_{\mathrm{gen}} = \epsilon/2\), finding the \(\epsilon_{\mathrm{opt}}\)-ERM with generalization gap of \(\epsilon_{\mathrm{gen}}\). The necessary sample complexity would only increase by a factor of 4, a constant factor which we neglect. With this understanding, we keep the current phrasing of 8 of assuming the ERM is tractable.

10.2 Proof of [lem:567-imply-1-4]↩︎

We now prove the main result of this section.

Proof. Since \(\forall x \in \operatorname{supp}(D)\), the proof of \(x\) is known, then by 8, given \(\delta > 0\) and \(n \in \mathbb{N}_+\) i.i.d. samples from \(D\), we can compute \(\hat{f}^{(n)}\) via ?? . By 13, 6, and 7, we have that with probability at least \(1 - \delta\),

\[\begin{align} \mathbb{E}_{x \sim D} [1 - \operatorname{succ}(x, \hat{f}^{(n)})] = L(\hat{f}^{(n)}, D) &\leq \frac{4\cdot \sqrt{\mathcal{C}(\mathcal{F}_{\mathrm{prover}})}}{\sqrt{n}} + 2 \sqrt{\frac{\log \frac{2}{\delta}}{2n}} \end{align}\]

By Markov’s inequality, for any \(p \in (0,1)\),

\[\begin{align} \mathbb{P}_{x \sim D} [\operatorname{succ}(x, \hat{f}^{(n)}) \geq p] \geq 1 - \frac{\frac{4\sqrt{\mathcal{C}(\mathcal{F}_{\mathrm{prover}})} + 2\sqrt{\frac{1}{2}\log \frac{2}{\delta}}}{\sqrt{n}}}{1 - p} \end{align}\]

Thus, it suffices to set \(n\) to be \((\frac{4\sqrt{\mathcal{C}(\mathcal{F}_{\mathrm{prover}})} + 2\sqrt{\frac{1}{2}\log \frac{2}{\delta}}}{\epsilon(1 - p)})^2 \leq \Theta(\frac{\mathcal{C}(\mathcal{F}_{\mathrm{prover}})\log \frac{1}{\delta}}{\epsilon^2 (1 - p)^2})\) in order for \(\mathbb{P}_{x \sim D} [\operatorname{succ}(x, \hat{f}^{(n)}) \geq p] \geq 1 - \epsilon\). ◻

11 Auxiliary Lemmas↩︎

Proof. For a distribution \(D \in \Delta(V)\) and subset \(A \subset V\), denote \(D(A)\) as the measure of \(A\) under \(D\). Since \(P\) is the transition matrix of a nearest-neighbor-type random walk, then for any set \(A \subset V\), and any distribution \(D \in \Delta(V)\), with \((P^\top)^\tau D\) representing the distribution of a \(\tau\)-step random walk according to \(P\) initialized with \(D\), we have

\[\begin{align} ((P^\top)^\tau D) \, (B(A, \tau)) \geq D(A) \end{align}\]

In particular, for the set \(A = \{ x \in V : \operatorname{succ}(x,f) \geq p\}\), we have

\[\begin{align} ((P^\top)^\tau D) \, (B(\{ x \in V : \operatorname{succ}(x,f) \geq p\}, \tau)) \geq \mathbb{P}_{x \sim D}[\operatorname{succ}(x,f) \geq p]\label{eq:min-measure-of-Kct} \end{align}\tag{28}\]

Next, for any set \(A' \subset V\) and any distribution \(D' \in \Delta(V)\), the cardinality of \(A'\) is lower bounded in terms of its measure under \(D'\) and the (weighted) two-norm of \(D'\). In particular, we apply 14 with \(A' = B(\{ x \in V : \operatorname{succ}(x,f) \geq p\}, \tau)\) and \(D' = (P^\top)^\tau D\).

\[\begin{align} |K_\tau^p(f)| &:= |B(\{ x \in V : \operatorname{succ}(x,f) \geq p\}, \tau)|\\ &\geq \frac{((P^\top)^\tau D) \, (B(\{ x \in V : \operatorname{succ}(x,f) \geq p\}, \tau))^2}{\sup_{x \in V} \pi(x)} \frac{1}{||(P^\top)^\tau D||^2_{\ell^2(1/\pi)}}\\ &\geq \frac{(\mathbb{P}_{x \sim D}[\operatorname{succ}(x,f) \geq p])^2}{\sup_{x \in V} \pi(x)} \mathrm{Div}^P_\tau(D) } \end{align}\] ◻

Lemma 14. For graph \(G = (V,E)\), let \(\pi : V \to (0,\infty)\). For any distribution \(D' \in \Delta(V)\) and any \(A' \subset V\), we have

\[\begin{align} |A'| \geq \frac{(D'(A'))^2 }{\sup_{x \in V} \pi(x)} \frac{1}{||D'||^2_{\ell^2(1/\pi))}}\label{eq:min-A-ent} \end{align}\qquad{(3)}\]

Proof. For any distribution \(D' \in \Delta(V)\), any \(\alpha \in [0,1]\), and any \(A' \subset V\), we have:

\[\begin{align} (D'(A'))^2 &\leq (\sum_{x \in V} \mathbf{1}_{A'}(x) D'(x))^2\\ &\leq [\sum_{x \in V} (\mathbf{1}_{A'}(x) \sqrt{\pi(x)})^2] \cdot [\sum_{x \in V} (D'(x) \frac{1}{\sqrt{\pi(x)}})^2] \end{align}\]

Thus,

\[\begin{align} |A'| &=\sum_{x \in V} \mathbf{1}_{A'}(x)\\ &\geq \frac{\sum_{x \in V} (\mathbf{1}_{A'}(x) \sqrt{\pi(x)})^2}{\sup_{x \in V} \pi(x)}\\ &\geq \frac{(D'(A'))^2 }{\sup_{x \in V} \pi(x)} \frac{1}{||D'||^2_{\ell^2(1/\pi))}} \end{align}\] ◻

Lemma 15. Let \(G = (V,E)\) be a finite, undirected, connected, and non-bipartite graph. Let \((V,P)\) be a nearest-neighbor-type Markov chain on \(G\). For every \(x \in V,\) let \(N(x)\) denote its neighbors in \(G\). If \(\, \forall x \in V, \forall y \in N(x), P[x,y] > 0\), then \(P\) is irreducible and aperiodic, and there exist constants \(C > 0\) and \(\alpha \in (0,1)\) where

\[\begin{align} \max_{x \in V} || p^{(n)}(x, \cdot) - \pi||_{\mathrm{TV}} \leq C \alpha^n \end{align}\]

Proof. Because \(G\) is connected, then \(\forall x \in V, \forall y \in N(x), P[x,y] > 0\), so \(P\) is irreducible.

Because \(G\) is undirected, \(\mathrm{gcd}\{ n \in \mathbb{N}: p^{(n)}(x,x) > 0\} \leq 2\). Because \(G\) is non-bipartite, \(\mathrm{gcd}\{ n \in \mathbb{N}: p^{(n)}(x,x) > 0\} \neq 2\). Thus, \(P\) is aperiodic.

Because \(V\) is finite and the rows of \(P \in [0,1]^{|V| \times |V|}\) sum to \(1\), then \(P \mathbf{1} = \mathbf{1}\), so that \(P\) has an eigenvalue of \(1\). The left eigenvector corresponding to eigenvalue \(1\) is the stationary distribution \(\pi\). Since \(P\) is irreducible, \(\pi\) is unique.

By 1, there exist constants \(C > 0\) and \(\alpha \in (0,1)\) where

\[\begin{align} \max_{x \in V} || p^{(n)}(x, \cdot) - \pi||_{\mathrm{TV}} \leq C \alpha^n \end{align}\] ◻

12 Figures↩︎

Figure 10: Schematic of a K-cluster graph: each cluster is internally well-connected (spectral gap \gamma), but only a sparse set of inter-cluster edges connects clusters, yielding a much smaller global spectral gap.

References↩︎

[1]
K. Dong and T. Ma, “STP: Self-play LLM theorem provers with iterative conjecturing and proving.” 2025, [Online]. Available: https://arxiv.org/abs/2502.00212.
[2]
T. Luong and E. Lockhart, “Advanced version of gemini with deep think officially achieves gold-medal standard at the international mathematical olympiad.” 2025, [Online]. Available: https://deepmind.google/blog/advanced-version-of-gemini-with-deep-think-officially-achieves-gold-medal-standard-at-the-international-mathematical-olympiad.
[3]
S. Bubeck et al., “Early science acceleration experiments with GPT-5.” 2025, [Online]. Available: https://arxiv.org/abs/2511.16072.
[4]
D. Silver et al., “Mastering chess and shogi by self-play with a general reinforcement learning algorithm.” 2017, [Online]. Available: https://arxiv.org/abs/1712.01815.
[5]
G. Poesia, D. Broman, N. Haber, and N. D. Goodman, “Learning formal mathematics from intrinsic motivation.” 2024, [Online]. Available: https://arxiv.org/abs/2407.00695.
[6]
L. de Moura and S. Ullrich, “The lean 4 theorem prover and programming language,” Automated Deduction–CADE 28: 28th International Conference on Automated Deduction, 2021, [Online]. Available: https://lean-lang.org/papers/lean4.pdf.
[7]
S. Lafon and A. B. Lee, “Diffusion maps and coarse-graining: A unified framework for dimensionality reduction, graph partitioning and data set parameterization,” IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. 28, NO. 9. 2006, [Online]. Available: https://www.cs.cmu.edu/~eairoldi/nets/public/lafo.lee.2006.pdf.
[8]
T. Achim et al., “Aristotle: IMO-level automated theorem proving,” arXiv preprint arXiv:2510.01346, 2025, [Online]. Available: https://arxiv.org/abs/2510.01346.
[9]
T. Hubert et al., Published online Nov. 12, 2025“Olympiad-level formal mathematical reasoning with reinforcement learning,” Nature, 2025, doi: 10.1038/s41586-025-09833-y.
[10]
Z. Wu et al., InternLM2.5-StepProver: Advancing automated theorem proving via expert iteration on large-scale LEAN problems,” arXiv preprint arXiv:2410.15700, 2024, [Online]. Available: https://arxiv.org/abs/2410.15700.
[11]
R. Xin et al., BFS-prover: Scalable best-first tree search for LLM-based automatic theorem proving,” arXiv preprint arXiv:2502.03438, 2025, [Online]. Available: https://arxiv.org/abs/2502.03438.
[12]
R. Xin, Z. Zheng, Y. Nie, K. Yuan, and X. Xiao, “Scaling up multi-turn off-policy RL and multi-agent tree search for LLM step-provers,” arXiv preprint arXiv:2509.06493, 2025, [Online]. Available: https://arxiv.org/abs/2509.06493.
[13]
L. Chen et al., Seed-Prover: Deep and broad reasoning for automated theorem proving,” arXiv preprint arXiv:2507.23726, 2025, [Online]. Available: https://arxiv.org/abs/2507.23726.
[14]
X. Ji et al., Leanabell-Prover-V2: Verifier-integrated reasoning for formal theorem proving via reinforcement learning,” arXiv preprint arXiv:2507.08649, 2025, [Online]. Available: https://arxiv.org/abs/2507.08649.
[15]
Y. Lin et al., Goedel-Prover: A frontier model for open-source automated theorem proving,” arXiv preprint arXiv:2502.07640, 2025, [Online]. Available: https://arxiv.org/abs/2502.07640.
[16]
Y. Lin et al., Goedel-Prover-V2: Scaling formal theorem proving with scaffolded data synthesis and self-correction,” arXiv preprint arXiv:2508.03613, 2025, [Online]. Available: https://arxiv.org/abs/2508.03613.
[17]
H. Xin et al., DeepSeek-Prover-V1.5: Harnessing proof assistant feedback for reinforcement learning and monte-carlo tree search,” in International conference on learning representations, 2025, [Online]. Available: https://openreview.net/forum?id=I4YAIwrsXa.
[18]
Z. Z. Ren et al., DeepSeek-Prover-V2: Advancing formal mathematical reasoning via reinforcement learning for subgoal decomposition,” arXiv preprint arXiv:2504.21801, 2025, [Online]. Available: https://arxiv.org/abs/2504.21801.
[19]
S. Shang et al., StepFun-Prover Preview: Let’s think and verify step by step,” arXiv preprint arXiv:2507.20199, 2025, [Online]. Available: https://arxiv.org/abs/2507.20199.
[20]
H. Wang et al., Kimina-Prover Preview: Towards large formal reasoning models with reinforcement learning,” arXiv preprint arXiv:2504.11354, 2025, [Online]. Available: https://arxiv.org/abs/2504.11354.
[21]
Y. Zhou et al., “Solving formal math problems by decomposition and iterative reflection,” arXiv preprint arXiv:2507.15225, 2025, [Online]. Available: https://arxiv.org/abs/2507.15225.
[22]
Y. Bai, C. Jin, and T. Yu, “Near-optimal reinforcement learning with self-play.” 2020, [Online]. Available: https://arxiv.org/abs/2006.12007.
[23]
M. Arjovsky, S. Chintala, and L. Bottou, “Wasserstein GAN.” 2017, [Online]. Available: https://arxiv.org/abs/1701.07875.
[24]
M.-F. Balcan, A. Blum, Z. Li, and D. Sharma, “On learning verifiers and implications to chain-of-thought reasoning.” 2026, [Online]. Available: https://arxiv.org/abs/2505.22650.
[25]
H. Geuvers and I. Loeb, “Natural deduction via graphs: Formal definition and computation rules.” 2006, [Online]. Available: https://www.cs.ru.nl/~herman/PUBS/gd.pdf.
[26]
M. Barkeshli, M. R. Douglas, and M. H. Freedman, “Artificial intelligence and the structure of mathematics.” 2026, [Online]. Available: https://arxiv.org/abs/2604.06107.
[27]
J. Kim, D. Wu, J. Lee, and T. Suzuki, “Metastable dynamics of chain-of-thought reasoning: Provable benefits of search, RL and distillation.” 2025, [Online]. Available: https://arxiv.org/abs/2502.01694.
[28]
A. Bovier, M. Eckhoff, V. Gayrard, and M. Klein, “Metastability and low lying spectra in reversible markov chains,” Communications in Mathematical Physics, 2002, [Online]. Available: https://link.springer.com/article/10.1007/s002200200609.
[29]
R. R. Coifman and S. Lafon, “Diffusion maps,” Applied Compututing Harmonic Analysis. 2006, [Online]. Available: https://www.math.pku.edu.cn/teachers/yaoy/Fall2011/Lafon06.pdf.
[30]
J. Z. HaoChen, C. Wei, A. Gaidon, and T. Ma, “Provable guarantees for self-supervised deep learning with spectral contrastive loss.” 2022, [Online]. Available: https://arxiv.org/abs/2106.04156.
[31]
R. Hadsell, S. Chopra, and Y. LeCun, “Dimensionality reduction by learning an invariant mapping,” in 2006 IEEE computer society conference on computer vision and pattern recognition (CVPR’06), 2006, vol. 2, pp. 1735–1742, doi: 10.1109/CVPR.2006.100.
[32]
A. van den Oord, Y. Li, and O. Vinyals, “Representation learning with contrastive predictive coding.” 2019, [Online]. Available: https://arxiv.org/abs/1807.03748.
[33]
T. Chen, S. Kornblith, M. Norouzi, and G. Hinton, “A simple framework for contrastive learning of visual representations.” 2020, [Online]. Available: https://arxiv.org/abs/2002.05709.
[34]
W. Hoeffding, “Probability inequalities for sums of bounded random variables,” Journal of the American Statistical Association, vol. 58, no. 301, pp. 13–30, 1963, doi: 10.1080/01621459.1963.10500830.
[35]
T. Ma, “Lecture notes for machine learning theory.” 2022, [Online]. Available: https://tselilschramm.org/mltheory/ma.pdf.
[36]
Y. Yao, “Lecture 6. Diffusion distance.” 2011, [Online]. Available: https://www.math.pku.edu.cn/teachers/yaoy/Fall2011/lecture06.pdf.
[37]
D. A. Levin, Y. Peres, and E. L. Wilmer, “Markov chains and mixing times.” 2017, [Online]. Available: https://pages.uoregon.edu/dlevin/MARKOV/markovmixing.pdf.
[38]
W. Woess, “Random walks on infinite graphs and groups.” 2004, [Online]. Available: https://math.bme.hu/~gabor/oktatas/SztoM/Woess.RWonInfinGrGp.pdf.
[39]
[40]
C. Eckart and G. Young, “The approximation of one matrix by another of lower rank,” Psychometrika, 1(3):211–218. 1936, [Online]. Available: https://ccrma.stanford.edu/~dattorro/eckart&young.1936.pdf.
[41]
S. Tu, R. Boczar, M. Simchowitz, M. Soltanolkotabi, and B. Recht, “Low-rank solutions of linear matrix equations via procrustes flow.” 2016, [Online]. Available: https://arxiv.org/abs/1507.03566.
[42]
K. Fan, “On a theorem of weyl concerning eigenvalues of linear transformations,” Proceedings of the National Academy of Sciences of the United States of America. 1950, [Online]. Available: https://www.jstor.org/stable/88028?seq=4.
[43]
M. L. Overton and R. S. Womersley, “On the sum of the largest eigenvalues of a symmetric matrix,” SIAM Journal on Matrix Analysis and Applications. 1991, [Online]. Available: https://ia800107.us.archive.org/11/items/onsumoflargestei00over/onsumoflargestei00over.pdf.
[44]
V. Q. Vu, J. Cho, J. Lei, and K. Rohe, “Fantope projection and selection: Near-optimal convex relaxation of sparse PCA.” 2013, [Online]. Available: https://www.stat.cmu.edu/~jinglei/fps-sps_12321.pdf.

  1. To further motivate diffusion similarity, note it is closely related to diffusion distance, used for graph partitioning [7].↩︎

  2. We believe the following analysis can be extended to infinite graphs.↩︎

  3. Alternatively, note that since \(P\) is reversible, \(\mathrm{diag}(\pi)P\) is symmetric. Let symmetric matrix \(\overline{A} = \mathrm{diag}(\pi)^{1/2}P \mathrm{diag}(\pi)^{-1/2} = \sum_{i}\lambda_i v_i v_i^\top\) with \(\{ v_i\}_{i \in [|V|]}\) being orthonormal. Then \(\forall i \in [|V|], \, \phi_i = \mathrm{diag}(\pi)^{-1/2} v_i\).↩︎

  4. This definition is different than [defn:rad-complexity], previously defined and used in the context of [30] in 8↩︎