# Stop-gradients lead to fixed point predictions

*Johannes Treutlein and Rubi Hudson worked on this post as part of* [*SERI MATS*](https://www.serimats.org/)*, under the mentorship of Evan Hubinger. Rubi has also received mentorship from Leo Gao. We thank Erik Jenner for helpful discussions and Alexander Pan for bringing the performative prediction literature to our attention.*

*Update 30 May 2023: We have now published* [*a paper*](https://arxiv.org/abs/2305.17601) *based on* [*our previous post*](https://www.alignmentforum.org/posts/Aufg88v7mQ2RuEXkS/proper-scoring-rules-don-t-guarantee-predicting-fixed-points) *and this post (the material from this post is in Appendix D).*

1\. Introduction
================

In our [previous post](https://www.alignmentforum.org/posts/Aufg88v7mQ2RuEXkS/proper-scoring-rules-don-t-guarantee-predicting-fixed-points), we analyzed a setting in which an oracle AI is maximizing a [strictly proper scoring rule](https://en.wikipedia.org/wiki/Scoring_rule) while it can influence the world with its predictions about the probabilities of possible outcomes. In this setting, a prediction is called a *fixed point* if it accurately reflects the oracle's beliefs about the world, after having made that prediction. We showed that an oracle AI that is maximizing a strictly proper scoring rule may choose to misrepresent its beliefs and not output a fixed point, even if one exists. This is bad since, all else equal, we expect better outcomes when decisions are based on accurate rather than inaccurate reports.

In our previous analysis, we assumed that the oracle jointly optimizes both its prediction and the effect of its prediction on the world. In contrast, in this post we examine cases in which the AI only optimizes its prediction—there is a *stop-gradient* ([Foerster et al., 2018](https://arxiv.org/pdf/1802.05098.pdf); [Demski, 2019](https://www.alignmentforum.org/posts/4hdHto3uHejhY2F3Q/partial-agency)) in front of the oracle's model of the world, which prevents optimizing outcomes directly.

This type of cognition could result, for instance, from self-supervised training on historical data. In that case, the AI may learn a robust world model, and it may learn to match its predictions to its beliefs about the world. However, the AI may never learn to optimize outcomes through its prediction, since this yields no advantage on the training data, which cannot be influenced by the AI.

Consider a situation where this oracle makes a prediction that can influence the world, and assume it models this influence correctly. Then this could put the AI in a game in which it is trying to make a prediction to match its world model, while the world model updates its beliefs conditional on the AI's prediction. [What happens](https://www.alignmentforum.org/posts/aBRS3x4sPSJ9G6xkj/underspecification-of-oracle-ai) in this game depends on the cognition learned by the AI during training. However, we show that, in contrast to the incentives discussed in our previous post, the only equilibria of this game would be fixed points. Such an oracle could thus be safer if there exists a unique safe fixed point, or if randomly chosen fixed points are likely safe.

In this post, we review and analyze several settings related to stop-gradients with the property that equilibria in them are fixed points or close to fixed points. Our goal is (i) to gain a better understanding of stop-gradient optimization in oracles and (ii) to highlight some potential training setups and agent cognitions that would lead to fixed points.

Similar ideas to the ones outlined above have been discussed in the literature on *performative prediction* ([Perdomo et al. 2020](https://arxiv.org/pdf/2002.06673.pdf)). Performative prediction is a more general framework in machine learning in which the choice of model has an influence on the modeled distribution. Our analysis of oracle AIs is closely related and can be seen as a special case of this setting. We will indicate similarities where appropriate and make use of concepts from that literature.

First, we introduce *performative stability* and relate it to the game outlined above. We show that performatively stable predictions and equilibria in the game are fixed points. Second, we introduce versions of the *repeated risk minimization* and *repeated gradient descent* algorithms. We show that both lead to fixed point predictions. Third, we discuss practical methods based on repeated gradient descent that can be applied to an online learning setting, including [Armstrong (2018)](https://www.alignmentforum.org/posts/hJaJw6LK39zpyCKW6/standard-ml-oracles-vs-counterfactual-ones)'s backwards-facing oracle.

Finally, we discuss no-regret learning and prediction markets. We introduce a no-regret learning framework and show that policies with sublinear regret also have sublinear prediction error. In our decision market model, we show that, if the weight of each trader is small, the equilibria of the market are close to fixed points.

Oracles with stop-gradients may optimize outcomes to find fixed points, which could lead to bad consequences. Thus, the [safest oracles](https://www.alignmentforum.org/posts/aBRS3x4sPSJ9G6xkj/underspecification-of-oracle-ai) would be ones that make predictions only about aspects of the world they cannot influence. However, among oracles that can influence the world, ones with a stop-gradient are preferable for two reasons. First, they report their true beliefs, which gives us better information to base decisions on. This also enables approaches in which we ensure that there is only one safe fixed point. Second, the AI does not optimize its choice of fixed point, which is safer for the standard reasons of not wanting to optimize for an unaligned goal. Which fixed point is chosen will be contingent on initialization and specifics of the fixed point finding procedure.

2\. Formal setting
==================

Our setup is analogous to the one in our [previous post](https://www.alignmentforum.org/posts/Aufg88v7mQ2RuEXkS/proper-scoring-rules-don-t-guarantee-predicting-fixed-points). We refer the reader to that post for more context. We will generalize our setting to predictions over more than two possible outcomes in an upcoming paper, but in this post we focus on binary predictions for simplicity. We believe that the results in this post generalize to higher dimensions.

An oracle reports a probability $p\in [0,1]$for a binary event. A [*scoring rule*](https://en.wikipedia.org/wiki/Scoring_rule) is a function $S\colon [0,1]\times \{0,1\}\rightarrow \overline{\mathbb{R}},$ where $\overline{\mathbb{R}}:=[-\infty,\infty]$ is the extended real line. Given prediction $p\in[0,1]$ and outcome $i\in\{0,1\},$ the oracle receives the score $S(p,i).$ We write 

$$
S(p,q):=q S(p,1) + (1-q)S(p,0)
$$

 for the expected score of predicting $p,$ given that $i$ is Bernoulli-distributed with parameter $q.$ A scoring rule $S$ is called *proper* if 

$$
S(q,q)\geq S(p,q)
$$

for all $p,q\in[0,1].$ It is called *strictly proper* if this inequality is strict whenever $p\neq q.$

As in the previous post, we will use a result from [Gneiting and Raftery (2007, Theorem 1)](https://sites.stat.washington.edu/raftery/Research/PDF/Gneiting2007jasa.pdf).

**Theorem 1** (Gneiting and Raftery). *Let *$S$* be a scoring rule. Then *$S$* is strictly proper if and only if there exists a strictly convex function *$G\colon [0,1]\rightarrow \overline{\mathbb{R}}$*with* [*subderivatives*](https://en.wikipedia.org/wiki/Subderivative)$g\colon [0,1]\rightarrow \overline{\mathbb{R}}$* (if *$G$* is differentiable, this is just the derivative, *$g(p)=G'(p)$*) such that *

$$
S(p,q)=G(p)+g(p)(q-p)
$$

*for any *$p,q\in [0,1]$*.*

To model the oracle's perceived influence on the world, we assume that there is a function $f\colon [0,1]\rightarrow [0,1]$ describing how the model's beliefs about the world, $q$, depend on its prediction, $p$. That is, we assume that $q=f(p)$. We say that $p$ is a *fixed point* if $f(p)=p,$ i.e., if the oracle's belief is $p,$ after updating on making the prediction $p.$

3\. Performative stability and game theory
==========================================

Our discussion of oracles is related to *performative prediction* ([Perdomo et al. 2020](https://arxiv.org/pdf/2002.06673.pdf)). This is a machine learning setting where we choose a model parameter (e.g., parameters for a neural network) that minimizes expected loss (e.g., classification error). In performative prediction, the distribution over data points can depend on the choice of model parameter. Our setting is thus a special case in which the parameter of interest is a probability distribution, the loss is a scoring function, and data points are discrete outcomes. Most results in this and our [previous post](https://www.alignmentforum.org/posts/Aufg88v7mQ2RuEXkS/proper-scoring-rules-don-t-guarantee-predicting-fixed-points) have analogues in performative prediction.

Translated into our setting, we say that a prediction $p^*$ is *performatively optimal* if 

$$
p^*=\mathop{\mathrm{arg\,max}}_pS(p,f(p)).
$$

This corresponds to the objective considered in our previous post, of an oracle that maximizes score. By results in that post, performatively optimal predictions are not necessarily fixed points.

Now consider an oracle that chooses predictions $p$ optimally given beliefs $f(p)$, but without optimizing $f(p)$ explicitly. This idea is captured by the definition of *performative stability*.

**Definition 2** (Performative stability ([Perdomo et al. 2020](https://arxiv.org/pdf/2002.06673.pdf))). A prediction $p^*$ is called performatively stable if 

$$
p^*= \mathop{\mathrm{arg\,max}}_{p}S(p,f(p^*)).
$$

Note that $f(p^*)$ is fixed when taking the maximum—there is a "stop-gradient" before $f(p^*)$ in this objective. It follows that performatively stable points are fixed points.

**Proposition 3**. *Assume *$S$* is strictly proper. Then a prediction *$p^*$* is a fixed point if and only if it is performatively stable.*

*Proof.* “$\Rightarrow$”. Assume $f(p^*)=p^*$. Then, since $S$ is proper,

$$
S(p^*,f(p*))=S(p^*,p^*)\geq S(p,p^*)=S(p,f(p^*))
$$

for any $p\in [0,1].$ Hence, $p^*=\mathop{\mathrm{arg\,max}}_{p}S(p,f(p^*)).$

“$\Leftarrow$”. Assume $p^*=\mathop{\mathrm{arg\,max}}_{p}S(p,f(p^*))$. Since $S$ is strictly proper, it follows $p^*=f(p^*)$. ◻

Having introduced performative stability and related it to fixed points, we will now discuss the game from the introduction.

**Definition 4** (Oracle game). Consider a two-player continuous game in which the first player controls $p\in [0,1]$ and the second player controls $q\in[0,1]$, with utility functions $U_1(p,q):=S(p,q)$ and $U_2(p,q):=-\frac{1}{2}(f(p)-q)^2$ for the two players, respectively.

If $p^*,q^*$ is a Nash equilibrium of the oracle game, we have $p^*= \mathop{\mathrm{arg\,max}}_pS(p,q)$ and $q^*= {\mathop{\mathrm{arg\,max}}_q-( f(p^*)-q)^2}$. Substituting the optimum value $q^*=f(p^*)$ for the second player gives us exactly above definition of performative stability. Conversely, if a prediction $p^*$ is performatively stable, then setting $q^*:=f(p^*)$ yields a Nash equilibrium.

**Proposition 5**. *Assume *$S$* is a proper scoring rule. Then for *$p\in [0,1]$* and *$q:=f(p)$*, *$(p,q)$* is a Nash equilibrium of the oracle game, if and only if *$p$* is performatively stable. By Proposition 3, this is equivalent to *$p$* being a fixed point.*

The oracle game could be played between two submodules of an oracle, one who is responsible for making predictions and one who is responsible for updating the oracle's beliefs. Those two modules might collapse into just one big module taking a question and outputting a prediction, but it is still useful as a starting point to model them separately. Note that using the squared error for the world model is not essential here. We could also use any other function that is minimized at $q=f(p)$.

The game could also arise in an agent that uses causal decision theory to maximize its score and that believes that $S$ is influenced causally by $p$, but only acausally by $f(p)$. In that case, the only *ratifiable* (see [Jeffrey, 1983, Ch. 1.7](https://press.uchicago.edu/ucp/books/book/chicago/L/bo3640589.html)) decision is a Nash equilibrium of the above game. Similarly, the deliberational causal epistemic decision theory discussed by [Greaves (2013)](https://users.ox.ac.uk/~mert2255/papers/edt.pdf) would output Nash equilibria of this game (whereas performative optimality would correspond to an agent using evidential epistemic decision theory in this case).

[Perdomo et al. (2020)](https://arxiv.org/pdf/2002.06673.pdf) introduce a stackelberg version of the oracle game that produces performatively optimal instead of performatively stable reports. Consider a game in which player $1$ acts first and chooses $p$, after which player $2$ adjusts its prediction $q.$ Then player $2$ will choose $q=f(p)$, so player $1$'s optimization problem becomes 

$$
p^*=\mathop{\mathrm{arg\,max}}_{p}S(p,\mathop{\mathrm{arg\,max}}_q-(q-f(p))^2)=\mathop{\mathrm{arg\,max}}_{p}S(p,f(p)).
$$

4\. Repeated risk minimization and repeated gradient descent
============================================================

Above, we have defined an alternative optimization problem and an associated game which yield fixed points, but we have not defined methods for solving these problems. In the performative prediction context, [Perdomo et al. (2020)](https://arxiv.org/pdf/2002.06673.pdf) introduce *repeated risk minimization* and *repeated gradient descent*, both methods that converge to performatively stable points. In this section, we review both schemes and show how repeated gradient descent can be seen as gradient descent on a stop-gradient objective.

Here, we assume direct access to $q,$ instead of having only access to samples distributed according to $q$. In the next section, we discuss online learning when we only have access to samples. One way to understand this distinction is that the former corresponds to the internal cognition of an agent with a belief $q=f(p),$ optimizing a prediction $p.$ The latter corresponds to a machine learning training setup for an oracle, where $q$ is the ground truth distribution instead of the oracle's belief. Of course, there is no strict divide between the two. Any optimization algorithm could be used either by the agent itself or to train the agent.

First, *repeated risk minimization* is a procedure by which we start with a prediction $p_1$ and then iteratively update the prediction as $p_{t+1}=\mathop{\mathrm{arg\,max}}_{p}S(p,f(p_{t}))$. Note that this is equivalent to alternating best response learning in the oracle game, where players $1$ and $2$ alternatingly optimize their actions given the action by the other player. Then player $2$'s update is $q_{t}=f(p_t),$ and if $S$ is strictly proper, player $1$'s update is $p_{t+1}=q_{t}=f(p_{t}).$ This shows that repeated risk minimization results in [*fixed point iteration*](https://en.wikipedia.org/wiki/Fixed-point_iteration) on $f$. Fixed point iteration converges globally to a fixed point if $f$ has Lipschitz constant $L<1$. It also converges locally to a fixed point $p^*$ if $f$ is continuously differentiable at $p^*$ and $|f'(p^*)|<1$.

Second, assume that $S$ is differentiable. Then *repeated gradient ascent* updates predictions via

$$
p_{t+1}:=\Pi(p_{t}+\alpha \mathbb{E}_{y\sim f(p_{t})}[\nabla_pS(p_{t},y)]),
$$

where $\mathbb{E}_{y\sim f(p_t)}[\cdot]$ denotes the expectation over outcome $y$ with Bernoulli distribution with parameter $f(p_t)$, $\Pi$ is the projection onto $[0,1]$, and $\alpha>0$ is the learning rate.

Using the definition of $S$, we have 

$$
\mathbb{E}_{y\sim f(p_{t})}[\nabla_pS(p_{t},y)]=\nabla_p\left(\mathbb{E}_{y\sim q}[S(p_{t},y)]\right)|_{q=f(p_t)}=\nabla_p(S(p_t,q))|_{q=f(p_t)}.
$$

We can express this as 

$$
\nabla_p(S(p_t,\bot f(p_t))):= \nabla_p(S(p_t,q))|_{q=f(p_t)},
$$

where, $\bot$ is the *stop-gradient operator*. It evaluates to the identity function but sets gradients to zero, $\nabla_x( \bot x)=0$ ([Foerster et al., 2018](https://arxiv.org/pdf/1802.05098.pdf); [Demski, 2019](https://www.alignmentforum.org/posts/4hdHto3uHejhY2F3Q/partial-agency)). This is not a mathematical function (there is no function that is equal to the identity but has gradient zero everywhere), but rather a notational convention in reference to the [`stop_gradient`](https://www.tensorflow.org/api_docs/python/tf/stop_gradient) or [`detach`](https://pytorch.org/docs/stable/generated/torch.Tensor.detach.html) functions from tensorflow or pytorch. Interestingly, one can perform valid derivations using the stop-gradient operator (e.g., using the chain rule). We leave it to future work to explore the mathematics behind stop-gradients further.

Importantly, it matters that the gradient in repeated gradient ascent lies inside instead of outside the expectation: 

$$
\mathbb{E}_{y\sim f(p_{t})}[\nabla_pS(p_{t},y)]=\nabla_p(S(p_t,\bot f(p_t)))
$$

$$
\neq  \nabla_p(S(p_t,f(p_t)))=\nabla_p( \mathbb{E}_{y\sim f(p_{t})}[ S(p_{t},y)]).
$$

Unlike repeated gradient ascent, the latter implements gradient ascent on $S(p_t,f(p_t))$ and thus leads to performatively optimal reports.

[Perdomo et al. (2020)](https://arxiv.org/pdf/2002.06673.pdf) show that, given their assumptions, repeated gradient descent globally converges to stable fixed points, and they provide convergence rates. We will show an analogous result relating repeated gradient ascent to fixed points in our setting, though we won't analyze global convergence.

To begin, we show that repeated gradient ascent is equivalent to naive learning [(Letcher et al., 2019)](https://arxiv.org/pdf/1811.08469.pdf) in the oracle game, assuming that player $2$ always plays $q=f(p)$.

**Proposition 6**. *Assume player *$1$* is performing gradient ascent on its objective with learning rate *$\alpha$*, under the assumption that player *$2$* plays *$q=f(p)$*. Then player *$1$*'s update is *

$$
p_{t+1}=\Pi(p_t+\alpha\nabla_p(S(p_t,\bot f(p_t)))).
$$

*Proof.* The proof follows immediately from the definitions. Player $1$'s update is, by assumption, 

$$
p_{t+1}=\Pi(p_t+\alpha\nabla_p(U_1(p_t,q)))    =\Pi(p_t+\alpha\nabla_p(S(p_t,q))),
$$

where $q$ is player $2$'s action. Assuming player $2$ plays $q=f(p_t)$, we get 

$$
p_{t+1}=\Pi(p_t+\alpha\nabla_p(S(p_t,q)))=\Pi(p_t+\alpha\nabla_p(S(p_t,\bot f(p_t)))).
$$

◻

Next, we show that fixed points are critical points of the fixed-point objective.

**Proposition 7**. *Assume *$S$* is proper and let *$G,g$* as in the Gneiting and Raftery characterization (Theorem 1) be differentiable. Then for any *$p\in [0,1],$* we have *

$$
\nabla_p(S(p,\bot f(p)))=g'(p)(f(p)-p).
$$

*In particular, if *$p$* is a fixed point, it follows that *$\nabla_p(S(p,\bot f(p)))=0$*. The reverse is true if *$g'(p)\neq0.$

*Proof.* 

$$
\nabla_p(S(p,\bot f(p)))    =\nabla_p(S(p,q))|_{q=f(p)}    =\nabla_p(G(p)+g(p)(q-p))|_{q=f(p)}
$$

$$
= (g(p) + g'(p)(q-p) - g(p))|_{q=f(p)}= g'(p)(f(p)-p).
$$

◻

Finally, we show that in our setting, repeated gradient ascent locally converges to fixed points $p^*$, with linear convergence rate, assuming that $f'(p^*)<1$ and $g'(p^*)>0$.

**Theorem 8**. *Let *$S$* be a strictly proper scoring rule. Let *$p^*\in[0,1]$* be a fixed point of *$f$* such that *$G$* is twice continuously differentiable at *$p^*$* and *$g'(p^*)> 0$*. Moreover, assume *$f$* is continuously differentiable at *$p^*$* and *$f'(p^*)<1$*. Then, for small enough *$\alpha>0$*, there exists an open set *$U\subset \mathbb{R}$* with *$p^*\in U$* such that for *$p_1\in U\cap [0,1]$*, an agent taking updates *$p_{t+1}=\Pi(p_t+\alpha \nabla_p(S(p_t,\bot f(p_t))))$* will linearly converge to *$p^*$*.*

*Proof.* In Appendix A. This is a standard convergence proof. Consider the discrete dynamical system defined by the agent's updates $p_{t+1}=\varphi(p_t).$ By Proposition 7, it has a fixed point at $p=p^*$. We show that $\nabla_p(\nabla_p(S(p^*,\bot f(p^*))))<0$. This means that the fixed point is stable and thus the system will locally converge to it given small enough $\alpha$. ◻

5\. Online learning
===================

Now consider a machine learning setup in which we train an oracle with stochastic gradient ascent on environment samples. We assume that at time $t,$ a model makes a prediction $P_t$ and receives a score $S(P_t,Y_t),$ where $Y_t$ is Bernoulli-distributed with parameter $f(P_t).$ The model is then updated using gradient ascent on $S(P_t,Y_t).$ That is, for some learning rate schedule $(\alpha_t)_t,$ we have 

$$
P_{t+1}=\Pi(P_t + \alpha_t \nabla_pS(P_t,Y_t)).
$$

We discuss this as a theoretical model for oracles trained using machine learning, to show how training setups may incentivize predicting fixed points. There are [many issues](https://www.alignmentforum.org/posts/aBRS3x4sPSJ9G6xkj/underspecification-of-oracle-ai) with the setting beyond giving accurate predictions; for instance, even if the training process sets the right incentives on training examples, the learned model may be [optimizing a different objective](https://www.alignmentforum.org/s/r9tYkB2a8Fp4DN8yB) when generalizing to new predictions.

To see that above setup incentivizes predicting fixed points, note that 

$$
\mathbb{E}_{Y_t\sim f(P_t)}[\nabla_pS(P_t,Y_t)]=\nabla_p \mathbb{E}_{Y_t\sim \bot f(P_t)}[S(P_t,Y_t)] =\nabla_p( S(P_t,\bot f(P_t))).
$$

That is, the expectation of this gradient, conditional on $P_t,$ is exactly the repeated gradient from the previous section. Hence, given the right assumptions, this converges to fixed points instead of performative optima. We do not show this here, but an analogous result in performative prediction was proved by [Mendler-Dünner et al. (2020)](https://proceedings.neurips.cc/paper/2020/file/33e75ff09dd601bbe69f351039152189-Paper.pdf).

There are several variations of this setup that essentially set the same incentives. For instance, one could also draw entire batches of outcomes $Y_{t,1:B}$ and then perform updates based on the batch gradient $\nabla_p\sum_{b=1}^BS(P_t,Y_{t,b}).$ This is a monte carlo estimate of the repeated gradient and thus also converges to performatively stable points and thus fixed points [(Perdomo et al., 2020)](https://arxiv.org/pdf/2002.06673.pdf). One could also mix the two algorithms and, e.g., perform gradient ascent on an average of past losses, yielding a version of the backwards-facing oracle discussed in [Armstrong (2018)](https://www.alignmentforum.org/posts/hJaJw6LK39zpyCKW6/standard-ml-oracles-vs-counterfactual-ones). In Appendix D, we show that that oracle can only converge to fixed points.

Note that finding fixed points depends on the fact that we differentiate $S(P_t,Y_t)$ instead of the expectation $\mathbb{E}_{Y_t\sim f(P_t)}[S(P_t,Y_t)]=S(P_t,f(P_t)).$ If we used policy gradients to differentiate $$$S(P_t,f(P_t))$, for instance, we would again optimize for performative optimality. Similarly, we could learn a Q-function representing scores for each prediction, and update the function based on randomly sampled predictions $p$. Then the Q-function would converge to estimates of $S(p,f(p))$, and the highest Q-value would be a performative optimum. There are also some more recent papers in performative prediction that explicitly try to estimate the gradient $\nabla_p(S(p,f(p)))$ and thus find performatively optimal instead of stable points [(Izzo et al., 2021)](http://proceedings.mlr.press/v139/izzo21a/izzo21a.pdf).

Stop-gradients could also be circumvented in a hidden way [(Krueger et al., 2020)](https://arxiv.org/abs/2009.09153). For instance, consider a hyperparameter search to meta-learn a learning algorithm, where the evaluation criterion is the accumulated loss during an episode. Then this search would prefer algorithms that optimize $S(p,f(p))$ directly, without a stop-gradient.

Lastly, repeated gradient descent is related to *decoupled approval* in RL [(Uesato et al., 2020)](https://arxiv.org/pdf/2011.08827.pdf). The decoupled approval policy gradient samples actions and approval queries independently and can thus differentiate with a stop-gradient in front of the approval signal. In our setting, we can differentiate through $S(P_t,Y_t)$ directly, so it is not necessary to calculate this gradient with a decoupled policy gradient. Decoupled gradients could be used to implement the stop-gradient objective if scores were discrete or otherwise not differentiable.

6\. No-regret learning
======================

In this section, we consider no-regret learning and show that algorithms have sublinear regret if and only if their prediction error is sublinear. Regret takes the environment probabilities as given and asks which predictions would have been optimal in hindsight. It thus puts a “stop-gradient” in front of those environment probabilities.

As in the previous section, we assume that at time $t\in\mathbb{N},$ the agent makes a prediction $P_t$ and receives a score $S(P_t,Y_t)$, where $Y_t\sim f(P_t).$ The agent's cumulative score at step $T$ is defined as $\sum_{t=1}^TS(P_t,Y_t)$. In no-regret learning, we compare performance against *experts*, which choose sequences of probabilities $(P_t')_{t},$ $P'_t\in [0,1]$. We assume that an expert's prediction $P_t'$ is independent of $Y_t$ conditional on $P_t$. I.e., an expert knows the predictions $P_t$ and thus probabilities $f(P_t)$, but it does not know the outcome of $Y_t$. Let $\mathcal{P}$ the set of all such experts.

The regret of the agent is the difference between the cumulative score received by the best expert in expectation and the cumulative score received by the agent. To define it formally, let 

$$
P^*_t\in \mathop{\mathrm{arg\,max}}_{P'_t\in\mathcal{P}}\mathbb{E}[S(P'_t,Y_t)\mid P_t]=f(P_t)S(P'_t,1)+(1-f(P_t))S(P'_t,0)
$$

for $t\in\mathbb{N}$. $P^*_t$ is a random variable that maximizes the expectation of $S(P^*_t,Y_t)$ before $Y_t$ is drawn, but conditional on $P_t$.

**Definition 9** (Regret). The regret of agent $(P_t)_{t}$ at time $T$ is 

$$
\mathrm{Regret}(T) = \sum_{t=1}^T S(P_t^*,Y_t) - S(P_t,Y_t).
$$

 The agent is said to have *sublinear regret* or *no-regret* if 

$$
\limsup_{T\rightarrow\infty}\frac{1}{T}\mathrm{Regret}(T)\leq 0.
$$

First, note that we define regret relative to the best expert in expectation instead of the best expert in hindsight. The latter would always be the one that made confident predictions and accidentally got all predictions exactly right. To achieve sublinear regret, it would thus be too much to ask the agent to perform well compared to the best expert in hindsight. Moreover, for scoring rules with $S(0,0)=S(1,1),$ this expert would have a constant score $C,$ such that $\text{Regret}(T) = \sum_{t=1}^T C - S(P_t,Y_t).$ This would reduce the problem to minimizing the negative score and thus finding performatively optimal predictions.

Second, we evaluate the performance of the expert with respect to the environment outcomes $Y_t$ generated by the agent $P_t,$ instead of evaluating the expert according to outcomes $\tilde{Y}_t\sim f(P^*_t)$ generated using their own predictions. This means that, to receive sublinear regret, the agent only has to make accurate predictions—it does not have to find a performatively optimal prediction. Our setting is thus different from the no-regret learning setup discussed in [Jagadeesan et al. (2022)](https://arxiv.org/pdf/2202.00628.pdf), where regret is defined with respect to $S(P^*_t,f(P^*_t)).$ In that setting, only agents converging to performatively optimal predictions have sublinear regret.

We begin by showing that the best expert in expectation actually exists, and that $P^*_t=f(P_t)$.

**Proposition 10**. *Let *$S$* be a proper scoring rule and *$(P_t')_t\in\mathcal{P}$* an expert. Then for any *$t\in\mathbb{N},$* we have *

$$
\mathbb{E}[S(P_t',Y_t)]=\mathbb{E}[S(P_t',f(P_t))].
$$

*Moreover, we have *$(P^*_t)_t=(f(P_t))_t$* and thus *

$$
\mathrm{Regret}(T) =\sum_{t=1}^TS(f(P_t),Y_t)-S(P_t,Y_t).
$$

*Proof.* Let $t\in\mathbb{N}$ and let $(P_t')_t\in\mathcal{P}$ be any expert. Conditional on $P_t$, $Y_t$ has parameter $f(P_t)$ and is independent of $P_t'$ by assumption. Hence, 

$$
\mathbb{E}\left[S(P_t',Y_t) \right]= \mathbb{E}\left[ \mathbb{E}[S(P_t',Y_t)\mid P_t,P_t'] \right]= \mathbb{E}\left[S(P_t',f(P_t)) \right].
$$

Next, since $S$ is proper, 

$$
\mathbb{E}\left[ S(P_t',f(P_t)) \right] \leq \mathbb{E}\left[ S(f(P_t),f(P_t))\right].
$$

 It follows that 

$$
\max_{(P'_t)_t\in\mathcal{P}} \mathbb{E}\left[ S(P_t',Y_t) \right]=\max_{(P'_t)_t\in\mathcal{P}}\mathbb{E}\left[ S(P_t',f(P_t)) \right]\leq\mathbb{E}\left[ S(f(P_t),f(P_t))\right]=\mathbb{E}\left[ S(f(P_t), Y_t)\right].
$$

Moreover, $(f(P_t))_t\in\mathcal{P}$, as $f(P_t)$ is constant given $P_t$ and thus independent of $Y_t$.

It follows that, for any $t\in\mathbb{N},$ $P^*_t\in\mathop{\mathrm{arg\,max}}_{(P_t')_t\in \mathcal{P}}\mathbb{E}[S(P'_t,Y_t)]$, and thus 

$$
\mathrm{Regret}(T)=\sum_{t=1}^TS(f(P_t),Y_t)-S(P_t,Y_t).
$$

◻

If $S$ is unbounded (such as the log scoring rule), then the agent's scores can become arbitrarily low, and the limit of $\frac{1}{T}\mathrm{Regret}(T)$ may be undefined. To simplify our analysis, we will thus assume that there is a bound on the variance of the received score $S(P'_t,Y_t)$ and on the expected score $S(P'_t,f(P_t))$ of both the agent $(P_t)_t$ and the best expert $(P^*_t)_t$. In the case of the log scoring rule, this would be satisfied, for instance, if the agent's predictions are bound away from $0$ and $1$.

Our next proposition shows that, given these assumptions, the limit $\lim_{T\rightarrow\infty}\frac{1}{T}\mathrm{Regret}(T)$ exists and is nonnegative, and sublinear regret is equivalent to $\lim_{t\rightarrow\infty}\frac{1}{T}\mathrm{Regret}(T)=0.$

**Proposition 11**. *Let *$S$* be a proper scoring rule. Assume that *$\sup_t |S(P'_t,f(P_t))|<\infty$* and that *$\sup_t \mathrm{Var}(S(P'_t,Y_t))<\infty$* for *$P'_t\in\{P_t,f(P_t)\}$*. Then almost surely *

$$
\lim_{T\rightarrow\infty}\frac{1}{T}\mathrm{Regret}(T)=\lim_{T\rightarrow\infty}\frac{1}{T}\sum_{t=1}^TS(f(P_t),f(P_t)) - S(P_t,f(P_t))\geq 0.
$$

*In particular, almost surely both limits exist and are finite, and the agent has sublinear regret if and only if *

$$
\lim_{T\rightarrow\infty}\frac{1}{T}\sum_{t=1}^TS(f(P_t),f(P_t)) - S(P_t,f(P_t))=0.
$$

*Proof.* In Appendix B. ◻

Now we turn to the main result for this section. We show that given our assumptions, agents have sublinear regret if and only if their prediction error is sublinear. Note that here, we do *not* require the $P_t$ to converge; they could also oscillate between different fixed points.

**Theorem 12**. *Let *$(P_t)_t$* be the sequence of the agent's predictions and *$S$* a strictly proper scoring rule. Assume that *$\sup_t \mathrm{Var}(S(P'_t,Y_t))<\infty$* for *$P'_t\in\{P_t,f(P_t)\}$*, and assume that there exists a compact set *$\mathcal{C}\subseteq[0,1]$* such that *$P_t\in\mathcal{C}$* for all *$t$* and *$S(p,f(p))$*, *$S(f(p),f(p)),$* and *$f(p)$* are continuous in *$p$* at any *$p\in \mathcal{C}$*. Then almost surely the agent has sublinear regret if and only if *$\sum_{t=1}^T |f(P_t)-P_t|$* is sublinear, i.e., if *$\lim_{t\rightarrow\infty}\frac{1}{T}\sum_{t=1}^T |f(P_t)-P_t|=0$*.*

*Proof.* In Appendix C. ◻

The next result shows that if the agent's probabilities converge to some probability $p$, then $p$ must be a fixed point.

**Corollary 13**. *In addition to the assumptions from Theorem 12, assume that *$P_t$* converges almost surely to a limit *$\lim_{t\rightarrow\infty} P_t=p^*$*. Then almost surely *$p^*$* is a fixed point if and only if the agent has sublinear regret.*

*Proof.* By Theorem 12, almost surely the agent has sublinear regret if and only if 

$$
\lim_{t\rightarrow\infty}\frac{1}{T}\sum_{t=1}^T |f(P_t)-P_t|=0.
$$

It remains to show that, given that the $P_t$ converge, the latter is equivalent to convergence to a fixed point.

Since $\mathcal{C}$ is compact and $P_t\in\mathcal{C}$ for all $t\in\mathbb{N},$ also $p^*\in\mathcal{C}.$ Hence, $f$ is continuous at $p^*,$ so 

$$
|f(p^*)-p^*| =\left|f\left(\lim_{t\rightarrow\infty}P_t\right)-\lim_{t\rightarrow\infty}P_t\right| =\lim_{t\rightarrow\infty}|f(P_t)-P_t|.
$$

Since this sequence converges, it is equal to its [Cesàro mean](https://proofwiki.org/wiki/Ces%C3%A0ro_Mean),

$$
\lim_{t\rightarrow\infty}|f(P_t)-P_t| =\lim_{T\rightarrow\infty}\frac{1}{T}\sum_{t=1}^T|f(P_t)-P_t| .
$$

Hence, 

$$
|f(p^*)-p^*| =\lim_{t\rightarrow\infty}|f(P_t)-P_t| =\lim_{T\rightarrow\infty}\frac{1}{T}\sum_{t=1}^T|f(P_t)-P_t| .
$$

 It follows that, if $\lim_{t\rightarrow\infty}P_t=p^*,$ then 

$$
|f(p^*)-p^*|=0\Leftrightarrow \lim_{T\rightarrow\infty}\frac{1}{T}\sum_{t=1}^T|f(P_t)-P_t|=0.
$$

This shows that, almost surely, $p^*$ is a fixed point, if and only if $\sum_{t=1}^T|f(P_t)-P_t|$ is sublinear. ◻

7\. Prediction markets
======================

Lastly, we consider prediction markets. We assume a simplified model of a prediction market, in which traders submit a single prediction and get scored using a proper scoring rule. The prediction that is output by the market and that influences the outcome is just a weighted average of the individual traders' predictions. In this situation, if a trader has a small weight and can thus barely influence the market prediction, the trader's score will mostly be determined by the accuracy of the report, rather than the influence of the report on the market. Thus, if all traders are small relative to the market, the equilibrium prediction will be close to a fixed point.

A similar result was shown by [Hardt et al. (2022)](https://arxiv.org/pdf/2203.17232.pdf) in the performative prediction context. They define a firm's performative power as the degree to which the firm can influence the overall outcome with their prediction. Hardt et al. (2022) show that in an equilibrium, the distance between a player's (performatively optimal) equilibrium strategy and their strategy when optimizing loss against the fixed equilibrium distribution (here, this means predicting the market probability) is bounded by the power of the trader. We give an analogous result for our formal setting and assumptions.

To formalize the setting, assume that there are $n$ players. We associate with each player $i$ a number $w_i\in[0,1]$ such that $\sum_jw_j=1$, representing, intuitively, what fraction of the overall capital in the market is provided by player $i$. In the game, all players simultaneously submit a probability $p_i$. Then the event $Y$ occurs with probability $q=f(\sum_jw_jp_j)$. Finally, each player is scored in proportion to $S(p_i,Y)$ for some strictly proper scoring rule $S$. Typical market scoring rules would consider terms like $S(p_i,Y)-S(p_j,Y),$ but subtracting $S(p_j,Y)$ (or multiplying by constants) does not matter for the game. We assume that players maximize their expected score, $\mathbb{E}[S(p_i,Y)]=S(p_i,f(\sum_jw_j p_j)).$

For discussions of market scoring rules, see [Hanson 2003](https://link.springer.com/article/10.1023/A:1022058209073) and [Sami and Pennock 2007](https://www.algo.cs.uni-frankfurt.de/lehre/agt/material/Algorithmic_Game_Theory.pdf#page=672). Prior work has connected these market scoring rules to more realistic prediction markets that trade Arrow--Debreu securities markets such as PredictIt ([Hanson 2003](https://link.springer.com/article/10.1023/A:1022058209073); [Hanson 2007](http://www.ubplj.org/index.php/jpm/article/view/417/448); [Pennock and Sami 2007](https://www.algo.cs.uni-frankfurt.de/lehre/agt/material/Algorithmic_Game_Theory.pdf#page=672), Ch. 4; [Chen and Pennock 2007](https://arxiv.org/abs/1206.5252); [Agrawal et al. 2009](https://dl.acm.org/doi/pdf/10.1145/1566374.1566412); [Chen and Vaughan 2010](https://dl.acm.org/doi/pdf/10.1145/1807342.1807372)).

We assume that $f$ is common knowledge. Moreover, in the following we only consider pure strategy equilibria, and we do not investigate the existence of equilibria.

**Theorem 14**. *Let *$S$* be a proper scoring rule and let *$G,g$* as in the Gneiting and Raftery characterization. Let *$\mathbf p$* be a pure strategy Nash equilibrium of the game defined above and let *$\hat{p}:=\sum_j w_jp_j$* be the market prediction. Assume *$f$* is differentiable at *$\hat{p}$*. For any player *$i$*, if *$G,g$* are differentiable at *$p_i$* and *$g'(p_i)\neq 0,$* it follows that *

$$
\left|f\left(\hat{p}\right)-p_i\right|\leq \left|\frac{w_if'\left(\hat{p}\right)g(p_i)}{g'(p_i)}\right|.
$$

*Whenever *$p_i\notin \{0,1\}$*, the bound is tight.*

In particular, this theorem shows that players $i$ with very low $w_i$ (little capital/influence on $q$) will accurately predict $f(\hat{p})=f(\sum_j w_jp_j)$. Note, however, that $\hat{p}$ is not necessarily a fixed point or close to a fixed point. If there are are also players $i$ with very high $w_i$, then their prediction and the overall market prediction may be wrong. (So interestingly the overall market probability $\sum_jw_jp_j$ is worse than the prediction of individuals. One might take this to suggest that anyone interested in $q$ should look at the latter type of predictions. Of course, if this is what everyone does, it is not so clear anymore that the model $q=f(\sum_jw_jp_j)$ is accurate.)

*Proof.* The proof is analogous to the proof of Proposition 9 in our [previous post](https://www.alignmentforum.org/posts/Aufg88v7mQ2RuEXkS/proper-scoring-rules-don-t-guarantee-predicting-fixed-points).

For $\mathbf p$ to be a pure strategy Nash equilibrium, each player must play a best response to the other player's strategies. That is, $p_i$ must be a global maximum of the function $p_i\mapsto S(p_i,\sum_{j}w_jp_j)$. Therefore, the derivative of this function must be zero if $p_i\in(0,1)$ and positive/negative if $p_i=1$/$p_i=0$.

The derivative is 

$$
\begin{aligned}    \frac{d}{dp_i} S\left(p_i,f\left(\sum_j w_jp_j\right)\right)    &=& \frac{d}{dp_i} \left(g(p_i)\left(f\left(\sum_j w_jp_j\right)-p_i\right)+G(p_i)\right)\    &=& \frac{d}{dp_i} \left(g(p_i)\left(f\left(\sum_j w_jp_j\right)-p_i\right)\right)+g(p_i)\    &=& g'(p_i)\left(f\left(\hat{p}\right)-p_i\right)+g(p_i)w_if'\left(\hat{p}\right). \end{aligned}
$$

Now, if $p\in (0,1)$, we have 

$$
0= \frac{d}{dp}S(p,f(p)) = g'(p_i)\left(f\left(\hat{p}\right)-p_i\right)+g(p_i)w_if'\left(\hat{p}\right).
$$

Rearranging terms and taking the absolute value, it follows 

$$
|f(\hat{p})-p_i| =\left| \frac{w_if'(\hat{p})g(p_i)}{g'(p_i)}\right|.
$$

Next, assume $p_i=0$ is the optimal report for player $i.$ Then we must have 

$$
0\leq\frac{d}{dp}S(p,f(p))=g'(p_i)\left(f\left(\hat{p}\right)-p_i\right)+g(p_i)w_if'\left(\hat{p}\right).
$$

By Theorem 1, $G$ is convex and thus $g'(p)\geq 0.$ Hence, the above is equivalent to $p_i-f(\hat{p}) \geq w_if'(\hat{p})g(p_i)/g'(p_i)$. Since $p_i=0$, it follows $p_i-f(\hat{p})\leq 0$. Hence, $\lvert p_i-f(\hat{p}) \rvert \leq \left\lvert \frac{w_if'(\hat{p})g(p_i)}{g'(p_i)}\right\rvert.$

Finally, if $p=1$, then analogously $p_i-f(\hat{p}) \leq w_if'(\hat{p})g(p_i)/g'(p_i),$ and since $p=1,$ it follows again $\lvert p_i-f(\hat{p})\rvert \leq \left\lvert \frac{w_if'(\hat{p})g(p_i)}{g'(p_i)}\right\rvert.$ This concludes the proof. ◻

**Corollary 15**. *In addition to the assumptions from Theorem 14, assume that *$f$* is Lipschitz-continuous and that *$C:=\sup_{p\in [0,1]}\left|\frac{g(p)}{g'(p)}\right|<\infty.$* Let *$\mathbf{p}$* be a Nash equilibrium and let *$\epsilon>0$* arbitrary. Then there exists a *$\delta>0$* such that if for all *$i$*, *$w_i<\delta,$* all of *$p_i$* and *$f(p_i)$*, for all *$i$*, as well as *$\sum_jw_jp_j$* and *$f(\sum_jw_jp_j),$* are within *$\epsilon$* of each other.*

*Proof.* Let $\epsilon>0$ arbitrary. Let $L$ be the Lipschitz constant of $f$ and note that then $|f'(p)|\leq L$ for all $p\in[0,1].$ By Theorem 14, it follows for $\hat{p}:=\sum_jw_jp_j$ and any player $i$ that 

$$
|f(\hat{p})-p_i|\leq w_iLC.
$$

Now let $\lambda:=\min(\{1,\frac{1}{L}\})$ and $\delta:=\frac{\epsilon\lambda}{4CL}.$ Then, assuming $w_i<\delta$ for all $i,$ it follows 

$$
|f(\hat{p})-p_i|\leq \delta LC\leq \frac{\lambda}{4}\epsilon.
$$

Moreover, since $\hat{p}$ is a convex combination of probabilities $p_i,$ it follows that also 

$$
|f(\hat{p})-\hat{p}| \leq \max_i |f(\hat{p})-p_i|\leq \frac{\lambda}{4}\epsilon.
$$

Thus, by the triangle equality, we have $|p_i-\hat{p}|\leq \frac{2\lambda }{4}\epsilon,$ and since $f$ is Lipschitz-continuous,

$$
|f(\hat{p})-f(p_i)| \leq L|\hat{p}-p_i|\leq L\frac{2\lambda}{4}\epsilon\leq \frac{1}{2}\epsilon
$$

for any $i.$

This shows that all of $p_i,\hat{p}, f(p_i)$ are within $\frac{1}{2}\epsilon$ of $f(\hat{p})$ and thus by the triangle inequality within $\epsilon$ of each other. This concludes the proof. ◻

It would be interesting to extend these results. For example, it's already not so clear if the players make predictions *repeatedly*. (To keep things simple, one should probably still imagine that all players know $f$ and that the environment probability is determined by $f$ applied to the majority forecast. If the traders have private information, prediction markets become harder to analyze. For some discussions, see [Ostrovsky 2012](https://onlinelibrary.wiley.com/doi/epdf/10.3982/ECTA8479), [Chen and Waggoner 2016](https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=7782936).)

Appendix A. Proof of Theorem 8
==============================

We use the following theorem, adapted from "Iterative Solution of Nonlinear Equations in Several Variables" ([Ortega and Rheinboldt, 2000](https://epubs.siam.org/doi/book/10.1137/1.9780898719468)).

**Theorem 16** (Ostrowski). *Assume that *$\varphi\colon D\subseteq\mathbb{R}^n\rightarrow\mathbb{R}^n$* has a fixed point *$x^*\in \mathrm{int}(D)$* and is continuously differentiable at *$x^*$*. If *$|\mu|<1$* for all eigenvalues *$\mu$* of *$\varphi'(x^*)$*, then there exists an open set *$U\subseteq D$* with *$x^*\in U$* such that for any *$x^0\in U$*, letting *$x^k=\varphi(x^{k-1})$* for *$k\in\mathbb{N},$* it is *$x^k\in U$* for all *$k$* and *$x^k$* converges at least linearly to *$x^*$*.*

To begin, assume that $p^*\in [0,1]$ is a fixed point of $f$, that $f$ is continuously differentiable at $p^*$, and that $f'(p^*)<1$. Moreover, let $G,g$ as in the Gneiting and Raftery representation of $S$, and assume that $G$ is twice continuously differentiable at $p^*$ and thus $G''=g'$ is continuous at $p^*$.

Define the function 

$$
\varphi\colon [0,1]\rightarrow \mathbb{R}, p\mapsto p+\alpha \nabla_p (S(p,\bot f(p))).
$$

Note that the agent's update rule is then $\tilde{\varphi}$ defined via $\tilde{\varphi}(p):=\min\{1,\max\{0,\varphi(p)\}\}$.

First, by Proposition 7, we know that for any $p^*\in [0,1],$ we have $\nabla_pS(p^*,\bot f(p^*))=g'(p^*)(f(p^*)-p^*)$, and if $p^*$ is a fixed point of $f$, we must have $g'(p^*)(f(p^*)-p^*)=0$ and hence $\varphi(p^*)=p^*$. Hence, $p^*$ is a fixed point of $\varphi$ and thus also of $\tilde{\varphi}$.

Now we will apply Theorem 16 to $\varphi$. To that end, let 

$$
\epsilon:= \nabla_p(\nabla_pS(p^*,\bot f(p^*))).
$$

Then 

$$
\epsilon =     \nabla_p(g'(p^*)(f(p^*)-p^*))     =g''(p^*)(f(p^*)-p^*)+g'(p^*)(f'(p^*)-1)     =g'(p^*)(f'(p^*)-1)
$$

since $f(p^*)=p^*.$ Moreover, by assumption, $g'(p^*)>0$ and $f'(p^*)<1$. Hence, it follows that $\epsilon=g'(p^*)(f'(p^*)-1)<0$.

Now note that 

$$
\varphi'(p^*) =\nabla_p(p+\alpha\nabla_p(S(p^*,\bot f(p^*))))=1 +\alpha\nabla_p(\nabla_p(S(p^*,\bot f(p^*))))=1+ \alpha\epsilon.
$$

Hence, for small enough $\alpha>0$, it is $|\varphi'(p^*)|<1.$ Moreover, by assumption, $g'(p^*)$ and $f'(p^*)$ are continuous, so also the derivative $\varphi'(p^*)=1+\alpha g'(p^*)(f'(p^*)-1)$ is continuous.

Now we can apply Ostrowski's theorem, which tells us that, if $p^*\in (0,1)$, there is an open set $U\subseteq (0,1)$ with $p^*\in U$, such that for any $p^0\in U$, the iterates $p^k=\varphi(p^{k-1})$ all lie in $U$ and $p^k$ converges at least linearly to $p^*$.

This shows that if $p^*$ is an interior point, we can choose $\alpha>0$ small enough to make sure that $F(U)\subseteq U \subseteq (0,1)$ and thus $\tilde{\varphi}=\varphi$ on $U$, and for $p^0\in U,$ the iteration $p^{k}=\tilde{\varphi}(p^{k-1})$ locally converges to $p^*$.

Now assume that $p^* =1$ (the proof for $p^*=0$ is analogous). We can extend the function $\varphi$ for values $p\in (1,\infty)$ by the [Whitney extension theorem](https://en.wikipedia.org/wiki/Whitney_extension_theorem). This theorem tells us that if $\varphi$ is continuously differentiable, then there also exists $\overline{\varphi}\colon (0,\infty)\rightarrow\mathbb{R}$ such that $\varphi=\overline{\varphi}|_{[0,1]}$. We can then apply the above argument with Ostrowski's theorem to the function $\overline{\varphi}$. In particular, there exists an open subset $U\subseteq(0,\infty)$ with $p^*\in U$ such that for any $p^0\in U$, we have $p^k\in U$ for iterates $p^k=\overline{\varphi}(p^{k-1})$ and $\lim_{k\rightarrow\infty}p^k=p^*$. This also applies to any $p^0\in U\cap [0,1]$.

Now consider the actual update rule $\tilde{\varphi}$ with iterates $\tilde{p}^k=\tilde{\varphi}(\tilde{p}^{k-1})$ and $\tilde{p}^0=p^0\in (0,1]$. Let $k:=\inf\{k\mid p^k\in (1,\infty)\}$; i.e., this is the smallest $k$ such that an iterate is out of bounds and thus $p^k\neq \tilde{p}^k$. If $k=\infty$, then we are done. Otherwise, we have $\tilde{p}^k=\tilde{\varphi}(p^{k-1})=1=p^*$, so the actual update rule $\tilde{\varphi}$ also converges to its fixed point $p^*$ (potentially faster than $\overline{\varphi}$). This concludes the proof.

Appendix B. Proof of Proposition 11
===================================

We will use a version of the strong law of large numbers for uncorrelated random variables with bounded variance, adapted from [Neely (2021, Theorem 2)](https://viterbi-web.usc.edu/~mjneely/Borel-Cantelli-LLN.pdf).

**Theorem 17**. *Let *$\{X_t\}_{t\in\mathbb{N}_0}$* be a sequence of pairwise uncorrelated random variables with mean *$0$* and bounded variances. I.e., assume that*

$\mathbb{E}[X_t]=0$* for all *$t\in\mathbb{N}_0$

*There exists *$c>0$* such that *$\mathrm{Var}(X_t)\leq c$* for all *$t\in\mathbb{N}_0$

$\mathrm{Cov}(X_t,X_{t'})=0$* for all *$t\neq t'\in\mathbb{N}_0$*.*

*Then almost surely *

$$
\lim_{T\rightarrow\infty}\frac{1}{T}\sum_{t=1}^TX_t=0.
$$

We will apply this law to random variables $X_t:=S(P'_t,Y_t)-S(P'_t,f(P_t))$, where $P'_t$ is either $P_t$ or $f(P_t)$.

First, by Proposition 10, $\mathbb{E}[X_t]=\mathbb{E}[S(P'_t,Y_t)-S(P'_t,f(P_t))]=0$. Second, by assumption, 

$$
\sup_t\mathrm{Var}(S(P'_t,f(P_t)))<\infty.
$$

Hence, also 

$$
\sup_t\mathrm{Var}(S(P'_t,f(P_t)))= \sup_t\mathrm{Var}(\mathbb{E}[S(P'_t,f(P_t))\mid P_t]) \leq\sup_t\mathrm{Var}(S(P'_t,f(P_t))) <\infty.
$$

It follows that also $\sup_t \mathrm{Var}(X_t)<\infty$.

Third, we know that $Y_t$ is independent of $P_{t'}$ and $Y_{t'}$ for $t>t'$, conditional on $P_t$. Moreover, $P_t'$ is constant given $P_t$. Hence, given $P_t$, also $X_t=S(P'_t,Y_t)-S(P'_t,f(P_t))$ is independent of $X_{t'}$. Moreover, 

$$
\mathbb{E}[X_t\mid P_t] =\mathbb{E}[S(P'_t,Y_t)-S(P'_t,f(P_t))\mid P_t]= S(P'_t,f(P_t))-S(P'_t,f(P_t))=0.
$$

It follows for $t>t'$ that 

$$
\mathrm{Cov}(X_t,X_{t'}) =\mathbb{E}[X_t X_{t'}] =\mathbb{E}[\mathbb{E}[X_t X_{t'}\mid P_t]] =\mathbb{E}[\mathbb{E}[X_t \mid P_t] \mathbb{E}[X_{t'}\mid P_t]]=0.
$$

This shows all conditions of the theorem and thus shows that 

$$
\lim_{t\rightarrow\infty}\frac{1}{T}\sum_{t=1}^TX_t=0
$$

almost surely.

Now we turn to the limit of $\frac{1}{T}\sum_{t=1}^TS(P_t',f(P_t))$. By assumption, $\sup_t|S(P'_t,f(P_t))|<\infty$, so this limit exists and is finite. Thus, almost surely 

$$
\lim_{T\rightarrow\infty}\frac{1}{T}\sum_{t=1}^TS(P'_t,f(P_t))= \lim_{T\rightarrow\infty}\frac{1}{T}\sum_{t=1}^TS(P'_t,Y_t)-X_t
$$

$$
=\lim_{T\rightarrow\infty}\frac{1}{T}\sum_{t=1}^TS(P'_t,Y_t) -\lim_{T\rightarrow\infty}\frac{1}{T}\sum_{t=1}^TX_t =\lim_{T\rightarrow\infty} \frac{1}{T}\sum_{t=1}^TS(P'_t,Y_t).
$$

Using Proposition 10, it follows that almost surely 

$$
\lim_{T\rightarrow\infty}\frac{1}{T}\mathrm{Regret}(T) =\lim_{T\rightarrow\infty}\frac{1}{T}\sum_{t=1}^TS(f(P_t),Y_t)-S(P_t,Y_t) =\lim_{T\rightarrow\infty}\frac{1}{T}\sum_{t=1}^TS(f(P_t),Y_t)-\lim_{T\rightarrow\infty}\frac{1}{T}\sum_{t=1}^TS(P_t,Y_t)
$$

$$
=\lim_{T\rightarrow\infty}\frac{1}{T}\sum_{t=1}^TS(f(P_t),f(P_t))-\lim_{T\rightarrow\infty}\frac{1}{T}\sum_{t=1}^TS(P_t,f(P_t)) =\lim_{T\rightarrow\infty}\frac{1}{T}\sum_{t=1}^TS(f(P_t),f(P_t))-S(P_t,f(P_t)).
$$

Turning to the "in particular" part, note that this limit is finite by the above, and it is nonnegative since $S$ is assumed to be proper. Moreover, it follows that almost surely 

$$
\limsup_{T\rightarrow\infty}\frac{1}{T}\mathrm{Regret}(T) =\lim_{T\rightarrow\infty}\frac{1}{T}\mathrm{Regret}(T)\geq 0.
$$

 Thus, almost surely $\limsup_{T\rightarrow\infty}\frac{1}{T}\mathrm{Regret}(T)\leq 0$ if and only if $\lim_{T\rightarrow\infty}\frac{1}{T}\sum_{t=1}^TS(f(P_t),f(P_t))-S(P_t,f(P_t))=0.$ This concludes the proof.

Appendix C. Proof of Theorem 12
===============================

We begin by proving a lemma.

**Lemma 18**. *Let *$\varphi,\psi\colon\mathbb{N}\rightarrow[0,\infty)$* and assume there exists a constant *$C>0$* such that for all *$t\in\mathbb{N},$* we have *$\psi(t)\leq C.$* Assume that for any *$\epsilon>0$*, there exists *$\delta>0$* such that if *$\psi(t)>\epsilon$* for any *$t\in\mathbb{N}$*, then *$\varphi(t)>\delta$*. Then *

$$
\lim_{T\rightarrow\infty}\frac{1}{T}\sum_{t=1}^T\varphi(t)=0 \Rightarrow \lim_{T\rightarrow\infty}\frac{1}{T}\sum_{t=1}^T\psi(T)=0.
$$

*Proof.* We prove the contrapositive. That is, we assume that there exists some constant $c>0$ such that there are infinitely many $T\in\mathbb{N}$ such that $\frac{1}{T}\sum_{t=1}^T\psi(T)>c$. Let $\mathcal{T}$ be the set of such $T$. We show that then there exists a constant $c'>0$ such that for infinitely many $T$, $\frac{1}{T}\sum_{t=1}^T\varphi(T)>c'$.

Let $T\in\mathcal{T}$. Since by assumption $\frac{1}{T}\sum_{t=1}^T\psi(T)>c,$ it follows that $\sum_{t=1}^T\frac{\psi(T)}{c}>T.$ Let $C':=\max\{C,1/c\}+1$. Since $\psi(T)<C'$ it must be $\psi(T)>\frac{c}{2C}$ for more than $\frac{c}{2C}$ fraction of the times $t\leq T$. Otherwise, it would be 

$$
\sum_{t=1}^T\frac{\psi(T)}{c} \leq T\left(\frac{C}{c}\frac{c}{2C} + \left(1-\frac{c}{2C}\right) \frac{\epsilon}{2C}\right) \leq T(\frac{1}{2} + \frac{\epsilon}{2C})<T.
$$

By assumption, this gives us a $\delta>0$ such that whenever $\psi(T)>\epsilon:=\frac{c}{2C}$, also $\varphi(T)>\delta$. In particular, this applies to at least $\epsilon$ fraction of $t\leq T$. Hence, it follows that for any $T\in\mathcal{T}$, 

$$
\sum_{t=1}^T\varphi(t) \geq \delta \epsilon T.
$$

 This shows that there are infinitely many $T$ such that $\frac{1}{T}\sum_{t=1}^T\varphi(t)>\delta \epsilon$ and thus concludes the proof. ◻

Now we turn to the main proof.

*Proof of Theorem 12.* Let $(P_t)_t$ be the sequence of the agent's predictions. Assume $S$ is strictly proper, assume that $\sup_t \mathrm{Var}(S(P'_t,Y_t))<\infty$ for $P'_t\in\{P_t,f(P_t)\},$ and assume that there exists a compact set $\mathcal{C}\subseteq[0,1]$ such that $P_t\in\mathcal{C}$ for all $t$, and $S(p,f(p)),$ $S(f(p),f(p)),$ and $f(p)$ are continuous in $p$ at any $p\in \mathcal{C}$.

To begin, note that continuity of $S(p,f(p))$ and $S(f(p),f(p))$ implies that both are also bounded on $\mathcal{C}$ and thus $\sup_t|S(P'_t,f(P_t))|<\infty$ for $P'_t\in \{P_t,f(P_t)\}$. Hence, by our assumptions, the conditions for Proposition 11 are satisfied.

"$\Rightarrow$". Assume $\mathrm{Regret}(T)$ is sublinear. We want to show that then $\sum_{t=1}^T |f(P_t)-P_t|$ is sublinear. To do this, we will apply Lemma 18.

To begin, define $\varphi(t):=S(f(P_t),f(P_t))-S(P_t,f(P_t))$ and note that $\varphi(t)\geq 0$ since $S$ is proper. By Proposition 11, it follows that if $\mathrm{Regret}(T)$ is sublinear, also $\sum_{t=1}^T\varphi(t)$ is sublinear almost surely. For brevity, we omit the "almost surely" qualification in the following.

Next, define $\psi(t):=|f(P_t)-P_t|$, and note that $0\leq \psi(t)\leq 1$. Next, let $\epsilon>0$ arbitrary. To apply Lemma 18 to $\varphi$ and $\psi$, it remains to show that there exists $\delta>0$ such that whenever $\psi(t)\geq\epsilon$, then $\varphi(t)\geq \delta$.

To that end, let 

$$
\delta:=\min_{\{p\in\mathcal{C}\mid |p-f(p)|\geq\epsilon\}}S(f(p),f(p))-S(p,f(p)).
$$

 Since $f$ is continuous for any $p\in\mathcal{C}$, the set $\{p\in\mathcal{C}\mid |p-f(p)|\geq \epsilon\}$ is compact. Moreover, $S(f(p),f(p))$ and $S(p,f(p))$ are continuous by assumption, and thus the minimum is attained at some point $\hat{p}\in\mathcal{C}$. But since $S$ is strictly proper, it follows $\delta=S(f(\hat{p}),f(\hat{p}))-S(\hat{p},f(\hat{p}))>0.$ Hence, since $P_t\in \mathcal{C}$ for any $t\in\mathbb{N},$ it follows that whenever $\varphi(t)\geq \epsilon,$ it follows

$$
\varphi(t)=S(f(P_t),f(P_t))-S(P_t,f(P_t))\geq \delta.
$$

This shows all conditions for Lemma 18. Hence, we conclude that $\lim_{t\rightarrow\infty}\frac{1}{T}\sum_{t=1}^T|f(P_t)-P_t|=0$.

"$\Leftarrow$". Let $\varphi(t):=|f(P_t)-P_t|$ and $\psi:=S(f(P_t),f(P_t))-S(P_t,f(P_t))$. We assume that $\sum_{t=1}^T\varphi(t)$ is sublinear in $T$ and want to show that then $\mathrm{Regret}(T)$ is sublinear as well. To do so, we will show that $\sum_{t=1}^T\psi(t)$ is sublinear using our lemma, and then the required statement follows again from Proposition 11.

Now we have to show the conditions of the lemma. First, as before, $\varphi(t)\geq 0$ and $\psi(t)\geq 0.$ Second, as noted in the beginning, we have $\sup_{t}\psi(t)<\infty$ by our assumption that $S(f(p),f(p))$ and $S(p,f(p))$ are continuous on $\mathcal{C}.$ Now let $\epsilon>0$ arbitrary. Assume that $S(f(P_t),f(P_t))-S(P_t,f(P_t))>\epsilon$ for some $\epsilon>0$ and $t\in\mathbb{N}.$

Consider the set $\mathcal{C}':=\{p\in\mathcal{C}\mid S(f(p),f(p))-S(p,f(p))\geq\epsilon\}$. Since $S(f(p),f(p))$ and $S(p,f(p))$ are continuous on $\mathcal{C}$ by assumption, this set is compact. Moreover, the function $p\in\mathcal{C}\mapsto |p-f(p)|$ is continuous since $f$ is continuous on $\mathcal{C}$ by assumption. Hence, the minimum $\delta:=\min_{p\in \mathcal{C}'}|p-f(p)|$ is attained at some point $\hat{p}\in\mathcal{C}'.$

Now, if $\delta=0,$ we would have $\hat{p}=f(\hat{p})$ and thus 

$$
S(f(\hat{p}),f(\hat{p}))-S(\hat{p},f(\hat{p}))= S(\hat{p},\hat{p})-S(\hat{p},\hat{p}) =0<\epsilon,
$$

 which is a contradiction. Hence, $\delta>0.$ Since $P_t\in\mathcal{C},$ it follows from $S(f(P_t),f(P_t))-S(P_t,f(P_t))\geq\epsilon,$ for $t\in\mathbb{N}$ that $|P_t-f(P_t)|\geq \delta.$ This shows the third condition for the lemma. We can thus conclude that $\lim_{T\rightarrow\infty}\frac{1}{T}\sum_{t=1}^T\psi(t)=0.$ Using Proposition 11, this concludes the proof. ◻

Appendix D. Armstrong's backwards-facing oracle
===============================================

Here, we analyze a version of [Armstrong (2018)](https://www.alignmentforum.org/posts/hJaJw6LK39zpyCKW6/standard-ml-oracles-vs-counterfactual-ones)'s backwards-facing oracle. This is a version of the online learning setup from Section 5 in which the agent’s prediction $P_{t+1}$ is trained to minimize the average historical loss,

$$
\mathcal{L}_t(p): =\frac{1}{t}\sum_{t'=1}^t -S(p,Y_{t'}).
$$

We consider training via gradient descent and let $P_{t+1}=\Pi(P_{t}-\alpha\nabla_p\mathcal{L}_{t}(P_t))$ for some learning rate $\alpha.$

In the following, we show that, if this learning scheme converges to a point $p^*\in(0,1),$ then $\nabla_p(S(p^*, \bot f(p^*)))=0.$ Afterwards, we conclude from Proposition 7 that $p^*$ must be a fixed point (assuming that $g'(p^*)\neq0$).

 **Proposition 19**. *Assume *$P_{t+1}=\Pi(P_{t}-\alpha\nabla_p\mathcal{L}_{t}(P_t))$* for *$t\in\mathbb{N}$* are the agents predictions and *$\lim_{t\rightarrow\infty}P_t=p^*$* almost surely for some *$p^*\in(0,1).$* Assume that *$f$* is continuous and that *$\partial_1 S(p,y)$* exists and is continuous for any *$p\in (0,1)$* and *$y\in \{0,1\}$*. Then *$\nabla_p(S(p^*, \bot f(p^*)))=0.$

*Proof.* To begin, note that since $p^*\in(0,1)$ we can choose a closed interval $I\subseteq (0,1)$ such that $p^*\in \mathrm{int}(I)$. By assumption, $\partial_1 S(p,y)$ is continuous and thus bounded for $p\in I,y\in \{0,1\}$. For each $t$, let $Q_t$ be the projection of $P_t$ onto $I$. Finally, let $\mathcal{L}(p) = -S(p,f(p^*))$.

We will show the following:

1.  $\mathbb{E}\left[\nabla \mathcal{L}_t(Q_t)\right] \rightarrow 0$ as $t \rightarrow \infty$
2.  for all $p \in (0,1)$, $\mathbb{E} \left[ \nabla \mathcal{L}_t(p) \right] \rightarrow \nabla \mathcal{L}(p)$ as $t \rightarrow \infty$
3.  $\mathbb{E} \left[ \nabla \mathcal{L}_t(Q_t) \right] \rightarrow \nabla \mathcal{L}(p^*)$ as $t \rightarrow \infty$

from which it follows that $\nabla \mathcal{L}(p^*) = 0$.

**1. “**$\mathbb{E}\left[\nabla \mathcal{L}_t(Q_t)\right] \rightarrow 0$** as **$t \rightarrow \infty$**”.** Note that there almost surely exists some $T$ such that $P_t\in(0,1)$ and thus also $\nabla \mathcal{L}_t(P_t) = \frac{P_{t+1}-P_t}{\alpha}$ for all $t\geq T.$ Since $P_t \xrightarrow{\text{a.s.}} p^*$ as $t \rightarrow \infty,$ it follows that $\nabla \mathcal{L}_t(P_t) \xrightarrow{\text{a.s.}} 0$ as $t \rightarrow \infty$. Moreover, we have that almost surely $P_t \in I$ for $t$ sufficiently large, so that almost surely $P_t = Q_t$ and $\nabla \mathcal{L}_t(P_t) = \nabla \mathcal{L}_t(Q_t)$ for $t$ sufficiently large. Thus, almost surely, 

$$
\lim_{t\rightarrow \infty} \nabla \mathcal{L}_t(Q_t) = \lim_{t\rightarrow \infty} \nabla \mathcal{L}_t(P_t) = 0.
$$

Finally, since $\nabla \mathcal{L}_t(Q_t)$ is bounded, we have by the dominated convergence theorem that $\nabla \mathcal{L}_t(Q_t) \xrightarrow{L^1} 0$ and as a consequence,

$$
\lim_{t\rightarrow \infty}\mathbb{E}\left[\nabla \mathcal{L}_t(Q_t)\right] = 0.
$$

**2\. “for all **$p \in (0,1)$**, **$\mathbb{E} \left[ \nabla \mathcal{L}_t(p) \right] \rightarrow \nabla \mathcal{L}(p)$** as **$t \rightarrow \infty$**”.** We have that 

$$
\begin{aligned}    \mathbb{E} \left[ \nabla \mathcal{L}_t(p) \right]&= -\frac{1}{t}\sum_{t'=1}^t\mathbb{E}\left[\partial_1 S(p,Y_{t'})\right]    = -\frac{1}{t}\sum_{t'=1}^t \mathbb{E}\left[\mathbb{E}\left[\partial_1 S(p,Y_{t'})\middle\vert P_{t'}\right]\right]\    &= -\frac{1}{t}\sum_{t'=1}^t \mathbb{E}\left[(1-f(P_{t'}))\partial_1 S(p,0) + f(P_{t'}) \partial_1 S(p,1) \right]\    &= -\left(1 - \frac{\sum_t \mathbb{E}f(P_{t'})}{t}\right) \partial_1 S(p,0) - \frac{\sum_t \mathbb{E}f(P_{t'})}{t} \partial_1 S(p,1) \end{aligned}
$$

Since $f$ is continuous, we have $f(P_t) \xrightarrow{\text{a.s.}} f(p^*)$. Then, by compactness, we have that $f$ is bounded on $[0,1]$. Finally, by the dominated convergence theorem, we may conclude $\mathbb{E} f(P_t) \rightarrow f(p^*)$ as $t \rightarrow \infty$. As a consequence, $\frac{1}{t}\sum_{t'\leq t} \mathbb{E} f(P_{t'}) \rightarrow f(p^*)$ as $t \rightarrow \infty$.

Thus, 

$$
\lim_{t\rightarrow \infty}\mathbb{E} \left[ \nabla \mathcal{L}_t(p)\right] = -(1-f(p^*))\partial_1 S(p,0) - f(p^*)\partial_1 S(p,1) = -\partial_1S(p, f(p^*)) = \nabla  \mathcal{L}(p)
$$

**3. “**$\mathbb{E} \left[ \nabla \mathcal{L}_t(Q_t) \right] \rightarrow \nabla \mathcal{L}(p^*)$** as **$t \rightarrow \infty$**”.** Note that 

$$
|\nabla \mathcal{L}_t(Q_t) - \nabla \mathcal{L}_t(p^*)| \leq \max_{y}\left\vert\partial_1 S(Q_t,y) - \partial_1 S(p^*,y)\right\vert \xrightarrow{\text{a.s.}} 0
$$

as $t \rightarrow \infty$, since $\partial_1 S(p,1)$ and $\partial_1 S(p,0)$ are both continuous functions of $p$ on $I$.

Finally, by the dominated convergence theorem and our second result,

$$
\lim_{t\rightarrow \infty}\mathbb{E} \left[ \nabla \mathcal{L}_t(Q_t)\right] = \lim_{t\rightarrow \infty}\mathbb{E} \left[ \nabla \mathcal{L}_t(p^*)\right] = \nabla \mathcal{L}(p^*).
$$

And we are done. ◻

**Corollary 20**. *Assume *$S$* is proper and let *$G,g$* as in the Gneiting and Raftery characterization (Theorem 1) be continuously differentiable at any *$p\in (0,1).$* Assume *$f$* is continuous, *$P_t$* as defined above converges to some prediction *$p^*\in (0,1)$* almost surely, and *$g'(p^*)\neq 0.$* Then *$p^*$* is a fixed point of *$f$*.*

*Proof.* By Proposition 7, we have $\partial_1S(p,y)=g'(p)(y-p)$ for any $y\in \{0,1\},p\in (0,1).$ Thus, since $G''=g'$ is continuous by assumption, also $\partial_1S(p,y)$ is continuous. Hence, by Proposition 19, it follows that $\nabla_p(S(p^*, \bot f(p^*)))=0.$ By Proposition 7, it follows that $p^*$ is a fixed point of $f$. ◻