betaFeedback

WorksComputer Science

Solomonoff induction of selected bits and online classification

Abstract

Solomonoff induction is a general solution for sequence prediction that started the field of algorithmic information theory around 1960. Let MM be the universal semimeasure. After observing a string ω1⋯ωn−1ω_1 \cdots ω_{n-1}, it predicts the next bit ωnω_n to be bb with conditional probability proportional to M(ω1⋯ωn−1b)M(ω_1 \cdots ω_{n-1} b). Thus the error of this probability is eω(n)=1−M(ω1⋯ωn−1ωn)M(ω1⋯ωn−10)+M(ω1⋯ωn−11). e_ω(n) = 1 - \frac {M(ω_1 \cdots ω_{n-1}ω_n)} {M(ω_1 \cdots ω_{n-1} 0) + M(ω_{1} \cdots ω_{n-1} 1)}. If ωω a computable infinite sequence with a self-delimiting description of at most kk bits, then ∑neω(n)≤kln⁡2+O(1)\sum_n e_ω(n) \le k\ln 2+O(1). Lattimore, Hutter and Gavane consider the problem of predicting computable patterns in a sequence, for example, the pattern of repeated bits ω=00 11 00 00 11 00⋯ω= 00\,11\,00\,00\,11\,00\cdots They show that the error probabilities of the bits fixed by a computable pattern have limit zero, for example, for repeated bits, one has lim⁡neω(2n)=0\lim_n e_ω(2n) = 0. We show that for some computable pattern, the sum of eω(n)e_ω(n) over positions nn from the pattern is not bounded. However, the sum of squares (eω(n))2(e_ω(n))^2 is bounded exponentially in the program length of the pattern. It is also shown that bits of ωω that are fixed by a computable classification function f:{0,1}∗→{0,1}f:\{0,1\}^* \rightarrow \{0,1\}, converges faster: the sum of (eω(n))2(e_ω(n))^2 is bounded by a polynomial in the program length for programs whose runtime is bounded by any fixed computable time bound.

Introduction

Many machine learning tasks can be viewed as sequence prediction: given bits ω1,…,ωn−1\omega_1,\ldots,\omega_{n-1}, what is the probability of the next bit ωn\omega_n being 00? Solomonoff provided a simple mathematical solution for this problem in [17], which is based on algorithmic probability MM defined below. In this way, he united various philosophical approaches to the problem of scientific inference and the foundations of probability, see [14 chapter 5].

Often, we are only interested in the errors of some of the bits. For example, “online classification” can be viewed as “sequence prediction” by building a sequence that alternates between inputs and labels. In this case, we do not care about predictions of the inputs, but only about their labels. In this paper, we determine convergence rates for predicting computable patterns in sequences and in particular for deterministic online classification rules.

Definition. A semimeasure is a function P:{0,1}∗→R≥0P : \{0,1\}^* \to\mathbb{R}_{\ge0} that satisfies P(empty str)≤1P(\text{empty str}) \le1 and P(x)≥P(x0)+P(x1)P(x) \ge P(x0) + P(x1), where xbxb denotes the concatenation of string xx and bit bb.

Among the lower semicomputable semimeasures, there exists a semimeasure MM that is maximal, in the sense that for each such semimeasure PP, one has ∃c∀x[P(x)≤cM(x)]\exists c \forall x[P(x) \le cM(x)], see [14 theorem 4.5.1] or [16 theorem 78]. Note that all maximal such semimeasures are equal up to a constant factor. Let MM be any such maximal semimeasure.

Such a maximal semimeasure is related to pretraining of large language models, where one selects model parameters θ\theta that minimize the cross-entropy loss on the training set xx, which equals the negative log-likelihood log⁡(1/Pθ(x))\log(1/P_\theta(x)), see [6 section 2] and [7].

Solomonoff’s solution for sequence prediction given ω<n=ω1⋯ωn−1\omega_{<n}=\omega_1\cdots\omega_{n-1} is to predict ωn=b\omega_n=b with probability1

M(b∣ω<n)=M(ω<nb)M(ω<n0)+M(ω<n1).M(b\mid\omega_{<n})=\frac{M(\omega_{<n}b)}{M(\omega_{<n}0)+M(\omega_{<n}1)}.

Computable patterns

It is well known that Solomonoff induction quickly converges on computable sequences (even for the unnormalized conditionals). Indeed, if kk is the minimal prefix complexity of a program that computes ω\omega, then by [11 theorem 3.8.9],2

∑n1−M(ω≤n)M(ω<n)≤kln⁡2+O(1).(1)\sum_n 1-\frac{M(\omega_{\le n})}{M(\omega_{<n})}\le k\ln2+O(1). \tag*{(1)}

The following question was raised in [9 problem 2.9 p. 63] and [10].

Question. Does conditional probability 1−M(ω≤n)/M(ω<n)1-M(\omega_{\le n})/M(\omega_{<n}) decrease rapidly to zero on the bits that are fixed by some computable pattern? For example, if each even bit equals the preceding odd bit, does the sum remain bounded?

In [12 theorem 11, p. 269] it was shown that M(ωn∣ω<n)M(\omega_n\mid\omega_{<n}) does converge to 1 for those bits ωn\omega_n that are fixed by a computable pattern.3 Unfortunately, the result depends on a proof cited as private communication [13], and we did not find a public version. For this reason, also no quantitative bounds were found.

Our first result provides upper bounds on the convergence rates for LγL_\gamma-losses with γ>1\gamma>1 and γ=1\gamma=1. For a bit bb, let bˉ\bar b be its negation.

Theorem 1.1. Fix γ>1\gamma>1. Let T⊆{0,1}∗T\subseteq\{0,1\}^{*} be decided by a program of length kk. If all prefixes of ω∈{0,1}∞\omega\in\{0,1\}^{\infty} are in TT, then

∑n:ω<nωˉn∉T(M(ωˉn∣ω<n))γ≤O(k22k2γk)\sum_{\substack{n:\omega_{<n}\bar{\omega}_n\notin T}} \bigl(M(\bar{\omega}_n\mid\omega_{<n})\bigr)^\gamma\le O(k2^{2k}2^{\gamma k})

and

∑n:ω<nωˉn∉Tn≤NM(ωˉn∣ω<n)≤O(k22klog⁡2Nlog⁡2log⁡N).\sum_{\substack{n:\omega_{<n}\bar{\omega}_n\notin T\\ n\le N}}M(\bar{\omega}_n\mid\omega_{<n})\le O(k2^{2k}\log^2 N\log^2\log N).

The above bounds are exponential in kk and we do not know if polynomial bounds hold. Our proof relies on a game that was earlier defined by Mikhail Andreev and Akim Kumok [1], but they mostly focus on the opposite player.

The following result shows that for γ=1\gamma=1, the sum of the errors can diverge slowly. This answers question 2 in [12 page 15], which asks whether there exists a bound in terms of Kolmogorov complexity of the pattern.

A tree TT is a subset of {0,1}∗\{0,1\}^{*} that is closed under taking prefixes. A branch w∈Tw\in T alternates at least kk times between 1 and 2 children if there are 1≤n1≤…≤nk≤∣w∣1\le n_1\le\ldots\le n_k\le|w| with w<niwˉni∈Tw_{<n_i}\bar{w}_{n_i}\in T for all even ii and w<niwˉni∉Tw_{<n_i}\bar{w}_{n_i}\notin T for all odd ii.

In the context of convergence of subpatterns, it is important that the denominator is normalized and equals M(ω<n0)+M(ω<n1)M(\omega_{<n}0)+M(\omega_{<n}1) instead of the commonly used M(ω<n)M(\omega_{<n}). Indeed, …

lim inf⁡n→∞M(ω<2n0)+M(ω<2n1)M(ω<2n)<1.\liminf_{n\to\infty}\frac{M(\omega_{<2n}0)+M(\omega_{<2n}1)}{M(\omega_{<2n})}<1.

However, the definition of algorithmic probability MM is different in [12]. We think this also holds for certain maximal semimeasures MM (but not for all).

Theorem 1.2. Suppose for a computable leafless tree T⊂{0,1}∗T \subset\{0,1\}^{*}, each z∈Tz \in T alternates a(∣z∣)a(|z|) times between having 1 and 2 children. Then there exists an infinite branch ω\omega and infinitely many NN such that

∑n:ω<nωˉn∉Tn<NM(ωˉn∣ω<n)≥Ω(log⁡a(N)log⁡log⁡a(N)).\sum_{\substack{n:\omega_{<n}\bar{\omega}_{n}\notin T\\ n<N}} M(\bar{\omega}_{n}\mid\omega_{<n}) \ge\Omega\left(\frac{\log a(N)}{\log\log a(N)}\right).

The proof is obtained by adapting the proof of the main result by Mikhail Andreev and Akim Kumok [1].

Application to the sunrise problem

Given that the sun has rises NN times, what is the probability that it will rise indefinitely? This problem is discussed for other inference rules in [11 p. 61]. The question translates to: what is the algorithmic probability that a long string of NN zeros will be continued indefinitely by zeros? This probability has limit 1 for large NN, since M(0N)M(0^N) is nonincreasing in NN, thus for large NN

∏n=N∞M(0∣0n)≥M(0∞)M(0N)→1.\prod_{n=N}^{\infty}M(0\mid0^n)\ge\frac{M(0^\infty)}{M(0^N)}\to1.

We explain that theorem 1.2 implies that the analogue for bits in even positions is false. Given a long string of length 2N2N that has 0 in even positions, what is the algorithmic probability of observing a sequence that always has 0 in even positions with causal conditions on given odd values? The tree of all strings with 0’s in even positions alternates a(N)=N/2+O(1)a(N)=N/2+O(1) times between 1 and 2 children. Hence, by theorem 1.2 there exists a sequence ω\omega with 0’s in even positions such that for all NN this probability is

∏n=N∞M(ω<2n0)M(ω<2n)≤∏n=N∞M(0∣ω<2n)=∏n=N∞(1−M(1∣ω<2n))≤exp⁡(−∑n=N∞M(1∣ω<2n))=0.\prod_{n=N}^{\infty}\frac{M(\omega_{<2n}0)}{M(\omega_{<2n})}\le\prod_{n=N}^{\infty}M(0\mid\omega_{<2n})=\prod_{n=N}^{\infty}(1-M(1\mid\omega_{<2n}))\le\exp\left(-\sum_{n=N}^{\infty}M(1\mid\omega_{<2n})\right)=0.

Thus, the algorithmic probability of even bits being 0 indefinitely, can be 0 or 1 in the limit depending on the causally conditioned odd bits.

Possible philosophic interpretation. Let us view algorithmic probability as intelligent prediction. Imagine that 2 people are asked what the probability is that suddenly, the sun will fail to rise one morning in the (far) future. The 1st person is only given 0’s and randomly generated information (all theorems hold with probability 1 when MM is defined with oracle access to a randomly generated sequence). The 2nd person is additionally given a black box that produces extra information every day, without any claimed connection to the observed world.

The above result suggests that over time, it is possible that the 2nd person might develop a strong expectation that the sun does not rise some day in the future, while the 1st person firmly believes such unexpected events will not happen. Note that both people believe that the probability for the next day converges to zero, so they never panic (after enough time).

Challenges to this interpretation.

  • The expectation is causal: the 2nd person needs to concentrate his belief in the specific odd bits that become gradually available. This might reduce to an ordinary expectation in case of a pessimist who believes in odd bits that maximize his future cumulated daily fears.

  • Each such pessimistic black box sequence is incomputable. In fact, the set of “fearful sequences” has measure zero in every computable measure. (Here, a “fearful sequence” is one for which an eventual catastrophe has probability 1.)

  • It is clear which bits are predicted, and hence, one should use online algorithmic probability as explained in appendix A.

However, one might consider multiple “catastrophes” based on potentially overlapping sequences, while using consistent conditional probabilities for all bits. In fact, what constitutes a catastrophe might also depend on observed inputs. In this setting, the online formalism of appendix A cannot be used.

Online classification

Solomonoff proved that for randomly generated sequences, algorithmic probability rapidly converges to conditional measure [18]. If PP is a measure computed by a self-delimiting program of length kk, then for an infinite sequence ω\omega generated from PP, one has

Eω∼P∑n=1∞(P(0∣ω<n)−M(0∣ω<n))2≤kln⁡2+O(1).\mathbb{E}_{\omega\sim P}\sum_{n=1}^{\infty}\left(P(0 \mid\omega_{<n})-M(0 \mid\omega_{<n})\right)^2 \le k\ln\sqrt{2}+O(1).

Now we consider the problem of online classification of strings of arbitrary length. This can be cast as sequence prediction using any prefix-free encoding§ ⟨x⟩\langle x\rangle of strings xx, where ω=⟨x1⟩f(x1)⟨x2⟩f(x2)⋯\omega=\langle x_1\rangle f(x_1)\langle x_2\rangle f(x_2)\cdots with xi∈{0,1}∗x_i\in\{0,1\}^{*}. Now we are interested in the sums of errors only for those bits ωn\omega_n that correspond to values f(xi)f(x_i).

Can we obtain a small mistake bound if there exists a simple classifier? Unfortunately, the above bound is only small when the combined complexity of input generation and the true classifier are small.

For example, imagine one wants to train a classifier for discriminating black-and-white movies from color movies in mp4 files. Such a classifier should be relatively easy to learn, however, any realistic measure PP over movies might be quite complex. In fact, it is not even clear what “realistic measure” means.

Our next result states that for online classifiers, the LγL_\gamma-norm of the error probability is polynomial in the Kolmogorov complexity of the classifier. Thus, this bound is exponentially better than the bound for general patterns.

Theorem 1.3. Fix γ>1\gamma>1 and a computable time bound tt. If ff is computed by a kk-bit program in time t(k,∣z∣)t(k,|z|) on input zz, then for each sequence x1,x2,…∈{0,1}∗x_1,x_2,\ldots\in\{0,1\}^{*},

∑n=1∞(1−M(f(xn)∣hn⟨xn⟩))γ≤O(k1+γlog⁡2γk).\sum_{n=1}^{\infty}\left(1-M(f(x_n)\mid h_n\langle x_n\rangle)\right)^\gamma\le O\left(k^{1+\gamma}\log^{2\gamma} k\right).

where hn=⟨x1⟩f(x1)⋯⟨xn−1⟩f(xn−1)h_n=\langle x_1\rangle f(x_1)\cdots\langle x_{n-1}\rangle f(x_{n-1}).

In this result, the time bound affects the constant in the big-O. A similar statement can be proven for functions ff that output strings of constant length, but we do not know how to prove it for arbitrary output.

Corollary 1.4. There exists a computable classifier ff, an infinite sequence of strings x1,x2,…∈{0,1}∗x_1,x_2,\ldots\in\{0,1\}^{*} and infinitely many NN such that

∑n=1NM(1−f(xn)∣hn⟨xn⟩)≥Ω(log⁡Nlog⁡log⁡N),\sum_{n=1}^{N}M(1-f(x_n)\mid h_n\langle x_n\rangle)\ge\Omega\left(\frac{\log N}{\log\log N}\right),

where hn=⟨x1⟩f(x1)⋯⟨xn−1⟩f(xn−1)h_n=\langle x_1\rangle f(x_1)\cdots\langle x_{n-1}\rangle f(x_{n-1}).

In fact, the above corollary is true for the constant 0 classifier. In appendix A we discuss online algorithmic probability, which was defined in [5] (and used in [9, 11] for reinforcement learning). If in the above sum, conditional algorithmic probability were replaced by online probability, then the sum would always be bounded by a constant. Thus with online algorithmic probability one can obtain better bounds for the absolute loss.

Games

Note that we may always assume that sets TT in the theorem are closed under prefixes, because dropping strings that do not contain all their prefixes neither changes the set of infinite ω\omega that are applicable to the theorems, nor does it affect the sums.

The flow-flow game

The flow-flow game. The game has parameters ss, γ\gamma and is played on KK trees T1,…,TK⊆{0,1}∗T_1,\ldots,T_K \subseteq\{0,1\}^*, which are known to both players. Two players, called Alice and Bob, each maintain their own continuous semimeasure, denoted AA and BB. Initially, A=B=0A=B=0. They alternate turns and at their turn, they can increase finitely many values of their semimeasure, provided functions AA and BB remain semimeasures.

Alice wins immediately if after some move of Bob, there exists an infinite branch ω\omega of some tree TjT_j such that

∑n:ω<nωˉn∉Tj(A(ω<nωˉn)B(ω<n0)+B(ω<n1))γ>s,\sum_{n:\omega_{<n}\bar{\omega}_n\notin T_j} \left(\frac{A(\omega_{<n}\bar{\omega}_n)} {B(\omega_{<n}0)+B(\omega_{<n}1)}\right)^\gamma> s,

where in the sum, 0/0=00/0=0 is assumed. Bob wins if he can reply indefinitely without Alice winning.

Example 1. Consider the game with s=γ=1s=\gamma=1 and the single tree T={empty string,0,00,000,…}T=\{\text{empty string},0,00,000,\ldots\}. Bob wins by concentrating all measure along the tree, thus setting B(x)=1B(x)=1 for all x∈Tx\in T.

Example 2. Again, let s=γ=1s=\gamma=1. Consider the game with an arbitrary single tree. If Alice evaluates a computable measure AA, then Bob has a computable winning strategy by splitting his flow proportionally to AA's flow in nodes xx for which both children are in the tree, and otherwise, if xx has only 1 child, sending all flow in this child's direction.

Indeed, at every round, the support of AA is finite, so we prove it by induction on the maximal length dd of the support. Suppose that the strategy works for some dd and all trees. Consider some AA supported on (d+1)(d+1)-bit strings.

First assume that the root of the tree has 2 children. Then the root does not contribute to the sums. Consider the 2 inductive applications corresponding to the children of the root. Compared to the original sum, both the numerators and denominators are multiplied by the same factors, thus Bob wins.

Now assume that the root has 1 child bb. Then B(empty string)=B(b)=1B(\text{empty string})=B(b)=1 and the root contributes an extra term A(bˉ)A(\bar b) to all sums. But by the inductive hypothesis, the strategy B′(x)=B(bx)B'(x)=B(bx) wins against strategy A′(x)=A(bx)/A(b)A'(x)=A(bx)/A(b), meaning that in our game, the sum is bounded by s⋅A(b)=A(b)s\cdot A(b)=A(b). Thus in each branch, the sum is at most s=1s=1. This finishes the proof that Bob wins.

This second example explains that the challenge for Bob is to deal with dynamics of Alice's moves and why he needs s>1s>1 to win.

Winning strategies and error bounds

Strategies for Alice provide lower bounds in the main theorems. Strategies for Bob provide upper bounds. For the exponential upper bounds in theorem 1.1, only the game with K=1K=1 tree is needed. For a set S⊆{0,1}∗S\subseteq\{0,1\}^*, let K(S)K(S) be the minimal prefix complexity of a program that decides SS, see [14, 16] for background on algorithmic information theory.

Lemma 2.1. Fix γ≥1\gamma\ge1 and a constant ss. Assume that for each tree TT, Bob has a winning strategy in the game with 1 tree TT and value ss, and that these strategies are uniformly computable given TT. Then for each computable TT and infinite branch ω\omega in TT,

∑n:ω<nωˉn∉T(M(ωn∣ω<n))γ≤O(2K(T)s).\sum_{n:\omega_{<n}\bar{\omega}_n\notin T} \left(M(\omega_n\mid\omega_{<n})\right)^\gamma \le O(2^{K(T)s}).

The proof of the lemma uses the following result, see for example [14 cor 4.5.1, p307].

Lemma 2.2. For all lower semicomputable semimeasures BB and xx,

2−K(B)B(x)≤O(M(x)),2^{-K(B)}B(x)\le O(M(x)),

where K(B)K(B) is the minimal prefix complexity of a program that lower approximates BB.

Proof of lemma 2.1. Consider the game for a computable tree TT. Let Alice play a strategy in which she ignores TT and Bob's moves: she computes a lower approximation of MM and, in each round, sets AA equal to the current approximation. Bob plays the winning strategy. We obtain a semimeasure BB by taking the limit of his semimeasure. It satisfies

∑n:ω<nω‾n∉T(M(ω<nω‾n)B(ω<n0)+B(ω<n1))γ≤s.\sum_{n:\omega_{<n}\overline{\omega}_n\notin T}\left(\frac{M(\omega_{<n}\overline{\omega}_n)}{B(\omega_{<n}0)+B(\omega_{<n}1)}\right)^\gamma\le s.

Note that K(B)≤K(T)+O(1)K(B)\le K(T)+O(1), because BB is computed from TT by evaluating the strategy. Hence, lemma 2.2 implies

M(ω‾n∣ω<n)≤O(2K(T))M(ω<nω‾n)B(ω<n0)+B(ω<n1).M(\overline{\omega}_n\mid\omega_{<n})\le O(2^{K(T)})\frac{M(\omega_{<n}\overline{\omega}_n)}{B(\omega_{<n}0)+B(\omega_{<n}1)}.

The proof is completed by raising to the power γ\gamma and summing.

Lemma 2.3. Fix γ≥1\gamma\ge1, a computable function s:N→Qs:\mathbb{N}\to\mathbb{Q}, and a uniformly computable sequence of trees T1,T2,…T_1,T_2,\ldots. Suppose Bob wins each game with parameters γ,sℓ\gamma,s_\ell and trees T1,…,T22ℓT_1,\ldots,T_{2^{2\ell}}. Also suppose that the strategies are uniformly computable in ℓ\ell. Then, for each ℓ\ell, each j≤22ℓj\le2^{2\ell} and each infinite branch ω\omega in TjT_j,

∑n:ω<nω‾n∉Tj(M(ω‾n∣ω<n))γ≤O(ℓ2γsℓ).\sum_{n:\omega_{<n}\overline{\omega}_n\notin T_j}\left(M(\overline{\omega}_n\mid\omega_{<n})\right)^\gamma\le O(\ell^{2\gamma}s_\ell).

Proof sketch. The proof is similar as for lemma 2.1, but with a different estimate for the complexity of Bob’s semimeasure. Now the trees and the strategies are uniformly computable in ℓ\ell, thus this complexity is bounded by the complexity of ℓ\ell. Hence, K(Bℓ)≤K(ℓ)+O(1)≤2log⁡ℓ+O(1)K(B_\ell)\le K(\ell)+O(1)\le2\log\ell+O(1). After taking exponents and γ\gamma powers, this corresponds to the factor O(ℓ2γ)O(\ell^{2\gamma}) on the right side.

The second part of theorem 1.1 requires bounds on the sum for NN-bit prefixes of ω\omega and ss is a function. Alice wins if after some move of Bob, there exists a tree TjT_j and a z∈Tjz\in T_j such that

∑z<nz‾n∉Tjn≤∣z∣(A(z<nz‾n)B(z<n0)+B(z<n1))γ>s∣z∣.(2)\sum_{\substack{z_{<n}\overline{z}_n\notin T_j\\ n\le|z|}}\left(\frac{A(z_{<n}\overline{z}_n)}{B(z_{<n}0)+B(z_{<n}1)}\right)^\gamma>s_{|z|}. \tag*{(2)}

It is easy to adapt the above lemmas when ss is a function instead of a constant. This was omitted for notational convenience. In theorem 1.2 a stronger requirement for Alice’s strategy is needed.

Lemma 2.4. Let tree TT and function ss be computable. Assume that Alice has a computable strategy in which for some sequence ω∈{0,1}∞\omega\in\{0,1\}^{\infty} and for infinitely many NN the following holds: for all but finitely many rounds

∑n:ω<nω‾n∉Tn≤NA(ω<nω‾n)B(ω<n0)+B(ω<n1)>sN.(3)\sum_{\substack{n:\omega_{<n}\overline{\omega}_n\notin T\\ n\le N}}\frac{A(\omega_{<n}\overline{\omega}_n)}{B(\omega_{<n}0)+B(\omega_{<n}1)}>s_N. \tag*{(3)}

Then there exists a sequence ω\omega such that for infinitely many NN,

∑n:ω<nω‾n∉Tn≤NM(ω‾n∣ω<n)>Ω(sN).\sum_{\substack{n:\omega_{<n}\overline{\omega}_n\notin T\\ n\le N}}M(\overline{\omega}_n\mid\omega_{<n})>\Omega(s_N).

Proof. Consider a game in which Bob plays blindly, and lower approximates a priori probability MM. Alice plays the winning strategy. Since Alice’s semimeasure AA is lower semicomputable, lemma 2.2 implies

M(x)≥Ω(A(x)).M(x)\ge\Omega(A(x)).

The proof finishes by substituting this and summing.

The weight-flow game

We now consider an equivalent game for the case of a single tree TT. The flow that leaves Alice’s tree in a certain node is viewed as a weight.

Formally, let ∂T\partial T denote the set of all nodes that are not in TT but whose parent is in TT. Note that ∂T\partial T is prefix-free. Let bb always represent a bit. For all xb∈∂Txb \in\partial T (implying x∈Tx \in T), we set w(x)=A(xb)w(x)=A(xb), provided xx is not a leaf, and otherwise, let w(x)=0w(x)=0 (but this does not matter).

This leads to an equivalent game, called the weight-flow game, where Alice controls weights instead of flows. We additionally allow weights on all the nodes, and it turns out that we need no tree TT at all.

The weight-flow game. The game has parameters γ\gamma and ss. Two players Alice and Bob alternate turns. As before, Bob maintains a semimeasure BB. Initially B=0B=0. Alice maintains weights w(x)≥0w(x)\ge0 for all strings x∈{0,1}∗x\in\{0,1\}^{*} such that

∑x∈{0,1}∗w(x)≤1.\sum_{x\in\{0,1\}^{*}}w(x)\le1.

Initially w=0w=0. In each round, Alice increase finitely many values of ww. Afterwards, Bob increases finitely many values of BB.

Alice wins if after Bob’s move, there exists an ω∈{0,1}∞\omega\in\{0,1\}^{\infty} with

∑x⊑ω(w(x)B(x))γ>s,\sum_{x\sqsubseteq\omega}\left(\frac{w(x)}{B(x)}\right)^{\gamma}>s,

where 0/0=00/0=0 is assumed. Bob wins if he can reply indefinitely without Alice winning.

Lemma 2.5. If Bob has a winning strategy in the weight-flow game, then for each single tree TT, Bob has a winning strategy in the flow-flow game with the same parameters γ\gamma and ss. Moreover, if Bob’s weight-flow strategy is computable, then his flow-flow strategy is computable given TT.

Proof. The proof is a simple formal verification. Let AffA_{\mathrm{ff}} be Alice’s strategy in a flow-flow game with a single tree TT. We need a winning strategy BffB_{\mathrm{ff}} for Bob in this game.

First AffA_{\mathrm{ff}} is transformed to a strategy ww for Alice in the weight-flow game. Recall that bb is always a bit. For each node xbxb in ∂T\partial T with xbˉ∈Tx\bar b\in T, Alice sets w(x)=Aff(xb)w(x)=A_{\mathrm{ff}}(xb). She keeps w(x)=0w(x)=0 for all other xx.

Bob plays his winning strategy BwfB_{\mathrm{wf}} against ww. He obtains a strategy BffB_{\mathrm{ff}} by “pushing BwfB_{\mathrm{wf}} one step forward” when the relevant direction in TT is unique. More precisely, Bff(ϵ)=Bwf(ϵ)B_{\mathrm{ff}}(\epsilon)=B_{\mathrm{wf}}(\epsilon)

  • Bff(xb)=0B_{\mathrm{ff}}(xb)=0 if xb∉Txb\notin T,

  • Bff(xb)=Bwf(xb)B_{\mathrm{ff}}(xb)=B_{\mathrm{wf}}(xb) for nodes xb∈Txb\in T with a brother, thus if xbˉ∈Tx\bar b\in T,

  • Bff(xb)=Bwf(x)B_{\mathrm{ff}}(xb)=B_{\mathrm{wf}}(x) for nodes xb∈Txb\in T without a brother.

Note that Bff(y)≥Bwf(y)B_{\mathrm{ff}}(y)\ge B_{\mathrm{wf}}(y) for y∈Ty\in T and that Bff(y)>Bwf(y)B_{\mathrm{ff}}(y)>B_{\mathrm{wf}}(y) only happens if yy is in TT and has no brother in TT. This implies Bff(x)≥Bff(xb)+Bff(xbˉ)B_{\mathrm{ff}}(x)\ge B_{\mathrm{ff}}(xb)+B_{\mathrm{ff}}(x\bar b) for all xx, because if xbˉ∉Tx\bar b\notin T, then Bff(xbˉ)=0B_{\mathrm{ff}}(x\bar b)=0. Clearly, if BwfB_{\mathrm{wf}} is lower semicomputable, then BffB_{\mathrm{ff}} is lower semicomputable given TT.

In the sum that defines the winning condition, only values Bff(xb)B_{\mathrm{ff}}(xb) are used for which xbxb has no brother. Thus we have

Aff(xbˉ)Bff(xb)+Bff(xbˉ)≤w(x)Bwf(x).\frac{A_{\mathrm{ff}(x\bar b)}}{B_{\mathrm{ff}}(xb)+B_{\mathrm{ff}}(x\bar b)} \le\frac{w(x)}{B_{\mathrm{wf}}(x)}.

Since these are precisely the terms we care about in the winning condition, Bob wins in the flow-flow game. □

The reverse is also true, a strategy for Alice in the weight-flow game gives a strategy for the flow-flow game.

Lemma 2.6. If Alice has a winning strategy in the weight-flow game, then Alice has a winning strategy in the flow-flow game with the same parameters and for the tree consisting of all strings with zeros in even positions. If the former strategy is computable, so is the latter.

Remark 2.7. Any tree could be used in which each infinite branch infinitely often alternates between having 1 and 2 children. For example, the tree with repeated positions. The above tree was chosen for notational convenience.

Proof. Let TT be the tree with zeros in even positions, thus T={z:0=z2=z4=…=z2⌊∣z∣/2⌋}T = \{z : 0 = z_2 = z_4 = \ldots= z_{2\lfloor|z|/2\rfloor}\}. The idea is to associate strings xx in the weight-flow game to expanded strings

xexp=00x10x20⋯0x∣x∣x_{\mathrm{exp}} = 00x_10x_20\cdots0x_{|x|}

in the flow-flow game. The empty string is encoded as string 1. Alice’s weights ww in xx become flows in w(xexp1)w(x_{\mathrm{exp}}1), since xexp1∈∂Tx_{\mathrm{exp}}1 \in\partial T. We explain in detail why this works.

Consider a strategy BffB_{\mathrm{ff}} for Bob in the flow-flow game with the tree from the lemma. Let Bob play the strategy

Bwf(x)=Bff(xexp0)+Bff(xexp1)B_{\mathrm{wf}}(x) = B_{\mathrm{ff}}(x_{\mathrm{exp}}0) + B_{\mathrm{ff}}(x_{\mathrm{exp}}1)

against Alice’s winning strategy ww in the weight-flow game.

Note that the set {xexp1:x∈{0,1}∗}\{x_{\mathrm{exp}}1 : x \in\{0,1\}^{*}\} is prefix-free. Alice’s strategy in the flow-flow game is obtained by setting

Aff(xexp1)=w(x) for all x∈{0,1}∗,A_{\mathrm{ff}}(x_{\mathrm{exp}}1) = w(x) \text{ for all } x \in\{0,1\}^{*},
Aff(xexp1z)=0 for all x∈{0,1}∗ and nonempty z,A_{\mathrm{ff}}(x_{\mathrm{exp}}1z) = 0 \text{ for all } x \in\{0,1\}^{*} \text{ and nonempty } z,

and all other values of AffA_{\mathrm{ff}} are obtained by recursively summing over the values of the children. This implies that Aff(empty string)≤1A_{\mathrm{ff}}(\text{empty string}) \le1 by the requirement of ww.

In the winning condition in the flow-flow game, we only sum over prefixes xx of odd length, since precisely the nodes xx with odd ∣x∣|x| have 1 child. Moreover, this child is always x0x0, thus the winning condition in the flow-flow game only consists of terms of the form

Aff(xexp1)Bff(xexp0)+Bff(xexp1)=w(x)Bwf(x).\frac{A_{\mathrm{ff}}(x_{\mathrm{exp}}1)}{B_{\mathrm{ff}}(x_{\mathrm{exp}}0) + B_{\mathrm{ff}}(x_{\mathrm{exp}}1)} = \frac{w(x)}{B_{\mathrm{wf}}(x)}.

Since Alice plays a winning strategy ww, the sum of γ\gamma-powers of the right-hand side exceeds ss and the AffA_{\mathrm{ff}} strategy also wins against BffB_{\mathrm{ff}}. Because we started with an arbitrary strategy BffB_{\mathrm{ff}}, the lemma is proven. □

Remark 2.8. Let m(x)m(x) denote discrete algorithmic probability, which is a maximal lower semicomputable discrete semimeasure. Moreover, it satisfies log⁡(1/m(x))=K(x)+O(1)\log(1/m(x)) = K(x) + O(1).

Below, we present for each γ>1\gamma> 1 and some large ss a winning strategy in the weight-flow game for Bob. This implies that for each sequence ω\omega,

∑n=1∞(m(ω≤n)M(ω≤n))γ\sum_{n=1}^{\infty} \left(\frac{m(\omega_{\le n})}{M(\omega_{\le n})}\right)^{\gamma}

is finite. Indeed, consider the game in which Alice enumerates a lower approximation of m(x)m(x) and Bob plays the winning strategy. For similar reasons as before, this implies a bound on the sum.

Why Bob loses the weight-flow game with γ=s=1\gamma= s = 1

If all of Alice’s moves are known in advance, then Bob wins the game for γ=s=1\gamma= s = 1, as is explained in example 2 at the beginning of section 2. To understand why Bob cannot win in general, consider Alice’s first move to set w(0)=w(00)=14w(0) = w(00) = \frac{1}{4}, as illustrated in figure 1. To prevent Alice from winning, Bob needs to increase B(0)B(0) and B(00)B(00) enough such that

1/4B(0)+1/4B(00)≤1.\frac{1/4}{B(0)} + \frac{1/4}{B(00)} \le1.

He can do this in several ways. Either he directs more flow to B(0)B(0). This is good if Alice’s next move is to increase w(01)w(01). Or he moves little flow to B(0)B(0), but moves more of it to make B(00)B(00) larger. This is good if Alice’s next move is to increase w(1)w(1). This dilemma is illustrated in figure 1.

Alice’s winning strategy. She plays w(0)=w(00)=1/4w(0) = w(00) = 1/4 and waits for Bob’s reply. If she did not win, she plays w(1)=1/2w(1) = 1/2 if B(0)>1/2B(0) > 1/2 and w(01)=1/2w(01) = 1/2 otherwise.

To see that Alice indeed wins, note that the case B(0)>1/2B(0) > 1/2 immediately gives w(1)/B(1)>1/21/2=1w(1)/B(1) > \frac{1/2}{1/2} = 1. For the other case, first note that if Bob survives the 1st round, then

1≥1/4B(0)+1/4B(00)≥1/2B(0),(4)1 \ge\frac{1/4}{B(0)} + \frac{1/4}{B(00)} \ge\frac{1/2}{B(0)}, \tag*{(4)}

Figure 1. What Bob needs to win the γ=s=1\gamma=s=1 game in 2 scenarios with w(0)=w(00)=14w(0)=w(00)=\frac{1}{4}.

thus B(0)≥1/2B(0)\ge1/2. Hence B(0)=1/2=B(00)B(0)=1/2=B(00), thus at any future moment, B(01)≤1/2B(01)\le1/2. This implies

w(0)B(0)+w(01)B(01)≥1/41+1/21/2≥5/4.\frac{w(0)}{B(0)}+\frac{w(01)}{B(01)}\ge\frac{1/4}{1}+\frac{1/2}{1/2}\ge5/4.

Hence, Alice wins by a big margin. With better parameters, it is possible to prove that Alice wins with s=1.09s=1.09, but this does not matter, later we only use the strategy for s=1s=1.

Bob’s strategy in the weight-flow game

Lemma 3.1. For each ε>0\varepsilon>0, Bob has a computable winning strategy in the weight-flow game for γ=1+ε\gamma=1+\varepsilon and s=2γ(8(1−2−ε)3+3)s=2^\gamma\left(\frac{8}{(1-2^{-\varepsilon})^3+3}\right).

The proof of the lemma starts with an easier variant of the weight-flow game. For strings x,yx,y, let x⊑yx\sqsubseteq y denote that xx is a prefix of yy. Let x⊏yx\sqsubset y mean x⊑yx\sqsubseteq y and x≠yx\ne y.

Variant of the weight-flow game. The game has an integer parameter C≥1C\ge1. Alice and Bob’s moves are the same (Alice increases weights ww and Bob a semimeasure BB). Alice wins if after Bob’s move there exist CC different strings x1,x2,…,xCx_1,x_2,\ldots,x_C such that x1⊏x2⊏⋯⊏xCx_1\sqsubset x_2\sqsubset\cdots\sqsubset x_C and for all j=1,…,Cj=1,\ldots,C,

w(xj)B(xj)>1C.\frac{w(x_j)}{B(x_j)}>\frac{1}{C}.

Lemma 3.2. For each integer C≥1C\ge1, Bob has a winning strategy in this variant of the weight-flow game.

Proof. With pushing flow δ\delta to node xx, we mean increasing B(z)←B(z)+δB(z)\leftarrow B(z)+\delta for all prefixes z⊑xz\sqsubseteq x. The idea of Bob’s reply is to push minimal flows to prevent Alice’s winning condition from happening. Thus each time he finds x1,…,xCx_1,\ldots,x_C that satisfy this condition, he pushes the minimal flow to xCx_C so that w(xj)>B(xj)/Cw(x_j)>B(x_j)/C holds for fewer than CC values of $j. In case there are several such CC-tuples, it does not matter which one is selected first.

Algorithm 1 Bob’s reply in the variant of the game.

  1. while strings x1⊏⋯⊏xCx_1 \sqsubset\cdots\sqsubset x_C exist with w(xj)>B(xj)/Cw(x_j)>B(x_j)/C for all j=1,…,Cj=1,\ldots,C do

  2. δ←min⁡{Cw(xj)−B(xj):j=1,…,C}\delta\leftarrow\min\{Cw(x_j)-B(x_j):j=1,\ldots,C\}

  3. B(z)←B(z)+δB(z)\leftarrow B(z)+\delta for all z⊑xCz\sqsubseteq x_C

By construction, Alice’s winning requirement is never satisfied. We verify that BB is always a semimeasure. Note that B(z)≥B(z0)+B(z1)B(z)\ge B(z0)+B(z1) holds for all zz, because each time a flow δ\delta is pushed through z0z0 or z1z1, also B(z)B(z) is increased.

Let ϵ\epsilon denote the empty string. It remains to prove that B(ϵ)≤1B(\epsilon)\le1. Let δt\delta_t be the value of δ\delta in line 2 during the tt-th push of flow in BB (in all replies combined). Now it is explained that

∑xw(x)≥∑xmax⁡(0,w(x)−B(x)C)+∑tδt.\sum_x w(x)\ge\sum_x\max\left(0,w(x)-\frac{B(x)}{C}\right)+\sum_t\delta_t.

Initially both sides are zero. At each increase of w(x)w(x), the left side can only increase more. Each time some flow δt\delta_t is pushed, the right side can only decrease, because there are CC different strings xjx_j where B(xj)B(x_j) increases by δt\delta_t and where Cw(xj)≥B(xj)+δtCw(x_j)\ge B(x_j)+\delta_t. Hence, the above inequality always holds.

By definition of the game, the left side is at most 1, thus 1≥∑tδt=B(ϵ)1\ge\sum_t\delta_t=B(\epsilon). Hence, BB is a semimeasure and the lemma is proven.

Proof of lemma 3.1. Bob’s strategy does not depend on ϵ\epsilon. The idea is that Bob plays the above strategy simultaneously for infinitely many CC. To guarantee B(ϵ)≤1B(\epsilon)\le1, we need to push slightly smaller flows. Let

Ci=i(i+1)2i.C_i=i(i+1)2^i.

Algorithm 2 Bob’s reply.

  1. while integer i≥1i\ge1 and x1⊏⋯⊏xCix_1\sqsubset\cdots\sqsubset x_{C_i} exist with w(xj)>2−iB(xj)w(x_j)>2^{-i}B(x_j) for all j=1,…,Cij=1,\ldots,C_i do

  2. δ←min⁡{2iw(xj)−B(xj):j=1,…,Ci}\delta\leftarrow\min\{2^iw(x_j)-B(x_j):j=1,\ldots,C_i\}

  3. B(z)←B(z)+δB(z)\leftarrow B(z)+\delta for all z⊑xCiz\sqsubseteq x_{C_i}

As before, B(z)≥B(z0)+B(z1)B(z)\ge B(z0)+B(z1). To see that B(ϵ)≤1B(\epsilon)\le1, consider the sets of rounds RiR_i where flow is pushed for value ii. Let B=∑Bi′B=\sum B'_i where Bi′B'_i corresponds to all flows pushed during rounds in RiR_i. For each Bi′B'_i, we have

∑xw(x)≥∑x∣w(x)−B(x)2i∣+∑t∈Rii(i+1)δt.\sum_xw(x)\ge\sum_x\left|w(x)-\frac{B(x)}{2^i}\right|+\sum_{t\in R_i}i(i+1)\delta_t.

for exactly the same reasons as in lemma 3.2, but now BB gets a δt\delta_t increase in Ci=i(i+1)2iC_i=i(i+1)2^i places (instead of 2i2^i), which implies that the sum decreases by i(i+1)δti(i+1)\delta_t. Thus, ∑{δt:t∈Ri}≤1i(i+1)\sum\{\delta_t:t\in R_i\}\le\frac{1}{i(i+1)}. After summing over ii, we see that ∑tδt≤1\sum_t\delta_t\le1 and hence, BB is indeed a semimeasure.

It remains to verify the winning condition. Fix ω\omega. First assume that all prefixes of xx of ω\omega satisfy w(x)/B(x)≤1w(x)/B(x)\le1. For each ii, there are at most Ci−1C_i-1 prefixes xx with 2−i<w(x)/B(x)≤2−i+12^{-i}<w(x)/B(x)\le2^{-i+1}. Thus,

∑x⊏ω(w(x)B(x))1+ϵ≤∑i=1∞(Ci−1)⋅(22i)1+ϵ<21+ϵ∑i=1∞i(i+1)2−ϵi≤4⋅2(1−2−ϵ)3.\sum_{x\sqsubset\omega}\left(\frac{w(x)}{B(x)}\right)^{1+\epsilon}\le\sum_{i=1}^{\infty}(C_i-1)\cdot\left(\frac{2}{2^i}\right)^{1+\epsilon}<2^{1+\epsilon}\sum_{i=1}^{\infty}i(i+1)2^{-\epsilon i}\le\frac{4\cdot2}{(1-2^{-\epsilon})^3}.

Unfortunately, it may happen that w(x)/B(x)>1w(x)/B(x)>1, but there are at most C1−1=3C_1-1=3 such strings. For this we modify the BB flow so that the ratio is always bounded by 2. Let

B′(x)=12B(x)+12∑z:x⊑zw(z).B'(x)=\frac{1}{2}B(x)+\frac{1}{2}\sum_{z:x\sqsubseteq z}w(z).

Thus w(x)/B′(x)≤2w(x)/B'(x) \le2. The sum for B′B' contains an additional factor 2γ2^\gamma plus the contribution of at most 3 larger terms. Hence, Bob wins the game for

s=2γ(8(1−2−ε)3+3).s = 2^\gamma\left(\frac{8}{(1-2^{-\varepsilon})^3}+3\right).

Lemma 3.1 is proven.

Lemma 3.3. Bob has a winning strategy in the weight-flow game for γ=1\gamma=1 and some s≤O(log⁡2Nlog⁡2log⁡N)s \le O(\log^2 N\log^2\log N).

Proof. We start by analyzing the finite game restricted to NN-bit strings where N≥2N \ge2. The algorithm is the same as for lemma 3.1, but using better coefficients Ci=⌈log⁡N⌉2iC_i=\lceil\log N\rceil2^i.

For notational convenience, we ignore the first few terms in the sum of the winning condition, equivalently, we assume 0=w(ϵ)=w(0)=w(1)=…0=w(\epsilon)=w(0)=w(1)=\ldots, since finitely many terms do not matter given the big-O notation in ss. For this, we need that the ratios w(x)/B(x)w(x)/B(x) are bounded on those finitely many strings, and this is achieved by adding a uniform flow to Bob’s flow and rescaling proportionally. This rescaling factor is absorbed in the big-OO.

Note that only flows are pushed for values of ii with Ci≤NC_i \le N, thus i≤⌈log⁡N⌉i \le\lceil\log N\rceil. If all prefixes of xx satisfy w(x)/B(x)≤1w(x)/B(x) \le1, then

∑z⊑ω≤Nw(z)B(z)≤∑i=1⌈log⁡N⌉(Ci−1)⋅22i+(N+1)2−⌈log⁡N⌉<O(log⁡2N).\sum_{z\sqsubseteq\omega\le N}\frac{w(z)}{B(z)} \le\sum_{i=1}^{\lceil\log N\rceil}(C_i-1)\cdot\frac{2}{2^i}+(N+1)2^{-\lceil\log N\rceil}<O(\log^2 N).

There might be C1≤O(log⁡N)C_1\le O(\log N) prefixes zz for which w(z)/B(z)>1w(z)/B(z)>1, but in a similar way as before, we bound their ratio by 2.

Now we need a strategy for all lengths NN. For this, we run infinitely many strategies of Bob in parallel where each strategy wℓw_\ell is supported on strings whose lengths are in the interval [Mℓ,Mℓ+1−1][M_\ell,M_{\ell+1}-1] where

Mℓ=22ℓ.M_\ell=2^{2^\ell}.

Thus, wℓ(x)=w(x)w_\ell(x)=w(x) if Mℓ≤∣x∣<Mℓ+1M_\ell\le|x|<M_{\ell+1} and 0 otherwise. Bob’s strategy is

B(x)=∑ℓBℓ(x)ℓ(ℓ+1).B(x)=\sum_\ell\frac{B_\ell(x)}{\ell(\ell+1)}.

We verify that Bob is winning.

∑x⊑ω≤Nw(x)B(x)≤∑ℓ=1⌈log⁡log⁡N⌉∑n=MℓMℓ+1−1ℓ(ℓ+1)wℓ(ω⊑n)Bℓ(ω⊑n)≤∑ℓ=1⌈log⁡log⁡N⌉ℓ2⋅O(log⁡2Mℓ+1).\begin{aligned} \sum_{x\sqsubseteq\omega\le N}\frac{w(x)}{B(x)} \le\sum_{\ell=1}^{\lceil\log\log N\rceil}\sum_{n=M_\ell}^{M_{\ell+1}-1}\ell(\ell+1)\frac{w_\ell(\omega\sqsubseteq n)}{B_\ell(\omega\sqsubseteq n)} \\ &\le\sum_{\ell=1}^{\lceil\log\log N\rceil}\ell^2\cdot O(\log^2 M_{\ell+1}). \end{aligned}

Finally, we observe that log⁡Mℓ\log M_\ell increases geometrically, thus

<O(log⁡2Nlog⁡2log⁡N).<O(\log^2 N\log^2\log N).

Proof of theorem 1.1. Apply lemmas 2.5, 2.1 and 3.1 (respectively lemma 3.3) to obtain the proof of the first part (respectively second part). Let pp be a program that decides the tree TT. Then, we have that K(p)≤∣p∣+2log⁡∣p∣K(p)\le|p|+2\log|p|. Thus 2K(T)≤k22k2^{K(T)}\le k^2 2^k. The theorem is proven.

Upper bound for online classification

Let ⟨z⟩\langle z\rangle be a computable prefix-free encoding of string zz. Recall that we view the task of learning f:{0,1}∗→{0,1}f:\{0,1\}^*\to\{0,1\} through online classification as a sequence prediction task. The learner iteratively receives xnx_n, predicts yny_n and receives the correct value f(xn)f(x_n). This task can be described as predicting selected bits in a sequence

⟨x1⟩f(x1)⟨x2⟩f(x2)⋯\langle x_1\rangle f(x_1)\langle x_2\rangle f(x_2)\cdots

Let TfT_f be the leafless tree consisting of all prefixes of such sequences for all choices of x1,x2,…∈{0,1}∗x_1,x_2,\ldots\in\{0,1\}^*.

Lemma 4.1. Fix γ>1\gamma> 1. If T1,…,T2k−1T_1,\ldots,T_{2^k-1} are trees obtained in the above way from classifiers, then Bob has a computable winning strategy for some s≤O(k1+γ)s \le O(k^{1+\gamma}).

Proof of theorem 1.3 assuming lemma 4.1. Let T1,…,T2k−1T_1,\ldots,T_{2^k-1} be a list of leafless trees that contain all TfT_f for classifiers ff that are computed by programs of length less than kk within time bound tt. Such a list can be made uniformly computable in kk by applying the same technique as in the construction of maximal semimeasures: interpret each string of length less than kk as a program that computes such a classifier, possibly by fixing the output if a program terminates too slowly or gives invalid output. Theorem 1.3 follows from lemma 2.3 applied to trees T1,…,T2k−1T_1,\ldots,T_{2^k-1} and the strategy from lemma 4.1. □\square

In the remainder of this section, lemma 4.1 is proven. Recall the transition from the flow-flow game with 1 tree TT to the weight-flow game in the previous section: when Alice’s flow leaves the tree TT, this corresponds to increasing the weight on the node from which the flow leaves.

A naive way to pass from a flow-flow game with many trees to the weight-flow game is to increase the weights of a node in which flow leaves some tree. To guarantee that the sum of weights is at most 1, the weights need to be rescaled by the number of trees. This means that the strategy of the weight-flow game requires ss proportional to 2k2^k. This is not enough, because we need O(k1+γ)O(k^{1+\gamma}). The idea is to partition the trees into a small number of forests, and only increase the weights when the flow leaves 1 of the forests.

Definition. A leafless forest FF is a subset of {0,1}∗\{0,1\}^* such that for all x∈Fx \in F, either x0∈Fx0 \in F or x1∈Fx1 \in F.

Note that a tree obtained from a classifier satisfies this property.

Definition. A tuple F1,…,FkF_1,\ldots,F_k of forests is called a good partition of the leafless trees T1,…,TKT_1,\ldots,T_K if

  • F1,…,FkF_1,\ldots,F_k partitions all nodes in T1∪⋯∪TKT_1 \cup\cdots\cup T_K,

  • forests FjF_j are leafless,

  • if a node vv in a tree TiT_i has a single child, then vv has a single child in the forest FjF_j containing vv,

  • the intersection of a branch ω\omega and a forest FiF_i is either empty or a path, thus {n:ω≤n∈Fi}\{n : \omega_{\leq n} \in F_i\} is an interval in N\mathbb{N} (possibly empty or infinite).

Lemma 4.2. Assume forests F1,…,FkF_1,\ldots,F_k are a good partition of leafless trees T1,…,TKT_1,\ldots,T_K. Also, assume that Bob has a winning strategy in the weight-flow game with parameters γ\gamma and ss. Then Bob has a winning strategy in the flow-flow game on the trees T1,…,TKT_1,\ldots,T_K with parameters γ\gamma and 2γk(1+kγs)2^\gamma k(1+k^\gamma s).

First this lemma is proven, and afterwards it is explained how forests FiF_i are obtained.

Proof. We will use kk copies of the weight-flow game, where for Alice, a strategy wjw_j in the weight-flow game is obtained by increasing wjw_j when flow AffA_{\mathrm{ff}} leaves forest FjF_j from a node in FjF_j. For Bob, a strategy is obtained in the flow-flow game by pushing the flow 1 step forward on nodes with 1 child in its forest. Here are the details.

Let AffA_{\mathrm{ff}} be a move by Alice in the flow-flow game. Recall that FjF_j is leafless, thus for each xx there is at most 1 value of bb with xb∈∂Fjxb \in\partial F_j.

Alice’s move wjw_j in the jj-th weight-flow game. Let wj(x)=Aff(xb)w_j(x)=A_{\mathrm{ff}}(xb) if x∈Fjx \in F_j and xb∈∂Fjxb \in\partial F_j for some bit bb. For all other xx, let wj(x)=0w_j(x)=0.

Note that ∑xwj(x)≤1\sum_x w_j(x) \leq1, because ∂Fj\partial F_j is prefix-free.

Bob’s move in the flow-flow game. Let Bwf,jB_{\mathrm{wf},j} be the reply from Bob when he plays a winning strategy against Alice’s move wjw_j. Flow BffB_{\mathrm{ff}} is obtained by pushing each flow Bwf,jB_{\mathrm{wf},j} for 1 step forward on nodes pp that have a unique child pbpb in the direction of pbpb, and taking the average over these Bwf,jB_{\mathrm{wf},j} and AffA_{\mathrm{ff}}’s flows.

Formally, let Bff,j′(x)=Bwf,j(p)B'_{\mathrm{ff},j}(x)=B_{\mathrm{wf},j}(p) if pp is the parent of xx and pp has exactly 1 child xx in its forest FjF_j. If pp has 2 children, then Bff,j′(x)=Bwf,j(x)B'_{\mathrm{ff},j}(x)=B_{\mathrm{wf},j}(x). If xx is on a path to at least 1 root of forest FjF_j, then let Bff,j′(x)B'_{\mathrm{ff},j}(x) be the sum of all flows Bwf,j(r)B_{\mathrm{wf},j}(r) over roots rr that are extensions of xx. If xx is neither in FjF_j nor on a path to some of its roots, then Bff,j′(x)=0B'_{\mathrm{ff},j}(x)=0. Finally, for all xx, we set

Bff(x)=12Aff(x)+1k∑j≤kBff,j′(x).B_{\mathrm{ff}}(x)=\frac{1}{2}A_{\mathrm{ff}}(x)+\frac{1}{k}\sum_{j\leq k}B'_{\mathrm{ff},j}(x).

For the same reasons as before, Bff,j′B'_{\mathrm{ff},j} is a semimeasure, thus so is BffB_{\mathrm{ff}}. It remains to verify that Bob wins the game with parameters γ\gamma and k2γ(1+kγs)k2^\gamma(1+k^\gamma s).

Fix a tree TiT_i and an infinite branch ω\omega. We need to bound

∑n:ω<n∈Tiω<nω‾n∉Ti(Aff(ω<nω‾n)Bff(ω<nωn)+Bff(ω<nω‾n))γ\sum_{\substack{n:\omega_{<n}\in T_i\\ \omega_{<n}\overline{\omega}_n\notin T_i}} \left(\frac{A_{\mathrm{ff}}(\omega_{<n}\overline{\omega}_n)} {B_{\mathrm{ff}}(\omega_{<n}\omega_n)+B_{\mathrm{ff}}(\omega_{<n}\overline{\omega}_n)}\right)^\gamma

We rewrite this so that the winning condition of the weight-flow game can be used, which requires us to think about forests.

All flow that leaves tree TiT_i also leaves some forest FjF_j, except in those nodes where the tree TiT_i leaves a forest FjF_j. Thus this exceptional flow exists in a node where flow leaves the tree and the tree leaves the forest. Hence, this flow stays in the forest and is not accounted for in any game, see figure 2. There is 1 such term per forest change on ω\omega.

∑n:ω<n∈Tiω<nω‾n∉Ti⋯≤∑j≤kMissing⁡ij+∑n:ω<n∈Fjω<nω‾n∉Fj⋯\sum_{\substack{n:\omega_{<n}\in T_i\\ \omega_{<n}\overline{\omega}_n\notin T_i}} \cdots \le \sum_{j\le k}\operatorname{Missing}_{ij} + \sum_{\substack{n:\omega_{<n}\in F_j\\ \omega_{<n}\overline{\omega}_n\notin F_j}} \cdots

Since Bff≥12AffB_{\mathrm{ff}}\ge\frac{1}{2}A_{\mathrm{ff}}, each (missing) term is at most 2γ2^\gamma. Hence, we need to bound

≤2γk+∑j≤k∑n:ω<n∈Fjω<nω‾n∉Fj(Aff(ω<nω‾n)Bff(ω<nωn)+Bff(ω<nω‾n))γ\le2^\gamma k+ \sum_{j\le k} \sum_{\substack{n:\omega_{<n}\in F_j\\ \omega_{<n}\overline{\omega}_n\notin F_j}} \left(\frac{A_{\mathrm{ff}}(\omega_{<n}\overline{\omega}_n)} {B_{\mathrm{ff}}(\omega_{<n}\omega_n)+B_{\mathrm{ff}}(\omega_{<n}\overline{\omega}_n)}\right)^\gamma

Note that if xx has 1 child xbxb in FjF_j, then Bwf,j(x)=Bff,j′(xb)B_{\mathrm{wf},j}(x)=B'_{\mathrm{ff},j}(xb). By definition of wjw_j,

≤2γk+∑j≤k∑n:ω<n∈Fjω<nω‾n∉Fj(wj(ω<n)12kBwf,j(ω<n))γ\le2^\gamma k+ \sum_{j\le k} \sum_{\substack{n:\omega_{<n}\in F_j\\ \omega_{<n}\overline{\omega}_n\notin F_j}} \left(\frac{w_j(\omega_{<n})} {\frac{1}{2k}B_{\mathrm{wf},j}(\omega_{<n})}\right)^\gamma

Now the lemma finishes by using that Bob is winning the weight-flow games, thus

≤2γk+k⋅(2k)γs.\le2^\gamma k+k\cdot(2k)^\gamma s.

It remains to construct the forests.

Definition. Let TT be a tree.

– A node z∈Tz\in T is called splitting if both z0∈Tz0\in T and z1∈Tz1\in T.

– A node z∈Tz\in T is called predicting if it has exactly 1 child in TT.

– Trees T1,…,TKT_1,\ldots,T_K are called jointly predicting if for every zz, either all trees that contain zz are splitting or all are predicting.

Observe that a set of trees TfT_f associated to classifiers is jointly predicting. Indeed, if 2 trees TfT_f and TgT_g contain a node zz, it means that both ff and gg are consistent with the labels in zz. When extending zz, this remains true as long as ff and gg agree on the encoded inputs. If z=⟨x1⟩f(x1)…⟨xn−1⟩f(xn−1)⟨xn⟩z=\langle x_1\rangle f(x_1)\ldots\langle x_{n-1}\rangle f(x_{n-1})\langle x_n\rangle for some xnx_n with f(xn)≠g(xn)f(x_n)\ne g(x_n), then both trees have exactly 1 child, but it will be a different child.

Lemma 4.3. Given 2k−12^k-1 leafless trees T1,…,T2k−1T_1,\ldots,T_{2^k-1} that are jointly predicting, one can compute kk forests F1,…,FkF_1,\ldots,F_k that are a good partition of these trees.

The idea of the construction mimics the halving algorithm for online classification given in [15].

First we construct the ‘most popular’ subtree F1F_1 in a greedy way, starting at the root: if the current node is splitting, add it to F1F_1 and recurse on both children, otherwise, recurse on the child that belongs to the maximal number of trees TjT_j (ignore the other child). Break ties arbitrarily. Then, remove F1F_1 from UU. Now UU is a forest. We repeat the process for each root in UU to obtain forest F2F_2 (thus F2F_2 consists of the “most popular subtrees” in the remaining UU). Then remove F2F_2 from UU and repeat to construct F3F_3, and so on. Note that this is a mathematical construction, not an algorithm.

The branch $\omega$ leaves $F_1$ through a root of $F_2$

Figure 2. The branch ω\omega leaves F1F_1 through a root of F2F_2. The red child ω<nωˉn\omega_{<n}\bar{\omega}_n belongs to F1F_1 but not to TiT_i, so this index contributes to the TiT_i-sum but not to the F1F_1-sum.

Construction of forests F1,…,FkF_1,\ldots,F_k for fixed T1,…,TKT_1,\ldots,T_K

ForestConstruction()

  1. U←T1∪⋯∪TKU \leftarrow T_1 \cup\cdots\cup T_K.

  2. for i←1,2,…,ki \leftarrow1,2,\ldots,k do

  3. &nbsp;&nbsp;&nbsp;&nbsp;Fi←∅F_i \leftarrow\varnothing

  4. &nbsp;&nbsp;&nbsp;&nbsp;for every root in UU do

  5. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Process(root, UU, FiF_i)

  6. &nbsp;&nbsp;&nbsp;&nbsp;remove FiF_i from UU

  7. Output F1,…,FkF_1,\ldots,F_k.

Process(node, UU, FF)

  1. while true do

  2. &nbsp;&nbsp;&nbsp;&nbsp;add node to FF

  3. &nbsp;&nbsp;&nbsp;&nbsp;if node is a splitting node then

  4. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Process(child 1, UU, FF)

  5. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Process(child 2, UU, FF)

  6. &nbsp;&nbsp;&nbsp;&nbsp;else # thus node has 1 child in each TT

  7. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;child ←\leftarrow child on the maximal number of trees TjT_j

  8. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Process(child, UU, FF)

Lemma 4.4. The output F1,…,FkF_1,\ldots,F_k of ForestConstruction partitions T1∪⋯∪TKT_1 \cup\cdots\cup T_K.

Proof. Claim. At the beginning of the ii-th iteration of the for loop in ForestConstruction, every remaining node in UU lies on less than 2k+1−i2^{k+1-i} trees.

Proof of the claim. Since the root belongs to less than 2k2^k trees, this holds for i=1i=1.

Now inductively assume the claim for some ii, thus we assume every node in FiF_i lies on less than 2k+1−i2^{k+1-i} trees. Every node in Fi+1F_{i+1} was not added to FiF_i, and such a decision can happen only in the else case inside Process. It happens only for the child that lies on the smaller number of trees. Thus this number is smaller than 2k+1−i/2=2k+1−i−12^{k+1-i}/2 = 2^{k+1-i-1}. The inductive step and hence the claim are proven.

This implies that at the beginning of the kk-th iteration, every node in UU lies on exactly 1 tree and Process copies UU into FkF_k. Hence, the forests F1,…,FkF_1,\ldots,F_k cover all the trees.

Proof of lemma 4.3. It is easy to see that the forests are computable, because the decision to include a node xx in some forest only depends on the part of the trees on strings of length at most ∣x∣|x|.

It remains to verify that F1,…,FkF_1,\ldots,F_k is a good partition of T1,…,TKT_1,\ldots,T_K. The previous lemma states that it is a partition.

At any moment, UU is leafless because the copying to FjF_j always starts from a root in UU. Hence, each Fj+1F_{j+1} is leafless, because the most popular child always exists and the copying never terminates.

If a node vv contains 1 child in a tree TiT_i, then this node is predicting and has 1 child in the forest containing vv.

Finally, observe that each infinite branch ω\omega of a tree TiT_i intersects FjF_j in a path. Indeed, each “less popular child” finishes the copying of the prefix to the current FjF_j. Afterwards, no more prefixes are copied from ω\omega.

In conclusion, the forests are a good partition. Lemma 4.3 and hence theorem 1.3 are proven.

Alice’s strategy in the weight-flow game

Lemma 5.1. Alice has a computable strategy in the weight-flow game such that for some sequence ω\omega and for infinitely many NN the following holds: for all but finitely many rounds,

∑n≤Nw(ω≤n)B(ω≤n)>Ω(log⁡Nlog⁡log⁡N).\sum_{n \le N} \frac{w(\omega_{\le n})}{B(\omega_{\le n})} > \Omega\left(\frac{\log N}{\log\log N}\right).

Proof of theorem 1.2. The theorem follows for a specific tree TT by applying this strategy to lemmas 2.4 and 2.6. To obtain the result for general trees, apply remark 2.7, which basically states that one only needs to embed an arbitrary tree T′T' in this TT so that the number of alternations between 1 and 2 child nodes is optimal. Then the same result is obtained for N←aT′(N)N \leftarrow a_{T'}(N).

It remains to prove lemma 5.1. The proof involves another lemma about a finite variant of the game with a strong winning condition for Alice. This condition is needed for inductive purposes and to obtain a “stable sequence” ω\omega in the combined game.

The composable weight-flow game G(ℓ,s)G(\ell,s). This is the weight-flow game restricted to ℓ\ell-bit strings. On her turn, Alice increases weights ww. Additionally, she must declare a winning string z∈{0,1}≤ℓz \in\{0,1\}^{\le\ell} for which

∑j≤∣z∣w(z≤j)B(z≤j)>s.\sum_{j \le|z|} \frac{w(z_{\le j})}{B(z_{\le j})} > s.

As long as this inequality holds, Alice does not need to declare a new winning string. But if the sum is at most ss, then Alice must declare a new winning string that she did not declare before. Moreover, the set of declared strings must be prefix-free.

The base case is game G(2,s)G(2,s) for any s≤1s \le1. For s<1s < 1, this is easy, because Alice wins by simply putting weight 1 in the root, for s=1s = 1, the strategy from figure 1 works. The following lemma provides the induction step.

Lemma 5.2. If Alice has a winning strategy in the composable game G(L,s)G(L,s) with s≥1s \ge1, then Alice has a winning strategy in the composable game

G(L+1+⌈5s⌉,s+2−⌈4s⌉).G\left(L+1+\lceil5s\rceil,s+2^{-\lceil4s\rceil}\right).

Proof. This proof follows the main technical result in [1 lemma 4]. The idea of the strategy is similar to that in figure 1 and is illustrated in figure 3: first Alice places a small weight in string 0 and she plays recursively in string 01+⌈5s⌉0^{1+\lceil5s\rceil}. Now Bob must send enough flow to nodes 0 and 01+⌈5s⌉0^{1+\lceil5s\rceil}. If he sends too much flow to 0, then Alice starts playing a recursive game in string 1 with all remaining weight. Otherwise, if Bob sends too little, then to win in 01+⌈5s⌉0^{1+\lceil5s\rceil}, he needs to send a larger amount of flow in this string. But then Alice starts playing games on other extensions of string 0, forcing much flow to 0 anyway, thus this extra flow in 01+⌈5s⌉01+\lceil5s\rceil was useless.

The strategy for the composable game

Figure 3. the strategy for the composable game.

Let game G(ℓ,s,α,β)G(\ell,s,\alpha,\beta) be a scaled version of G(ℓ,s)G(\ell,s), in which Alice and Bob should satisfy

∑{w(z):∣z∣≤ℓ}≤αandB(empty string)≤β.\sum\{w(z): |z|\le\ell\}\le\alpha\qquad\text{and}\qquad B(\text{empty string})\le\beta.

Alice wins if

∑j≤∣z∣w(z≤j)B(z≤j)≥αβs.(5)\sum_{j\le|z|}\frac{w(z_{\le j})}{B(z_{\le j})}\ge\frac{\alpha}{\beta}s. \tag*{(5)}

Thus the original game G(ℓ,s)G(\ell,s) is the game G(ℓ,s,1,1)G(\ell,s,1,1). Note that if Alice has a strategy to win the game G(ℓ,s)G(\ell,s), then she also wins the game G(ℓ,s,α,β)G(\ell,s,\alpha,\beta) for all α>0\alpha>0 and β>0\beta>0, simply by rescaling Alice and Bob’s moves by factors α\alpha and β\beta.

In the algorithm and the proof we use the following constants,

ε=2−⌈4s⌉\varepsilon=2^{-\lceil4s\rceil}
n=2⌈5s⌉n=2^{\lceil5s\rceil}
α=(1−ε)/n.\alpha=(1-\varepsilon)/n.

Let ⟨i⟩\langle i\rangle denote the lexicographically ii-th binary string of length 1+⌈5s⌉1+\lceil5s\rceil. Alice’s strategy is given below, where the values did_i and βi\beta_i will be determined soon.

Alice’s strategy in game G(L+1+⌈5s⌉,s+ε)G(L+1+\lceil5s\rceil,s+\varepsilon)
1: w(0)←εw(0)\leftarrow\varepsilon
2: i←1i\leftarrow1
3: while B(0)≤diB(0)\le d_i do
4: Play Alice’s next move in game G(L,s,α,βi)G(L,s,\alpha,\beta_i) on extensions of string ⟨i⟩\langle i\rangle declare the same winning string of the form ⟨i⟩z\langle i\rangle z
5: B←B\leftarrow Bob’s reply
6: if B(⟨i⟩)>βiB(\langle i\rangle)>\beta_i then
7: i←i+1i\leftarrow i+1
8: Play Alice’s strategy for game G(L,s,(1−ε)(1−i/n),1−di)G(L,s,(1-\varepsilon)(1-i/n),1-d_i) on extensions of string 1.

Table 1.

Note that the value w(0)=εw(0)=\varepsilon is equal to the progress in s←s+εs\leftarrow s+\varepsilon. This is done for convenience, but is not necessary. By construction the same winning string is declared at most once.

Our choice of βi\beta_i will imply i≤ni \le n during the execution of the algorithm. Let ii be the maximal value appearing in the strategy. Let us write down the winning conditions both in the case B(0)>diB(0)>d_i and not:

s+ε≤s(1−ε)(1−in)1−dis+\varepsilon\le\frac{s(1-\varepsilon)(1-\frac{i}{n})}{1-d_i}
s+ε≤εdi+s(1−ε)/nβi.s+\varepsilon\le\frac{\varepsilon}{d_i}+s\frac{(1-\varepsilon)/n}{\beta_i}.

The values of did_i and βi\beta_i are obtained by viewing the above inequalities as equalities and solving them. It remains to verify that i≤ni\le n always holds. This follows from

∑i=1nβi≥1,(6)\sum_{i=1}^{n}\beta_i\ge1, \tag*{(6)}

because to get i=n+1i=n+1, it would be needed that B(⟨i⟩)>βiB(\langle i\rangle)>\beta_i for all i≤ni\le n, and hence,

1≥B(0)≥∑i≤nB(⟨i⟩)>∑i≤nβi≥1.1\ge B(0)\ge\sum_{i\le n}B(\langle i\rangle)>\sum_{i\le n}\beta_i\ge1.

Now the sum (6) is verified. Let ti=ε+iαt_i=\varepsilon+i\alpha. One calculates that

βi=αε+sti(ε+s)ti,\beta_i=\alpha\frac{\varepsilon+st_i}{(\varepsilon+s)t_i},

which is decreasing in ii. Hence,

∑i=1nβi=1−εn(s+ε)∑i=1nε+stiti≥1s+ε∫ε1ε+suu du−β0+βn.\sum_{i=1}^{n}\beta_i=\frac{1-\varepsilon}{n(s+\varepsilon)}\sum_{i=1}^{n}\frac{\varepsilon+st_i}{t_i}\ge\frac{1}{s+\varepsilon}\int_{\varepsilon}^{1}\frac{\varepsilon+su}{u}\,du-\beta_0+\beta_n.

Evaluating the integral gives

=εln⁡1ε+(1−ε)ss+ε−β0+βn.=\frac{\varepsilon\ln\frac{1}{\varepsilon}+(1-\varepsilon)s}{s+\varepsilon}-\beta_0+\beta_n.

One verifies that for ε=2−⌈4s⌉\varepsilon=2^{-\lceil4s\rceil}, n=2⌈5s⌉n=2^{\lceil5s\rceil} and s≥1s\ge1, this bound is indeed at least 1. Hence, the sum (6) is at least 1 and the lemma is proven. □

Lemma 5.3. There exists a constant cc such that Alice has a strategy in the game G(2cs,s)G(2^{cs},s).

Proof. The strategy is defined recursively. Recall that a strategy for G(2,1)G(2,1) is given in figure 1. Apply induction using lemma 5.2. Raising ss from i−1i-1 to ii requires 24i2^{4i} recursive calls. Thus the total length of the strings in this game is at most

∑i=1s+1(5i+1)⋅24i≤O(s24s).\sum_{i=1}^{s+1}(5i+1)\cdot2^{4i}\le O(s2^{4s}).

□

Proof of lemma 5.1. The plan is to start a scaled game in each declared winning string zz, and this happens recursively. All games started at recursion level jj receive total weight γj=1j(j+1)\gamma_j=\frac{1}{j(j+1)}. Here are the details. The recursion starts with j=1j=1, s1=1s_1=1 and z0=ϵz_0=\epsilon. The game G1=G(2,s1,γ1,1)G_1=G(2,s_1,\gamma_1,1) is played and each time a winning string z1z_1 is declared, a 2nd game G2G_2 is launched on extensions of z1z_1, where the total weight is γ22−∣z1∣\gamma_2 2^{-|z_1|}. More generally, when game Gj−1G_{j-1} declares a winning string zj−1z_{j-1}, then launch the following game on extensions of zj−1z_{j-1},

Gj=G(2csj,sj,αj,1) withG_j=G(2^{cs_j},s_j,\alpha_j,1)\text{ with}
αj=2−∣zj−1∣j(j+1)\alpha_j=\frac{2^{-|z_{j-1}|}}{j(j+1)}
sj=1+2sj−1αj.s_j=1+2^{\frac{s_{j-1}}{\alpha_j}}.

Note that zjz_j extends zj−1z_{j-1}. Also note that sj≥Ω(log⁡∣zj∣)s_j \ge\Omega(\log|z_j|), since 2csj2^{cs_j} increases at least geometrically because of the +1+1 term in the choice of sjs_j.

Since each string zjz_j changes finitely often, it becomes a fixed string zj∗z_j^* after enough rounds. Let ω\omega be the limit sequence of strings zj∗z_j^* for large jj. The sum in the winning condition (5) is

αj1sj≥sjlog⁡sj≥Ω(log⁡∣zj∗∣log⁡log⁡∣zj∗∣).\frac{\alpha_j}{1}s_j \ge\frac{s_j}{\log s_j} \ge\Omega\left(\frac{\log|z_j^*|}{\log\log|z_j^*|}\right).

Thus for infinitely many prefixes of ω\omega, the required winning condition is satisfied.

Proof of corollary 1.4. Recall that in the proof of lemma 2.6, we can choose a tree in which the predicted bits are precisely those at even positions, and the prediction is always zero. This tree corresponds to any classifier that maps both strings “0” and “1” to the bit 0. This almost works, but there is a small problem, because we need to assume a prefix encoding of the strings in the input stream. But the fix is obvious, the tree should alternate predicting layers with several branching layers according to the prefix encoding.

Statement about AI usage

All theorems were proved and written by the authors. Theorems 1.1 and 1.2 are based on German Kuznetsov’s thesis from June 2025. ChatGPT 6.1 (OpenAI) wrote a detailed review, where it pointed out subtle technical mistakes. Most were easily fixable, and others let to slightly weaker parameters in the main results. It also gave useful references to the halving algorithm and Hutter’s work.

Online semimeasures are slightly better for online classification

Definition ([5]). An online semimeasure PonP_{\mathrm{on}} is a function that maps lists of the form x1,b1,x2,b2,…,xnx_1,b_1,x_2,b_2,\ldots,x_n or x1,b1,x2,b2,…,xn,bnx_1,b_1,x_2,b_2,\ldots,x_n,b_n with xi∈{0,1}∗x_i \in\{0,1\}^* and bi∈{0,1}b_i \in\{0,1\} to R≥0\mathbb{R}_{\ge0} and satisfies

  • Pon(empty list)≤1P_{\mathrm{on}}(\text{empty list}) \le1,

  • Pon(x1,b1,…,xn−1,bn−1)=Pon(x1,b1,…,xn−1,bn−1,xn)P_{\mathrm{on}}(x_1,b_1,\ldots,x_{n-1},b_{n-1}) = P_{\mathrm{on}}(x_1,b_1,\ldots,x_{n-1},b_{n-1},x_n),

  • Pon(x1,b1,…,xn)≥∑bn∈{0,1}Pon(x1,b1,…,xn,bn)P_{\mathrm{on}}(x_1,b_1,\ldots,x_n) \ge\sum_{b_n \in\{0,1\}} P_{\mathrm{on}}(x_1,b_1,\ldots,x_n,b_n).

Online algorithmic probability is defined in a similar way to standard algorithmic probability by the following result.

Proposition A.1 ([5]). Among the lower semicomputable online semimeasures, there exists a semimeasure MonM_{\mathrm{on}} that is maximal up to a constant factor, thus for each such semimeasure PonP_{\mathrm{on}} one has ∃c∀L[Pon(L)≤cMon(L)]\exists c\forall L[P_{\mathrm{on}}(L) \le cM_{\mathrm{on}}(L)].

All MonM_{\mathrm{on}} that satisfy the conditions of the proposition are equal up to a constant factor. We fix such MonM_{\mathrm{on}}. An interesting application is Marcus Hutter’s AIXI policy for reinforcement learning [9, 11]. This theoretical policy models the environment using MonM_{\mathrm{on}} and practical variants of the policy have been studied [11].1

Side note. The online Kolmogorov complexity of x1,b1,…,xn,bnx_1,b_1,\ldots,x_n,b_n is the minimal length of a program that for each i≤ni \le n computes bib_i given x1,…,xix_1,\ldots,x_i. An online variant of the coding theorem holds: the negative algorithm of online algorithmic probability equals online complexity up to additive O(log⁡n)O(\log n) terms [5 theorem 5, p. 144]. Unfortunately, symmetry of information does not hold [2] but does hold for space-bounded complexity with reasonable precision [4].

The unnormalized conditional probability is defined as usual,

M~on(a∣x1,b1,…,xn)=Mon(x1,b1,…,xn,a)Mon(x1,b1,…,xn)\widetilde{M}_{\mathrm{on}}(a \mid x_1,b_1,\ldots,x_n)=\frac{M_{\mathrm{on}}(x_1,b_1,\ldots,x_n,a)}{M_{\mathrm{on}}(x_1,b_1,\ldots,x_n)}

A tilde is used to remind that this version is unnormalized. The following lemma gives a tight bound even for this variant.

Let Hn=[x1,f(x1),…,xn−1,f(xn−1)]H_n=[x_1,f(x_1),\ldots,x_{n-1},f(x_{n-1})] in the following 2 results.

Lemma A.2. If ff is computed by a program of prefix-complexity kk, then for each sequence x1,x2,…∈{0,1}∗x_1,x_2,\ldots\in\{0,1\}^{*},

∑n=1∞1−M~on(f(xn)∣Hn,xn)≤kln⁡2+O(1).\sum_{n=1}^{\infty}1-\widetilde{M}_{\mathrm{on}}(f(x_n)\mid H_n,x_n)\leq k\ln2+O(1).

The proof follows the standard one and is given below. By corollary 1.4 this implies that errors converge faster using online algorithmic probability.

Corollary A.3. There exists a computable classifier ff and a sequence of strings x1,x2,…∈{0,1}∗x_1,x_2,\ldots\in\{0,1\}^{*} such that

lim⁡N→∞∑n=1N1−M(f(xn)∣hn⟨xn⟩)=+∞and∑n=1N1−M~on(f(xn)∣Hn,xn)≤O(1).\lim_{N\to\infty}\sum_{n=1}^{N}1-M(f(x_n)\mid h_n\langle x_n\rangle)=+\infty \qquad\text{and}\qquad \sum_{n=1}^{N}1-\widetilde{M}_{\mathrm{on}}(f(x_n)\mid H_n,x_n)\leq O(1).

Proof of lemma A.2. The proof follows [11 theorem 3.8.9]. Since $1-a\leq\ln\frac{1}{a}forallfor alla>0,

∑n=1∞1−M~on(f(xn)∣Hn,xn)≤∑n=1∞ln⁡1M~on(f(xn)∣Hn,xn).\sum_{n=1}^{\infty}1-\widetilde{M}_{\mathrm{on}}(f(x_n)\mid H_n,x_n)\leq\sum_{n=1}^{\infty}\ln\frac{1}{\widetilde{M}_{\mathrm{on}}(f(x_n)\mid H_n,x_n)}.

Expanding the definition of conditional online probability,

≤ln⁡(Mon(x1)Mon(x1,f(x1))⋅Mon(x1,f(x1),x2)Mon(x1,f(x1),x2,f(x2))⋯Mon(Hn,xn)Mon(Hn,xn,f(xn))).\leq\ln\left(\frac{M_{\mathrm{on}}(x_1)}{M_{\mathrm{on}}(x_1,f(x_1))}\cdot\frac{M_{\mathrm{on}}(x_1,f(x_1),x_2)}{M_{\mathrm{on}}(x_1,f(x_1),x_2,f(x_2))}\cdots\frac{M_{\mathrm{on}}(H_n,x_n)}{M_{\mathrm{on}}(H_n,x_n,f(x_n))}\right).

By definition of online semimeasure, each denominator cancels with the next numerator. Thus this equals

ln⁡Mon(empty list)Mon(H∞)≤ln⁡1Mon(H∞).\ln\frac{M_{\mathrm{on}}(\text{empty list})}{M_{\mathrm{on}}(H_\infty)}\leq\ln\frac{1}{M_{\mathrm{on}}(H_\infty)}.

Now it remains to show that −log⁡Mon(H∞)≤K(q)+O(1)-\log M_{\mathrm{on}}(H_\infty)\leq K(q)+O(1) where qq is a program that computes ff on some (plain) reference machine VV. As usual, we do this by constructing an online semimeasure PonP_{\mathrm{on}} and invoking optimality from proposition A.1. Let UU be the optimal prefix machine in the definition of KK and let

Pon(x1,b1,…,xn,bn)=∑{2−∣p∣:V(U(p),xi)=bi with i=1,…,n}.P_{\mathrm{on}}(x_1,b_1,\ldots,x_n,b_n)=\sum\{2^{-|p|}:V(U(p),x_i)=b_i\text{ with }i=1,\ldots,n\}.

Since UU is prefix-free, one has Pon(empty list)≤1P_{\mathrm{on}}(\text{empty list})\leq1. For lists ending with xnx_n, let PonP_{\mathrm{on}} be defined by dropping xnx_n. By construction, Pon(H∞)≥2−kP_{\mathrm{on}}(H_\infty)\geq2^{-k} if ff is computed by a program of prefix-complexity kk. By definition of MonM_{\mathrm{on}}, one has Mon≥Ω(Pon)M_{\mathrm{on}}\geq\Omega(P_{\mathrm{on}}), thus

log⁡1Mon(H∞)≤log⁡1Pon(H∞)+O(1)≤k+O(1).\log\frac{1}{M_{\mathrm{on}}(H_\infty)}\leq\log\frac{1}{P_{\mathrm{on}}(H_\infty)}+O(1)\leq k+O(1).

The lemma is proven.

References

  1. [1]Mikhail Andreev and Akim Kumok. The sum 2^{K_M(x)−K(x)} over all prefixes x of some binary sequence can be infinite. Theory of Computing Systems, 58(3):424–440, 2016.DOI
  2. [2]Bruno Bauwens. Asymmetry of the Kolmogorov complexity of online predicting odd and even bits. In 31st International Symposium on Theoretical Aspects of Computer Science, pages 125–136, 2014.arxiv.org/abs/1307.4007
  3. [3]Bruno Bauwens. Solomonoff induction of selected bits and online classification, August 2026. Talk at Novikov-125: International Conference Dedicated to the 125th Anniversary of P.S. Novikov, slides https://www.mathnet.ru/PresentFiles/51146/bauwens_slides.pdf.
  4. [4]Bruno Bauwens and Maria Marchenko. Space-bounded online Kolmogorov complexity is additive. In Conference on Computability in Europe, pages 133–142. Springer, 2025.arxiv.org/abs/2502.02777
  5. [5]Alexey Chernov, Alexander Shen, Nikolay Vereshchagin, and Vladimir Vovk. On-line probability, complexity and randomness. In ALT ’08: Proceedings of the 19th international conference on Algorithmic Learning Theory, pages 138–153, Berlin, Heidelberg, 2008. Springer-Verlag.
  6. [6]Grégoire Delétang, Anian Ruoss, Paul-Ambroise Duquenne, Elliot Catt, Tim Genewein, Christopher Mattern, Jordi Grau-Moya, Li Kevin Wenliang, Matthew Aitchison, Laurent Orseau, et al. Language modeling is compression. In International Conference on Learning Representations, volume 2024, pages 14165–14181, 2024.arxiv.org/abs/2309.10668
  7. [7]Jordi Grau-Moya, Tim Genewein, Marcus Hutter, Laurent Orseau, Gregoire Deletang, Elliot Catt, Anian Ruoss, Li Kevin Wenliang, Christopher Mattern, Matthew Aitchison, and Joel Veness. Learning universal predictors. In Ruslan Salakhutdinov, Zico Kolter, Katherine Heller, Adrian Weller, Nuria Oliver, Jonathan Scarlett, and Felix Berkenkamp, editors, Proceedings of the 41st International Conference on Machine Learning, volume 235 of Proceedings of Machine Learning Research, pages 16178–16205. PMLR, 21–27 Jul 2024.
  8. [8]Marcus Hutter. Convergence and loss bounds for bayesian sequence prediction. IEEE Transactions on Information Theory, 49(8):2061–2067, 2003.
  9. [9]Marcus Hutter. Universal artificial intelligence: Sequential decisions based on algorithmic probability. Springer Science & Business Media, 2005.
  10. [10]Marcus Hutter. Open problems in universal induction & intelligence. Algorithms, 2(3):879–906, 2009.
  11. [11]Marcus Hutter, David Quarel, and Elliot Catt. An Introduction to Universal Artificial Intelligence. CRC Press, 2024.DOI
  12. [12]Tor Lattimore, Marcus Hutter, and Vaibhav Gavane. Universal prediction of selected bits. In International Conference on Algorithmic Learning Theory, pages 262–276. Springer, 2011.arxiv.org/abs/1107.5531
  13. [13]Steffen Lempp, Joseph Miller, Selwyn Ng, and Dan Turetsky. Complexity inequality, 2010. Private communication to Marcus Hutter, cited in [12].
  14. [14]Ming Li and Paul M.B. Vitányi. An Introduction to Kolmogorov Complexity and Its Applications, 4th edition. Springer, 2019.
  15. [15]Nick Littlestone. Learning quickly when irrelevant attributes abound: A new linear-threshold algorithm. Machine Learning, 2(4):285–318, 1988.
  16. [16]Alexander Shen, Vladimir A. Uspensky, and Nikolay Vereshchagin. Kolmogorov complexity and algorithmic randomness, volume 220. American Mathematical Soc., 2017.
  17. [17]Ray J. Solomonoff. A preliminary report on a general theory of inductive inference, on February 4, 1960. Available at http://raysolomonoff.com/publications/rayfeb60.pdf. A revised version of this report was published in November 1960, A Preliminary Report on a General Theory of Inductive Inference, (Revision of Report V-131), Contract AF 49(639)-376, Report ZTB-138, Zator Co., Cambridge, Mass., Nov. 1960, available at http://raysolomonoff.com/publications/z138.pdf.
  18. [18]Ray J. Solomonoff. Complexity-based induction systems: Comparisons and convergence theorems. IEEE Trans. on Inform. Theor., 24(4):422–432, 1978.DOI

Paper details

vlnc:W_7uhtks6h
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents