# Solomonoff induction

**Solomonoff induction** is an idealized method of sequence prediction.

## Contents

- 1 Model selection vs sequence prediction
- 2 Variants
- 3 Type of hypothesis
- 4 Significance of random coin flips
- 5 Measures vs semimeasures
- 6 Computable, computably enumerable, lower semicomputable, upper semicomputable
- 7 Turing machines, prefix machines, monotone machines
- 8 Applications
- 9 Questions/things to explain
- 10 See also
- 11 References

## Model selection vs sequence prediction

This section should answer the question of "what do we even mean by 'induction'?", "what does it mean to do good epistemology?" In all cases, we get some sort of data, and then we're supposed to make some prediction, but there are several possibilities for the nature of the prediction (are we predicting what we will likely see next? are we predicting what we think is the laws of physics? are we going to get an "x" value and asked to predict a "y" value that corresponds to it, like in supervised learning?). Each of these different "nature of the prediction" leads to a conceptually different form of induction:

- model selection
- sequence prediction -- this is the topic of solomonoff induction
- supervised learning and unordered prediction: see e.g. http://world.std.com/~rjs/compj99.pdf

Solomonoff induction is formulated in terms of *sequence prediction* so the nature of the prediction = the nature of the data, i.e. we want to predict the likely data we will observe next.

The other thing to mention is that the other kinds of "induction" can be converted into a sequence prediction problem or can be obtained by slightly modifying the Solomonoff induction scheme. This means that if we figure out a way to "do good sequence prediction", we will have essentially solved how to "do good induction"/"do good epistemology". (?) (I *think* this is right, but I am fuzzy on the details)

## Variants

(Note: I'm splitting off most of this to Variants of Solomonoff induction while keeping a high-level summary here)

^{[1]}

^{[2]}

^{[3]}

There are many variants of Solomonoff induction that seem to all turn out essentially the same, but most resources on Solomonoff induction only talk about one or two of the variants, which makes it pretty confusing for someone trying to learn about it. It's also not obvious that all of these variants *are* essentially the same, so showing that would be nice.

Comparison dimensions:

- Determinism: are your programs probabilistic or deterministic? If deterministic, I think the programs require random coinflips as input.
- Kind of Turing machine used: ordinary, prefix, monotone
- Prediction length: finite vs infinite sequences
- Input (to UTM) length: finite vs infinite
- Solomonoff prior vs universal mixture; for universal mixture, you need to also specify the class over which you're mixing, and what you are summing over (programs, as in Eliezer's Arbital dialogue, or semimeasures, as in Legg's paper)
- Discrete vs continuous? (is this the same as finite vs infinite?)

List of variants considered in various resources:

- Li and Vitanyi:
^{[4]}- (defined in theorem 4.3.1 and example 4.3.3) seems like a discrete universal mixture. Input is finite. The "programs" (lower semicomputable discrete semimeasures ) are probabilistic.
- universal a priori probability (definition 4.3.5): deterministic prefix machine, random coinflips as input, finite input (program), finite output
- universal a priori probability (definition 4.5.6, p. 302)
- (a version of that is a measure)

- Marcus Hutter's papers...
- Herrmann's "An Introduction to Solomonoff Induction With an Application to Scientific Confirmation Theory":
- Logical Induction Arbital page:
^{[5]}- deterministic, regular (rather than prefix-free) Turing machines

## Type of hypothesis

What is the type of a hypothesis? The type varies by formalization. For example:

- In classical statistical inference, a hypothesis is a constant that happens to be unknown, so e.g. it is a real number. This hypothesis then induces a probability distribution (called a "model").
- In Bayesian statistical inference, a hypothesis is an event (i.e. a subset of the sample space). There is a random variable representing the hypothesis (e.g. ), and you can get each individual hypothesis (e.g. ) by setting it to different values (e.g. ).
- In Solomonoff induction a hypothesis is a program (?) whose type depends on the variant of Solomonoff induction being used. In one of the versions, a hypothesis is a program that outputs bits; in another version a hypothesis assigns probabilities to bits.
- logical induction: this framework has various "characters" in it, namely a market, a deductive process, and traders. I guess a hypothesis can correspond to traders, who (unlike the other frameworks) only need to focus on a single pattern to try to exploit the market.

## Significance of random coin flips

See Equivalence of random coinflips view and minimal programs view.

^{[6]}

^{[7]} (p. 4)

"""The prior AIXI is based on is the *Solomonoff prior*. It is defined as the output of a universal Turing machine (UTM) whose inputs are coin-flips.

In other words, feed a UTM a random program. Normally, you’d think of a UTM as only being able to simulate deterministic machines. Here, however, the initial inputs can instruct the UTM to use the rest of the infinite input tape as a source of randomness to simulate a *stochastic* Turing machine.

Combining this with the previous idea about viewing Bayesian learning as a way of allocating “trust” to “experts” which meets a bounded loss condition, we can see the Solomonoff prior as a kind of ideal machine learning algorithm which can learn to act like any algorithm you might come up with, no matter how clever."""^{[8]} -- one thing that's not clear to me with this interpretation is what if we want something to have probability 1/3? we can approximate it arbitrarily well using coinflips, but we can never get it exactly. contrast this to probabilistic programs, which can output 1/3 exactly.

## Measures vs semimeasures

Multiple ways to think about semimeasures:

- "defective" measures that can be patched up by adding an extra element
- probability distribution over finite and infinite strings
^{[5]}-- the "semi" part comes because of the inclusion of the finite strings. If all the finite strings had probability 0, then we would have a measure.

## Computable, computably enumerable, lower semicomputable, upper semicomputable

there is "computable" in the recursion theory sense, and then there is "computable" in the lower and upper approximations sense. I think these are equivalent; the latter is just trying to define the former in the case where the domain/range are uncountable.

## Turing machines, prefix machines, monotone machines

Kraft's inequality

prefix machine = prefix-free machine?

"can be computed by a monotone machine" = "can be computed by an interactive algorithm" = "process" (see Hay 2007)

In terms of notation, some authors use and others use .

prefix machines are used for discrete version, and monotone machines are used for continuous version?

What functions can prefix/monotone machines compute? Can they compute everything a regular Turing machine can, but just add an "interactive" component? Or is there some Turing-computable function that prefix/monotone machines can't compute? -- since the work tape is bidirectional and we can move freely on it, we can start by copying the program to it, then going back to the leftmost nonblank square, then executing the program like a normal Turing machine, and finally copying the resulting tape onto the write-only output tape. This only works if the program is finite though.

Suppose the set of input programs is prefix-free. Then if , we must have , so we automatically get . So prefix-free implies monotonicity.

Hutter says (p. 11) that "For given , forms a prefix code". At first I was confused about this. What if a program prints "+" each time it reads a 0 and does nothing when it reads a 1? Then on input "000" it prints "+++", but if the input was "0001", then it seems like this would also print "+++", so the set of programs that print "+++" don't form a prefix code (because "000" is a prefix of "0001")! But looking more closely, Hutter says that means " is to the left of the input head when the last bit of is output". When the last bit of "+++" is output, the thing to the left of the input head is "000". So by this definition, it seems like "0001" will not be in the set of programs, i.e. we *cannot* say . This is somewhat unintuitive to me (I wouldn't have expected this from the notation), but at least now it makes sense to say that the set of programs for a given output forms a prefix code.

So why do we sometimes use a prefix machine and sometimes use a monotone machine? If we're dealing with *finite* output strings, then we can require that the machine halts. So then program itself contains the halting instruction. But when we're dealing with infinite output strings, we also want to allow for the fact that maybe the machine *won't* halt, and that *that's okay too*. But if we allow non-halting programs, then we need to be more careful about which programs to allow.

I have an intuition that says if we take monotone machines but restrict to finite output, then we get exactly prefix machines.

consider program p:

print("+") halt()

and program p':

print("+") print("") halt()

because of the halting instruction, p is not a prefix of p'. But if we're working with infinite programs q:

print("+")

and q':

print("+") print("")

then q is a prefix of q'. Monotone machines prevent this kind of thing by saying that you're only allowed to call yourself is a program if you've just finished printing a non-empty string.

What if we take the set of all monotone programs, and insert `halt()`

at every possible location?

## Applications

- there are some standard applications you can find standard references
- AIXI
- carl's analogy to psychophysical laws -- rob bensinger's post about AIXI also talks about "qualia factory"
- malign prior stuff
- comparison to logical induction

## Questions/things to explain

- https://www.greaterwrong.com/posts/3xnkw6JkQdwc8Cfcf/is-the-human-brain-a-valid-choice-for-the-universal-turing
- incorporating actions/what solomonoff induction does if its input sequence is partially controlled by some agent's motor response
- how/in what sense solomonoff induction contains exact copies of Terence Tao or an advanced human civilization
- in the deterministic version, Epicurus's principle is invoked the assign equal probability to each program of a fixed length, but there's a fishy assumption here that the correct program has this exact length. Why not consider all programs of length at most this fixed bound? Or all programs more generally? See e.g. p. 53 of https://arxiv.org/pdf/1105.5721.pdf
- Eliezer's dialogue contains "Did you say something earlier about the deterministic and probabilistic versions of Solomonoff induction giving the same answers? Like, is it a distinction without a difference whether we ask about simple programs that reproduce the observed data versus simple programs that assign high probability to the data? I can't see why that should be true, especially since Turing machines don't include a randomness source." [1] I'm wondering what "added assumption" he sees. Some possible answers are: (1) the assumption that the world is deterministic, e.g. p. 52 "To do this we assume in this subsection that the world is governed by some deterministic computable process." [2]; and (2) the assumption that a completely random sequence of coinflips can be provided. -- but as [3] explains (p. 54), even when we use deterministic programs, the
*predictions*are still stochastic.

## See also

## References

- ↑ "Solomonoff induction: Intro Dialogue (Math 2)". Arbital.
- ↑ Marcus Hutter; Shane Legg; Paul M.B. Vitanyi. "Algorithmic probability".
*Scholarpedia*. 2007. - ↑ Shane Legg. "Solomonoff Induction". 2004.
- ↑
*An Introduction to Kolmogorov Complexity and Its Applications*(3rd ed). - ↑
^{5.0}^{5.1}Alex Appel. "Logical Induction (incomplete)". 2017. - ↑ Marcus Hutter. "On Universal Prediction and Bayesian Confirmation".
- ↑ Ian Wood; Peter Sunehag; Marcus Hutter. "(Non-)Equivalence of Universal Priors".
- ↑ https://intelligence.org/2018/11/02/embedded-models/