# AISC team report: Soft-optimization, Bayes and Goodhart

*This is a report on our work in* [*AISC Virtual 2023*](https://aisafety.camp/)*.*

For AISC 2023, our team looked into the foundations of soft optimization. Our goal at the beginning was to investigate variations of the original quantilizer algorithm, in particular by following intuitions that uncertainty about goals can motivate soft optimization. We ended up spending most of the time discussing the foundations and philosophy of agents, and exploring toy examples of Goodhart’s curse. 

Our discussions centered on the form of knowledge about the utility function that an agent must have, such that expected utility maximization isn’t the correct procedure (from the designer's perspective). With well-calibrated beliefs about the true utility function, it’s always optimal to do Expected Utility maximization. However, there are situations where an agent is very sensitive to prior specification, and getting this wrong can have a large impact on the true utility achieved by the agent. Several other unrelated threads were pursued, such as an algorithm with high probability of above-threshold utility, and the relationship between SGD and soft optimization.

The Bayesian view on Goodhart's law
===================================

Goodhart's Law states that when maximizing an approximation of a *true utility* function, which we call *proxy utility* function, this leads to outcomes that are much less valuable than predicted by the proxy utility function. There is a Bayesian perspective from which it doesn't look like Goodhart's law will be a problem at all, namely if the agent has correct beliefs about the quality of the approximation. An ideal rational agent would represent the information they have about the world with a probability distribution that they arrived at by Bayesian reasoning. We assume that they represent their goals as a utility function over world states or as a belief distribution over such utility functions. Thus, they select actions by maximizing the expected utility over goals and world models.

If the agent was able to perfectly capture all available information about goals into an "ideal"[^f31pkv7jx3m] belief distribution, maximizing the utility in expectation over this distribution would be optimal.[^2w9iaf9czw6] It would avoid Goodhart’s law as much as possible given the agent's knowledge by anticipating any overestimation of the true utility function by the proxy utility function. In this section, we try to formalize this intuition. Sadly, Bayesian reasoning is intractable in practice, both because specifying the prior is difficult and because updating the distribution is computationally hard. This framing is explained in more detail in [Does Bayes Beat Goodhart?.](https://www.lesswrong.com/posts/YJq6R9Wgk5Atjx54D/does-bayes-beat-goodhart)[^spvmxx62hq]

Beliefs about values are difficult to deal with, because you may not have a reliable way to update these beliefs after deployment. In this situation the agent's behavior is heavily dependent on the way we specify the priors.

Setup and notation
------------------

We generally consider situations where an agent can choose a single action $a\in\mathcal A$ from some space $\mathcal A$. For that choice, we are interested in knowledge about the (true) utility function $v: \mathcal A \to \mathbb R$, $a\mapsto v(a)$ that we want the agent to maximize. The situation might include observed variables $\mathrm{Obs}$ and hidden variables $h$. The agent models each of them respectively by random variables $V$, $\textrm{Obs}$ and $H$. We denote the ideal prior belief distribution, without prior misspecification or compute limitation, by $\phi(V, \textrm{Obs}, H)$. We denote the belief distribution that the agent estimated by $\widetilde \phi(V, \textrm{Obs}, H)$.[^fptph4ioko4] Hidden variables are used in some of our toy examples to provide better intuition about the problem. The observed variables $\textrm{Obs}$ could for example be a dataset such as that containing human preferences used to train the reward model in RLHF. But in this post the observed variable is always a proxy utility function $\textrm{Obs} = U$. We write $E := U-V$ for the "error" random variable that indicates the error between the proxy utility and true utility functions. 

Goodhart's law
--------------

[Goodhart’s law](https://arxiv.org/pdf/1803.04585.pdf) can be formalized in different ways; here we focus on “regressional Goodhart”. We will model the situation where the difference between the true and proxy utilities for a given action $a$ is given by an error term $E(a)$:

$U(a)=V(a)+E(a)$

We will now assume that the proxy utility function is an unbiased estimator of the true utility function, i.e. $\mathbb E_{\phi(U|V=v)} U = v$, or equivalently that the error function is the zero function in expectation, i.e. $\mathbb E_{\phi(E|V=v)} E = 0$.

In expectation over $\phi(V)$ and evaluated at any action $a\in\mathcal A$, this yields

$\mathbb E_{\phi(V,U)} \underbrace{U(a)}_\textrm{estimate of $V(a)$} = \mathbb E_{\phi(V)}V(a) = \mathbb E_{\phi(V,U)}V(a)$.

However, this equality is not true if the fixed action $a$ is replaced with the action $A^\star$ that optimizes $U$, that is $A^\star = \arg\max_{a\in\mathcal A} U(a)$. Note here that $A^\star$ is itself now a random variable.

N​ow, we find that

$\mathbb E_{\phi(V)\phi(U|V)} \underbrace{U(A^\star)}_\textrm{estimate of $V(A^\star)$} \geq \mathbb E_{\phi(V)\phi(U|V)} V(A^\star)$

and the inequality is strict under mild assumptions[^4bbucwz2b4s], e.g. in all of our toy examples. Intuitively, $A^\star$ selects for positive error $E=U-V$ so that $E(A^\star) = U(A^\star)-V(A^\star)$ is positive in expectation.

So, the expected value $\mathbb E_{\phi(V)\phi(U|V)} V(A^\star)$ of the action selected by proxy maximization is lower than the proxy prediction $\mathbb E_{\phi(V)\phi(U|V)} U(A^\star)$, even though we assumed that U was an unbiased estimator. This is one way of stating the regressional variant of Goodhart's law.

How Bayes could beat Goodhart
-----------------------------

From a Bayesian perspective, the situation after observing the proxy utility function $U$ is best described by the conditional distribution $\phi(V|\mathrm{U=u})$. We will therefore look at the conditional expected true utility and write it as $f(u, a) = \mathbb E_{\phi(V|\mathrm{U=u})} V(a)$.

The Bayes-optimal action for belief $\phi$ is $A^\star_\mathrm{Bayes}(u) = \arg\max_{a\in\mathcal A} f(u, a)$. While $A^\star$ maximizes the proxy utility $U$, $A^\star_\mathrm{Bayes}$ maximizes the conditional expected true utility $f(U,a)$.

Just as is the case for $U$, this maximization objective also has the same expectation over $\phi(V,U)$, as the true utility function $V$. We can see this for any action $a\in\mathcal A$ as follows:

$\mathbb E_{\phi(V,U)} \underbrace{f(U, a)}_\textrm{estimate of $V(a)$} = \mathbb E_{\phi(V,U)} \mathbb E_{\phi(V'|U)} V'(a) = \mathbb E_{\phi(U)} \mathbb E_{\phi(V'|U)} V'(a) = \mathbb E_{\phi(V,U)} V(a) \text{.}$

But, in contrast to $U$, this equation also holds for the optimal action $A^\star_\mathrm{Bayes}$:

$\mathbb E_{\phi(V,U)} \underbrace{f(U, A^\star_\textrm{Bayes})}_\textrm{estimate of $V(A^\star_\textrm{Bayes})$} = \mathbb E_{\phi(V,U)} \mathbb E_{\phi(V'|U)} V'(A^\star_\textrm{Bayes}) = \mathbb E_{\phi(V,U)} V(A^\star_\textrm{Bayes}) \text{.}$

Intuitively, this is due to the fact that the distribution $\phi(V|U)$ used in the Bayesian maximization objective, which we used as approximation of $V$, is the same as the distribution from which $V$ is indeed sampled (at least according to the agent's best knowledge).

In this sense, "Bayes beats Goodhart". The Bayesian maximization objective $\mathbb E_{\phi(V|\mathrm{Obs})} V$ does not have the problem that by maximizing it, it ceases to be a good approximation of the true utility function $V$. As a consequence, the Bayesian maximization objective also doesn't suffer from Goodhart's law.

As a consequence of stochasticity in the belief distribution $\phi(V|U)$, the selected action might still turn out to perform poorly according to V, but it was the best the agent could have selected with its knowledge.

Why Bayes can't beat Goodhart
-----------------------------

However, we think that in practice an agent would not be able to access the ideal belief distribution $\phi$. This is firstly because specifying priors is notoriously difficult, and because optimal actions usually require pushing away from regions of action-space where we (the designers) have a lot of data about the true value, so an agent is always heavily reliant on prior information about the reliability of the proxy. And secondly, computational limitations might mean that the distribution $\phi(V|U)$ can't be computed exactly.

See Abram Demski’s post, [Does Bayes Beat Goodhart?](https://www.lesswrong.com/posts/YJq6R9Wgk5Atjx54D/does-bayes-beat-goodhart), for a more detailed discussion. We found that this topic was difficult to think about, and very philosophical.

Our best guess is that the prior has to capture all the meta-knowledge that is known to the designer, for instance about boundaries in action-space or outcome-space where there is a possibility of breaking the relationship between your proxy value and true value. One extreme example of such knowledge is deontological rules like "don't kill people". We are confused about exactly what are the desiderata for such a "correct" prior specification.

We explored examples related to this below, but don't feel like we have resolved our confusion completely yet. In the next sections we look at different types of concrete examples both with and without "objectively correct" beliefs.

What if the agent can access the ideal belief distribution?
===========================================================

In this section, we consider the scenario of an agent that is able to represent its beliefs about the true values and the errors of the proxy variable with an ideal belief distribution. We worked through several examples, some more general and some more specific, to get a better intuition about when and why regressional Goodhart can cause the most damage, and how the Bayesian approach fares.

The recent post [When is Goodhart catastrophic?](https://www.lesswrong.com/posts/fuSaKr6t6Zuh6GKaQ/regressional-goodhart-is-catastrophic-for-heavy-tailed) by Drake Thomas and Thomas Kwa contains an in-depth analysis of a similar scenario with emphasis on how errors are distributed in heavy-tailed vs light-tailed distributions.

The scenario
------------

For various actions, we observe the proxy values $u(a)$. Our goal is to use this information to choose the action with the highest expected value of $V(a)$. We will now assume that we know the prior distribution of the true values and the distribution of the error term, and that they are independent for each action.

By Bayes’ theorem, we can calculate then the distribution of $V(a)$ given an observed value $u$, using $\mathbb{P}[U(a) = u \mid V(a) = v] = \mathbb{P}[E(a) = u-v]$:

$\mathbb{P}[V(a) = v \mid U(a) = u] = \frac{\mathbb{P}[V(a) = v]\mathbb{P}[E(a) = u-v]}{\int{dv' \mathbb{P}[V(a) = v']\mathbb{P}[E(a) = u-v']}}.$

Given this distribution, it is now possible to calculate the expected value $\mathbb{E}[V(a) \mid U(a) = u]$ and use this value to compare policies instead of the naive method of optimizing the proxy $U(a)$. In other words, the rational choice of the action is

$a^* = \arg\max_{a \in \mathcal{A }} \mathbb{E}[V(a) \mid U(a) = u(a)]\text{.}$

Example: Generalized normal distributions
-----------------------------------------

Here, we assume that both the true values as well as the error term are distributed according to the [generalized normal distribution](https://en.wikipedia.org/wiki/Generalized_normal_distribution) with standard deviation $\sigma = 1$. The shape parameter $\beta$ of these distribution determines their "tailedness"; distributions with a smaller shape parameter have a heavier tail. We vary the shape parameters of both the error and the true value distribution and calculate the expected true value conditional on the proxy value, $\mathbb{E}[V(a) \mid U(a) = u(a)]$, using numerical integration. The plots show the expected conditional values as a function of $u$ as well as the identity function for comparison as a dashed line.

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/7cdb668942462d0d070aba17db276dea66d5fa7caa308d3e.png)

Only in the case where $\beta_V > \beta_E$ and $\beta_E \le 1$ do we observe that the expected value graph does not go to infinity for large values of the proxy value. That is, only in these cases to we observe Goodhart's curse. This seems to be in agreement with the result proven in [Catastrophic Regressional Goodhart: Appendix](https://www.lesswrong.com/posts/GdkixRevWpEanYgou/catastrophic-regressional-goodhart-appendix).

Example: Normally distributed error term with randomly drawn standard deviations
--------------------------------------------------------------------------------

We wanted a concrete example where the error distribution had a free parameter that controls the variance, which we can think of as being upon observing the proxy value, which intuitively should create a situation where maximizing the proxy reduces the correlation. In this example, we assume the error is normally distributed with mean 0, but for each action the standard deviation itself is randomly drawn from an exponential distribution with rate parameter $\lambda=0.3$. For concreteness, the error values can be sampled using the following Python code:

    def create_error_vector(n):
        std_dev = np.random.exponential(0.3, size=n)
        return np.random.normal(0, std_dev, size=n)

The resulting distribution of the error term can be calculated as

$$$\begin{align*} \mathbb{P}[E(a) = x] &= \int_0^\infty \mathbb{P}[E(a) = x | \sigma(a) = s]\mathbb{P}[\sigma(a) = s] ds \ &= \frac{0.3}{\sqrt{2\pi}} \int_0^\infty \exp\left[-\frac{1}{2}\left(\frac{x}{s}\right)^2 -0.3s\right]ds \end{align*}$

We will now look at two cases for the distribution of the true values.

In the first case, we assume that the prior values are uniformly distributed in the interval \[-0.5, 0.5\]. Here, the graph of the expected true values look like this:

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/3242866aedcc90944cbebd6341ea534e2e9da855fd64817b.png)

In the second case, we assume a standard Gaussian distribution (i.e. with mean $\mu = 0$ and standard deviation $\sigma = 1$). The graph of the expected true values looks very similar:

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/ffef4b271e9ff539c3911164ce4e90e6f89db3d501f34a9a.png)

In both cases, it is clearly not optimal to choose the policies with the largest proxy values. Instead, values quite close to $u = 0$ have much higher expected value and the expected value decays towards $0$ (the mean of the prior distribution) for very high values.

Example: Laplace-distributed error term with randomly drawn scale parameters
----------------------------------------------------------------------------

In this example, we assume the error is Laplace-distributed with mean $0$ and scale parameter $0.9$, but the error is “stretched” by multiplying it with a random value from an exponential distribution (with rate parameter $1$) taken to the power of $6$. This was done in an attempt to make the Goodhart effect much stronger. In other words, the error values can be sampled using the following Python code:

    def create_error_vector(n):
        scale_factor = np.random.exponential(1, size=n) ** 6
        return np.random.laplace(0, 0.9 * scale_factor, size=n)

The resulting distribution can be calculated similarly to the previous example.[^dqtwr1iiglv]

We again calculated the resulting graph of the expected true values for the case of a uniform and a Gaussian distribution of the error term (both with the same parameters as before).

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/aba7534b243fed80b5ec9e4083957e56c82292476992a047.png)

Uniform value distribution

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/8ddba2b15cc2a945d6b909dab5d2d8a2ed919b35cbf79540.png)

Gaussian value distribution

Example: Goodhart's rollercoaster
---------------------------------

A fun phenomenon occurs when the distribution of the error term has multiple modes. Here we combined three heavy-tailed distributions and generated the error values using the code:

    def create_error_vector(n):
    	locations = np.random.choice([-1, 0, 1], size = n)
    	return scipy.stats.gennorm.rvs(beta = 0.25, scale = 0.0001, loc = locations)

Combined with uniformly-distributed true values, this results in an expected true value graph like this:

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/77ab82b9aec3a740edaf68a076b7946795a2bd0901fb6cac.png)

This illustrates that if there are different sources of errors, each with different mean, regressional Goodhart can occur not only in the extreme values, but also in intermediate values in the domain of the proxy function.

What if the agent can't access the ideal belief distribution?
=============================================================

As discussed, we think that action selection by EU maximization with ideal belief, $a^\star_\textrm{Bayes} = \arg\max_{a'\in\mathcal A} \mathbb E_{\phi(V|\mathrm{Obs}=\mathrm{obs})} V(a')$, is the best thing to do if feasible, but is infeasible in realistic situations, due to the unavailability of $\phi$. This raises the question what action selection procedure (algorithm) to employ instead. We search for algorithms with performance (as potentially evaluated by the true value functions for a set of representative situations) as close to the optimal performance reached by EU maximization with ideal belief as possible. In other words: We search for good approximations of action selection by EU maximization with ideal belief.

The naive algorithm and a second-level Goodhart's law
-----------------------------------------------------

A salient candidate for the approximation of action selection by EU maximization with ideal belief $\phi$ is what we call the *naive algorithm* or *naive EU maximization*: Action selection by EU maximization with an approximate/estimated belief $\widetilde\phi$:

$a^\star_\widetilde{\textrm{Bayes}} = \arg\max_{a'\in\mathcal A} \mathbb E_{\widetilde\phi(V|\mathrm{Obs}=\mathrm{obs})} V(a')$

Curiously, and as observed in [Does Bayes Beat Goodhart?](https://www.lesswrong.com/posts/YJq6R9Wgk5Atjx54D/does-bayes-beat-goodhart), this brings us back into a familiar situation: We found that, in order to optimize $V$ when just knowing $\phi$, the correct objective to maximize is $\mathbb E_{\phi(V|\textrm{Obs})} V$. However, we noticed that the agent can't typically access this objective and proposed it might maximize $\mathbb E_{\widetilde\phi(V|\textrm{Obs})} V$ instead. Just as in the original situation involving $V$ and $U$, the agent ends up maximizing a proxy of the true objective. This is the recipe for Goodhart's law. Regardless, we hope that Bayesian reasoning would still reduce the extent of Goodhart's law in the sense that a solution that avoids it needs to "bridge less of a gap".

With $\mathrm{Obs} = U$, this situation arises in the context of trying to beat Goodhart's law by Bayesian reasoning, so in some sense on a second level. We could of course attempt to also capture this situation by Bayesian modelling of a meta distribution over $\phi$ and $\widetilde\phi$, but that would just give us a third level Goodhart's law. Generally, for any meta level of Bayesian reasoning, there is Goodhart's law one level above. While we hope the Bayesian reasoning on the first level alleviates Goodhart's law to some degree, our intuition is that further levels of Bayesian reasoning are not helpful. An attempt at an argument for this intuition is that $\phi$ already captures all the agent's prior knowledge and $\widetilde\phi$ already approximates $\phi$ to the agent's best ability. So, if, by replacing $\widetilde\phi$ with an expected value of $\phi$ over the (approximate, not ideal) meta distribution, the agent captures it's knowledge better, then it must have done a poor job with computing $\widetilde\phi$.

In the next section, we will describe a toy example that we will use to test the robustness of the naive approach to Goodhart's law.

A simulated toy example with difference between ideal and estimated belief distribution
---------------------------------------------------------------------------------------

In this example we will analyze how an agent can utilize the true belief distribution $\phi(V|U)$ to choose actions to avoid Goodhart's law, and whether we need this.

If we knew the true belief distribution $\phi(V|U)$ we could label actions as safe or unsafe depending on how correlated V and U are according to $\phi$. In the figure below we show the extreme example where the true value of “safe actions” are distributed with low variance around the true value mean, while unsafe actions are distributed with high-variance around the true value mean. This is illustrated in the figure below.

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/b39866cf16cc01649997288ee05d9ec09ee3339744836ffa.png)

The red curve is a “regression curve” which represents the expected conditional true utility for each proxy utility. This expectation is calculated locally across bins of the proxy utility for visualization purposes.

We can observe that unsafe actions can have two unintended consequences. First, obviously the proxy utilities of unsafe actions are useless as they do not correlate significantly with true utilities. However, the second consequence is that unsafe actions can introduce extremal Goodhart, as the expected true utility (regression curve) decreases for extremal values of the proxy utility.

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/d049e81b638f87621bba36b128fdc58712a5ae70b119b954.png)

By knowing $\phi(V|U)$$$, we can avoid taking actions for which proxy utilities do not correlate with true utility. Since we do not have knowledge about $\phi(V|U)$, we must rely on an estimated belief distribution $\widetilde \phi(V|U)$.

If we assume $\widetilde\phi(V|U)$ is distributed in the same way as $\phi(V|U)$, we can observe that, while $\widetilde \phi$ and $\phi$ correlate for safe actions, there is still a Goodhart effect due to the unsafe actions. This example illustrate that approximating $\phi(V|U)$ by a prior belief $\widetilde\phi(V|U)$ can still introduce Goodhart. This observations made us consider the usage of soft-optimizers to deal with imperfect information about the prior beliefs.

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/f7a694935995db15e95cf0fea845d7e20e699c2cc8395f91.png)

Conclusion
==========

We investigated concrete examples to build intuitions about Goodhart's law and found a Bayesian perspective to be helpful for that. We concluded that Goodhart's law can indeed be beaten by Bayesian reasoning, but that belief misspecification can reintroduce Goodhart's law. As future work, we are still working on empirical evaluations of soft optimization as an alternative to naive Bayesian expected utility maximization.

Other Results
=============

### Stochastic gradient descent as a soft optimizer

Although soft optimizers seem somewhat artificial at first, in fact, a very common soft optimizer is the simplest of optimizers, the standard stochastic gradient descent with a constant time step. The reason for that is exactly because stochastic gradient descent is *stochastic*, so we can think of it as a sequence of random variables, such that it converges to a stationary distribution around the minimum.

To make this more clear, consider a loss function  $$$l(\theta) = \mathbb{E}[L(\theta)]$, with $L(\theta)$ being a random loss function whose distribution depends on the data. Then, assume we are doing SGD with a step size $\beta$$$, starting from some $$$\theta_0 \sim \pi(\theta_0)$. Letting $L_1(\theta), \ldots, L_B(\theta)$ be i.i.d. minibatch samples of $L(\theta)$, then the SGD update forms a Markov chain defined as

$\theta_{t+1} = \theta_t - \frac{\beta}{B} \sum_{b=1}^B \nabla L_b(\theta_t)$

The following is a [standard result](https://jmlr.org/papers/volume18/17-214/17-214.pdf), which we briefly recap here. We can analyze better this chain by considering

*   The CLT approximation $\frac{1}{B} \sum_{b=1}^B \nabla L_b(\theta_t) \approx \nabla l(\theta) + B^{-1/2} \Sigma(\theta)^{1/2} Z$, where $\Sigma(\theta)$ be the covariance matrix of $L(\theta)$, and $Z \sim \operatorname{Normal}(0, I)$.
*   That $\beta$ is small enough so that we can consider the stochastic differential limit $d\theta_t = -\beta \nabla l(\theta_t) + \beta B^{-1/2} \Sigma(\theta)^{1/2} dW_t$, with $W_t$ denoting the [Wiener process](https://en.wikipedia.org/wiki/Wiener_process).
*   That, around the minimum (and under a suitable change of variables) the quadratic approximation $l(\theta) \approx \frac{1}{2} \theta^T H \theta$, with $H$ being the Hessian at the minimum, is valid.
*   Finally, around the minimum, $\Sigma(\theta) = \Sigma$ is a constant.

Then our SDE limit becomes $d \theta_t = - \beta H \theta_t dt + \beta B^{-1/2} \Sigma^{1/2} dW_t$, which we recognize as an [OU process](https://en.wikipedia.org/wiki/Ornstein%E2%80%93Uhlenbeck_process), whose stationary distribution is distributed according to $p(\theta) \propto \exp(-\theta^T A^{-1} \theta)$, where $A$ is the solution of the equation $AH + HA = \beta^{-1} B^{-1} \Sigma$. We can solve this equation for $A$ by letting $H = Q \operatorname{diag}(\lambda) Q^T$ be the eigendecomposition of $H$, defining $\Sigma_Q := Q^T \Sigma Q$, and letting[^3irjvt6o5nv]

$A = \frac{\beta}{B} Q \Gamma Q^T, \quad \Gamma_{i, j} := \frac{\Sigma^{(Q)}_{i,j}}{\lambda_i + \lambda_j}.$

We then conclude that SGD with a constant time step is a soft optimizer that, at convergence, approximately follows a Gaussian distribution whose covariance is proportional to the step size $\beta$ and to the innate covariance $\Sigma$ of $L$, and inversely proportional to $B$ and the eigenvalues of $H$.

An [interesting phenomenon](https://arxiv.org/pdf/1701.02434.pdf) arising in high-dimensional probability is that, under usual conditions, the distribution gets highly concentrated in a shell *around* the mode, called the *typical set*. In the case of the distribution $p(\theta)$, we can find this typical set by noticing that, if $\Theta \sim p(\theta)$, then $\Theta = A^{1/2} Z, Z \sim \mathcal{N}(0, \mathbf{I})$, so we find that $Y :=||\Theta^T A^{-1} \Theta||^2 \sim \chi(d)$, wi$$th $\chi(d)$ being the chi-squared distribution with $d$ degrees of freedom, and $d$ the dimension of the parameter space. Therefore,  we find that $\mathbb{E}[Y] = d$ and, using Markov inequality, $P(|Y - k| > td) < 2 d^{-1} t^{-2}$, so the typical set becomes the ellipsoid $\theta^T \Gamma^{-1} \theta = \beta d/B$, and the relative distance to that set is inversely proportional to $d$.[^5xl6zbxsnfr] This implies that, in very high dimensions, not only is constant step SGD soft optimizing the minima, but it in fact rarely gets very near the minima, and just hovers around the typical set.

Of course, SGD with a constant time step is rarely used in real situations, and instead, we use adaptations such as Adam with a schedule for varying the time step. Although the analysis in these cases is somewhat harder, we can conjecture that the general idea still holds, and we still have the same proportionality results. If true, this shows that, when thinking about soft optimizers, we should always remember that soft optimizers are "out there", already being used all the time. 

### High probability soft optimizer alternative formulation and proof

Another soft optimizer, that explicitly tries to be a soft optimizer (unlike constant step SGD) is the [quantilizer](https://intelligence.org/files/QuantilizersSaferAlternative.pdf), as proposed by Jessica Taylor. Here, we give an alternative formulation for the quantilizer, one that we believe is more intuitive and slightly more general. To maintain continuity with the previous section, we use a minimization framing, consistent with the SGD discussion, and contrasting to the maximization framing used in the original paper.

Let $l:\Theta \to \mathbb{R}$ be a function[^leh2s6n84ho] to be soft minimized on the state space $\Theta$. We can, for any $t \in \mathbb{R}$, consider the sublevel-set $A_{t, l} \subseteq \Theta$ given by $A_{t, l} := \{\theta \in \Theta; l(\theta) \leq t\}$. Now, assume a prior probability measure $\mu$ on $\Theta$$$. With it, we can define a function $g_{\mu, l}:\mathbb{R} \to [0, 1]$ given by $g_{\mu, l}(t) = \mu(A_{t, l})$. This function has the following properties:

*   For $t \leq s$, $A_{t, l} \leq A_{t, s}$, therefore $g_{\mu, l}$ is non-decreasing.
*   $\lim_{t \to -\infty} g_{\mu, l}(t) = \mu(\varnothing) = 0$, and $\lim_{t \to -\infty} g_{\mu, l}(t) = \mu(\varnothing) = 0$.

Therefore, we can define a function $h_{\mu, l}:[0, 1] \to \mathbb{R}$, working as a "generalized inverse" of $g_{\pi, l}$ ($h_{\pi, l} = g^{-1}_{\pi, l}$* if *$g_{\pi, l}$ is invertible), by defining $h_{\mu, l}(q) = \sup\{t \in \mathbb{R}; g_{\mu, f}(t) \leq q\}$. With it, we can define the $q$-*quantilizer set* $\Theta_q$ by letting $t_l = h_{\mu, l}(q)$ and $\Theta_q := A_{t_q, l}$. Of course, this defines a *quantilizer function* $\sigma_{\mu, l}:[0, 1] \to 2^\Theta$ defined as $\sigma_{\mu, l}(q) = \Theta_q$. Moreover, we can define the *quantilizer distribution function* $\rho_{\mu, l}:[0,1] \to \mathcal{P}(\Theta)$ by restricting $\mu$ to $\Theta_q$, such that $\rho_{\mu, l}(q) = \mu(\Theta \cap \sigma_{\mu, l}(q))/\mu(\Theta) =: \mu_{q, l}$.

How is this a reformulation? In the original work, the desiderata used is "choosing an action from the set $\{a \in \mathcal{A}, \mathbb{E}[U(W(a))] \geq t\}$". In our language (under suitable change to a minimization framing), this is exactly one of the subset levels, and the reordering of the action set and choosing a random variable from $[1-q, 1]$ is exactly sampling one of the $q$-best actions based on the prior $\mu$, that is, sampling one of $\mu_{q, l}$. We find this explicit reordering of the action space is both awkward, lacking geometric intuition, and hard to generalize to continuous spaces. Instead, we argue that the above reformulation is more intuitive while having the same properties as the original formulation.

We can gain some geometric intuition on quantilizers in $\mathbb{R}^d$, by assuming again, that around the minima, we have $l(\theta) \approx \theta^T H \theta.$ Then, our quantilizer sets become (approximately) the ellipsoids $A_{t, l} \approx \{\theta^T H \theta \leq t\}$. For large $d$, we again have concentration phenomena in quantilizers. In fact, letting $V(A_{t, l})$ be the $d$[-dimensional volume](https://en.wikipedia.org/wiki/Ellipsoid#In_higher_dimensions) of $A_{t, l}$, we find that, for some $\delta < t$, that $V(A_{t-\delta, l})/V(A_{t}) = (1 - \delta/t)^{d/2}$. So, if $\mu$ is approximately uniform around the minima, then for large $d$, and small $q$, almost all of the measure of $\mu_{q, l}$ is concentrated around the set $\{\theta H \theta^T = t_q\}$. In this case, we conclude that the quantilizer becomes an almost *exact* quantilizer sampling from the exact $q$-best values of $l(\theta)$. Of course, unlike in the case of SGD, is not clear that the action set $\mathcal{A}$ in the original framing should be modeled as a subset of $\mathbb{R}^d$ with all its geometric structure, so whether this result is relevant depends on what is being modeled.

[^f31pkv7jx3m]: By "ideal" we mean that the agent has arrived at the distribution by Bayesian updates from a well-specified prior, and it includes all the explicit and implicit knowledge available to the agent. From the subjective perspective of the agent, the variables appear (according to some notion that is not very clear to us) to be sampled from this distribution. In the simplest case, the world literally samples from this distribution, e.g. by rolling a die, and the agent has knowledge about the probabilities involved in that sampling process. We are still philosophically confused about what exactly characterizes this ideal distribution and whether there is really only one such distribution in any situation. 

[^2w9iaf9czw6]: With respect to the true value function, which is the value function the designer intends for the agent. 

[^spvmxx62hq]: “One possible bayes-beats-goodhart argument is: "Once we quantify our uncertainty with a probability distribution over possible utility functions, the best we can possibly do is to choose whatever maximizes expected value. Anything else is decision-theoretically sub-optimal." Do you think that the true utility function is really sampled from the given distribution, in some objective sense? And the probability distribution also quantifies all the things which can count as evidence? If so, fine. Alternatively, do you think the probability distribution really codifies your precise subjective uncertainty? Ok, sure, that would also justify the argument.” 

[^fptph4ioko4]: Note that we regard \(\phi\) and \(\widetilde\phi\) as denoting probability measures, joint, conditional and marginal distributions, probability density functions or probability mass functions as convenient. 

[^4bbucwz2b4s]: To show this, we first show \(\mathbb E_{\phi(U|V=v)} U(A^\star) \geq \mathbb E_{\phi(U|V=v)} v(A^\star)\) and then take the expectation over \(\phi(V)\). Define \(\hat a := \arg\max_{a\in\mathcal A} v(a)\). With that, we have \(\mathbb E_{\phi(U|V=v)} U(A^\star) \geq \mathbb E_{\phi(U|V=v)} U(\hat a) = \mathbb E_{\phi(U|V=v)} v(\hat a) \geq \mathbb E_{\phi(U|V=v)} v(A^\star)\). The strict version of this inequality clearly holds if \(\phi(U(A^\star) - U(\hat a)) < 1\) or \(\phi(v(A^\star) = v(\hat a)) < 1\). 

[^dqtwr1iiglv]: The exponential distribution has pdf (for \(x \ge 0\)): \(f(x) = \lambda e^{-\lambda x}\)When values drawn from this distribution are transformed by \(g(x) = x^6\), the pdf of the transformed variable \(\sigma\) is given by:\(\begin{align*} \mathbb{P}(\sigma = y) &= f(g^{-1}( y))\frac{d}{dy}g^{-1}(y) \\ &= \frac{\lambda}{6}\exp\left(-\lambda y^{\frac{1}{6}}\right)y^{-\frac{5}{6}}\text{.} \end{align*}\)Our noise function is Laplace-distributed with location parameter \(\mu = 0\) and scale parameter \(b = 0.9 \sigma\) and therefore has the pdf (given \(\sigma\))\(\mathbb{P}(\epsilon = x | \sigma) =\frac {1}{2b} \exp\left(-\frac {|x-\mu |}{b}\right) = \frac {1}{2\cdot0.9\sigma} \exp\left(-\frac {|x |}{0.9\sigma}\right)\text{.}\)Therefore, if we integrate out \(\sigma\), we have\(\begin{align*} \mathbb{P}(\epsilon = x) &= \int_0^{\infty}d\sigma \mathbb{P}(\epsilon = x | \sigma) \mathbb{P}(\sigma = y) \\ &= \int_0^{\infty}d\sigma \frac {1}{2\cdot0.9\sigma} \exp\left(-\frac {|x |}{0.9\sigma}\right) \frac{\lambda}{6}\exp\left(-\lambda \sigma^{\frac{1}{6}}\right)\sigma^{-\frac{5}{6}} \\ &= \frac {\lambda}{10.8}\int_0^{\infty}d\sigma \exp\left(-\frac {|x |}{0.9\sigma} -\lambda \sigma^{\frac{1}{6}}\right)\sigma^{-\frac{11}{6}} \\ &= \frac {\lambda}{9}\int_0^{\infty}dr \exp\left(-\frac {|x |}{0.9} r^{\frac{6}{5}}-\lambda r^{-\frac{1}{5}}\right) \text{ by substituting } r(\sigma) = \sigma^{-\frac{5}{6}} \text{,} \end{align*}\)where the last substitution is useful to simplify numerical integration. 

[^3irjvt6o5nv]: This can be shown that the general equation \(PX + XP = Y\), for \(P\) positive-definite, can be solved using the eigendecomposition \(P = Q \Lambda Q^T\), \(\Lambda = \operatorname{diag}{\lambda}\) and letting\(PX + XP = Y \implies \\ Q^T(PX + XP)Q = Q^T Y Q\)\(\implies Q^T P Q Q^T X Q + Q^T X Q Q^T P Q = Q^T Y Q\)\(\implies\Lambda X' + X' \Lambda = Y', \quad X' := Q^TXQ, Y':= Q^T Y Q\)\(\implies \lambda_i X'_{i, j} + \lambda_j X'_{i, j} = Y'_{i, j} \implies X'_{i, j} = Y'_{i, j}(\lambda_i + \lambda_j)^{-1}\) 

[^5xl6zbxsnfr]: Much sharper exponential bounds can be derived, see here.  

[^leh2s6n84ho]: We assume everything to be well-behaved enough (measurable functions and measurable sets)  so we don't need to do measure theory here.