a short chat about realityfluid
-------------------------------

(anonymized and lightly edited)

a short chat about realityfluid


*this work was done by [Tamsin Leake](https://carado.moe) and [Julia Persson](https://www.lesswrong.com/users/juliahp) at [Orthogonal](https://orxl.org).*

*thanks to [mesaoptimizer](https://mesaoptimizer.com/) for his help putting together this post.*

formalizing the QACI alignment formal-goal
------------------------------------------

what does the [QACI](qaci.html) plan for [formal-goal alignment](formal-alignment.html) actually look like when formalized as math? in this post, we'll be presenting our current formalization, which we believe has most critical details filled in.

this post gives a brief explanation of what QACI tries to do, but people unfamiliar with this alignment scheme might want to read the [narrative explanation](narrative-explanation-qaci.html), which is a recommended introduction to QACI — though keep in mind that it's not entirely up to date.

this post straightforwardly builds up the math for QACI from the bottom up; and while it does explain all of the math, it does so by presenting it all at once. you might find prefer reading the companion post, [*"an Evangelion dialogue explaining the QACI alignment plan"*](qaci-invention-dialogue.html), which builds up this math gradually and provides more context.

### 1. math constructs

in this first part, we'll be defining a collection of mathematical constructs which we'll be using in the rest of the post.

#### 1.1. basic set theory

we'll be assuming basic set theory notation; in particular, [A×B×C](javascript:alert(%22A%5Cu00d7B%5Cu00d7C%22)) is the set of tuples whose elements are respectively members of the sets [A](javascript:alert(%22A%22)), [B](javascript:alert(%22B%22)), and [C](javascript:alert(%22C%22)), and for [n∈ℕ](javascript:alert(%22n%5Cu2208%5Cu2115%22)), [Sn](javascript:alert(%22S%5En%22)) is the set of tuples of [n](javascript:alert(%22n%22)) elements, all members of [S](javascript:alert(%22S%22)).

[𝔹={⊤,⊥}](javascript:alert(%22%5Cud835%5Cudd39%3D%5C%5C%7B%5Cu22a4%2C%5Cu22a5%5C%5C%7D%22)) is the set of booleans and [ℕ](javascript:alert(%22%5Cu2115%22)) is the set of natural numbers including [0](javascript:alert(%220%22)).

given a set [X](javascript:alert(%22X%22)), [𝒫(X)](javascript:alert(%22%5C%5Cmathcal%7BP%7D%28X%29%22)) will be the set of subsets of [X](javascript:alert(%22X%22)).

[#S](javascript:alert(%22%5C%5C%23%20S%22)) is the cardinality (number of different elements) in set [S](javascript:alert(%22S%22)).

for some set [X](javascript:alert(%22X%22)) and some complete ordering [<∈X2→𝔹](javascript:alert(%22%3C%5C%5C%3B%5Cu2208%5C%5C%3BX%5E2%5Cu2192%5Cud835%5Cudd39%22)), [min<](javascript:alert(%22%5C%5Ctextit%7Bmin%7D_%3C%22)) and [max<](javascript:alert(%22%5C%5Ctextit%7Bmax%7D_%3C%22)) are two functions of type [𝒫(X)\{∅}→X](javascript:alert(%22%5C%5Cmathcal%7BP%7D%28X%29%5C%5Cbackslash%5C%5C%7B%5Cu2205%5C%5C%7D%5Cu2192X%22)) finding the respective minimum and maximum element of non-empty sets when they exist, using [<](javascript:alert(%22%3C%22)) as an ordering.

#### 1.2. functions and programs

if [n∈ℕ](javascript:alert(%22n%5Cu2208%5Cu2115%22)), then we'll denote [f∘n](javascript:alert(%22f%5Cu2218%5En%22)) as repeated composition of [f](javascript:alert(%22f%22)): [f∘…∘f](javascript:alert(%22f%5Cu2218%5Cu2026%5Cu2218f%22)) ([n](javascript:alert(%22n%22)) times), with [∘](javascript:alert(%22%5Cu2218%22)) being the composition operator: [(f∘g)(x)=f(g(x))](javascript:alert(%22%28f%5Cu2218g%29%28x%29%3Df%28g%28x%29%29%22)).

[λx:X.B](javascript:alert(%22%5Cu03bbx%3AX.B%22)) is an anonymous function defined over set [X](javascript:alert(%22X%22)), whose parameter [x](javascript:alert(%22x%22)) is bound to its argument in its body [B](javascript:alert(%22B%22)) when it is called.

[A→B](javascript:alert(%22A%5Cu2192B%22)) is the set of functions from [A](javascript:alert(%22A%22)) to [B](javascript:alert(%22B%22)), with [→](javascript:alert(%22%5Cu2192%22)) being right-associative ([A→B→C](javascript:alert(%22A%5Cu2192B%5Cu2192C%22)) is [A→(B→C)](javascript:alert(%22A%5Cu2192%28B%5Cu2192C%29%22))). if [f∈A→B→C](javascript:alert(%22f%5C%5C%3B%5Cu2208%5C%5C%3BA%5Cu2192B%5Cu2192C%22)), then [f(x)(y)](javascript:alert(%22f%28x%29%28y%29%22)) is simply [f](javascript:alert(%22f%22)) applied once to [x∈A](javascript:alert(%22x%5C%5C%3B%5Cu2208%5C%5C%3BA%22)), and then the resulting function of type [B→C](javascript:alert(%22B%5Cu2192C%22)) being applied to [y∈B](javascript:alert(%22y%5C%5C%3B%5Cu2208%5C%5C%3BB%22)). [A→B](javascript:alert(%22A%5Cu2192B%22)) is sometimes denoted [BA](javascript:alert(%22B%5EA%22)) in set theory.

[A→HB](javascript:alert(%22A%5C%5Coverset%7BH%7D%5Cu2192B%22)) is the set of always-halting, always-succeeding, deterministic programs taking as input an [A](javascript:alert(%22A%22)) and returning a [B](javascript:alert(%22B%22)).

given [f∈A→HB](javascript:alert(%22f%5Cu2208A%5C%5Coverset%7BH%7D%5Cu2192B%22)) and [x∈A](javascript:alert(%22x%5Cu2208A%22)), [R(f,x)∈ℕ\{0}](javascript:alert(%22R%28f%2Cx%29%5C%5C%3B%5Cu2208%5C%5C%3B%5Cu2115%5C%5Cbackslash%5C%5C%7B0%5C%5C%7D%22)) is the runtime duration of executing [f](javascript:alert(%22f%22)) with input [x](javascript:alert(%22x%22)), measured in compute steps doing a constant amount of work each — such as turing machine updates.

#### 1.3. sum notation

i'll be using a syntax for sums [∑](javascript:alert(%22%5C%5Csum%22)) in which the sum iterates over all possibles values for the variables listed *above* it, given that the constraints *below* it hold.

[x,y∑y=1y=xmod2x∈{1,2,3,4}x≤2](javascript:alert(%22%5Cn%5Ct%5C%5Cbegin%7Bsplit%7D%5Cn%5Ct%5Ct%26x%2Cy%5Cn%5C%5C%5C%5C%5Ct%26%5C%5Csum%5C%5C%3By%20%26%3D%5C%5C%3B1%5Cn%5C%5C%5C%5C%5Ct%26y%3Dx%5C%5C%3B%5C%5Ctextit%7Bmod%7D%5C%5C%3B2%20%26%5Cn%5C%5C%5C%5C%5Ct%26x%5Cu2208%5C%5C%7B1%2C2%2C3%2C4%5C%5C%7D%26%5Cn%5C%5C%5C%5C%5Ct%26x%5C%5C%3B%5Cu2264%5C%5C%3B2%20%26%5Cn%5C%5C%5C%5C%5Ct%26%26%5Cn%5Ct%5C%5Cend%7Bsplit%7D%5Cn%22))

says "for any value of [x](javascript:alert(%22x%22)) and [y](javascript:alert(%22y%22)) where these three constraints hold, sum [y](javascript:alert(%22y%22))".

#### 1.4. distributions

for any countable set [X](javascript:alert(%22X%22)), the set of distributions over [X](javascript:alert(%22X%22)) is defined as:

[ΔX≔{f|f∈X→[0;1],∑x∈Xxf(x)≤1}](javascript:alert(%22%5Cn%5Ct%5C%5Cmathrm%7B%5Cu0394%7D_X%5C%5C%3B%5Cu2254%5C%5C%3B%5C%5C%7Bf%7Cf%5C%5C%3B%5Cu2208%5C%5C%3BX%5Cu2192%5B0%3B1%5D%2C%5C%5Cbegin%7Bsplit%7D%5C%5Coverset%7Bx%7D%7B%5C%5Cunderset%7Bx%5Cu2208X%7D%7B%5C%5Csum%7D%7D%5C%5Cend%7Bsplit%7Df%28x%29%5C%5C%3B%5Cu2264%5C%5C%3B1%5C%5C%7D%5Cn%22))

a function [f∈X→[0;1]](javascript:alert(%22f%5C%5C%3B%5Cu2208%5C%5C%3BX%5Cu2192%5B0%3B1%5D%22)) is a distribution [ΔX](javascript:alert(%22%5C%5Cmathrm%7B%5Cu0394%7D_X%22)) over [X](javascript:alert(%22X%22)) if and only if its sum over all of [X](javascript:alert(%22X%22)) is never greater than 1. we call "mass" the scalar in [[0;1]](javascript:alert(%22%5B0%3B1%5D%22)) which a distribution assigns to any value. note that in our definition of distribution, we do not require that the distribution over all elements in the domain sums up to 1, but merely that it sums up to *at most* 1. this means that different distributions can have different "total mass".

we define [ΔX0∈ΔX](javascript:alert(%22%5C%5Cmathrm%7B%5Cu0394%7D%5E0_X%5C%5C%3B%5Cu2208%5C%5C%3B%5C%5Cmathrm%7B%5Cu0394%7D_X%22)) as the empty distribution: [ΔX0(x)=0](javascript:alert(%22%5C%5Cmathrm%7B%5Cu0394%7D%5E0_X%28x%29%3D0%22)).

we define [ΔX1∈X→ΔX](javascript:alert(%22%5C%5Cmathrm%7B%5Cu0394%7D%5E1_X%5C%5C%3B%5Cu2208%5C%5C%3BX%5Cu2192%5C%5Cmathrm%7B%5Cu0394%7D_X%22)) as the distribution entirely concentrated on one element: [ΔX1(x)(y)={1ify=x0ify≠x](javascript:alert(%22%5C%5Cmathrm%7B%5Cu0394%7D%5E1_X%28x%29%28y%29%3D%5C%5Cbegin%7Bcases%7D1%26%5C%5Ctext%7Bif%7D%5C%5C%3By%3Dx%5C%5C%5C%5C0%26%5C%5Ctext%7Bif%7D%5C%5C%3By%5C%5C%3B%5Cu2260%5C%5C%3Bx%5C%5Cend%7Bcases%7D%22))

we define [NormalizeX∈ΔX→ΔX](javascript:alert(%22%5C%5Ctextit%7BNormalize%7D_X%5C%5C%3B%5Cu2208%5C%5C%3B%5C%5Cmathrm%7B%5Cu0394%7D_X%5Cu2192%5C%5Cmathrm%7B%5Cu0394%7D_X%22)) which modifies a distribution to make it sum to 1 over all of its elements, except for empty distributions:

[NormalizeX(δ)(x)≔{δ(x)∑y∈Xyδ(y)ifδ≠ΔX00ifδ=ΔX0](javascript:alert(%22%5Cn%5Ct%5C%5Ctextit%7BNormalize%7D_X%28%5Cu03b4%29%28x%29%5C%5C%3B%5Cu2254%5C%5C%3B%5C%5Cbegin%7Bcases%7D%5Cn%5Ct%5Ct%5C%5Cfrac%7B%5Cu03b4%28x%29%7D%7B%5C%5Cbegin%7Bsplit%7D%5C%5Coverset%7By%7D%7B%5C%5Cunderset%7By%5Cu2208X%7D%7B%5C%5Csum%7D%7D%5C%5Cend%7Bsplit%7D%5Cu03b4%28y%29%7D%20%26%20%5C%5Ctext%7Bif%7D%5C%5C%3B%5Cu03b4%5C%5C%3B%5Cu2260%5C%5C%3B%5C%5Cmathrm%7B%5Cu0394%7D%5E0_X%5Cn%5C%5C%5C%5C%5Ct0%20%26%20%5C%5Ctext%7Bif%7D%5C%5C%3B%5Cu03b4%3D%5C%5Cmathrm%7B%5Cu0394%7D%5E0_X%5Cn%5Ct%5C%5Cend%7Bcases%7D%5Cn%22))

we define [UniformX](javascript:alert(%22%5C%5Ctextit%7BUniform%7D_X%22)) as a distribution attributing equal value to every different element in a finite set [X](javascript:alert(%22X%22)), or the empty distribution if [X](javascript:alert(%22X%22)) is infinite.

[UniformX(x)≔{1#Xif#X∈ℕ0if#X∉ℕ](javascript:alert(%22%5Cn%5Ct%5C%5Ctextit%7BUniform%7D_X%28x%29%5C%5C%3B%5Cu2254%5C%5C%3B%5C%5Cbegin%7Bcases%7D%5Cn%5Ct%5Ct%5C%5Cfrac%7B1%7D%7B%5C%5C%23%20X%7D%20%26%20%5C%5Ctext%7Bif%7D%5C%5C%3B%20%5C%5C%23%20X%5C%5C%3B%5Cu2208%5C%5C%3B%5Cu2115%5Cn%5C%5C%5C%5C%5Ct0%20%20%20%20%20%20%20%20%20%20%20%20%20%20%26%20%5C%5Ctext%7Bif%7D%5C%5C%3B%20%5C%5C%23%20X%5C%5C%3B%5Cu2209%5C%5C%3B%5Cu2115%5Cn%5Ct%5C%5Cend%7Bcases%7D%5Cn%22))

we define [maxXΔ∈ΔX→𝒫(X)](javascript:alert(%22%5C%5Ctextit%7Bmax%7D%5E%5C%5Cmathrm%7B%5Cu0394%7D_X%5C%5C%3B%5Cu2208%5C%5C%3B%5C%5Cmathrm%7B%5Cu0394%7D_X%5Cu2192%5C%5Cmathcal%7BP%7D%28X%29%22)) as the function finding the elements of a distribution with the highest value:

[maxXΔ(δ)≔{x|x∈X,∀x′∈X:δ(x′)≤δ(x)}](javascript:alert(%22%5Cn%5Ct%5C%5Ctextit%7Bmax%7D%5E%5C%5Cmathrm%7B%5Cu0394%7D_X%28%5Cu03b4%29%5C%5C%3B%5Cu2254%5C%5C%3B%5C%5C%7Bx%7Cx%5Cu2208X%2C%5Cu2200x%5E%5C%5Cprime%5Cu2208X%3A%5C%5C%3B%5Cu03b4%28x%5E%5C%5Cprime%29%5C%5C%3B%5Cu2264%5C%5C%3B%5Cu03b4%28x%29%5C%5C%7D%5Cn%22))

#### 1.5. constrained mass

given distributions, we will define a notation which i'll call "constrained mass".

it is defined as a syntactic structure that turns into a sum:

[v1,…,vpv1,…,vp𝐌[V]≔∑X1(x1)⋅…⋅Xn(xn)⋅Vx1:X1x1∈domain(X1)⋮⋮xn:Xnxn∈domain(Xn)C1C1⋮⋮CmCm](javascript:alert(%22%5Cn%5Ct%5C%5Cbegin%7Bsplit%7D%5Cn%5Ct%5Ct%26%20v_1%2C%5C%5Cldots%2Cv_p%20%26%20%20%20%26%20v_1%2C%5C%5Cldots%2Cv_p%5Cn%5C%5C%5C%5C%5Ct%26%5C%5Cmathbf%7BM%7D%5C%5C%3B%5BV%5D%20%26%5Cu2254%5C%5C%3B%26%20%5C%5Csum%5C%5C%3BX_1%28x_1%29%5C%5C%3B%5Cu22c5%5C%5C%3B%5C%5Cldots%5C%5C%3B%5Cu22c5%5C%5C%3BX_n%28x_n%29%5C%5C%3B%5Cu22c5%5C%5C%3BV%5Cn%5C%5C%5C%5C%5Ct%26%20x_1%5C%5C%3B%3A%5C%5C%3BX_1%20%20%20%20%26%20%20%20%26%20x_1%5C%5C%3B%5Cu2208%5C%5C%3B%5C%5Ctextit%7Bdomain%7D%28X_1%29%5Cn%5C%5C%5C%5C%5Ct%26%20%5C%5Cvdots%20%20%20%20%20%20%20%20%20%26%20%20%20%26%20%5C%5Cvdots%5Cn%5C%5C%5C%5C%5Ct%26%20x_n%5C%5C%3B%3A%5C%5C%3BX_n%20%20%20%20%26%20%20%20%26%20x_%7Bn%7D%5C%5C%3B%5Cu2208%5C%5C%3B%5C%5Ctextit%7Bdomain%7D%28X_n%29%5Cn%5C%5C%5C%5C%5Ct%26%20C_1%20%20%20%20%20%20%20%20%20%20%20%20%26%20%20%20%26%20C_1%5Cn%5C%5C%5C%5C%5Ct%26%20%5C%5Cvdots%20%20%20%20%20%20%20%20%20%26%20%20%20%26%20%5C%5Cvdots%5Cn%5C%5C%5C%5C%5Ct%26%20C_m%20%20%20%20%20%20%20%20%20%20%20%20%26%20%20%20%26%20C_m%5Cn%5Ct%5C%5Cend%7Bsplit%7D%5Cn%22))

in which variables [x](javascript:alert(%22x%22)) are sampled from their respective distributions [X](javascript:alert(%22X%22)), such that each instance of [V](javascript:alert(%22V%22)) is multiplied by [X(x)](javascript:alert(%22X%28x%29%22)) for each [x](javascript:alert(%22x%22)). constraints [C](javascript:alert(%22C%22)) and iterated variables [v](javascript:alert(%22v%22)) are kept as-is.

it is intended to weigh its expression body [V](javascript:alert(%22V%22)) by various sets of assignments of values to the variables [v](javascript:alert(%22v%22)), weighed by how much mass the [X](javascript:alert(%22X%22)) distributions return and filtered for when the [C](javascript:alert(%22C%22)) constraints hold.

to take a fairly abstract but fully calculable example,

[𝐌x,f[f(x,2)]≔∑x,f(λn:{1,2,3}.n10)(x)⋅Uniform{min,max}(f)⋅f(x,2)x:λn:{1,2,3}.n10x∈domain(λn:{1,2,3}.n10)f:Uniform{min,max}f∈domain(Uniform{min,max})xmod2≠0xmod2≠0=∑x,fx10⋅12⋅f(x,2)x∈{1,2,3}f∈{min,max}xmod2≠0=1⋅min(1,2)10⋅2+3⋅min(3,2)10⋅2+1⋅max(1,2)10⋅2+3⋅max(3,2)10⋅2=1⋅1+3⋅2+1⋅2+3⋅320=1+6+2+920=1820=910](javascript:alert(%22%5Cn%5Ct%5C%5Cbegin%7Bsplit%7D%5Cn%5Ct%5Ct%26%5C%5Coverset%7Bx%2Cf%7D%7B%5C%5Cmathbf%7BM%7D%7D%5C%5C%3B%5Bf%28x%2C2%29%5D%20%26%5Cu2254%5C%5C%3B%26%5C%5Coverset%7Bx%2Cf%7D%7B%5C%5Csum%7D%5C%5C%3B%5C%5Cleft%28%5Cu03bbn%3A%5C%5C%7B1%2C2%2C3%5C%5C%7D.%5C%5Cfrac%7Bn%7D%7B10%7D%5C%5Cright%29%28x%29%5C%5C%3B%5Cu22c5%5C%5C%3B%5C%5Ctextit%7BUniform%7D_%7B%5C%5C%7B%5C%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%5Cn%22))

in this syntax, the variables being sampled from distributions are allowed to be bound by an arbitrary amount of logical constraints or new variable bindings below it, other than the variables being sampled from distributions.

#### 1.6. bitstrings

[𝔹\*](javascript:alert(%22%5Cud835%5Cudd39%5E%2A%22)) is the set of finite bitstrings.

bitstrings can be compared using the lexicographic order [<𝔹\*](javascript:alert(%22%3C_%7B%5Cud835%5Cudd39%5E%2A%7D%22)), and concatenated using the [‖](javascript:alert(%22%5C%5C%7C%22)) operator. for a bitstring [x∈𝔹\*](javascript:alert(%22x%5C%5C%3B%5Cu2208%5C%5C%3B%5Cud835%5Cudd39%5E%2A%22)), [|x|∈ℕ](javascript:alert(%22%7B%7Cx%7C%7D%5C%5C%3B%5Cu2208%5C%5C%3B%5Cu2115%22)) is its length in number of bits.

for any countable set [X](javascript:alert(%22X%22)), [EncodeX∈X→𝔹\*](javascript:alert(%22%5C%5Ctextit%7BEncode%7D_X%5C%5C%3B%5Cu2208%5C%5C%3BX%5Cu2192%5Cud835%5Cudd39%5E%2A%22)) and will be some reasonable function to convert values to bitstrings, such that [∀(x,y)∈X2:EncodeX(x)=EncodeX(y)⇔x=y](javascript:alert(%22%5Cu2200%28x%2Cy%29%5Cu2208X%5E2%3A%5C%5C%3B%5C%5Ctextit%7BEncode%7D_X%28x%29%3D%5C%5Ctextit%7BEncode%7D_X%28y%29%5C%5C%3B%5Cu21d4%5C%5C%3Bx%3Dy%22)). "reasonable" entails constraints such as:

* it can be computed efficiently.
* it can be inverted efficiently and unambiguously.
* its output's size is somewhat proportional to the actual amount of information. for example, integers are encoded in binary, not unary.

#### 1.7. cryptography

we posit [σ≔𝔹σ¯](javascript:alert(%22%5Cu03c3%5C%5C%3B%5Cu2254%5C%5C%3B%5Cud835%5Cudd39%5E%5C%5Cbar%7B%5Cu03c3%7D%22)), the set of "signatures", sufficiently large bitstrings for cryptographic and uniqueness purposes, with their length defined as [σ¯=231](javascript:alert(%22%5C%5Cbar%7B%5Cu03c3%7D%3D2%5E%7B31%7D%22)) for now. this *feels* to me like it should be enough, and if it isn't then something is fundamentally wrong with the whole scheme, such that no manageable larger size would do either.

we posit a function [ExpensiveHash∈𝔹\*→Hσ](javascript:alert(%22%5C%5Ctextit%7BExpensiveHash%7D%5C%5C%3B%5Cu2208%5C%5C%3B%5Cud835%5Cudd39%5E%2A%5C%5Coverset%7BH%7D%5Cu2192%5Cu03c3%22)), to generate fixed-sized strings from seed bitstrings, which must satisfy the following:

* it must be too expensive for the AI to compute *in any way* (including through superintelligently clever tricks), but cheap enough that we can compute it outside of the AI — for example, it could require quantum computation, and the AI could be restricted to classical computers
* it should take longer to compute (again, in any way) than the expected correct versions of [Loc](javascript:alert(%22%5C%5Ctextit%7BLoc%7D%22))'s [f,g](javascript:alert(%22f%2Cg%22)) functions (as will be defined later) could afford to run
* it should tend to be collision-resistant

at some point, we might come up with more formal ways to define [ExpensiveHash](javascript:alert(%22%5C%5Ctextit%7BExpensiveHash%7D%22)) in a way that checks that it isn't being computed inside [Loc](javascript:alert(%22%5C%5Ctextit%7BLoc%7D%22))'s [f,g](javascript:alert(%22f%2Cg%22)) functions, nor inside the AI.

#### 1.8. text and math evaluation

for any countable set [X](javascript:alert(%22X%22)), we'll be assuming [EvalMathX∈𝔹\*→{{x}|x∈X}∪{∅}](javascript:alert(%22%5C%5Ctextit%7BEvalMath%7D_X%5C%5C%3B%5Cu2208%5C%5C%3B%5Cud835%5Cudd39%5E%2A%5Cu2192%5C%5C%7B%5C%5C%7Bx%5C%5C%7D%7Cx%5Cu2208X%5C%5C%7D%5Cu222a%5C%5C%7B%5Cu2205%5C%5C%7D%22)) to interpret a piece of text as a piece of math in some formal language, evaluating to either:

* a set of just one element of [X](javascript:alert(%22X%22)), if the math parses and evaluates properly to an element of [X](javascript:alert(%22X%22))
* an empty set otherwise

for example,

[EvalMathℕ("1+2")={3}EvalMathℕ("hello")=∅](javascript:alert(%22%5Cn%5Ct%5C%5Cbegin%7Bsplit%7D%5Cn%5Ct%5Ct%26%5C%5Ctextit%7BEvalMath%7D_%5Cu2115%28%5C%5Ctext%7B%5C%221%2B2%5C%22%7D%29%3D%5C%5C%7B3%5C%5C%7D%5Cn%5C%5C%5C%5C%5Ct%26%5C%5Ctextit%7BEvalMath%7D_%5Cu2115%28%5C%5Ctext%7B%5C%22hello%5C%22%7D%29%3D%5Cu2205%5Cn%5Ct%5C%5Cend%7Bsplit%7D%5Cn%22))

#### 1.9. kolmogorov simplicity

for any countable sets [X](javascript:alert(%22X%22)) and [P](javascript:alert(%22P%22)):

[KX−∈ΔX](javascript:alert(%22K%5E-_X%5C%5C%3B%5Cu2208%5C%5C%3B%5C%5Cmathrm%7B%5Cu0394%7D_X%22)) is some "[kolmogorov](https://en.wikipedia.org/wiki/Kolmogorov_complexity) simplicity" distribution over set [X](javascript:alert(%22X%22)) which has the properties of never assigning 0, and summing/converging to 1 over all of [X](javascript:alert(%22X%22)). it must satisfy [∀x∈X:KX−(x)>0](javascript:alert(%22%5Cu2200x%5Cu2208X%3A%5C%5C%3BK%5E-_X%28x%29%3E0%22)) and [∑x∈XxKX−(x)=1](javascript:alert(%22%5C%5Cbegin%7Bsplit%7D%5C%5Coverset%7Bx%7D%7B%5C%5Cunderset%7Bx%5Cu2208X%7D%7B%5C%5Csum%7D%7D%5C%5Cend%7Bsplit%7DK%5E-_X%28x%29%3D1%22)).

[K−](javascript:alert(%22K%5E-%22)) is expected to give more mass to simpler elements, in an information-theoretic sense.

notably, it is expected to "deduplicate" information that appears in multiple parts of a same mathematical object, such that even if [x∈𝔹\*](javascript:alert(%22x%5C%5C%3B%5Cu2208%5C%5C%3B%5Cud835%5Cudd39%5E%2A%22)) holds lots of information, [K𝔹\*−(x)](javascript:alert(%22K%5E-_%7B%5Cud835%5Cudd39%5E%2A%7D%28x%29%22)) is not much higher (higher simplicity, i.e. lower complexity) to [K𝔹\*×𝔹\*−(x,x)](javascript:alert(%22K%5E-_%7B%5Cud835%5Cudd39%5E%2A%5Cu00d7%5Cud835%5Cudd39%5E%2A%7D%28x%2Cx%29%22)).

we could define [KX−](javascript:alert(%22K%5E-_X%22)) [similarly to cross-entropy](https://www.lesswrong.com/posts/KcvJXhKqx4itFNWty/k-complexity-is-silly-use-cross-entropy-instead), with some universal turing machine [UTM∈𝔹\*×ℕ→𝔹\*](javascript:alert(%22%5C%5Ctextit%7BUTM%7D%5C%5C%3B%5Cu2208%5C%5C%3B%5Cud835%5Cudd39%5E%2A%5Cu00d7%5Cu2115%5Cu2192%5Cud835%5Cudd39%5E%2A%22)) returning the state of its tape after a certain number of compute steps:

[i,nKX−≔NormalizeX(λx:X.∑1(2|i|⋅(n+1))2)i∈𝔹\*n∈ℕUTM(i,n)=EncodeX(x)](javascript:alert(%22%5Cn%5Ct%5C%5Cbegin%7Bsplit%7D%5Cn%5Ct%5Ct%26%20i%2Cn%5Cn%5C%5C%5C%5C%5CtK%5E-_X%5C%5C%3B%5Cu2254%5C%5C%3B%5C%5Ctextit%7BNormalize%7D_X%28%5Cn%5Ct%5Ct%5Ct%5Cu03bbx%3AX.%26%5C%5Csum%5C%5C%3B%5C%5Cfrac%7B1%7D%7B%20%282%5E%7B%7Ci%7C%7D%5C%5C%3B%5Cu22c5%5C%5C%3B%28n%2B1%29%29%5E2%7D%20%5C%5C%3B%5Cn%5Ct%5Ct%29%5Cn%5C%5C%5C%5C%5Ct%26%20i%5C%5C%3B%5Cu2208%5C%5C%3B%5Cud835%5Cudd39%5E%2A%5Cn%5C%5C%5C%5C%5Ct%26%20n%5C%5C%3B%5Cu2208%5C%5C%3B%5Cu2115%5Cn%5C%5C%5C%5C%5Ct%26%20%5C%5Ctextit%7BUTM%7D%28i%2Cn%29%3D%5C%5Ctextit%7BEncode%7D_X%28x%29%5Cn%5Ct%5C%5Cend%7Bsplit%7D%5Cn%22))

*kolmogorov simplicity over [X](javascript:alert(%22X%22)) with a prior from [P](javascript:alert(%22P%22))*, of type [KP,X−~:P→ΔX](javascript:alert(%22K%5E%7B-%5C%5Csim%7D_%7BP%2CX%7D%5C%5C%3B%3A%5C%5C%3BP%5Cu2192%5C%5Cmathrm%7B%5Cu0394%7D_X%22)), allows elements it samples over to share information with a prior piece of information in [P](javascript:alert(%22P%22)). it is defined as [KP,X−~(p)≔NormalizeX(λx:X.KP×X−(p,x))](javascript:alert(%22K%5E%7B-%5C%5Csim%7D_%7BP%2CX%7D%28p%29%5C%5C%3B%5Cu2254%5C%5C%3B%5C%5Ctextit%7BNormalize%7D_X%28%5Cu03bbx%3AX.K%5E-_%7BP%5Cu00d7X%7D%28p%2Cx%29%29%22)).

### 2. physics

in this section we posit some formalisms for modeling world-states, and sketch out an implementation for them.

#### 2.1. general physics

we will posit some countable set [Ω](javascript:alert(%22%5Cu03a9%22)) of world-states, and a distribution [Ωα∈ΔΩ](javascript:alert(%22%5Cu03a9_%5Cu03b1%5C%5C%3B%5Cu2208%5C%5C%3B%5C%5Cmathrm%7B%5Cu0394%7D_%5Cu03a9%22)) of possible initial world-states.

we'll also posit a function [Ωα→∈Ω→ΔΩ](javascript:alert(%22%5Cu03a9%5E%5Cu2192_%5Cu03b1%5C%5C%3B%5Cu2208%5C%5C%3B%5Cu03a9%5Cu2192%5C%5Cmathrm%7B%5Cu0394%7D_%5Cu03a9%22)) which produces a distribution of future world-states for any specific world-state in the universe starting at [α](javascript:alert(%22%5Cu03b1%22)).

given an initial world-state [α∈Ω](javascript:alert(%22%5Cu03b1%5C%5C%3B%5Cu2208%5C%5C%3B%5Cu03a9%22)), we'll call [Ωα→(α)](javascript:alert(%22%5Cu03a9%5E%5Cu2192_%5Cu03b1%28%5Cu03b1%29%22)) the "universe" that it gives rise to. it must be the case that [∑ω∈ΩωΩα→(α)(ω)=1](javascript:alert(%22%5C%5Cbegin%7Bsplit%7D%5C%5Coverset%7B%5Cu03c9%7D%7B%5C%5Cunderset%7B%5Cu03c9%5C%5C%3B%5Cu2208%5C%5C%3B%5Cu03a9%7D%7B%5C%5Csum%7D%7D%5C%5Cend%7Bsplit%7D%5Cu03a9%5E%5Cu2192_%5Cu03b1%28%5Cu03b1%29%28%5Cu03c9%29%3D1%22)).

when [α](javascript:alert(%22%5Cu03b1%22)) describes the start of a quantum universe, individual world-states [Ω](javascript:alert(%22%5Cu03a9%22)) following it by [Ωα→](javascript:alert(%22%5Cu03a9%5E%5Cu2192_%5Cu03b1%22)) would be expected to correspond to [many-worlds everett branches](https://www.lesswrong.com/tag/many-worlds-interpretation).

for concreteness's sake, we could posit [Ω⊂𝔹\*](javascript:alert(%22%5Cu03a9%5C%5C%3B%5Cu2282%5C%5C%3B%5Cud835%5Cudd39%5E%2A%22)), though note that [α](javascript:alert(%22%5Cu03b1%22)) is expected to not just hold information about the initial state of the universe, but also about how it is computed forwards.

given a particular [α∈Ω](javascript:alert(%22%5Cu03b1%5C%5C%3B%5Cu2208%5C%5C%3B%5Cu03a9%22)):

finally, we define [SimilarPastsα∈Ω×Ω→[0;1]](javascript:alert(%22%5C%5Ctextit%7BSimilarPasts%7D_%5Cu03b1%5C%5C%3B%5Cu2208%5C%5C%3B%5Cu03a9%5Cu00d7%5Cu03a9%5Cu2192%5B0%3B1%5D%22)) which checks how much they have past world-states [ωpast](javascript:alert(%22%5Cu03c9_%7B%5C%5Ctextit%7Bpast%7D%7D%22)) in common:

[ω1SimilarPastsα(ω2,ω2′)≔𝐌[Ωα→(ω1)(ω2)⋅Ωα→(ω1)(ω2′)]ω1:Ωα→(α)](javascript:alert(%22%5Cn%5Ct%5C%5Cbegin%7Bsplit%7D%5Cn%5Ct%5Ct%26%20%5Cu03c9_1%5Cn%5C%5C%5C%5C%5Ct%5C%5Ctextit%7BSimilarPasts%7D_%5Cu03b1%28%5Cu03c9_2%2C%5Cu03c9_2%5E%5C%5Cprime%29%5C%5C%3B%5Cu2254%5C%5C%3B%26%5C%5Cmathbf%7BM%7D%5C%5C%3B%5C%5Cleft%5B%5Cn%5Ct%5Ct%5Ct%5Cu03a9%5E%5Cu2192_%5Cu03b1%28%5Cu03c9_1%29%28%5Cu03c9_2%29%5C%5C%3B%5Cu22c5%5C%5C%3B%5Cu03a9%5E%5Cu2192_%5Cu03b1%28%5Cu03c9_1%29%28%5Cu03c9_2%5E%5C%5Cprime%29%5Cn%5Ct%5Ct%5C%5Cright%5D%5Cn%5C%5C%5C%5C%5Ct%26%20%5Cu03c9_1%5C%5C%3B%3A%5C%5C%3B%5Cu03a9%5E%5Cu2192_%5Cu03b1%28%5Cu03b1%29%5Cn%5Ct%5C%5Cend%7Bsplit%7D%5Cn%22))

#### 2.2. quantum turing machines

we will sketch out here a proposal for [Ω](javascript:alert(%22%5Cu03a9%22)), [Ωα](javascript:alert(%22%5Cu03a9_%5Cu03b1%22)), and [Ω→](javascript:alert(%22%5Cu03a9%5E%5Cu2192%22)) such that our world-state [w](javascript:alert(%22w%22)) has hopefully non-exponentially-small [Ωα→(α)(ω)](javascript:alert(%22%5Cu03a9%5E%5Cu2192_%5Cu03b1%28%5Cu03b1%29%28%5Cu03c9%29%22)).

the basis for this will be a universal [quantum turing machine](https://en.wikipedia.org/wiki/Quantum_Turing_machine). we will posit:

* [Tape≔{s|s∈𝒫(ℤ),#s∈ℕ}](javascript:alert(%22%5C%5Ctextit%7BTape%7D%5C%5C%3B%5Cu2254%5C%5C%3B%5C%5C%7Bs%7Cs%5C%5C%3B%5Cu2208%5C%5C%3B%5C%5Cmathcal%7BP%7D%28%5Cu2124%29%2C%5C%5C%23s%5C%5C%3B%5Cu2208%5C%5C%3B%5Cu2115%5C%5C%7D%22)) the set of turing machine tapes, as *finite* (thanks to [#s∈ℕ](javascript:alert(%22%5C%5C%23s%5C%5C%3B%5Cu2208%5C%5C%3B%5Cu2115%22))) sets of relative integers representing positions in the tape holding a 1 rather than a 0.
* [State](javascript:alert(%22State%22)) some finite ([#S∈ℕ](javascript:alert(%22%5C%5C%23S%5Cu2208%5Cu2115%22))) set of states, and some [state0∈State](javascript:alert(%22%5C%5Ctextit%7Bstate%7D_0%5C%5C%3B%5Cu2208%5C%5C%3B%5C%5Ctextit%7BState%7D%22)).
* [Ω≔Tape×State×ℤ](javascript:alert(%22%5Cu03a9%5C%5C%3B%5Cu2254%5C%5C%3B%5C%5Ctextit%7BTape%7D%5Cu00d7%5C%5Ctextit%7BState%7D%5Cu00d7%5Cu2124%22)): world-states consist of a tape, state, and machine head index.
* [ΔΩq≔{f|f∈Ω→ℂ,∑ω∈Ωω‖f(ω)‖2=1}](javascript:alert(%22%5C%5Cmathrm%7B%5Cu0394%7D%5Eq_%5Cu03a9%5C%5C%3B%5Cu2254%5C%5C%3B%5C%5C%7Bf%7Cf%5C%5C%3B%5Cu2208%5C%5C%3B%5Cu03a9%5Cu2192%5Cu2102%2C%5C%5Cbegin%7Bsplit%7D%5C%5Coverset%7B%5Cu03c9%7D%7B%5C%5Cunderset%7B%5Cu03c9%5Cu2208%5Cu03a9%7D%7B%5C%5Csum%7D%7D%5C%5Cend%7Bsplit%7D%7B%5C%5C%7Cf%28%5Cu03c9%29%5C%5C%7C%7D%5E2%3D1%5C%5C%7D%22)) the set of "quantum distributions" over world-states
* [Step∈ΔΩq→ΔΩq](javascript:alert(%22%5C%5Ctextit%7BStep%7D%5C%5C%3B%5Cu2208%5C%5C%3B%5C%5Cmathrm%7B%5Cu0394%7D%5Eq_%5Cu03a9%5Cu2192%5C%5Cmathrm%7B%5Cu0394%7D%5Eq_%5Cu03a9%22)) the "time step" operator running some universal turing machine's transition matrix to turn one quantum distribution of world-states into another

we'll also define [Δℕ2∈Δℕ](javascript:alert(%22%5C%5Cmathrm%7B%5Cu0394%7D%5E2_%5Cu2115%5C%5C%3B%5Cu2208%5C%5C%3B%5C%5Cmathrm%7B%5Cu0394%7D_%5Cu2115%22)) as the "quadratic realityfluid distribution" which assigns diminishing quantities to natural numbers, but only quadratically diminishing: [Δℕ2(n)≔Normalizeℕ(1(n+1)2)](javascript:alert(%22%5C%5Cmathrm%7B%5Cu0394%7D%5E2_%5Cu2115%28n%29%5C%5C%3B%5Cu2254%5C%5C%3B%5C%5Ctextit%7BNormalize%7D_%5Cu2115%5C%5Cleft%28%7B%5C%5Clarge%7B%5C%5Cfrac%7B1%7D%7B%28n%2B1%29%5E2%7D%7D%7D%5C%5Cright%29%22))

we can then define [Ω→](javascript:alert(%22%5Cu03a9%5E%5Cu2192%22)) as repeated applications of [Step](javascript:alert(%22%5C%5Ctextit%7BStep%7D%22)), with quadratically diminishing realityfluid:

[n1,n2,sΩα→(ω1)(ω2)≔c⋅𝐌[s(n1,ω1)⋅s(n1+n2,ω2)]n1:Δℕ2n2:Δℕ2s(n,ω)=‖Step∘n(ΔΩ1(α))(ω)‖2](javascript:alert(%22%5Cn%5Ct%5C%5Cbegin%7Bsplit%7D%5Cn%5Ct%5Ct%26%20n_1%2Cn_2%2Cs%5Cn%5C%5C%5C%5C%5Ct%5Cu03a9%5E%5Cu2192_%5Cu03b1%28%5Cu03c9_1%29%28%5Cu03c9_2%29%5C%5C%3B%5Cu2254%5C%5C%3Bc%5C%5C%3B%5Cu22c5%5C%5C%3B%26%5C%5Cmathbf%7BM%7D%5C%5Cleft%5Bs%28n_1%2C%5Cu03c9_1%29%5C%5C%3B%5Cu22c5%5C%5C%3Bs%28n_1%2Bn_2%2C%5Cu03c9_2%29%5C%5Cright%5D%5Cn%5C%5C%5C%5C%5Ct%26n_1%5C%5C%3B%3A%5C%5C%3B%5C%5Cmathrm%7B%5Cu0394%7D%5E2_%5Cu2115%5Cn%5C%5C%5C%5C%5Ct%26n_2%5C%5C%3B%3A%5C%5C%3B%5C%5Cmathrm%7B%5Cu0394%7D%5E2_%5Cu2115%5Cn%5C%5C%5C%5C%5Ct%26s%28n%2C%5Cu03c9%29%3D%7B%5C%5C%7C%5C%5Ctextit%7BStep%7D%5Cu2218%5En%28%5C%5Cmathrm%7B%5Cu0394%7D%5E1_%5Cu03a9%28%5Cu03b1%29%29%28%5Cu03c9%29%5C%5C%7C%7D%5E2%5Cn%5Ct%5C%5Cend%7Bsplit%7D%5Cn%22))

where the constant [c](javascript:alert(%22c%22)) is whatever scalar it needs to be for [∑ω∈ΩωΩα→(α)(ω)=1](javascript:alert(%22%5C%5Cbegin%7Bsplit%7D%5C%5Coverset%7B%5Cu03c9%7D%7B%5C%5Cunderset%7B%5Cu03c9%5C%5C%3B%5Cu2208%5C%5C%3B%5Cu03a9%7D%7B%5C%5Csum%7D%7D%5C%5Cend%7Bsplit%7D%5Cu03a9%5E%5Cu2192_%5Cu03b1%28%5Cu03b1%29%28%5Cu03c9%29%3D1%22)) to be satisfied.

this implementation of [Ωα→](javascript:alert(%22%5Cu03a9%5E%5Cu2192_%5Cu03b1%22)) measures how much [ω2](javascript:alert(%22%5Cu03c9_2%22)) is in the future of [ω1](javascript:alert(%22%5Cu03c9_1%22)) by finding paths from [α](javascript:alert(%22%5Cu03b1%22)) to [ω1](javascript:alert(%22%5Cu03c9_1%22)), and then longer paths from [α](javascript:alert(%22%5Cu03b1%22)) to [ω2](javascript:alert(%22%5Cu03c9_2%22)).

and finally, we define [Ωα](javascript:alert(%22%5Cu03a9_%5Cu03b1%22)) as a distribution giving non-zero value to world-states [(t,state0,0)](javascript:alert(%22%28t%2Cstate_0%2C0%29%22)) where [t](javascript:alert(%22t%22)) is a tape where no negative-index cells are set to 1.

[Ωα(t,s,i)≔{Δℕ2(∑n∈tn2n)ifs=state0,i=0,t⊂ℕ0otherwise](javascript:alert(%22%5Cn%5Ct%5Cu03a9_%5Cu03b1%28t%2Cs%2Ci%29%5C%5C%3B%5Cu2254%5C%5C%3B%5C%5Cbegin%7Bcases%7D%5Cn%5Ct%5Ct%26%20%5C%5Cmathrm%7B%5Cu0394%7D%5E2_%5Cu2115%5C%5Cleft%28%5C%5Cbegin%7Bsplit%7D%5C%5Coverset%7Bn%7D%7B%5C%5Cunderset%7Bn%5Cu2208t%7D%7B%5C%5Csum%7D%7D%5C%5Cend%7Bsplit%7D%202%5En%5C%5Cright%29%20%26%20%5C%5Ctext%7Bif%7D%5C%5C%3Bs%3Dstate_0%2Ci%3D0%2Ct%5C%5C%3B%5Cu2282%5C%5C%3B%5Cu2115%5Cn%5C%5C%5C%5C%5Ct%260%20%26%20%5C%5Ctext%7Botherwise%7D%5Cn%5Ct%5C%5Cend%7Bcases%7D%5Cn%22))

because we selected a universal (quantum) turing machine, there is at least one input tape implementing any single quantum algorithm, including the quantum algorithm implementing our physics.

### 3. implementing QACI

finally, we get into the core mechanisms of QACI.

the core idea of QACI is "blob location": mathematically formalizing the idea of locating our world and locating bitstrings (which i'll call "blobs") stored on computers within that world, out of the space of all possible computational universes, by sampling over functions which extract those blobs from world-states in [Ω](javascript:alert(%22%5Cu03a9%22)) and functions which can produce a counterfactual world where that blob has been replaced with another blob of the same length (in number of bits).

#### 3.1. question blob and observation

throughout these functions, we will posit the following constants:

* the initial factual question blob [q∈𝔹\*](javascript:alert(%22q%5C%5C%3B%5Cu2208%5C%5C%3B%5Cud835%5Cudd39%5E%2A%22))
* two "observation" blobs [μ1∈𝔹\*](javascript:alert(%22%5Cu03bc_1%5C%5C%3B%5Cu2208%5C%5C%3B%5Cud835%5Cudd39%5E%2A%22)) and [μ2∈𝔹\*](javascript:alert(%22%5Cu03bc_2%5C%5C%3B%5Cu2208%5C%5C%3B%5Cud835%5Cudd39%5E%2A%22))

[μ1,μ2](javascript:alert(%22%5Cu03bc_1%2C%5Cu03bc_2%22)) are variables which will be passed around, called "observations". in normal AI agent framings, an AI would have a history of actions and observations, and decide on its next action based on that; but, in the [one-shot](delegated-embedded-agency-decision-theory.html) framing we use, there is only a single action and a fixed set of observations. the observations, in practice, will be a very large pieces of data helping the AI locate itself in the multiverse of all possible computations, as well as get a better idea of how and where it is being ran. we will likely include in it things like:

* a full explanation of the QACI alignment plan, including the math
* the AI's code
* a dump of wikipedia and other large parts of the internet
* a copy of some LLM

[μ1](javascript:alert(%22%5Cu03bc_1%22)) will be produced before the question blob is generated, and [μ2](javascript:alert(%22%5Cu03bc_2%22)) will be produced after the question blob is generated but before the AI is launched.

#### 3.2. overview

the overall shape of what we're doing can be seen on the illustration below: we start at the start of the universe [α](javascript:alert(%22%5C%5Ccolor%7B%2376c281%7D%5Cu03b1%22)), and use four blob locations and a counterfactual blob function call to locate five other world-states. the illustration shows distributions of future and past world-states, as well as a particular sampling of for all four blob locations.

* we sample [ωμ1](javascript:alert(%22%5C%5Ccolor%7B%23ff6a85%7D%7B%5Cu03c9_%7B%5Cu03bc_1%7D%7D%22)) using [Loc(α,Ωα→(α),μ1,ξ)](javascript:alert(%22%5C%5Ccolor%7B%23999%7D%7B%5C%5Ctextit%7BLoc%7D%28%5Cu03b1%2C%5Cu03a9%5E%5Cu2192_%5Cu03b1%28%7B%5C%5Ccolor%7B%2376c281%7D%5Cu03b1%7D%29%2C%7B%5C%5Ccolor%7B%23ff6a85%7D%7B%5Cu03bc_1%7D%7D%2C%5Cu03be%29%7D%22)), world-states containing the first observation [μ1](javascript:alert(%22%5C%5Ccolor%7B%23ff6a85%7D%7B%5Cu03bc_1%7D%22))
* we sample [ωμ2](javascript:alert(%22%5C%5Ccolor%7B%23f3936f%7D%7B%5Cu03c9_%7B%5Cu03bc_2%7D%7D%22)) using [Loc(α,Ωα→(ωμ1),μ2,ξ)](javascript:alert(%22%5C%5Ccolor%7B%23999%7D%7B%5C%5Ctextit%7BLoc%7D%28%5Cu03b1%2C%5Cu03a9%5E%5Cu2192_%5Cu03b1%28%7B%5C%5Ccolor%7B%23ff6a85%7D%7B%5Cu03c9_%7B%5Cu03bc_1%7D%7D%7D%29%2C%7B%5C%5Ccolor%7B%23f3936f%7D%7B%5Cu03bc_2%7D%7D%2C%5Cu03be%29%7D%22)), world-states containing the second observation [μ2](javascript:alert(%22%5C%5Ccolor%7B%23f3936f%7D%7B%5Cu03bc_2%7D%22))
* we sample [ωq](javascript:alert(%22%5C%5Ccolor%7B%23f263ed%7D%7B%5Cu03c9_q%7D%22)) using [Loc(α,Ωα→(ωμ1),q,ξ)](javascript:alert(%22%5C%5Ccolor%7B%23999%7D%7B%5C%5Ctextit%7BLoc%7D%28%5Cu03b1%2C%5Cu03a9%5E%5Cu2192_%5Cu03b1%28%7B%5C%5Ccolor%7B%23ff6a85%7D%7B%5Cu03c9_%7B%5Cu03bc_1%7D%7D%7D%29%2C%7B%5C%5Ccolor%7B%23f263ed%7Dq%7D%2C%5Cu03be%29%7D%22)), world-states containing the question blob [q](javascript:alert(%22%5C%5Ccolor%7B%23f263ed%7D%7Bq%7D%22)), but requiring that its world-state [ωq](javascript:alert(%22%5C%5Ccolor%7B%23f263ed%7D%7B%5Cu03c9_q%7D%22)) precede the world-state [ωμ2](javascript:alert(%22%5C%5Ccolor%7B%23f3936f%7D%7B%5Cu03c9_%7B%5Cu03bc_2%7D%7D%22))
* we get [ωq′](javascript:alert(%22%5C%5Ccolor%7B%23ccc22b%7D%7B%5Cu03c9_q%5E%5C%5Cprime%7D%22)), the world-state with a counterfactual question blob, using blob location [γq](javascript:alert(%22%5C%5Ccolor%7B%23f263ed%7D%7B%5Cu03b3_q%7D%22)) found by sampling [ωq](javascript:alert(%22%5C%5Ccolor%7B%23f263ed%7D%7B%5Cu03c9_q%7D%22))
* we sample [ωr](javascript:alert(%22%5C%5Ccolor%7B%2321d5ff%7D%7B%5Cu03c9_r%7D%22)) using [Loc(α,Ωα→(ωq′),r,ξ)](javascript:alert(%22%5C%5Ccolor%7B%23999%7D%7B%5C%5Ctextit%7BLoc%7D%28%5Cu03b1%2C%5Cu03a9%5E%5Cu2192_%5Cu03b1%28%7B%5C%5Ccolor%7B%23ccc22b%7D%7B%5Cu03c9_q%5E%5C%5Cprime%7D%7D%29%2C%7B%5C%5Ccolor%7B%2321d5ff%7Dr%7D%2C%5Cu03be%29%7D%22)), possible world-states containing an answer to a given counterfactual question [q′](javascript:alert(%22%5C%5Ccolor%7B%23ccc22b%7D%7Bq%5E%5C%5Cprime%7D%22))

![](qaci-math-2.svg)

the location path from [ωq′](javascript:alert(%22%5C%5Ccolor%7B%23ccc22b%7D%7B%5Cu03c9_q%5C%5Cprime%7D%22)) to [ωr](javascript:alert(%22%5C%5Ccolor%7B%2321d5ff%7D%7B%5Cu03c9_r%7D%22)) is used to run QACI intervals, where counterfactual questions [q′](javascript:alert(%22%5C%5Ccolor%7B%23ccc22b%7D%7Bq%5E%5C%5Cprime%7D%22)) are inserted and answers [r](javascript:alert(%22%5C%5Ccolor%7B%2321d5ff%7D%7Br%7D%22)) are located in their future.

(we could also build fancier schemes where we locate the AI's returned action, or its code running over time, in order to "tie more tightly" the blob locations to the AI — but it is not clear that this helps much with [blob location failure modes i'm concerned about](blob-quantum-issue.html).)

for the moment, we merely rely on [μ1](javascript:alert(%22%5C%5Ccolor%7B%23ff6a85%7D%7B%5Cu03bc_1%7D%22)) and [μ2](javascript:alert(%22%5C%5Ccolor%7B%23f3936f%7D%7B%5Cu03bc_2%7D%22)) being uniquely identifying enough — though implementing them as *static bitstrings* might suffice, perhaps they could instead be implemented as *[lazily evaluated](https://en.wikipedia.org/wiki/Lazy_evaluation) associative maps*. when the AI tries to access members of those maps, code which computes or fetches information from the world (such as from the internet) would be executed determines the contents of that part of the observation object. this way, the observation would be conceptualized as a static object to the AI — and indeed it wouldn't be able to observe any mutations — but it'd be able to observe arbitrary amounts of the world, not just amounts we'd have previously downloaded.

we could make the QACI return not a scoring over actions but a proper utility function, but this only constrains the AI's action space and doesn't look like it helps in any way, including making QACI easier for the AI to make good guesses about. perhaps with utility functions we find a way to make the AI go "ah, well i'm not able to steer much future in world-states where i'm in hijacked sims", but it's not clear how or even that this helps much. so for now, the math focuses on this simple case of returning an action-scoring function.

#### 3.3. blob location

(remember that while this section does explain the blob location math, it does so by presenting it all at once. for a gentler introduction, see part **7. blob location** (and onwards) of the [dialogue explaining QACI](qaci-invention-dialogue.html))

for any blob length (in bits) [n∈ℕ](javascript:alert(%22n%5C%5C%3B%5Cu2208%5C%5C%3B%5Cu2115%22)):

first, we'll posit [Γn≔𝔹n→Ω](javascript:alert(%22%5Cu0393_n%5C%5C%3B%5Cu2254%5C%5C%3B%5Cud835%5Cudd39%5En%5Cu2192%5Cu03a9%22)) the set of blob locations; they're identified by a counterfactual blob location function, which takes any counterfactual blob and return the world-state in which a factual blob has been replaced with that counterfactual blob.

[Locn∈Ω×ΔΩ×𝔹n×Ξ→ΔΓn](javascript:alert(%22%5C%5Ctextit%7BLoc%7D_n%5C%5C%3B%5Cu2208%5C%5C%3B%5Cu03a9%5Cu00d7%5C%5Cmathrm%7B%5Cu0394%7D_%5Cu03a9%5Cu00d7%5Cud835%5Cudd39%5En%5Cu00d7%5Cu039e%5Cu2192%5C%5Cmathrm%7B%5Cu0394%7D_%7B%5Cu0393_n%7D%22)) tries to locate an individual blob [b](javascript:alert(%22b%22)) (as a bitstring of length [n](javascript:alert(%22n%22))) in a particular world-state sampled from the time-distribution (past or future) [δ](javascript:alert(%22%5Cu03b4%22)) (which will usually be a distribution returned by [Ωα→](javascript:alert(%22%5Cu03a9%5E%5Cu2192_%5Cu03b1%22))) within the universe starting at [α](javascript:alert(%22%5Cu03b1%22)).

it returns a distribution over counterfactual insertion functions of type [𝔹n→Ω](javascript:alert(%22%5Cud835%5Cudd39%5En%5Cu2192%5Cu03a9%22)) which take a counterfactual blob and return the matching counterfactual world-state. the elements in that distribution typically sum up to much less than 1; the total amount they sum up to corresponds to how much [Loc](javascript:alert(%22%5C%5Ctextit%7BLoc%7D%22)) finds the given blob in the given world-state to begin with; thus, sampling from a distribution returned by [Loc](javascript:alert(%22%5C%5Ctextit%7BLoc%7D%22)) in a constrained mass calculation [𝐌](javascript:alert(%22%5C%5Cmathbf%7BM%7D%22)) is useful even if said result is not used, because of its multiplying factor.

note that the returned counterfactual insertion function can be used to locate the factual world-state — simply give it the factual blob as input.

[Ξ](javascript:alert(%22%5Cu039e%22)) is some countably infinite set of arbitrary pieces of information which each call to [Loc](javascript:alert(%22%5C%5Ctextit%7BLoc%7D%22)) can use internally — the goal of this is for multiple different calls to [Loc](javascript:alert(%22%5C%5Ctextit%7BLoc%7D%22)) to be able to share some prior information, while only being penalized by [K−](javascript:alert(%22K%5E-%22)) for it once. for example, an element of [Ξ](javascript:alert(%22%5Cu039e%22)) might describe how to extract the contents of a specific laptop's memory from physics, and individual [Loc](javascript:alert(%22%5C%5Ctextit%7BLoc%7D%22)) calls only need to specify the date and the memory range. for concreteness, we can posit [Ξ≔𝔹\*](javascript:alert(%22%5Cu039e%5C%5C%3B%5Cu2254%5C%5C%3B%5Cud835%5Cudd39%5E%2A%22)), the set of finite bitstrings.

[f,g,ω,b′,τLocn(α,δ,b,ξ)(γ)≔𝐌[SimilarPastsα(ω,g(b′,τ))R(g,(b′,τ))+R(f,g(b′,τ))](f,g):KΞ,(Ω→H𝔹n×𝔹\*)×(𝔹n×𝔹\*→HΩ)−~(ξ)ω:λω:maxXΔ(λω:Ω.{δ(ω)iff(ω)=(b,τ)0otherwise).δ(ω)b′:Uniform𝔹n∀b′′∈𝔹n:γ(b′′)=g(b′′,τ)f(γ(b′′))=(b′′,τ)](javascript:alert(%22%5Cn%5Ct%5C%5Cbegin%7Bsplit%7D%5Cn%5Ct%5Ct%26%20f%2Cg%2C%5Cu03c9%2Cb%5E%5C%5Cprime%2C%5Cu03c4%5Cn%5C%5C%5C%5C%5Ct%5C%5Ctextit%7BLoc%7D_n%28%5Cu03b1%2C%5Cu03b4%2Cb%2C%5Cu03be%29%28%5Cu03b3%29%5C%5C%3B%5Cu2254%5C%5C%3B%26%5C%5Cmathbf%7BM%7D%5Cn%5Ct%5Ct%5C%5Cleft%5B%5Cn%5Ct%5Ct%5Ct%5C%5Cfrac%7B%5Cn%5Ct%5Ct%5Ct%5Ct%5C%5Ctextit%7BSimilarPasts%7D_%5Cu03b1%28%5Cu03c9%2Cg%28b%5E%5C%5Cprime%2C%5Cu03c4%29%29%5Cn%5Ct%5Ct%5Ct%7D%7B%5Cn%5Ct%5Ct%5Ct%5CtR%28g%2C%28b%5E%5C%5Cprime%2C%5Cu03c4%29%29%2BR%28f%2Cg%28b%5E%5C%5Cprime%2C%5Cu03c4%29%29%5Cn%5Ct%5Ct%5Ct%7D%5Cn%5Ct%5Ct%5C%5Cright%5D%5Cn%5C%5C%5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5Cprime%5C%5Cprime%7D%29%29%3D%28b%5E%7B%5C%5Cprime%5C%5Cprime%7D%2C%5Cu03c4%29%5Cn%5Ct%5Ct%5C%5Cend%7Bsplit%7D%5Cn%5Ct%5C%5Cend%7Bsplit%7D%5Cn%22))

[Loc](javascript:alert(%22%5C%5Ctextit%7BLoc%7D%22)) works by sampling a pair of functions [f,g](javascript:alert(%22f%2Cg%22)), which convert world-states forth and back into {pairs whose first element is the blob and whose second element represents everything in the world-state except the blob}.

that latter piece of information is called [τ](javascript:alert(%22%5Cu03c4%22)) (tau), and rather than being sampled [τ](javascript:alert(%22%5Cu03c4%22)) is defined by the return value of [f](javascript:alert(%22f%22)) on the original world-state — notably, [τ](javascript:alert(%22%5Cu03c4%22)) is not penalized for being arbitrarily large, though [f](javascript:alert(%22f%22)) and [g](javascript:alert(%22g%22)) are penalized for their compute time.

for a given fixed pair of [f](javascript:alert(%22f%22)) and [g](javascript:alert(%22g%22)), [Loc](javascript:alert(%22%5C%5Ctextit%7BLoc%7D%22)) finds the set of hypothesis world-states [ω](javascript:alert(%22%5Cu03c9%22)) with the highest value within the time-distribution [δ](javascript:alert(%22%5Cu03b4%22)) for which [f,g](javascript:alert(%22f%2Cg%22)) work as intended. this is intended to select the "closest in time" world-states in [δ](javascript:alert(%22%5Cu03b4%22)), to avoid adversarial attackers generating their own factual blobs and capturing our location.

it then weighs locations using, for every counterfactual blob [b′∈𝔹n](javascript:alert(%22b%5E%5C%5Cprime%5C%5C%3B%5Cu2208%5C%5C%3B%5Cud835%5Cudd39%5En%22)):

* the degree to which counterfactual world-states tend to share pasts with the original factual world-state, for [b′](javascript:alert(%22b%5E%5C%5Cprime%22)).
* the compute time of [g](javascript:alert(%22g%22)) and [f](javascript:alert(%22f%22)) on counterfactual blobs and world-states respectively.

note that [Locn](javascript:alert(%22%5C%5Ctextit%7BLoc%7D_n%22)), by design, only supports counterfactual blobs whose length [n](javascript:alert(%22n%22)) is equal to the length of the initial factual blob [b](javascript:alert(%22b%22)) — it wouldn't really make sense to talk about "replacing bits" if the bits are different.

in effect, [Loc](javascript:alert(%22%5C%5Ctextit%7BLoc%7D%22)) takes random [f,g](javascript:alert(%22f%2Cg%22)) decoding and re-encoding programs, measures how complex and expensive they are and how far from our desired distributions are world-states in which they work, and how close to the factual world-state their counterfactual world-states are.

#### 3.4. blob signing

we'll define [Π≔𝔹|q|−σ¯](javascript:alert(%22%5Cu03a0%5C%5C%3B%5Cu2254%5C%5C%3B%5Cud835%5Cudd39%5E%7B%7B%7Cq%7C%7D-%5C%5Cbar%7B%5Cu03c3%7D%7D%22)), the set of possible answer bitstring payloads.

counterfactual questions will not be signed, and thus will be the set of bitstrings of the same length as the factual question — [𝔹|q|](javascript:alert(%22%5Cud835%5Cudd39%5E%7B%7Cq%7C%7D%22)).

we'll define [Sign∈Π×𝔹\*→𝔹|q|](javascript:alert(%22%5C%5Ctextit%7BSign%7D%5C%5C%3B%5Cu2208%5C%5C%3B%5Cu03a0%5Cu00d7%5Cud835%5Cudd39%5E%2A%5Cu2192%5Cud835%5Cudd39%5E%7B%7Cq%7C%7D%22)) as [Sign(π,k)≔ExpensiveHash(π‖k)‖π](javascript:alert(%22%5C%5Ctextit%7BSign%7D%28%5Cu03c0%2Ck%29%5C%5C%3B%5Cu2254%5C%5C%3B%5C%5Ctextit%7BExpensiveHash%7D%28%5Cu03c0%5C%5C%7Ck%29%5C%5C%7C%5Cu03c0%22)). this functions tags blob payloads using a "signature" generated from a seed bitstring, concatenating it to the blob payload.

#### 3.5. action-scoring functions

we will posit [A⊂𝔹\*](javascript:alert(%22A%5C%5C%3B%5Cu2282%5C%5C%3B%5Cud835%5Cudd39%5E%2A%22)) as the finite set of actions the AI can take, as a finite set of bitstrings.

we'll call [U≔A→[0;1]](javascript:alert(%22U%5C%5C%3B%5Cu2254%5C%5C%3BA%5Cu2192%5B0%3B1%5D%22)) the set of "scoring functions" over actions — functions which "have an opinion" about various actions. this is similar to utility functions, except it's over actions rather than over worlds or world-histories.

they can be composed using [Compose∈ΔU→U](javascript:alert(%22%5C%5Ctextit%7BCompose%7D%5C%5C%3B%5Cu2208%5C%5C%3B%5C%5Cmathrm%7B%5Cu0394%7D_U%5Cu2192U%22)), which could be simple scoring-function averaging:

[uCompose(δ)(a)≔?𝐌[u(a)]u:δ](javascript:alert(%22%5Cn%5Ct%5Ct%5C%5Cbegin%7Bsplit%7D%5Cn%5Ct%5Ct%5Ct%26%20u%5Cn%5C%5C%5C%5C%5Ct%5Ct%5C%5Ctextit%7BCompose%7D%28%5Cu03b4%29%28a%29%5C%5C%3B%5C%5Coverset%7B%3F%7D%5Cu2254%5C%5C%3B%26%5C%5Cmathbf%7BM%7D%5C%5C%3B%5Bu%28a%29%5D%5Cn%5C%5C%5C%5C%5Ct%5Ct%26%20u%5C%5C%3B%3A%5C%5C%3B%5Cu03b4%5Cn%5Ct%5Ct%5C%5Cend%7Bsplit%7D%5Cn%22))

but alternatively, we could use something like [Diffractor's Rose bargaining](https://www.lesswrong.com/posts/vJ7ggyjuP4u2yHNcP/threat-resistant-bargaining-megapost-introducing-the-rose) to reduce the ability for scoring/utility functions to threaten each other — and notably ours.

[Compose≔?Rose](javascript:alert(%22%5Cn%5Ct%5C%5Ctextit%7BCompose%7D%5C%5C%3B%5C%5Coverset%7B%3F%7D%5Cu2254%5C%5C%3B%5C%5Ctextit%7BRose%7D%5Cn%22))

(where i'm using [≔?](javascript:alert(%22%5C%5Coverset%7B%3F%7D%5Cu2254%22)) to mean "maybe define this way, but i'm not sure")

#### 3.6. QACI query

using those, we define [QACI∈Ω×Γ|q|×Ξ×𝔹|q|→ΔΠ](javascript:alert(%22%5C%5Ctextit%7BQACI%7D%5C%5C%3B%5Cu2208%5C%5C%3B%5Cu03a9%5Cu00d7%5Cu0393_%7B%7Cq%7C%7D%5Cu00d7%5Cu039e%5Cu00d7%5Cud835%5Cudd39%5E%7B%7Cq%7C%7D%5Cu2192%5C%5Cmathrm%7B%5Cu0394%7D_%5Cu03a0%22)) which given a physics hypothesis [α](javascript:alert(%22%5Cu03b1%22)), a question blob location [γq](javascript:alert(%22%5Cu03b3_q%22)), and a blob location prior [ξ](javascript:alert(%22%5Cu03be%22)), returns the highest guess returned answer payload [πr](javascript:alert(%22%5Cu03c0_r%22)) for a given counterfactual question [q′](javascript:alert(%22q%5E%5C%5Cprime%22)).

[γrQACI(α,γq,ξ,q′)(πr)≔𝐌[1]γr:Loc|q|(α,Ωα→(γq(q′)),Sign(πr,q′),ξ)](javascript:alert(%22%5Cn%5Ct%5C%5Cbegin%7Bsplit%7D%5Cn%5Ct%5Ct%5Ct%26%20%5Cu03b3_r%5Cn%5C%5C%5C%5C%5Ct%5Ct%5C%5Ctextit%7BQACI%7D%28%5Cu03b1%2C%5Cu03b3_q%2C%5Cu03be%2Cq%5E%5C%5Cprime%29%28%5Cu03c0_r%29%5C%5C%3B%5Cu2254%5C%5C%3B%26%5C%5Cmathbf%7BM%7D%5C%5C%3B%5B1%5D%5Cn%5C%5C%5C%5C%5Ct%5Ct%26%20%5Cu03b3_r%5C%5C%3B%3A%5C%5C%3B%5C%5Ctextit%7BLoc%7D_%7B%7Cq%7C%7D%28%5Cu03b1%2C%5Cu03a9%5E%5Cu2192_%5Cu03b1%28%5Cu03b3_q%28q%5E%5C%5Cprime%29%29%2C%5C%5Ctextit%7BSign%7D%28%5Cu03c0_r%2Cq%5E%5C%5Cprime%29%2C%5Cu03be%29%5Cn%5Ct%5C%5Cend%7Bsplit%7D%5Cn%22))

[QACI](javascript:alert(%22%5C%5Ctextit%7BQACI%7D%22)) works by sampling answer blob locations [γr](javascript:alert(%22%5Cu03b3_r%22)), from world-states in the future of the counterfactual question world-state [γq(q′)](javascript:alert(%22%5Cu03b3_q%28q%5E%5C%5Cprime%29%22)), signed using [q′](javascript:alert(%22q%5E%5C%5Cprime%22)).

with its first three parameters fixed, [QACI](javascript:alert(%22%5C%5Ctextit%7BQACI%7D%22)) becomes the straightforward counterfactual query function [𝔹|q|→ΔΠ](javascript:alert(%22%5Cud835%5Cudd39%5E%7B%7Cq%7C%7D%5Cu2192%5C%5Cmathrm%7B%5Cu0394%7D_%7B%5Cu03a0%7D%22)) as used in [the narrative explanation of QACI](narrative-explanation-qaci.html): one can call it with arbitrary counterfactual text inputs (within the size limitation), and get a distribution over possible answers, which can easily be collapsed using [maxΠΔ](javascript:alert(%22%5C%5Ctextit%7Bmax%7D%5E%5C%5Cmathrm%7B%5Cu0394%7D_%5Cu03a0%22)).

#### 3.7. top-level QACI call

the top-level call to the [QACI](javascript:alert(%22%5C%5Ctextit%7BQACI%7D%22)) query function, [QACI0∈Ω×Γ|q|×Ξ→ΔU](javascript:alert(%22%5C%5Ctextit%7BQACI%7D_0%5C%5C%3B%5Cu2208%5C%5C%3B%5Cu03a9%5Cu00d7%5Cu0393_%7B%7Cq%7C%7D%5Cu00d7%5Cu039e%5Cu2192%5C%5Cmathrm%7B%5Cu0394%7D_U%22)) interprets its output as a piece of math and executes it with, as parameters, various global and contextual values it might need access to, and returns a distribution over action-scoring functions:

[πr,fQACI0(α,γq,ξ)(u)≔𝐌[1]πr:QACI(α,γq,ξ,q0′)f∈EvalMath{q}×{μ1}×{μ2}×Ω×Γ|q|×Ξ→U(πr)f(q,μ1,μ2,α,γq,ξ)=u](javascript:alert(%22%5Cn%5Ct%5C%5Cbegin%7Bsplit%7D%5Cn%5Ct%5Ct%26%20%5Cu03c0_r%2Cf%5Cn%5C%5C%5C%5C%5Ct%5C%5Ctextit%7BQACI%7D_0%28%5Cu03b1%2C%5Cu03b3_q%2C%5Cu03be%29%28u%29%5C%5C%3B%5Cu2254%5C%5C%3B%26%5C%5Cmathbf%7BM%7D%5C%5C%3B%5B1%5D%5Cn%5C%5C%5C%5C%5Ct%26%20%5Cu03c0_r%5C%5C%3B%3A%5C%5C%3B%5C%5Ctextit%7BQACI%7D%28%5Cu03b1%2C%5Cu03b3_q%2C%5Cu03be%2Cq%5E%5C%5Cprime_0%29%5Cn%5C%5C%5C%5C%5Ct%26%20f%5C%5C%3B%5Cu2208%5C%5C%3B%5C%5Ctextit%7BEvalMath%7D_%7B%5C%5C%7Bq%5C%5C%7D%5Cu00d7%5C%5C%7B%5Cu03bc_1%5C%5C%7D%5Cu00d7%5C%5C%7B%5Cu03bc_2%5C%5C%7D%5Cu00d7%5Cu03a9%5Cu00d7%5Cu0393_%7B%7Cq%7C%7D%5Cu00d7%5Cu039e%5Cu2192U%7D%28%5Cu03c0_r%29%5Cn%5C%5C%5C%5C%5Ct%26%20f%28q%2C%5Cu03bc_1%2C%5Cu03bc_2%2C%5Cu03b1%2C%5Cu03b3_q%2C%5Cu03be%29%3Du%5Cn%5Ct%5C%5Cend%7Bsplit%7D%5Cn%22))

where [q0′∈𝔹|q|](javascript:alert(%22q%5E%5C%5Cprime_0%5C%5C%3B%5Cu2208%5C%5C%3B%5Cud835%5Cudd39%5E%7B%7Cq%7C%7D%22)) is the initial counterfactual blob, such as "return a good scoring of actions" encoded in ASCII, padded with zeros to be of the right length.

[QACI0](javascript:alert(%22%5C%5Ctextit%7BQACI%7D_0%22))'s distribution over answers demands that the answer payload [πr](javascript:alert(%22%5Cu03c0_r%22)), when interpreted as math and with all required contextual variables passed as input ([q,μ1,μ2,α,γq,ξ](javascript:alert(%22q%2C%5Cu03bc_1%2C%5Cu03bc_2%2C%5Cu03b1%2C%5Cu03b3_q%2C%5Cu03be%22))), returns an action-scoring function equal to [u](javascript:alert(%22u%22)) — this is how it measures the weight of any action-scoring function [u](javascript:alert(%22u%22)).

[𝐌[1]](javascript:alert(%22%5C%5Cmathbf%7BM%7D%5C%5C%3B%5B1%5D%22)) makes it that [QACI0](javascript:alert(%22%5C%5Ctextit%7BQACI%7D_0%22))'s distributions are only determined by the sampled variables and logical requirements.

[EvalMath](javascript:alert(%22%5C%5Ctextit%7BEvalMath%7D%22))'s [f](javascript:alert(%22f%22)) function having access to [QACI](javascript:alert(%22%5C%5Ctextit%7BQACI%7D%22))'s distribution over output texts rather than best candidate allows it to discard as many invalid candidates as it needs and stick to ones that match whatever constraits it has.

#### 3.8. action scoring

we'll posit the AI as [AI∈U→A](javascript:alert(%22%5C%5Ctextit%7BAI%7D%5C%5C%3B%5Cu2208%5C%5C%3BU%5Cu2192A%22)) — a program which tries to satisfy a scoring over actions, by making a high-expected-score guess.

we define [Score∈U](javascript:alert(%22%5C%5Ctextit%7BScore%7D%5C%5C%3B%5Cu2208%5C%5C%3BU%22)), the action-scoring function which the AI will be making guesses about as a scoring function over actions, which happens to be one that is, hopefully, good. this is the scoring function for which the AI will be trying to produce an action that is as favorable as possible, within its limited capabilities.

[α,ξ,γμ1,γμ2,γqScore≔Compose(λu:U.𝐌[NormalizeU(QACI0(α,γq,ξ))(u)])α:Ωαξ:KΞ−γμ1:Loc|μ1|(α,Ωα→(α),μ1,ξ)γμ2:Loc|μ2|(α,Ωα→(γμ1(μ1)),μ2,ξ)γq:Loc|q|(α,Ωα→(γμ1(μ1)),q,ξ)Ωα→(γq(q))(γμ2(μ2))>Ωα→(γμ2(μ2))(γq(q))](javascript:alert(%22%5Cn%5Ct%5C%5Cbegin%7Bsplit%7D%5Cn%5Ct%5Ct%26%20%5Cu03b1%2C%5Cu03be%2C%5Cu03b3_%7B%5Cu03bc_1%7D%2C%5Cu03b3_%7B%5Cu03bc_2%7D%2C%5Cu03b3_q%5Cn%5C%5C%5C%5C%5Ct%5C%5Ctextit%7BScore%7D%5C%5C%3B%5Cu2254%5C%5C%3B%5C%5Ctextit%7BCompose%7D%28%5Cu03bbu%3AU.%26%5C%5Cmathbf%7BM%7D%5C%5C%3B%5C%5Cleft%5B%5C%5Ctextit%7BNormalize%7D_U%28%5C%5Ctextit%7BQACI%7D_0%28%5Cu03b1%2C%5Cu03b3_q%2C%5Cu03be%29%29%28u%29%5C%5Cright%5D%5C%5C%3B%29%5Cn%5C%5C%5C%5C%5Ct%26%20%5Cu03b1%5C%5C%3B%3A%5C%5C%3B%5Cu03a9_%5Cu03b1%5Cn%5C%5C%5C%5C%5Ct%26%20%5Cu03be%5C%5C%3B%3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

where the following variables are sampled:

* an initial state of the universe [α](javascript:alert(%22%5Cu03b1%22)).
* a blob location prior [ξ](javascript:alert(%22%5Cu03be%22)), sampled for simplicity.
* the blob locations of [μ1](javascript:alert(%22%5Cu03bc_1%22)), [μ2](javascript:alert(%22%5Cu03bc_2%22)), and [q](javascript:alert(%22q%22)).

and the world-state containing the second observation [μ2](javascript:alert(%22%5Cu03bc_2%22)) is required to be in the future of the word-state containing the question [q](javascript:alert(%22q%22)).

then, we rate possible actions [a](javascript:alert(%22a%22)) by composing the scoring functions produced by [QACI0](javascript:alert(%22%5C%5Ctextit%7BQACI%7D_0%22)) for all of those blob location hypotheses.

for any question location, the set of action-scoring functions sampled by [QACI0](javascript:alert(%22%5C%5Ctextit%7BQACI%7D_0%22)) is normalized. this is because pairs of *AI-action location and question location* should not be penalized for having a "harder to find" answer — once the observations and question have been located, we want to obtain the answer no matter what.

finally, we'll just execute the action returned by [AI(Score)](javascript:alert(%22%5C%5Ctextit%7BAI%7D%28%5C%5Ctextit%7BScore%7D%29%22)).