# Aspiration-based Q-Learning

*Work completed during a two-month internship supervised by* [*@Jobst Heitzig*](https://www.lesswrong.com/users/jobst-heitzig?mention=user)*. *

*Thanks to Phine Schikhof for her invaluable conversations and friendly support during the internship, and to Jobst Heitzig, who was an amazing supervisor.*

*Epistemic Status: I dedicated two full months to working on this project. I conducted numerous experiments to develop an intuitive understanding of the topic. However, there is still further research required. Additionally, this was my first project in Reinforcement Learning.*

**tldr** — Inspired by satisficing, we introduce a novel concept of non-maximizing agents, $\aleph$-aspiring agents, whose goal is to achieve an expected gain of $\aleph$. We derive aspiration-based algorithms from Q-learning and DQN. Preliminary results show promise in multi-armed bandit environments but fall short when applied to more complex settings. We offer insights into the challenges faced in making our aspiration-based Q-learning algorithm converge and propose potential future research directions.

The [AI Safety Camp](https://aisafety.camp/) 2024 will host a project for continuing this work and similar approaches under the headline "SatisfIA – AI that satisfies without overdoing it".

Introduction
============

This post centers on the outcomes of my internship, detailing the developments and results achieved. For a deeper understanding of the motivation behind our research, we encourage you to explore [Jobst's agenda](https://forum.effectivealtruism.org/posts/ZWjDkENuFohPShTyc/my-lab-s-small-ai-safety-agenda) or refer to [my internship report](https://butanium.github.io/files/satisficing-rl.pdf), which also includes background information on RL and an appendix presenting the algorithms used. Our code is available on [our GitHub](https://github.com/pik-gane/stable-baselines3-contrib-satisfia/tree/master).

The end goal of this project was about developing and testing agents for environments in which the "reward function" is an imperfect proxy for the true utility function and their relation is so ambiguous that maximizing the reward function is likely not optimizing the true utility function. Because of this, I do not use the term "*optimize*" in this post and rather say "*maximize*" in order to avoid confusion.

Other researchers have proposed alternative techniques to mitigate Goodhart's law in reinforcement learning, such as quantilizers (detailed by [@Robert Miles](https://www.lesswrong.com/users/robert-miles?mention=user)  in [this video](https://www.youtube.com/watch?v=gdKMG6kTl6Y)) and the approach described by [@jacek](https://www.lesswrong.com/users/jacek?mention=user)  in [this post](https://www.lesswrong.com/posts/Eu6CvP7c7ivcGM3PJ/goodhart-s-law-in-reinforcement-learning). These methods offer promising directions that are worth exploring further. Our satisficing algorithms could potentially be combined with these techniques to enhance performance, and we believe there are opportunities for symbiotic progress through continued research in this area.

Satisficing and aspiration
==========================

The term of *satisficing* was first introduced in economics by [Simon in 1956](https://academic.oup.com/qje/article-abstract/69/1/99/1919737?redirectedFrom=fulltext). According to Simon's definition, a satisficing agent with an aspiration $\aleph$[^t7feh5hr6kn] will search through available alternatives, until it finds one that give it a return greater than $\aleph$. However under this definition of satisficing, [Stuart Armstrong highlights](https://www.lesswrong.com/posts/2qCxguXuZERZNKcNi/satisficers-want-to-become-maximisers):

> Unfortunately, a self-improving satisficer has an extremely easy way to reach its satisficing goal: to transform itself into a maximiser.

Therefore, inspired by satisficing, we introduce a novel concept: $\aleph$*-aspiring agent*. Instead of trying to achieve an expected return greater or equal to $\aleph$, an $\aleph$-aspiring agent aims to **achieve an expected return** of $\aleph$: 

$$
\mathbb E G = \aleph
$$

 Where $G$ is the discounted cumulated reward defined for $\gamma\in[0,1[$ as: 

$$
G = \sum_{t=0}^{\infty} \gamma^{t} r_{t+1}
$$

This can be generalized with an interval of acceptable $\aleph$ instead of a single value.

In other words, if we are in an apple harvesting environment, where the reward is the amount of apples harvested, here are the goals the different agent will pursue:

| **Agent ** | Maximizer | $\\aleph$-satisficer | $\\aleph$-aspiring |
| --- | --- | --- | --- |
| **Goal** | Harvest as many apple as possible | Harvest at least $\\aleph$ apples | On expectation, harvest $\\aleph$ apples |

Local Relative Aspiration
=========================

In the context of Q-learning, both the maximization and minimization policies (i.e., selecting $\mathop{\mathrm{argmax}}_a Q(s,a)$ or $\mathop{\mathrm{argmin}}_a Q(s,a)$) can be viewed as the extremes of a continuum of $\text{LRA}^\lambda$ policies, where $\lambda\in[0,1]$ denotes the Local Relative Aspiration (LRA). At time $t$, such a policy samples an action $a$ from a probability distribution $\pi(s_t)\in \Delta(A)$, satisfying the $\text{LRA}^\lambda$ equation: 

$$
{\mathop{\mathbb{E}}}_{a\sim \pi(s_t)} Q(s_t, a) = \min_a Q(s_t, a):\lambda:\max_a Q(s_t, a) = \aleph_t
$$

 Here, $x:u:y$ denotes the interpolation between $x$ and $y$ using a factor $u$, defined as: 

$$
x:u:y = x + u(y-x)
$$

This policy allows the agent to satisfy $\aleph_t$ at each time $t$, with $\lambda=0$ corresponding to minimization and $\lambda=1$ corresponding to maximization.

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

The most straightforward way to determine $\pi$ is to sample  from $\{a | Q(s,a) = \aleph_t\}$. If no such $a$ exists, we can define $\pi$ as a mixture of two actions $a^+_t$ and $a^-_t$: 

$$
\begin{aligned}   a^+_t &= \mathop{\mathrm{argmin}}_{a: Q(s_t, a) > \aleph_t} Q(s_t,a)\   a^-_t &= \mathop{\mathrm{argmax}}_{a: Q(s_t, a) < \aleph_t} Q(s_t,a)\   p &= Q(s_t, a^-_t)\,\backslash\,\aleph_t\,\backslash\,Q(s_t, a^+_t,) \end{aligned}
$$

 where $x\,\backslash\,y\,\backslash\,z$ denotes the interpolation factor of $y$ relative to the interval between $x$ and $z$, i.e: 

$$
x\,\backslash\,y\,\backslash\,z = \frac{y-x}{z-x}
$$

 The choice of $p$ ensures that $\pi$ fulfills the $\text{LRA}^\lambda$ equation.

This method is notable because we can learn $$the $Q$ function associated to our $\pi$ using similar updates to Q-Learning and DQN. For a quick reminder, the Q-Learning update is as follows: 

$$
\begin{aligned} y &= r_{t+1} + \gamma\max_a Q(s_{t+1}, a)\ Q(s_t, a_t) &= Q(s_t, a_t) + \alpha(y - Q(s_t, a_t))\ \end{aligned}
$$

Where $\alpha$ is the learning rate. To transition to the $\text{LRA}^\lambda$ update, we simply replace $y$ with:

$$
y = r_t + \gamma\min_a Q(s_t, a):\lambda:\max_a Q(s_t, a)
$$

By employing this update target and replacing $a\gets \mathop{\mathrm{argmax}}_a Q(s,a)$ with $a\sim\pi$ as defined above, we create two variants of Q-learning and DQN we call *LRA Q-learning* and *LRA-DQN*. Furthermore, LRA Q-learning maintains some of the key properties of Q-learning. Another intern proved that for all values of $\lambda$, $Q$ converges to a function $Q^\lambda$, with $Q^1 = Q^*$ corresponding to the maximizing policy and $Q⁰$ to the minimizing policy.

However, the LRA approach to non-maximization has some drawbacks. For one, if we require the agent to use the same value of $\lambda$ in all steps, the resulting behavior can get unnecessarily stochastic. For example, assume that its aspiration is 2 in the following Markov Decision Process (MDP) environment:

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

$s_i$ is the initial state and $s_f$ the terminal state. 

Ideally we would want the agent to always choose $a_1$, therefore in the first step $\lambda$ would be 100% and in the second step $\lambda$ would be 0%. This is not possible using a $\text{LRA}^\lambda$ policy which enforce a fixed $\lambda$ for every steps. The only way to get 2 in expectation with a $\lambda$ that remains the same in both steps is to toss a coin in both steps, which also gives 2 in expectation.

The second drawback is that establishing a direct relationship between the value of $\lambda$ and an agent's performance across different environments remains a challenge. In scenarios where actions only affect the reward, i.e. $\forall s, s',a, a'$ 

$$
\mathbb P(s' | s,a) = \mathbb P(s' | s,a')
$$

 such as the multi-armed bandit environment, $\mathbb{E}_\lambda G$ is linear in respect to $\lambda$: 

$$
\mathbb{E}_{\pi^\lambda}G = \mathbb{E}_{\pi^0}G:\lambda:\mathbb{E}_{\pi^1}G
$$

However, as soon as the distribution of the next state is influenced by $a$, which is the case in most environments, we can loose this property as shown in this simple MDP:

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

If we run the LRA-Q learning algorithm on this MDP, $\mathbb E G = 20\lambda²$ when it has finished to converge[^swbxtcnt4ui].

Aspiration Propagation
======================

The inability to robustly predict agent performance for a specific value of $\lambda$ show that we can not build an $\aleph$-aspiring agent with LRA alone[^jfxfi4y6s2]. The only certainty we have is that if $\lambda < 1$, the agent will not maximize. However, it might be so close to maximizing that it attempts to exploit the reward system. This uncertainty motivates the transition to a global aspiration algorithm. Instead of specifying the LRA, we aim to directly specify the agent's aspiration, $\aleph_0$, representing the return we expect the agent to achieve. The challenge then becomes how to *propagate* this aspiration from one timestep to the next. It is crucial that aspirations remain *consistent* ensuring recursive fulfillment of $\aleph_0$:

$$
\textbf{Consistency: }\aleph_t = {\mathop{\mathbb{E}}}_{a_t} {\mathop{\mathbb{E}}}_{(r_t, s_{t+1})} (r_t + \gamma \aleph_{t+1})
$$

A direct approach to ensure consistent aspiration propagation would be to employ a *hard* update, which consists in subtracting $r_{t+1}$ from $\aleph_t$:

$$
\aleph_{t+1} = (\aleph_t - r_{t+1}) / \gamma
$$

and then follow a policy $\pi$, which, at time $t$, fulfills $\aleph_t$:

$$
\mathbb E_{a\sim\pi}Q(s_t,a)=\aleph_t
$$

However, this method of updating aspirations does not guarantee that the aspiration remains *feasible*:

$$
\textbf{Feasibility: }    \min_a Q(s_t, a) \leqslant\aleph_t \leqslant\max_a Q(s_t, a)
$$

Ensuring feasibility is paramount: otherwise we can't find such $\pi$. If the aspiration is consistently feasible, applying **consistency** at $t=0$ guarantees that $\mathbb E G = \aleph_0$.

To elucidate the importance of feasibility and demonstrate why hard updates might be inadequate (since they do not ensure feasibility), consider this MDP :![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/918c70820f58099474d3deef8247b53c67c04ace503bfad8.png)Assume the agent is parameterized by $\gamma = 1$ and $\aleph_0=10$, and possesses a comprehensive understanding of the reward distribution. 

Upon interacting with the environment and reaching $s_0$ after its initial action, the agent's return is 15, leading to a new aspiration of $\aleph=-5$. This aspiration is no longer feasible, culminating in an episode end with $G=15$. If the agent reaches $s_1$, then $\aleph_1 = 9$. Consequently, the agent selects $a_0$ and receives $r=9$, ending the episode with $G=10$. As a result, $\mathbb E G = 12.5 \neq \aleph_0$.

Aspiration Rescaling
--------------------

To address the aforementioned challenges, we introduce *Aspiration Rescaling* (AR). This approach ensures that the aspiration remains both *feasible* and *consistent* during propagation. To achieve this, we introduce two additional values, $\overline Q$ and $\underline Q$: 

$$
\begin{aligned}    \overline Q(s,a) &= {\mathop{\mathbb{E}}}_{(r,s')\sim(s,a)} \big[r + \overline{V}(s')\big]\    \underline Q(s,a) &= {\mathop{\mathbb{E}}}_{(r,s')\sim(s,a)} \big[r + \underline{V}(s')\big]\    \overline{V}(s) &= \max_a Q(s,a)\    \underline{V}(s) &= \min_a Q(s,a) \end{aligned}
$$

These values provide insight into the potential bounds of subsequent states:

*   $\overline Q(s,a)$ corresponds to "what will be my expected return if I choose action a in state s, **choose the maximizing action** **in the next step**, and then continue with policy $\pi$**"**
*   $\underline Q(s,a)$ corresponds to "what will be my expected return if I choose action a in state s, **choose the minimizing action** **in the next step**, and then continue with policy $\pi$**"**

The AR strategy is to compute $\lambda_{t+1}$, the LRA for the next step, at time $t$, rather than directly determining $\aleph_{t+1}$. By calculating an LRA, **we ensure the aspiration will be feasible** in the next state. Furthermore, by selecting it such that 

$$
{\mathop{\mathbb{E}}}_{(r_t,s_{t+1})\sim(s_t,a)} \min_a Q(s_{t+1}, a):\lambda_{t+1}:\max_a Q(s_{t+1}, a) - \frac{\aleph_t - r_t}{\gamma} = 0
$$

 we ensure consistency. More precisely, at each step, the algorithm propagates its aspiration using the AR formula: 

$$
\begin{aligned}    \lambda_{t+1} &= \underline Q(s_t, a_t)\,\backslash\,Q(s_t, a_t)\,\backslash\,\overline Q(s_t, a_t)\    \aleph_{t+1} &= \min_a Q(s_{t+1}, a):\lambda_{t+1}:\max_a Q(s_{t+1}, a) \end{aligned}
$$

 which ensures consistency, as depicted in this figure :

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

By choosing $\lambda_{t+1}=0.5$, we ensure we will get an expected return of $(\aleph_t - r_{t+1})/\gamma$

The mathematical proof of the algorithm's consistency can be found in the appendix of my internship report.

As $\overline Q$ and $\underline Q$ cannot be derived from $Q$ (it would require to know $s_{t+1}\sim(s_t, a_t)$), they need to be learned alongside Q.

As we don't want the algorithm to alternate between maximizing and minimizing, we introduce a new parameter $\mu$ whose goal is to *smooth* the different $\lambda$ chosen by the algorithm, so that consecutive $\lambda$ are closer to each other.

Using this aspiration rescaling to propagate the aspiration, we derive AR-Q learning and AR-DQN algorithms:  
**1- Interact with the environment**

with probability$\varepsilon_t$, $a_t\gets$ random action, else $a_t\sim\pi$  s.t $\mathop{\mathbb E}_{a\sim \pi} Q(s_t, a) = \aleph_t$  
$(r_{t+1},s_{t+1}, \text{done})\gets \text{Env}(a_t)$  
$$$\lambda_{t+1}\gets {\underline Q(s_t,a_t)}\backslash{Q(s_t,a_t)}\backslash{\overline Q(s_t,a_t)}$$  
$\aleph_{t+1}\gets{\min_a Q(s_{t+1},a)}:{\lambda_{t+1}}:{\max_a Q(s_{t+1},a)}$

**2- Compute the targets for the 3 Q functions:**

$\begin{aligned} \lambda_{t+1}&\gets \underline Q(s_t,a_t)\backslash Q(s_t,a_t)\backslash\overline Q(s_t,a_t)\ \lambda'&\gets \lambda_{t+1}:\mu:\lambda_t\ \underline{v} &\gets \min_{a} Q(s_{t+1},a), \ \overline{v} &\gets \max_{a} Q(s_{t+1},a), \ v &\gets \underline{v}:\lambda':\overline{v}, \ y_j &\gets r_j + \gamma v', \ \underline{y_j} &\gets r_j + \gamma \underline{v}' \ \overline{y_j} &\gets r_j + \gamma \overline{v}' \ \end{aligned}$

**3- Update the Q estimators. For example in Q-learning: **

$\begin{aligned} Q(s_t, a) &\mathrel{+}= \alpha_t \big(y - Q(s_t,a)\big) \ \overline Q(s_t, a) &\mathrel{+}= \alpha_t \big(\overline{y} - \overline Q(s_t, a)\big) \ \underline Q(s_t, a) &\mathrel{+}= \alpha_t \big(\underline{y} - \underline Q(s_t, a)\big) \end{aligned}$

Generalization of Aspiration Rescaling
--------------------------------------

At the end of the internship we realized we could leverage the fact that in the proof of AR's consistency, we are not restricted to $\underline Q$ and $\overline Q$. In fact, we can use any proper Q functions $Q^-$ and $Q^+$ as "safety bounds" we want the Q values of our action to be between. We can then actually derive $Q$ from $Q^+$, $Q^-$ and $\aleph$: 

$$
Q(s_t, \aleph_t, a_t) = Q^-(s_t, a_t)\,{[}\,\aleph_t\,{]}\,Q^+(s_t, a_t)
$$

 where we use this notation for "clipping":

$$
x\,{[}\,y\,{]}\,z = \min(\max(x,y) ,z)
$$

 The rationale is that if the aspiration is included within the safety bounds, our algorithm will, on average, achieve it, hence $Q = \aleph_t$. Otherwise, we will approach the aspiration as closely as our bounds permit. This method offers several advantages over our previous AR algorithms:

**Adaptability:** $\aleph_0$ can be adjusted without necessitating retraining.

**Stability:** $Q^+$ and $Q^-$ can be trained independently, offering greater stability compared to training $Q$ alongside both of them simultaneously.

**Flexibility:** $Q^+$ and $Q^-$ can be trained using any algorithm as soon as the associated $V^+$ and $V^-$ respect $V^-(s) \leqslant Q(s,a) \leqslant V^+(s)$.

**Modularity:** There are minimal constraints on the choice of the action lottery, potentially allowing the combination of aspiration with safety criteria for possible actions[^yrreh6y8f9].

For instance, we can use LRA to learn $Q^{\lambda^+}$ and $Q^{\lambda^-}$ for $\lambda^- < \lambda^+$ and use them along with $V^+(s) = \min_a Q^+(s,a):\lambda^+:\max_a Q^+(s,a)$ and $V^-$ defined analogously. This algorithm is called **LRAR-DQN**.

Experiments
===========

Algorithms were implemented using the [stable baselines 3](https://github.com/DLR-RM/stable-baselines3) (SB3) framework. The presented results utilize the DRL version of the previously discussed algorithms, enabling performance comparisons in more complex environments. The DNN architecture employed is the default SB3 "MlpPolicy''. All environment rewards have been standardized such that the maximizing policy's return is 1. Environment used were:

*   **Iterated Multi Armed Bandit** (IMAB): The agent choose between different arms for $N_{\text{round}}$ times. Each arm gives a certain reward plus Gaussian noise. The observation is $k\leqslant N_{\text{round}}$ the number of rounds played.
*   **Simple gridworlds**: We used Boat racing gridworld from [AI safety Gridworlds](https://arxiv.org/abs/1711.09883). 2020 and the Empty env from [Minigrid](https://github.com/Farama-Foundation/Minigrid).

LRA-DQN
-------

We conducted experiments to explore the relationships between $G$ and $\lambda$. In the IMAB setup, as expected, it is linear. In boat racing, it seems quadratic. Results for Empty env also suggest a quadratic relationship, but with noticeable noise and a drop at $\lambda=1$. Experiments with DQN showed that DQN was unstable in this environment, as indicated by this decline. Unfortunately, we did not have time to optimize the DQN hyperparameters for this environment.

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

X-axis is $\aleph_0$, Y-axis denotes $\mathbb E G$, averaged over 10 learning runs. Each run undergoes 100 evaluations to estimate $\mathbb E G$

As expected, we cannot robustly predict the agent's performance for a specific $\lambda$ value.

AR-DQN
------

Our experiment show that using a hard update[^5sk6ynug2m] yields more stable results. The AR update is primarily unstable due to the inaccuracy of aspiration rescaling in the initial stages, where unscaled Q-values lead to suboptimal strategies. As the exploration rate converges to 0, the learning algorithm gets stuck in a local optimum, failing to meet the target on expectation. In the MAB environment, the problem was that the algorithm was too pessimistic about what is feasible because of too low Q values. the algorithm's excessive pessimism about feasibility, stemming from undervalued Q-values, was rectified by subtracting $Q(s,a)$ from $\aleph_t$ and adding $\aleph_{t+1}$. Instead of doing $\aleph\gets\aleph_{t+1}$ we do 

$$
\aleph \gets (\aleph_t - Q(s,a)) / \gamma + \aleph_{t+1}
$$

 However, in the early training phase, the Q-values are small which incentivizes the agent to select the maximizing actions.

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

X-axis is training steps, Y-axis mean $G$. Different colors correspond to different $\aleph_0$

You can see this training dynamic on this screenshot from the IMAB environment training run. No matter $\aleph_0$: 

*   it starts each episode by selecting maximizing actions and therefore overshoot its aspiration ($G\gg\aleph_0$)
*   later in the training it realizes it was overshooting, and starts to avoid reward in the late stage of the episodes, lowering $G$
*   Eventually the mean episode return decreases and $G\approx\aleph_0$

We also introduced a new hyperparameter, $\rho$, to interpolate between hard updates and aspiration rescaling, leading to an updated aspiration rescaling function: 

$$
\begin{aligned}    \delta_{\text{hard}} &= -r_t / \gamma\    \delta_{\text{AR}} &= -Q(s,a)/\gamma + \aleph_{t+1}\    \aleph &\gets \aleph_t/\gamma + \delta_{\text{hard}}:\rho:\delta_{\text{AR}} \end{aligned}
$$

 Here, $\rho=0$ corresponds to a hard update, and on expectation, $\rho=1$ is equivalent to AR.

We study the influence of of $\rho$ and $\mu$ on the performance of the algorithm. The algorithm is evaluated using a set of target aspirations $(\aleph_0^i)_{1\leqslant i\leqslant n}$. For each aspiration, we train the algorithm and evaluate it using: 

$$
\text{Err} = \sqrt{\frac{\sum_{i}^n(\mathbb E G_i - \aleph_0^i)^2}{n}}
$$

 This would be minimized to 0 by a perfect aspiration-based algorithm.

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

The scale ranges from 0 to 1, with 1 representing the maximum achievable gain. Each ($\rho$, $\mu$) pair is evaluated using 10 aspirations

As observed, having a small $\rho$ is crucial for good performance, while $\mu$ has a less predictable effect. This suggests that aspiration rescaling needs further refinement to be effective.

Comparing aspiration rescaling, hard update and Q-learning can give an intuition about why aspiration rescaling might be harder than hard update or classical Q learning:

|     | Q learning | Hard update | Aspiration Rescaling |
| --- | --- | --- | --- |
| **Objective** | Learn $Q^*$ | Learn $Q$ | Learn $Q, \\underline Q, \\overline Q$ |
| **Policy** | $\\text{argmax}(s_t,a)$ | Select $a\\sim \\pi$ s.t $ \\mathbb E Q(s_t,a) = \\aleph_t$ |   |
| **Success condition** | $\\text{argmax} Q(s_t,a)=$$\\text{argmax} Q^*(s_t,a)$ | Exact $Q$ **or** can recover from overshooting | Exact $Q$ |

What makes aspiration rescaling harder than Q-learning is that Q-learning does not require Q values to be close to reality to choose the maximizing policy. It only requires that the best action according to $Q$ is the same than the one according to $Q^*$. In this sense, the learned $Q$ only needs to be a *qualitatively* good  approximation of $Q^*$.

In hard update, if the agent underestimate the return of its action, it might choose maximizing action in the beginning. But if it can recover from it (e.g when $\aleph < 0$, it's able to stop collecting rewards) it might be able to fulfill $\aleph_0$. 

However aspiration rescaling demands values for $Q, \underline Q$ and $\overline Q$ that are *quantitatively * good approximations of their true values in order to rescale properly. Another complication arises as the three Q estimators and the policy are interdependent, potentially leading to unstable learning.

LRAR-DQN
--------

Results on LRAR-DQN confirm our hypothesis that precise Q values are essential for aspiration rescaling.

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

On each graph, the X-axis is $\aleph_0$ and Y-axis is $\mathbb E G$. The colorscale represents $\rho$, from  
red=0 to green=1

After 100k steps, in both boat racing and iterated MAB, the two LRA-DQN agents derived from $Q^+$and $Q^-$, have already converged to their final policies. However, both Q-estimator still underestimates the Q values. As illustrated in figure [14](#fig:lrarres), waiting for 1M steps does not alter the outcome with hard updates ($\rho=0$), which depend less on the exact Q values. Nevertheless, they enable AR ($\rho=1$) to match its performance.

In our experiments, the LRAR-DQN algorithm exhibited suboptimal performance on the empty grid task. A potential explanation, which remains to be empirically validated, is the divergence in state encounters between the $Q^+$ and $Q^-$ during training. Specifically, $Q^-$ appears to predominantly learn behaviors that lead to prolonged stagnation in the top-left corner, while $Q^+$ seems to be oriented towards reaching the exit within a reasonable timestep. As a future direction, we propose extending the training of both $Q^+$ and $Q^-$ under the guidance of the LRAR-DQN policy to ascertain if this approach rectifies the observed challenges.

Conclusion
==========

Throughout the duration of this internship, we successfully laid the groundwork for aspiration-based Q-learning and DQN algorithms. These were implemented using Stable Baseline 3 to ensure that, once fully functional, aspiration-based algorithms can be readily assessed across a wide range of environments, notably Atari games. Future work will focus on refining the DQN algorithms, exploring the possibility of deriving aspiration-based algorithms from other RL methodologies such as the Soft Actor-Critic or PPO, and investigating the behavior of $\aleph$-aspiring agent in multi-agent environments both with and without maximizing agents.

* * *

[^t7feh5hr6kn]: Read "aleph", the first letter of the Hebrew alphabet 

[^swbxtcnt4ui]: In \(s_1\) it will get \(20\lambda\) in expectation and will choose \(a_0\) in \(s_i\) with a probability of \(\lambda\). Therefore the expected \(G\) will be \(20\lambda^2\). 

[^jfxfi4y6s2]: Unless we are willing to numerically determine the relationship between \(\lambda\) and \(\mathbb E_\lambda G\) and find \(\lambda_\aleph\) s.t \(\mathbb E_{\lambda_\aleph} G = \aleph\) 

[^yrreh6y8f9]: e.g draw actions more human-like with something similar to quantilizers 

[^5sk6ynug2m]: \(\aleph_{t+1}\gets(\aleph_t-r_{t+1})/\gamma\)