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 be the universal semimeasure. After observing a string , it predicts the next bit to be with conditional probability proportional to . Thus the error of this probability is If a computable infinite sequence with a self-delimiting description of at most bits, then . Lattimore, Hutter and Gavane consider the problem of predicting computable patterns in a sequence, for example, the pattern of repeated bits They show that the error probabilities of the bits fixed by a computable pattern have limit zero, for example, for repeated bits, one has . We show that for some computable pattern, the sum of over positions from the pattern is not bounded. However, the sum of squares 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 , converges faster: the sum of 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 , what is the probability of the next bit being ? Solomonoff provided a simple mathematical solution for this problem in [17], which is based on algorithmic probability 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 that satisfies and , where denotes the concatenation of string and bit .
Among the lower semicomputable semimeasures, there exists a semimeasure that is maximal, in the sense that for each such semimeasure , one has , see [14 theorem 4.5.1] or [16 theorem 78]. Note that all maximal such semimeasures are equal up to a constant factor. Let be any such maximal semimeasure.
Such a maximal semimeasure is related to pretraining of large language models, where one selects model parameters that minimize the cross-entropy loss on the training set , which equals the negative log-likelihood , see [6 section 2] and [7].
Solomonoff’s solution for sequence prediction given is to predict with probability1
Computable patterns
It is well known that Solomonoff induction quickly converges on computable sequences (even for the unnormalized conditionals). Indeed, if is the minimal prefix complexity of a program that computes , then by [11 theorem 3.8.9],2
The following question was raised in [9 problem 2.9 p. 63] and [10].
Question. Does conditional probability 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 does converge to 1 for those bits 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 -losses with and . For a bit , let be its negation.
Theorem 1.1. Fix . Let be decided by a program of length . If all prefixes of are in , then
and
The above bounds are exponential in 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 , 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 is a subset of that is closed under taking prefixes. A branch alternates at least times between 1 and 2 children if there are with for all even and for all odd .
In the context of convergence of subpatterns, it is important that the denominator is normalized and equals instead of the commonly used . Indeed, …
However, the definition of algorithmic probability is different in [12]. We think this also holds for certain maximal semimeasures (but not for all).
Theorem 1.2. Suppose for a computable leafless tree , each alternates times between having 1 and 2 children. Then there exists an infinite branch and infinitely many such that
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 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 zeros will be continued indefinitely by zeros? This probability has limit 1 for large , since is nonincreasing in , thus for large
We explain that theorem 1.2 implies that the analogue for bits in even positions is false. Given a long string of length 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 times between 1 and 2 children. Hence, by theorem 1.2 there exists a sequence with 0’s in even positions such that for all this probability is
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 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 is a measure computed by a self-delimiting program of length , then for an infinite sequence generated from , one has
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§ of strings , where with . Now we are interested in the sums of errors only for those bits that correspond to values .
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 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 -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 and a computable time bound . If is computed by a -bit program in time on input , then for each sequence ,
where .
In this result, the time bound affects the constant in the big-O. A similar statement can be proven for functions 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 , an infinite sequence of strings and infinitely many such that
where .
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 in the theorem are closed under prefixes, because dropping strings that do not contain all their prefixes neither changes the set of infinite that are applicable to the theorems, nor does it affect the sums.
The flow-flow game
The flow-flow game. The game has parameters , and is played on trees , which are known to both players. Two players, called Alice and Bob, each maintain their own continuous semimeasure, denoted and . Initially, . They alternate turns and at their turn, they can increase finitely many values of their semimeasure, provided functions and remain semimeasures.
Alice wins immediately if after some move of Bob, there exists an infinite branch of some tree such that
where in the sum, is assumed. Bob wins if he can reply indefinitely without Alice winning.
Example 1. Consider the game with and the single tree . Bob wins by concentrating all measure along the tree, thus setting for all .
Example 2. Again, let . Consider the game with an arbitrary single tree. If Alice evaluates a computable measure , then Bob has a computable winning strategy by splitting his flow proportionally to 's flow in nodes for which both children are in the tree, and otherwise, if has only 1 child, sending all flow in this child's direction.
Indeed, at every round, the support of is finite, so we prove it by induction on the maximal length of the support. Suppose that the strategy works for some and all trees. Consider some supported on -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 . Then and the root contributes an extra term to all sums. But by the inductive hypothesis, the strategy wins against strategy , meaning that in our game, the sum is bounded by . Thus in each branch, the sum is at most . 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 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 tree is needed. For a set , let be the minimal prefix complexity of a program that decides , see [14, 16] for background on algorithmic information theory.
Lemma 2.1. Fix and a constant . Assume that for each tree , Bob has a winning strategy in the game with 1 tree and value , and that these strategies are uniformly computable given . Then for each computable and infinite branch in ,
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 and ,
where is the minimal prefix complexity of a program that lower approximates .
Proof of lemma 2.1. Consider the game for a computable tree . Let Alice play a strategy in which she ignores and Bob's moves: she computes a lower approximation of and, in each round, sets equal to the current approximation. Bob plays the winning strategy. We obtain a semimeasure by taking the limit of his semimeasure. It satisfies
Note that , because is computed from by evaluating the strategy. Hence, lemma 2.2 implies
The proof is completed by raising to the power and summing.
Lemma 2.3. Fix , a computable function , and a uniformly computable sequence of trees . Suppose Bob wins each game with parameters and trees . Also suppose that the strategies are uniformly computable in . Then, for each , each and each infinite branch in ,
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 , thus this complexity is bounded by the complexity of . Hence, . After taking exponents and powers, this corresponds to the factor on the right side.
The second part of theorem 1.1 requires bounds on the sum for -bit prefixes of and is a function. Alice wins if after some move of Bob, there exists a tree and a such that
It is easy to adapt the above lemmas when 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 and function be computable. Assume that Alice has a computable strategy in which for some sequence and for infinitely many the following holds: for all but finitely many rounds
Then there exists a sequence such that for infinitely many ,
Proof. Consider a game in which Bob plays blindly, and lower approximates a priori probability . Alice plays the winning strategy. Since Alice’s semimeasure is lower semicomputable, lemma 2.2 implies
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 . The flow that leaves Alice’s tree in a certain node is viewed as a weight.
Formally, let denote the set of all nodes that are not in but whose parent is in . Note that is prefix-free. Let always represent a bit. For all (implying ), we set , provided is not a leaf, and otherwise, let (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 at all.
The weight-flow game. The game has parameters and . Two players Alice and Bob alternate turns. As before, Bob maintains a semimeasure . Initially . Alice maintains weights for all strings such that
Initially . In each round, Alice increase finitely many values of . Afterwards, Bob increases finitely many values of .
Alice wins if after Bob’s move, there exists an with
where 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 , Bob has a winning strategy in the flow-flow game with the same parameters and . Moreover, if Bob’s weight-flow strategy is computable, then his flow-flow strategy is computable given .
Proof. The proof is a simple formal verification. Let be Alice’s strategy in a flow-flow game with a single tree . We need a winning strategy for Bob in this game.
First is transformed to a strategy for Alice in the weight-flow game. Recall that is always a bit. For each node in with , Alice sets . She keeps for all other .
Bob plays his winning strategy against . He obtains a strategy by “pushing one step forward” when the relevant direction in is unique. More precisely,
if ,
for nodes with a brother, thus if ,
for nodes without a brother.
Note that for and that only happens if is in and has no brother in . This implies for all , because if , then . Clearly, if is lower semicomputable, then is lower semicomputable given .
In the sum that defines the winning condition, only values are used for which has no brother. Thus we have
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 be the tree with zeros in even positions, thus . The idea is to associate strings in the weight-flow game to expanded strings
in the flow-flow game. The empty string is encoded as string 1. Alice’s weights in become flows in , since . We explain in detail why this works.
Consider a strategy for Bob in the flow-flow game with the tree from the lemma. Let Bob play the strategy
against Alice’s winning strategy in the weight-flow game.
Note that the set is prefix-free. Alice’s strategy in the flow-flow game is obtained by setting
and all other values of are obtained by recursively summing over the values of the children. This implies that by the requirement of .
In the winning condition in the flow-flow game, we only sum over prefixes of odd length, since precisely the nodes with odd have 1 child. Moreover, this child is always , thus the winning condition in the flow-flow game only consists of terms of the form
Since Alice plays a winning strategy , the sum of -powers of the right-hand side exceeds and the strategy also wins against . Because we started with an arbitrary strategy , the lemma is proven. □
Remark 2.8. Let denote discrete algorithmic probability, which is a maximal lower semicomputable discrete semimeasure. Moreover, it satisfies .
Below, we present for each and some large a winning strategy in the weight-flow game for Bob. This implies that for each sequence ,
is finite. Indeed, consider the game in which Alice enumerates a lower approximation of 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
If all of Alice’s moves are known in advance, then Bob wins the game for , 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 , as illustrated in figure 1. To prevent Alice from winning, Bob needs to increase and enough such that
He can do this in several ways. Either he directs more flow to . This is good if Alice’s next move is to increase . Or he moves little flow to , but moves more of it to make larger. This is good if Alice’s next move is to increase . This dilemma is illustrated in figure 1.
Alice’s winning strategy. She plays and waits for Bob’s reply. If she did not win, she plays if and otherwise.
To see that Alice indeed wins, note that the case immediately gives . For the other case, first note that if Bob survives the 1st round, then
Figure 1. What Bob needs to win the game in 2 scenarios with .
thus . Hence , thus at any future moment, . This implies
Hence, Alice wins by a big margin. With better parameters, it is possible to prove that Alice wins with , but this does not matter, later we only use the strategy for .
Bob’s strategy in the weight-flow game
Lemma 3.1. For each , Bob has a computable winning strategy in the weight-flow game for and .
The proof of the lemma starts with an easier variant of the weight-flow game. For strings , let denote that is a prefix of . Let mean and .
Variant of the weight-flow game. The game has an integer parameter . Alice and Bob’s moves are the same (Alice increases weights and Bob a semimeasure ). Alice wins if after Bob’s move there exist different strings such that and for all ,
Lemma 3.2. For each integer , Bob has a winning strategy in this variant of the weight-flow game.
Proof. With pushing flow to node , we mean increasing for all prefixes . The idea of Bob’s reply is to push minimal flows to prevent Alice’s winning condition from happening. Thus each time he finds that satisfy this condition, he pushes the minimal flow to so that holds for fewer than values of $j. In case there are several such -tuples, it does not matter which one is selected first.
Algorithm 1 Bob’s reply in the variant of the game.
while strings exist with for all do
for all
By construction, Alice’s winning requirement is never satisfied. We verify that is always a semimeasure. Note that holds for all , because each time a flow is pushed through or , also is increased.
Let denote the empty string. It remains to prove that . Let be the value of in line 2 during the -th push of flow in (in all replies combined). Now it is explained that
Initially both sides are zero. At each increase of , the left side can only increase more. Each time some flow is pushed, the right side can only decrease, because there are different strings where increases by and where . Hence, the above inequality always holds.
By definition of the game, the left side is at most 1, thus . Hence, is a semimeasure and the lemma is proven.
Proof of lemma 3.1. Bob’s strategy does not depend on . The idea is that Bob plays the above strategy simultaneously for infinitely many . To guarantee , we need to push slightly smaller flows. Let
Algorithm 2 Bob’s reply.
while integer and exist with for all do
for all
As before, . To see that , consider the sets of rounds where flow is pushed for value . Let where corresponds to all flows pushed during rounds in . For each , we have
for exactly the same reasons as in lemma 3.2, but now gets a increase in places (instead of ), which implies that the sum decreases by . Thus, . After summing over , we see that and hence, is indeed a semimeasure.
It remains to verify the winning condition. Fix . First assume that all prefixes of of satisfy . For each , there are at most prefixes with . Thus,
Unfortunately, it may happen that , but there are at most such strings. For this we modify the flow so that the ratio is always bounded by 2. Let
Thus . The sum for contains an additional factor plus the contribution of at most 3 larger terms. Hence, Bob wins the game for
Lemma 3.1 is proven.
Lemma 3.3. Bob has a winning strategy in the weight-flow game for and some .
Proof. We start by analyzing the finite game restricted to -bit strings where . The algorithm is the same as for lemma 3.1, but using better coefficients .
For notational convenience, we ignore the first few terms in the sum of the winning condition, equivalently, we assume , since finitely many terms do not matter given the big-O notation in . For this, we need that the ratios 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-.
Note that only flows are pushed for values of with , thus . If all prefixes of satisfy , then
There might be prefixes for which , but in a similar way as before, we bound their ratio by 2.
Now we need a strategy for all lengths . For this, we run infinitely many strategies of Bob in parallel where each strategy is supported on strings whose lengths are in the interval where
Thus, if and 0 otherwise. Bob’s strategy is
We verify that Bob is winning.
Finally, we observe that increases geometrically, thus
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 be a program that decides the tree . Then, we have that . Thus . The theorem is proven.
Upper bound for online classification
Let be a computable prefix-free encoding of string . Recall that we view the task of learning through online classification as a sequence prediction task. The learner iteratively receives , predicts and receives the correct value . This task can be described as predicting selected bits in a sequence
Let be the leafless tree consisting of all prefixes of such sequences for all choices of .
Lemma 4.1. Fix . If are trees obtained in the above way from classifiers, then Bob has a computable winning strategy for some .
Proof of theorem 1.3 assuming lemma 4.1. Let be a list of leafless trees that contain all for classifiers that are computed by programs of length less than within time bound . Such a list can be made uniformly computable in by applying the same technique as in the construction of maximal semimeasures: interpret each string of length less than 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 and the strategy from lemma 4.1.
In the remainder of this section, lemma 4.1 is proven. Recall the transition from the flow-flow game with 1 tree to the weight-flow game in the previous section: when Alice’s flow leaves the tree , 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 proportional to . This is not enough, because we need . 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 is a subset of such that for all , either or .
Note that a tree obtained from a classifier satisfies this property.
Definition. A tuple of forests is called a good partition of the leafless trees if
partitions all nodes in ,
forests are leafless,
if a node in a tree has a single child, then has a single child in the forest containing ,
the intersection of a branch and a forest is either empty or a path, thus is an interval in (possibly empty or infinite).
Lemma 4.2. Assume forests are a good partition of leafless trees . Also, assume that Bob has a winning strategy in the weight-flow game with parameters and . Then Bob has a winning strategy in the flow-flow game on the trees with parameters and .
First this lemma is proven, and afterwards it is explained how forests are obtained.
Proof. We will use copies of the weight-flow game, where for Alice, a strategy in the weight-flow game is obtained by increasing when flow leaves forest from a node in . 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 be a move by Alice in the flow-flow game. Recall that is leafless, thus for each there is at most 1 value of with .
Alice’s move in the -th weight-flow game. Let if and for some bit . For all other , let .
Note that , because is prefix-free.
Bob’s move in the flow-flow game. Let be the reply from Bob when he plays a winning strategy against Alice’s move . Flow is obtained by pushing each flow for 1 step forward on nodes that have a unique child in the direction of , and taking the average over these and ’s flows.
Formally, let if is the parent of and has exactly 1 child in its forest . If has 2 children, then . If is on a path to at least 1 root of forest , then let be the sum of all flows over roots that are extensions of . If is neither in nor on a path to some of its roots, then . Finally, for all , we set
For the same reasons as before, is a semimeasure, thus so is . It remains to verify that Bob wins the game with parameters and .
Fix a tree and an infinite branch . We need to bound
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 also leaves some forest , except in those nodes where the tree leaves a forest . 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 .
Since , each (missing) term is at most . Hence, we need to bound
Note that if has 1 child in , then . By definition of ,
Now the lemma finishes by using that Bob is winning the weight-flow games, thus
It remains to construct the forests.
Definition. Let be a tree.
– A node is called splitting if both and .
– A node is called predicting if it has exactly 1 child in .
– Trees are called jointly predicting if for every , either all trees that contain are splitting or all are predicting.
Observe that a set of trees associated to classifiers is jointly predicting. Indeed, if 2 trees and contain a node , it means that both and are consistent with the labels in . When extending , this remains true as long as and agree on the encoded inputs. If for some with , then both trees have exactly 1 child, but it will be a different child.
Lemma 4.3. Given leafless trees that are jointly predicting, one can compute forests 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 in a greedy way, starting at the root: if the current node is splitting, add it to and recurse on both children, otherwise, recurse on the child that belongs to the maximal number of trees (ignore the other child). Break ties arbitrarily. Then, remove from . Now is a forest. We repeat the process for each root in to obtain forest (thus consists of the “most popular subtrees” in the remaining ). Then remove from and repeat to construct , and so on. Note that this is a mathematical construction, not an algorithm.

Figure 2. The branch leaves through a root of . The red child belongs to but not to , so this index contributes to the -sum but not to the -sum.
Construction of forests for fixed
ForestConstruction()
.
for do
for every root in do
Process(root, , )
remove from
Output .
Process(node, , )
while true do
add node to
if node is a splitting node then
Process(child 1, , )
Process(child 2, , )
else # thus node has 1 child in each
child child on the maximal number of trees
Process(child, , )
Lemma 4.4. The output of ForestConstruction partitions .
Proof. Claim. At the beginning of the -th iteration of the for loop in ForestConstruction, every remaining node in lies on less than trees.
Proof of the claim. Since the root belongs to less than trees, this holds for .
Now inductively assume the claim for some , thus we assume every node in lies on less than trees. Every node in was not added to , 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 . The inductive step and hence the claim are proven.
This implies that at the beginning of the -th iteration, every node in lies on exactly 1 tree and Process copies into . Hence, the forests 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 in some forest only depends on the part of the trees on strings of length at most .
It remains to verify that is a good partition of . The previous lemma states that it is a partition.
At any moment, is leafless because the copying to always starts from a root in . Hence, each is leafless, because the most popular child always exists and the copying never terminates.
If a node contains 1 child in a tree , then this node is predicting and has 1 child in the forest containing .
Finally, observe that each infinite branch of a tree intersects in a path. Indeed, each “less popular child” finishes the copying of the prefix to the current . Afterwards, no more prefixes are copied from .
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 and for infinitely many the following holds: for all but finitely many rounds,
Proof of theorem 1.2. The theorem follows for a specific tree 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 in this so that the number of alternations between 1 and 2 child nodes is optimal. Then the same result is obtained for .
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” in the combined game.
The composable weight-flow game . This is the weight-flow game restricted to -bit strings. On her turn, Alice increases weights . Additionally, she must declare a winning string for which
As long as this inequality holds, Alice does not need to declare a new winning string. But if the sum is at most , 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 for any . For , this is easy, because Alice wins by simply putting weight 1 in the root, for , 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 with , then Alice has a winning strategy in the composable game
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 . Now Bob must send enough flow to nodes 0 and . 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 , 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 was useless.

Figure 3. the strategy for the composable game.
Let game be a scaled version of , in which Alice and Bob should satisfy
Alice wins if
Thus the original game is the game . Note that if Alice has a strategy to win the game , then she also wins the game for all and , simply by rescaling Alice and Bob’s moves by factors and .
In the algorithm and the proof we use the following constants,
Let denote the lexicographically -th binary string of length . Alice’s strategy is given below, where the values and will be determined soon.
| Alice’s strategy in game |
| 1: |
| 2: |
| 3: while do |
| 4: Play Alice’s next move in game on extensions of string declare the same winning string of the form |
| 5: Bob’s reply |
| 6: if then |
| 7: |
| 8: Play Alice’s strategy for game on extensions of string 1. |
Table 1.
Note that the value is equal to the progress in . This is done for convenience, but is not necessary. By construction the same winning string is declared at most once.
Our choice of will imply during the execution of the algorithm. Let be the maximal value appearing in the strategy. Let us write down the winning conditions both in the case and not:
The values of and are obtained by viewing the above inequalities as equalities and solving them. It remains to verify that always holds. This follows from
because to get , it would be needed that for all , and hence,
Now the sum (6) is verified. Let . One calculates that
which is decreasing in . Hence,
Evaluating the integral gives
One verifies that for , and , 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 such that Alice has a strategy in the game .
Proof. The strategy is defined recursively. Recall that a strategy for is given in figure 1. Apply induction using lemma 5.2. Raising from to requires recursive calls. Thus the total length of the strings in this game is at most
□
Proof of lemma 5.1. The plan is to start a scaled game in each declared winning string , and this happens recursively. All games started at recursion level receive total weight . Here are the details. The recursion starts with , and . The game is played and each time a winning string is declared, a 2nd game is launched on extensions of , where the total weight is . More generally, when game declares a winning string , then launch the following game on extensions of ,
Note that extends . Also note that , since increases at least geometrically because of the term in the choice of .
Since each string changes finitely often, it becomes a fixed string after enough rounds. Let be the limit sequence of strings for large . The sum in the winning condition (5) is
Thus for infinitely many prefixes of , 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 is a function that maps lists of the form or with and to and satisfies
,
,
.
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 that is maximal up to a constant factor, thus for each such semimeasure one has .
All that satisfy the conditions of the proposition are equal up to a constant factor. We fix such . An interesting application is Marcus Hutter’s AIXI policy for reinforcement learning [9, 11]. This theoretical policy models the environment using and practical variants of the policy have been studied [11].1
Side note. The online Kolmogorov complexity of is the minimal length of a program that for each computes given . An online variant of the coding theorem holds: the negative algorithm of online algorithmic probability equals online complexity up to additive 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,
A tilde is used to remind that this version is unnormalized. The following lemma gives a tight bound even for this variant.
Let in the following 2 results.
Lemma A.2. If is computed by a program of prefix-complexity , then for each sequence ,
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 and a sequence of strings such that
Proof of lemma A.2. The proof follows [11 theorem 3.8.9]. Since $1-a\leq\ln\frac{1}{a}a>0,
Expanding the definition of conditional online probability,
By definition of online semimeasure, each denominator cancels with the next numerator. Thus this equals
Now it remains to show that where is a program that computes on some (plain) reference machine . As usual, we do this by constructing an online semimeasure and invoking optimality from proposition A.1. Let be the optimal prefix machine in the definition of and let
Since is prefix-free, one has . For lists ending with , let be defined by dropping . By construction, if is computed by a program of prefix-complexity . By definition of , one has , thus
The lemma is proven.
References
- [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]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]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]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]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]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]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]Marcus Hutter. Convergence and loss bounds for bayesian sequence prediction. IEEE Transactions on Information Theory, 49(8):2061–2067, 2003.
- [9]Marcus Hutter. Universal artificial intelligence: Sequential decisions based on algorithmic probability. Springer Science & Business Media, 2005.
- [10]Marcus Hutter. Open problems in universal induction & intelligence. Algorithms, 2(3):879–906, 2009.
- [11]Marcus Hutter, David Quarel, and Elliot Catt. An Introduction to Universal Artificial Intelligence. CRC Press, 2024.DOI
- [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]Steffen Lempp, Joseph Miller, Selwyn Ng, and Dan Turetsky. Complexity inequality, 2010. Private communication to Marcus Hutter, cited in [12].
- [14]Ming Li and Paul M.B. Vitányi. An Introduction to Kolmogorov Complexity and Its Applications, 4th edition. Springer, 2019.
- [15]Nick Littlestone. Learning quickly when irrelevant attributes abound: A new linear-threshold algorithm. Machine Learning, 2(4):285–318, 1988.
- [16]Alexander Shen, Vladimir A. Uspensky, and Nikolay Vereshchagin. Kolmogorov complexity and algorithmic randomness, volume 220. American Mathematical Soc., 2017.
- [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]Ray J. Solomonoff. Complexity-based induction systems: Comparisons and convergence theorems. IEEE Trans. on Inform. Theor., 24(4):422–432, 1978.DOI
