# Traversing a Cognition Space

_(This post is part of a sequence that's meant to be read in order; see the [preface](https://www.lesswrong.com/posts/fnrpxdnodQmanibmB/preface-to-the-sequence-on-factored-cognition).)_

[Post #1](https://www.lesswrong.com/posts/S5oWwZMJBvfChSquW/idealized-factored-cognition) was about developing and justifying a formalism for Factored Cognition. Now that we have this formalism, this post is about doing as much with it as possible.

# 1. Debate Trees

[Recall](https://www.lesswrong.com/posts/S5oWwZMJBvfChSquW/idealized-factored-cognition#2__Cognition_Spaces) that a Cognition Space is a pair $(\mathcal{S}_h, d_h)$ where $\mathcal{S}_h$ is a set of statements, $d_h : \mathcal{S}_h \rightarrow \mathbb{R}_+$ is a difficulty function, and $h$ is a human.

So far, I've only shown examples of single transcripts. A single transcript corresponds to one path through $d_h$ that is dependent on choices from both agents: at every step, the first agent outputs an explanation (which is a sequence of statements), the second agent points at one element of this sequence, and the first agent continues the path from that element onward. However, given that we model Ideal Debate agents as maximally powerful, it is also coherent to ask about the object that results if we fix _all_ of the first agent's actions in advance, such that she 'pre-commits' for any possible combination of choices from the second agent.

I call such an object a **_Debate Tree_**, and we can define it formally as a _directed rooted tree_[^arborescence] $(V, E)$, where $V \subset  \mathcal{S}_h^*$ (so each node is a sequence of statements) and $E \subset V \times V$, that satisfies the following three conditions:

1. The unique root of $(V, E)$ is a one-element 'sequence' $(s_0)$.
2. $\forall (\mathbf{S}, \mathbf{S}') \in E \hspace{5pt} \exists s \in \mathbf{S}$[^in] $: \mathbf{S'} \overset{e}{\rightarrow} s$.
3. $\forall (\mathbf{S}, \mathbf{S}'), (\mathbf{S}, \mathbf{S}'') \in E : [\exists s \in \mathbf{S} : \mathbf{S}' \overset{e}{\rightarrow} s \land \mathbf{S}'' \overset{e}{\rightarrow} s] \implies [\mathbf{S'} = \mathbf{S''}]$.

The first condition says that the root of the tree needs to be a single statement (this should be the answer to the input question). The second condition says that every edge $(\mathbf{S}, \mathbf{S'})$ needs to explain a statement in $\mathbf{S}$; we don't have redundant edges in our tree. And the third condition says that each statement is only explained once; the formal way of saying this is that, if two explanations exist for the same statement, they're really the same. (Note that this restriction exists because the first agent has to choose one explanation during the game; it certainly doesn't imply that only one explanation exists.) There is no condition to demand that each statement needs to have an explanation – whenever there is none, it means that the first  agent decides to end the debate when that statement is pointed at.[^emptytree]

In this definition, nodes are explanations, and each node has one outgoing edge for each [statement of the explanation that the first agent wants to explain further], which links to an explanation for that statement. Defining the tree over individual statements would lead to a functionally equivalent definition, but I think defining it as-is makes arguments simpler.

Recall that a Debate Tree encodes all decisions that the first agent makes (for any possible combination of choices from the second agent). This means that, once we fix this object, the second agent is free to choose any path she wants out of the tree, without further involvement from the first agent. Formally, a _**path**_ through a Debate tree with root $(s_0)$ is a pair[^path]

$$\Big(\big((s_0), \mathbf{S}_1, ..., \mathbf{S}_n\big), s_\text{final}\Big)$$

where $(\mathbf{S}_{j-1}, \mathbf{S}_j) \in E \hspace{5pt} \forall j \in \{1, ..., n\}$ and $s_\text{final} \in \mathbf{S}_n$. (And $\mathbf{S}_0 = (s_0)$.) (You can go back to post 1 to convince yourself that a path through a Debate tree is also a path through a Cognition Space.)

As mentioned in the first post, we define the difficulty of a path $\mathbf{P} := (\mathbf{p}, s_\text{final})$ as the difficulty of the final statement (since that is the one being judged). In symbols, $d_h(\mathbf{P}) := d_h(s_\text{final})$.


# 2. The Ideal Debate-FCH

So far, we haven't talked about how precisely the two agents make their decisions.  Given the concepts of Debate Trees and paths, this is now easy. The second agent wants the first agent to lose, which means she'll choose the most difficult path in whatever Debate Tree the first agent chooses. (We still assume that the first agent outputs only true statements, which means that the second agent can't win if the judge successfully verifies the final statement.) The first agent, knowing this, chooses the Debate tree such that the difficulty of the hardest path is minimized.

With this, we are almost ready to define a FCH for Ideal Debate. But first, we need a bit more notation:

* Given a question $q$, we (for now) assume there is a unique statement $a_q \in \mathcal{S}^T_h$ that correctly answers the question.
* Given a cognition space $(\mathcal{S}_h, d_h)$, we write $\mathbf{T}((\mathcal{S}_h,d_h), a_q)$ for the set of all Debate trees that begin with statement $a_q$.
* Given a Debate tree $T$, we write $P(T)$ for the set of all paths in $T$.

Given this, the difficulty of the path we will end up with is

$$\min_{T \in \mathbf{T}((\mathcal{S}_h,d_h), a_q)} \Big( \max_{\mathbf{p} \in P(T)} d_h(\mathbf{p}) \Big)$$

Since the absolute values of the difficulty function $d_h$ are arbitrary (it doesn't matter whether we denote difficulties from 0 to 100 or from 0 to $10^{10000}$), we can assume without loss of generality that the hardest difficulty a human can handle is 1.[^lineartransformation] Thus, we can formulate:

$$\text{the Ideal Debate FCH}(h, Q)\text{:}\\[6pt] \forall q \in Q : \min_{T \in \mathbf{T}((\mathcal{S}_h, d_h), a_q)} \Big( \max_{\mathbf{p} \in P(T)} d_h(\mathbf{p}) \Big) \le 1$$

where $h$ is a human and $Q$ a set of questions.

Going forward, it will also be useful to talk about the difficulty of Debate Trees. Thus, we define

$$ d_h(T) := \max_{\mathbf{p} \in P(T)} d_h(\mathbf{p}) $$

and we say that a Debate tree $T$ **_can handle_** question $q$ if $d(T) \le 1$.[^equivalentdefinitions]

---

Here is a different view of the problem. In the space of all statements, there is a subset that the human judge can verify directly, i.e., 

$$D_h^{(0)} := \{s \in \mathcal{S}_h \hspace{5pt} | \hspace{5pt} d_h(s) \le 1\}$$

Then, there is a larger subset that contains all of the above plus the statements that can be explained solely in terms of statements in $D_h^{(0)}$, i.e.,

$$D_h^{(1)} := D_h^{(0)} \cup \{s \in \mathcal{S}_h \hspace{5pt} | \hspace{5pt} \exists \mathbf{S} \in (D_h^{(0)})^* : \mathbf{S} \overset{e}{\rightarrow} s\}$$

In general, given any $k \in \mathbb{N}_+$, we can extend $D_h^{(k-1)}$ by adding all statements that can be explained solely in terms of statements in $D_h^{(k-1)}$, i.e., 

$$D_h^{(k)} := D_h^{(k-1)} \cup \{s \in \mathcal{S}_h \hspace{5pt} | \hspace{5pt} \exists \mathbf{S} \in (D_h^{(k-1)})^* : \mathbf{S} \overset{e}{\rightarrow} s\}$$

Note that this gives us a chain of expanding sets, i.e., 

$$D_h^{(0)} \subseteq D_h^{(1)} \subseteq \cdots \subseteq D_h^{(k)} \subseteq D_h^{(k+1)} \subseteq \cdots$$

We can also define the set of all statements that are eventually explainable in this way, i.e.,

$$D_h := \bigcup_{j = 0}^\infty D_h^{(j)}$$

Intuitively, it seems like Ideal Debate should be able to handle all questions with answers in $D_h$, since they can be explained in terms of progressively easier statements – and then any path should eventually bottom out at $D_h^{(0)}$, which means that the second agent cannot delay success indefinitely.

This brings us to our first (and as of now, only) theorem:

**Theorem.** Given any $h$ and $Q$, Ideal Debate-FCH$(h, Q) \iff \forall q \in Q : a_q \in D_h$.

**Proof.** First, note that, while the Ideal Debate-FCH is formulated as a hypothesis, the definition also defines a set, namely

$$X_h = \Big\{s \in \mathcal{S}_h \hspace{5pt} \Big| \hspace{5pt} \min_{T \in \mathbf{T}((\mathcal{S}_h, d_h), s)} d(T) \le 1\Big\}$$

and the Ideal-Debate FCH simply says that $\forall q \in Q : a_q \in X_h$. It thus suffices to show that $X_h = D_h$. We will prove an even stronger statement. Note that we can restrict the set $X_h$ by limiting the maximum depth of the Debate Trees that can handle the respective statements. Formally, we can define

$$X_h^{(k)} := \Big\{s \in \mathcal{S}_h\hspace{5pt} \Big| \hspace{5pt} \min_{T \in \mathbf{T}^{(k)}((\mathcal{S}_h, d_h), s)} d(T) \le 1\Big\}$$

for any $k \in \mathbb{N}$, where $\mathbf{T}^{(k)}$ denotes the set of Debate Trees with depth at most $k$. ('Depth' is defined as the number of edges in the longest path through the tree.) By construction, we now have  $X_h = \bigcup_{j = 0}^{\infty} X_h^{(j)}$, just as $D_h = \bigcup_{j = 0}^{\infty} D_h^{(j)}$. What we will show is that

$$D_h^{(k)} = X_h^{(k)} \hspace{5pt} \forall k \in \mathbb{N}.$$

We proceed by induction. First, if $s \in D_h^{(0)}$, then $d_h(s) \le 1$, which means that the trivial tree $(\{(s)\}, \emptyset)$ is a Debate Tree of depth 0 that can handle $s$, so that $s \in X_h^{(0)}$. Conversely, if $s \in X_h^{(0)}$, then the Debate tree $T$ handling $s$ must have no edges (otherwise, its depth would be at least 1). Thus, $\mathbf{p} := (((s)), s)$ is a path in this tree, and we have $1 \ge d(\mathbf{p}) = d(s)$, hence $s \in D_h^{(0)}$.

Now, suppose the statement is true for some $k \in \mathbb{N}$. We show that $D_h^{(k+1)} = X_h^{(k+1)}$.

"$\subset$": Let $s \in D_h^{(k+1)}$. Then, there exists $\mathbf{S} = (s_1, ..., s_{n+1}) \in (D_h^{(k)})^*$ such that $\mathbf{S} \overset{e}{\rightarrow} s$. Apply the Inductive Hypothesis to find Debate Trees $T_1, ..., T_{n+1}$ of depth at most $k$ such that tree $T_j$ handles statement $s_j$. We combine these trees into a larger tree with root $(s)$ and an additional edge $((s), \mathbf{S})$.[^combine] Since all $T_j$ have depth at most $k$, this tree has depth at most $k+1$. Furthermore, given any path $\mathbf{p}$ through $T$, by construction, the path must end in a node that exists in one of the $T_j$, which implies that $d(\mathbf{p}) \le 1$. It follows that $T$ handles $s$ and hence $s \in X_h^{(k+1)}$.

"$\supset$": Let $s \in X_h^{(k+1)}$. Then, there exists a Debate Tree of depth at most $k+1$ that handles $s$. Let $((s), \mathbf{S})$ be the unique[^unique] edge descending from the root. For each $s_j \in \mathbf{S}$, let $T_j$ be the subtree growing out of $s_j$.[^subtree] By construction, $T_j$ has depth at most $k$ and handles $s_j$, so (applying the Inductive hypothesis), we have $s_j \in D_h^{(k)}$. Then, $\mathbf{S} \in (D_h^{(k)})^*$ and $\mathbf{S} \overset{e}{\rightarrow} s$, and hence $s \in D_h^{(k+1)}$.


# 3. Interpretation

At this point, we have a bunch more definitions and a theorem. Now, what does this mean?

Let's start with Debate Trees. A Debate Tree is actually a very natural object; it's what you get if you explain a subject in a hierarchical rather than a linear way. ($X$ is true because of $Y_1, ..., Y_4$; then $Y_1$ is true because [...].) It is very similar to [Elizabeth](https://acesounderglass.com/)'s project of [breaking questions down](https://www.lesswrong.com/posts/Gkn5wKchLEkGKWfnz/breaking-questions-down). Notably, that project never mentions Factored Cognition; it's just presented as an epistemic tool.

In a better world, would textbooks use something like Debate Trees to explain proofs? I'm almost certain the answer is yes. There is no way that a purely sequential presentation of information is optimal. Our understanding doesn't work that way (compare [post #-2](https://www.lesswrong.com/posts/6zbRy3aADCsRmFcgv/hiding-complexity)).

There is one difference between Debate Trees and a hierarchical presentation of information optimized for being easily understandable. In the former, only one part is actually explored, which means that a Debate Tree doesn't mind having redundancy in it (by explaining stuff in more than one place). Conversely, if you optimize for understandability with respect to a single reader, you'll want to avoid redundancy. Nonetheless, they are very similar.

So much for Debate Trees. What about the theorem we've just proved? What does it mean?

Essentially, it means that Debate is nicely behaved in the limit. As both agents become stronger and the structure of the game becomes stricter, we approach a situation where the scheme can answer a question if and only if its answer can be recursively explained until there are no more difficult components. Even though the game results from two powerful agents applying optimization in opposite directions, the result is can be described without mentioning either one of them. Note that the same is not true for Iterated Amplification; even in the limit of perfect Factored Cognition, it is entirely possible that the scheme fails at a question for which an easy explanation exists.

Notably, the theorem stops being true if we drop the assumption that both agents are maximally powerful.[^copies] If the first agent is weaker, she might fail to find the best explanation, which shrinks the set of statements Debate can handle. Conversely, if the second agent is weaker, she may fail to point to the most problematic statement, which enlarges the set of statements Debate can handle. Do these factors equal out? I'm not sure. One of the things that I haven't yet tried but may be reasonable is to model inadequacy and see whether this benefits the first or second agent.

It's worth pointing out that the Ideal Debate FCH doesn't talk about false statements. It formalizes the claim 'the first agent can always win by being honest' which leaves open the possibility that she can also win by being dishonest. (And if she could do both, she would presumably do what's easier or safer.) It is necessary but perhaps not sufficient to realize Factored Cognition with Debate.

I think focusing on the honest case makes the most sense. Nonetheless, the next chapter is about what happens if the first agent wants to defend a lie.


# 4. Relaxing the truth assumption

To model dishonesty by the first agent, we assume that

* In addition to $\mathcal{S}^T_h$, there is a set $\mathcal{S}^F_h$ of false statements. We have $\mathcal{S}_h = \mathcal{S}^T_h \sqcup \mathcal{S}^F_h$.[^disjointunion]
* Given a question $q$, in addition to the honest answer $a_q \in \mathcal{S}^T_h$, there is at least one dishonest answer $\tilde a_q \in \mathcal{S}^F_h$. The first agent may defend this dishonest answer.
* Any explanation for a false statement needs to contain at least one false element, i.e., if $(s_1, ..., s_{n+1}) \overset{e}{\rightarrow} s$ and $s \in \mathcal{S}^F_h$, then $\exists j \in \{1, ..., n+1\}$ such that $s_j \in \mathcal{S}^F_h$.

Since the second agent is also maximally powerful, she can repeatedly point to a false statement in the explanation. Due to the third assumption made above, this becomes an invariant: the ability to point to a false statement in any one step leads to the ability to point to a false statement in the next step, and therefore, since she can point to one in the beginning, she can do so at every step in the game.

In particular, this means that, regardless of when the first agent ends the game, we will have that $s_\text{final} \in \mathcal{S}^F_h$.

At this point, we have two conflicting intuitions. On the one hand, the judge should only declare the first agent the winner if she is _certain_ that the statement to be verified is correct. This should only happen for simple statements; if $s_\text{final}$ is complicated, she should declare the second agent the winner. Thus, the first agent should only be able to win the game by choosing a $s_\text{final}$ that looks _simple and obviously true_, yet is false. This sounds extremely hard to accomplish.

On the other hand, we are, in some sense, pitching a human in a battle of wits against a potentially superintelligent AI, which sure sounds like doom. The superintelligent AI has to follow a very rigid structure, but... it still kinda sounds like doom. In particular, we probably expect that the first agent will navigate the game so cleverly that she only appears to follow the rigid structure while really doing something else. Crucially, _we lack the ability of the second agent to interfere through an equally powerful I/O channel_ that exists in regular Debate.

There thus seems to be a tradeoff here, where at the one end, we have the 'stock Debate' protocol that enforces no structure, and on the other, the 'Ideal Debate' protocol that enforces extremely rigid structure. More structure means more concern with things like wireheading, but also stronger theoretical guarantees.

![](https://i.ibb.co/BfPWTLG/Contrasting-Debate.png)

I strongly suspect that running literal Ideal Debate is a recipe for disaster since the first agent can break away from the format entirely and attempt to wirehead the judge. At the very least, it would require a way for the judge to prematurely declare a winner (in literal Ideal Debate, the first agent has complete control over when to end the game), and it would probably also require the second agent to claim that wireheading is occurring. On the other hand, I do have the intuition that one should aim to get as close to Ideal Debate as possible while managing these concerns.

# 5. The HCH-FCH

Ideal Debate has been amendable to a formal description because the human only makes decisions at the end. In HCH, the human is involved all throughout and, crucially, is in charge of decomposing questions. To have an accurate model, one needs to abstract away the entire process of the human decomposing the question as well as any other cognitive work she might do on the question – but if this is done, there is nothing left to formally capture.

(And older version of this post used to have an attempt of formalizing it more, but I've since concluded that it can't be done right.)

To have something analogous to the Ideal Debate-FCH, we trivially define:

$$\text{the HCH-FCH}(Q, h, t, \ell)\text{:}\\[6pt] \text{HCH}_{h,t, \ell} \text{ can solve every question in } Q$$


# 6. Conclusion

This post concludes the first part of the sequence. There probably weren't any huge surprises so far. Is having a formalism useful?

I think so. One purpose of formalizing a setup is that it overcomes the [illusion of transparency](https://www.lesswrong.com/posts/sSqoEw9eRP2kPKLCz/illusion-of-transparency-why-no-one-understands-you). Without it, it is possible to think the setup is clear even when it really is not. I can take myself as one data point: my first attempt at coming up with a formalism looked different (and, I think, wrong). At least my past self did not understand the problem to the point that the formalism is trivial.

Anyway, at this point in the sequence, I want to defend the following two claims:

1. It doesn't make any sense to talk about the 'Factored Cognition Hypothesis'; there is no one requirement that works for both schemes.
2. The formalism of Cognition Spaces is *accurate*, in that it doesn't include anything that misrepresents Factored Cognition as implemented by IDA or Debate. It may be incomplete (e.g., there is nothing about defining terms, as people have pointed out on post #1, and maybe you could do more with false statements).

I think these are pretty conservative claims, even though the first clearly contradicts what I've heard other people say. If anyone doubts them, this is the place to discuss it. My conclusions from the second part are probably going to be a lot more controversial.






[^in]: We continue writing $s \in \mathbf{S}$ to denote that $s$ appears in the sequence $\mathbf{S}$.

[^arborescence]: A directed rooted tree, also called an [arborescence](https://en.wikipedia.org/wiki/Arborescence_(graph_theory)), is a directed acyclic graph such that there exists [a node from which there is exactly one path to every other node]. This node is called the root; it's unique because, if there were two such nodes $x$ and $y$, there would be a path $x \longrightarrow y$ and a path $y \longrightarrow x$ and hence a cycle $x \longrightarrow y \longrightarrow x$.

[^lineartransformation]: In particular, one could model the same by having a difficulty threshold $c_h$ for a human, such that the human can deal with all questions that are at most $c_h$ hard. However, the pair $(d_h, c_h)$ is equivalent to the pair $(d_h', 1)$, where $d_h'$ is like $d_h$ except that all difficulties are scaled by $\frac{1}{c_h}$.

[^path]: Note that the first element of this pair is a _path_ as defined in Graph theory (through the Debate Tree, which is a graph) whereas the second is an additional element that denotes which statement in final explanation we end up in.

[^emptytree]: The 'trivial tree' $((s_0), \emptyset)$ for some $s_0 \in S$ is a proper Debate Tree, according to this definition. It corresponds to the first Debate agent giving an answer $s_0$ to the input question and deciding that this answer is already self-evident.

[^combine]: This is a step where defining the nodes of Debate Trees to be explanations rather than individual statements makes things harder. For each subtree, one needs to replace its current root (that's a one-element sequence) with the node $\mathbf{S}$. This can be done formally in terms of the underlying nodes and edge sets; it's just cumbersome.

[^unique]: The edge from the root is unique because the root is a one-element sequence $(s)$, and each statement can only have one explanation (and thus only one edge) by the third condition of Debate Trees. This corresponds to the fact that the first agent only has to prepare one explanation for her initial answer; there is not yet a choice from the second agent involved.

[^subtree]: This step is the reverse of the combining step. The subtree growing out of $s_j$ is the tree we get by taking the sub-graph out of $\mathbf{S}$ and replacing its root $\mathbf{S}$ with just $(s_j )$.

[^copies]: Recall that there is, in fact, only one agent playing against itself. Thus, we can assume that both agents are always *equally* competent.

[^disjointunion]: The 'squared cup' symbol $\sqcup$ means the same as $\cup$ plus the information that the two sets are disjoint.

[^equivalentdefinitions]: Given this, one could alternatively phrase the Ideal Debate FCH as

    $$\forall q \in Q : \min_{T \in \mathbf{T}(d_h, a_q)} d_h(T) \le 1 $$

    Or in words, one could say, 'every question in $Q$ can be handled by a Debate Tree'.