Research
Published
Mood Manifolds: three neuromodulatory gains for impulse–caution control in deep reinforcement learning
BY

Dario Fumarola, Jin Tan Ruan
We tested how three control settings change the balance between earning rewards and avoiding collisions in a learning agent. In the Pac-Mind simulation, agents trained with a higher hazard penalty kept farther from danger and collided less often, at the cost of lower average reward. Encouraging exploration alone produced more varied actions and a slight increase in collision risk. We trained each configuration separately, leaving open whether an already trained agent could switch between these behaviors.

Featured
Contents
Abstract
Mood Manifolds investigates how three global gains relate to impulse–caution behavior in deep reinforcement learning: a gain on the temporal-difference error, an entropy coefficient, and a hazard-penalty coefficient. The described protocol trains actor–critic agents separately for each gain configuration, resetting weights between runs. Those comparisons do not establish that changing the gains alone switches the behavior of a frozen network. Fixed-weight switching remains a research question; Figure 6 illustrates the proposed idea rather than a measured response.
Introduction
Deep-RL agents routinely eclipse humans in games and benchmark suites, yet they fracture when the reward map or threat landscape changes. Brains handle such non-stationarity with ease: a handful of neuromodulators diffuse through wide swathes of cortex and subcortex, retuning synaptic plasticity and circuit excitability within seconds. Emulating that chemical “control channel” could allow artificial controllers to adapt online without retraining or structural modifications.
Dopamine and serotonin dominate laboratory studies of behavioural flexibility. Phasic dopamine bursts encode reward-prediction errors (RPEs) that drive reinforcement learning, while tonic levels track opportunity cost and motor vigour. Serotonin projects almost ubiquitously and shapes patience, harm avoidance, and uncertainty sensitivity through multiple receptor families. Crucially, the two systems often push in opposite directions: dopamine favours appetitive, high-gain choices; serotonin biases toward cautious exploration, hinting that a low-dimensional neuromodulatory space may be enough to span a rich behavioural repertoire.
Most attempts to port these ideas into machine learning either hard-code exploration bonuses, hand-craft risk penalties, or meta-learn entire weight sets. All three approaches are heavy compared with biology’s minimalist broadcast.
Research question. We ask whether a fixed actor–critic agent, augmented only with three global scalars that mimic dopaminergic gain and serotonergic entropy- and risk-control, can switch on demand between impulsive and cautious policies while remaining stable.
The three gains act on the training signals and objective: k_DA scales the temporal-difference error, k_5HT^ent weights the entropy term, and k_5HT^risk weights a supplied hazard penalty. They are hyperparameters external to the network weights. In the algorithm described here, their effect on a learned policy operates through optimization; changing these values does not by itself establish a change in a frozen policy's action probabilities.
The note reports comparisons among separately trained gain configurations in Pac-Mind and MiniHack. These comparisons concern behavior after training under different settings. They should be distinguished from an inference-time switching experiment on one fixed set of network weights.
Related work
Neuromodulators as meta-parameters. Computational accounts have related neuromodulators to learning signals, exploration, and risk sensitivity. Here, those ideas motivate three scalar terms in an actor–critic objective. This computational analogy is not a claim that the model reproduces the underlying biological mechanisms.
Neuromodulated plasticity and continual adaptation. Some approaches place modulation inside a network's dynamics or plasticity rules. This note instead describes gains applied to learning signals and the training objective. Whether a separate inference-time control pathway can support frozen-weight switching requires its own implementation and evaluation.
Meta-gradient and meta-RL baselines. Methods that adapt hyperparameters or learn adaptation procedures provide relevant comparisons. The three-gain setup is a different parameterization of the training objective; the described sweep does not establish lower adaptation cost or better generalization than those baselines.
Robotics and safety-critical applications. Impulse–caution control motivates questions about systems operating near hazards. The reported tasks are simulations. They do not establish deployment readiness, safe behavior on physical robots, or adaptation without retraining.
Preliminaries
Markov decision process. The environment is a Markov decision process M = (S, A, P, r, γ). At step t the agent observes a state S_t ∈ S, samples an action A_t ~ π_θ(· | S_t), receives reward R_{t+1} = r(S_t, A_t, S_{t+1}) and transitions to S_{t+1} ~ P(· | S_t, A_t). The objective is to maximise the discounted return G_t = Σ_{k=0}^∞ γ^k · R_{t+k+1}.
Actor–critic baseline. A value network V_w estimates the state value v_π(s) = E_π[G_t | S_t = s]. The temporal-difference error is
The critic follows stochastic gradient descent on ½ · δ_t², while the actor ascends the policy gradient log π_θ(A_t | S_t) · δ_t. This backbone remains untouched in what follows; neuromodulation operates only through three global scalars applied to the signals in Eq. (1) and to the actor objective.
Neuromodulatory actor–critic model
The model adds three scalar gains to a standard actor–critic training procedure. The gains alter learning signals and objective terms while retaining the network architecture. The optimizer still updates the network weights, as shown in Algorithm 1; retaining the architecture is different from freezing the weights.
Serotonergic risk modulation (
k_5HT^risk). To promote harm avoidance, the immediate rewardR_{t+1}is adjusted based on proximity to hazards. A differentiable danger signal,ρ(S_{t+1})(for example, distance to a threat), is scaled byk_5HT^riskand subtracted from the reward (Algorithm 1, line 2). This reshaped rewardR′_{t+1}is then used to calculate the temporal-difference (TD) error (line 4), effectively creating “value valleys” around threats for cautious navigation.Dopaminergic gain (
k_DA). Mimicking phasic dopamine’s role in scaling reward-prediction errors (RPEs), the calculated TD errorδ_tis multiplied by a non-negative gaink_DA(Algorithm 1, line 6). This scaled error,δ′_t, serves as the learning signal for both the critic (line 8) and actor (line 11) updates, influencing the speed and intensity of learning.Serotonergic entropy drive (
k_5HT^ent). To encourage exploratory breadth, the actor’s objective is augmented with the policy entropyH_t, weighted byk_5HT^ent(Algorithm 1, line 11). Higher values of this coefficient promote wider action distributions, reflecting serotonin’s link to patience and uncertainty-driven exploration.
Figure 1. Where the three gains enter the actor–critic update. The environment reward R is reshaped to R′ = R − k_5HT^risk · ρ(S); the TD error δ computed from R′ is scaled to δ′ = k_DA · δ; the critic minimises ½ δ′² and the actor ascends log π(A|S) · δ′ + k_5HT^ent · H. The shared network (11 × 11 × 6 egocentric slice, two 3 × 3 convolutions with 32 and 64 filters, 256-d features, value head and 4-action policy head) is updated by the optimizer on every step; nothing is frozen.
Algorithm 1. Neuromodulatory actor–critic update
Mood manifold. The triplet k = (k_DA, k_5HT^ent, k_5HT^risk) defines a three-dimensional space of training configurations, with k = (1, 0, 0) as the baseline. The reported sweep compares agents trained at different points in that space. A continuous parameter space does not establish a continuous behavioral response or an inference-time switch within a single frozen network.
Experimental protocol
We evaluate neuromodulatory control in two domains: a custom grid-world, Pac-Mind, designed for fine-grained safety analysis, and the publicly available MiniHack HazardRooms benchmark, which adds sparse rewards and stochastic traps. Both tasks share the same perception stack, training loop, and hyper-parameters; only the raw observations differ.
Pac-Mind
Pac-Mind is a 20 × 20 toroidal maze. Cells may contain walls, pellets (+1), power-pellets (+10 plus 40 steps of ghost vulnerability), the agent, or one of four ghosts. A vulnerable ghost grants +50 when captured; contact with a non-vulnerable ghost ends the episode with −100. Ghosts pursue the agent with probability 0.8 and otherwise move randomly. The danger signal ρ(S_{t+1}) for Pac-Mind is defined as 1 / (1 + d), where d is the Manhattan distance from state S_{t+1} to the nearest non-vulnerable ghost; if no non-vulnerable ghosts are present, ρ(S_{t+1}) = 0. Episodes terminate on collision, after 3,000 steps, or when all pellets are cleared.
MiniHack HazardRooms
MiniHack rooms are 17 × 17 ASCII layouts containing lava tiles (instant death, −100), floor spikes (−10), and a single amulet goal (+100). The environment randomly samples one of eight room templates each episode, forcing the agent to recompute safe paths. Observation is an egocentric 15 × 15 × 8 tensor encoding glyphs, colours, and terrain types; we down-project it to the six-channel format used in Pac-Mind to keep networks identical. In MiniHack, the danger signal ρ(S_{t+1}) is a binary indicator: ρ(S_{t+1}) = 1 if the agent’s state S_{t+1} corresponds to a lava tile or floor spike, and ρ(S_{t+1}) = 0 otherwise.
Perception and control network
At every step the agent receives an 11 × 11 × 6 egocentric slice centred on its position. Two convolutional layers (kernels 3 × 3, strides 1, filters 32 and 64, ReLU activations) compress the slice to a 256-dimensional embedding φ(S_t). A linear value head outputs V_w(S_t); a parallel linear policy head produces π_θ(· | S_t) over the four cardinal actions. Parameters are initialised with Xavier uniform variance 2 / (n_in + n_out).
Training regime
We train with synchronous Advantage Actor–Critic (A2C). The Adam optimiser uses α_a = α_c = 10⁻⁴ and (β₁, β₂) = (0.9, 0.999). Batches comprise 20-step roll-outs from 16 parallel environments; gradients are clipped to unit norm. The discount is γ = 0.99.
Table 1. Hyperparameters shared by every mood configuration in both Pac-Mind and MiniHack HazardRooms.
Each setting of the mood vector k = (k_DA, k_5HT^ent, k_5HT^risk) is trained for 50,000 episodes under five random seeds, resetting weights between runs. Training for each of the 36 mood configurations took approximately 4–6 GPU-hours on an NVIDIA V100 GPU. The sweep spans k_DA ∈ {0.5, 1, 2, 4}, k_5HT^ent ∈ {0, 0.02, 0.05}, and k_5HT^risk ∈ {0, 0.2, 1}, yielding 36 distinct computational moods. The specific ranges for k_5HT^ent and k_5HT^risk were determined through preliminary experiments to explore distinct behavioural regimes effectively within a computationally feasible sweep.
Evaluation protocol
Every tenth episode runs in evaluation mode with greedy action selection; no learning occurs and statistics are logged. Performance is summarised by cumulative return, episode length, pellets (or amulets) collected, ghost or lava collisions, and ghosts eaten. Behavioural style is quantified by mean policy entropy and average Euclidean distance to the nearest hazard (defined as ghosts in Pac-Mind, and lava or spikes in MiniHack). Safety is the empirical collision probability. Metrics are averaged over seeds, and 95% confidence intervals are computed via bootstrap resampling.
Hypotheses. We expect larger k_DA to accelerate early learning and amplify return variance. Increasing k_5HT^ent or k_5HT^risk should extend survival and lower collision risk at the expense of slower reward accumulation. Intermediate moods ought to interpolate smoothly, forming a safety–performance frontier that is examined in “Reported training results”.
Reported training results
Learning dynamics
Figure 2 plots the average return over training episodes in Pac-Mind, illustrating the typical learning dynamics for different neuromodulatory moods. These curves, representing means over five random seeds, exhibit the characteristic variability inherent in deep reinforcement learning.
Figure 2. Learning dynamics in Pac-Mind for four separately trained mood configurations. Curves show average return (mean over five random seeds) against training episodes; shaded bands are bootstrap 95% confidence intervals. Labels at the right edge mark approximate plateau levels for Baseline k = (1, 0, 0) (about 134), High DA k = (4, 0, 0) (about 155) and High 5-HT k = (1, 0.05, 1) (about 124); Mixed k = (4, 0.05, 1) plateaus between them. The vertical line marks where High DA overtakes Baseline (about episode 11,800).
The baseline mood (k_DA, k_5HT^ent, k_5HT^risk) = (1, 0, 0) shows a generally steady climb after an initial learning phase, eventually approaching a fluctuating plateau averaging around 134 ± 4 after approximately 4 × 10⁴ episodes. Quadrupling the dopaminergic gain (k_DA = 4) markedly accelerates the initial learning rate: this curve overtakes the baseline around episode 11,800 and reaches a higher plateau averaging 155 ± 5. The confidence band for mean return is wider in the high-gain condition over this interval.
Serotonin-dominant moods show the opposite pattern. Setting k_5HT^ent = 0.05 and k_5HT^risk = 1 (with baseline k_DA = 1) delays the take-off by roughly 8,000 to 10,000 episodes, with learning appearing very slow initially. Yet eventual convergence leads to a more stable plateau, averaging only about 7% below baseline (around 124) and exhibiting considerably less variance. Mixed neuromodulation (k_DA = 4 plus full serotonin, that is, k_5HT^ent = 0.05, k_5HT^risk = 1) initially follows the rapid ascent characteristic of the high dopaminergic influence. It then levels off, achieving a plateau between those of the purely high-dopamine and high-serotonin conditions, illustrating how the effects of these scalars can combine.
A mixed-effects regression (return ~ k_DA × k_5HT^ent × k_5HT^risk + (1 | seed)) confirms a strong three-way interaction (F(6, 684) = 18.4, p < 10⁻⁴), supporting the claim that the scalars act as somewhat orthogonal control axes influencing the learning process and resultant behaviours.
Safety–performance frontier
Plotting catastrophic-collision probability against mean return across all 36 distinct neuromodulatory moods (Figure 3) reveals a well-defined, continuous frontier. The cloud of points illustrates a clear trade-off between reward acquisition and risk avoidance.
Figure 3. Safety–performance frontier in Pac-Mind across the 36 separately trained moods. Each marker is one k setting, plotting mean return against catastrophic collision probability. Fill density encodes k_DA (lightest 0.5, darkest 4); marker shape encodes k_5HT^risk (circle 0, square 0.2, triangle 1). The three k_5HT^ent values (0, 0.02, 0.05) produce the small local spread within each density–shape group. The arrow marks the impulsive corner (high return, high collision rate).
High-dopamine settings (darkest markers, k_DA = 4) predominantly cluster in the upper-right quadrant, achieving returns above 150 but at the cost of higher collision rates, some approaching 3.9% to 4.5%. Conversely, configurations emphasising high serotonin-like risk aversion (triangles, k_5HT^risk = 1), particularly when combined with lower dopamine, anchor the lower-left of the frontier. These moods yield more modest returns, typically around 100 to 110, but maintain excellent safety with collision probabilities often below 0.8%, and some near zero.
Intermediate gain configurations occupy the region between the reported return and collision-rate extremes. The reported Spearman correlation is 0.91 (p < 10⁻⁶). These comparisons concern separately trained configurations; they do not show that an operator can move one frozen policy along the plotted trade-off by changing three scalars.
Behavioral signatures
The neuromodulatory scalars imprint distinct behavioral signatures on the agent, affecting not only its learning and safety but also its moment-to-moment decision-making processes.
Entropy coefficients, particularly k_5HT^ent, demonstrably widen the policy. In our experiments, the average action entropy for agents with high serotonergic drive (for example, those with high k_5HT^ent and/or k_5HT^risk) settles at approximately 0.86 ± 0.02 nats. This contrasts sharply with dopamine-heavy agents (high k_DA, low serotonin coefficients), whose average action entropy is typically around 0.48 ± 0.03 nats, indicating more deterministic, exploitative policies.
The influence of these modulators extends to how the agent perceives and values its environment. As illustrated in the value-function heat-maps (Figure 4), the serotonergic risk coefficient k_5HT^risk plays a crucial role in shaping the agent’s aversion to threats. Figure 4B shows that when k_5HT^risk > 0 (specifically, k = (1, 0, 1) with baseline k_DA = 1), deep “value valleys” or depressions form around the ghost. This makes states proximal to the hazard significantly less attractive. In contrast, the baseline mood (Figure 4A, k = (1, 0, 0) with k_5HT^risk = 0) shows a less pronounced devaluation of states near the ghost. Furthermore, increasing dopaminergic gain alone (Figure 4C, k = (4, 0, 0) with k_5HT^risk = 0) primarily rescales the value surface, amplifying both positive and negative values, without creating the specific, deep hazard-avoidance depressions induced by k_5HT^risk.
Figure 4. Value-function landscapes V(S) in a 9 × 9 egocentric view from Pac-Mind under three separately trained moods. The agent (triangle) is central; a ghost (diamond) is two cells to its right. Denser fill indicates higher V(S). (A) Baseline, k = (1, 0, 0). (B) High serotonergic risk, k = (1, 0, 1), creates a deep value depression around the ghost. (C) High dopaminergic gain, k = (4, 0, 0), primarily rescales the value surface without the hazard depression seen in (B). Panels (A) and (B) share one colour scale; panel (C) uses a separate scale.
These differences in policy breadth and value perception manifest intuitively in the agent’s movement patterns, as demonstrated by the trajectory overlays in Figure 5. The figure presents two scenarios (A and B) within an identical maze layout, where agents start from the same position (blue diamond) and can target the same rewards, including a power-pellet (blue square) and other pellets (grey circles). Panel A of Figure 5 shows that dopamine-rich agents (representing high k_DA) exhibit impulsive behaviour, tending to dash straight for the power-pellet and accepting higher risk by “clipping ghost corners”, passing very close to the primary ghost (black triangle) through a narrow passage. In stark contrast, Panel B of Figure 5 demonstrates that serotonin-rich agents (representing high k_5HT^risk) display cautious navigation when approaching the same power-pellet; they arc wide around threats, taking a significantly longer and safer route, thereby maintaining a substantial buffer from the ghost. This cautious approach is consistent with broader evaluations showing such agents maintaining a median distance of 5.7 cells from the nearest hazard. The secondary trajectories (dashed black lines) in both panels, targeting another pellet, further reinforce these distinct impulsive versus cautious styles in the face of other potential hazards (secondary ghost, grey triangle).
Figure 5. Trajectory overlays illustrating behavioural styles in Pac-Mind. Both panels (A: Impulsive, B: Cautious) depict the identical maze layout, start position (blue diamond), power-pellet (blue square), primary ghost (black triangle), secondary ghost (grey triangle) and other pellets (grey circles). Trajectory 1 (solid blue) targets the power-pellet; Trajectory 2 (dashed black) targets an upper-right pellet. Panel (A) shows an agent trained with high k_DA (for example, k = (4, 0, 0)) taking direct, risky paths. Panel (B) shows an agent trained with high serotonergic gains (for example, k = (1, 0.05, 1)) taking wide, arcing paths. The two panels show separately trained agents, not one network under two gain settings.
Cross-task generalization
In MiniHack HazardRooms, the main behavioural trends related to dopamine and serotonin influence persist. Table 2 reports steady-state metrics over the final 5,000 evaluation episodes. High dopamine (k_DA = 4) settings generally yield higher returns (+24% against baseline) but at the cost of significantly increased risk (lava deaths triple relative to baseline). High serotonin settings (specifically high k_5HT^risk = 1, k_5HT^ent = 0.05 with baseline k_DA = 1) drastically reduce catastrophic failures (deaths reduced to 1.3%) and prolong episode duration by 38%, indicative of a cautious policy, though with tempered returns. The “Mixed” mood (k_DA = 4, k_5HT^ent = 0.05, k_5HT^risk = 1) presents an intermediate profile, outperforming the purely high-serotonin mood in returns but with a death rate slightly higher than the baseline, illustrating the combined influence of the scalars.
Table 2. Steady-state performance (mean ± 95% CI over the final 5,000 evaluation episodes, five seeds) on MiniHack HazardRooms.
The note reports both task families under the described gain sweep. Because configurations are trained separately, this comparison does not establish zero-shot transfer of a trained policy or fixed-weight adaptation between tasks.
Discussion
The described training procedure changes learning signals and objective terms using three scalar gains. The reported comparisons concern the policies learned under those configurations. They do not establish that the gains directly reroute a frozen policy, that the same weights transfer between tasks, or that changing k alone controls behavior during deployment.
The gains have distinct roles in the update rule: k_DA scales the temporal-difference learning signal, k_5HT^ent weights policy entropy, and k_5HT^risk weights the supplied hazard penalty. Distinct roles in an objective do not establish independent behavioral effects; that interpretation requires the recorded experiments and analysis.
A controller that changes behavior at inference time remains a possible research direction. The update rule described here does not demonstrate that capability. The risk gain is a chosen coefficient on a supplied penalty, not a measurement of perceived hazard or a validated safety indicator.
Limitations. The described tasks are discrete simulations, and the hazard signal is hand-crafted. The protocol holds k fixed within an episode and retrains each gain configuration. The preprocessing description and reported evaluation statistics also require reconciliation with the manuscript and run records before exact reproduction.
Future directions. A meta-controller that adjusts k online, driven by surprise, energy budgets, or formal safety constraints, would close the loop toward fully autonomous mood regulation. Extending the scheme to continuous-control robots will test scaling and energy efficiency, while porting it to spiking networks with local three-factor rules would let us compare directly to cortical data. Finally, incorporating noradrenaline (exploration temperature) and acetylcholine (learning-rate gating) could turn the current 3-D manifold into a richer, biologically grounded control atlas.
Conclusion
Mood Manifolds examines how three global gains relate to impulse–caution behavior in deep reinforcement learning. The described protocol compares separately trained configurations. It does not establish behavioral switching in a frozen network, a measured switching time, or safety in real-world environments. Those questions require a documented inference-time mechanism and recorded evaluation.
Appendix A. Supplementary results and conceptual illustration
This appendix presents supplementary ablation results and, separately, a conceptual illustration of mood switching. The illustrative traces in “Conceptual illustration of mood switching” should not be interpreted as recorded experimental trajectories.
Ablation studies: isolating serotonergic influences
To better understand the individual contributions of the serotonergic scalars, k_5HT^ent and k_5HT^risk, we conducted ablation studies in the Pac-Mind environment. We compared the baseline mood k = (1, 0, 0) with two ablated conditions:
Risk-only mood:
k = (1, 0, k_5HT^risk), withk_5HT^risk = 1. Here, only the risk penalty component is active.Entropy-only mood:
k = (1, k_5HT^ent, 0), withk_5HT^ent = 0.05. Here, only the entropy drive component is active.
All other experimental conditions, including the k_DA = 1 setting and training duration, were kept identical to the main experiments. Table 3 summarises key performance and behavioural metrics averaged over the final 5,000 evaluation episodes for five random seeds.
Table 3. Ablation results in Pac-Mind (mean ± 95% CI over the final 5,000 evaluation episodes, five seeds).
The results in Table 3 highlight distinct effects. The risk-only mood significantly reduces collision probability and increases the average distance to hazards, consistent with the role of k_5HT^risk in promoting cautious navigation, albeit with a reduction in mean return. Policy entropy remains similar to the baseline. Conversely, the entropy-only mood markedly increases policy entropy, leading to more explorative behaviour. This results in a slightly lower return and a marginal increase in collision risk compared to baseline, as the increased exploration does not inherently include hazard aversion without active k_5HT^risk. These findings support the hypothesis that k_5HT^ent primarily governs policy stochasticity, while k_5HT^risk directly implements a safety bias by penalising proximity to threats, demonstrating their somewhat orthogonal contributions to behaviour.
Conceptual illustration of mood switching
Figure 6 illustrates a proposed mid-episode change in the mood vector k. The illustrative settings change from k_impulsive = (4, 0, 0) to k_cautious = (1, 0.05, 1) at step 100. This scenario explains the proposed switching idea; the figure does not report a measured switching experiment.
Figure 6. Conceptual sketch only; not measured results. The traces illustrate a proposed mid-episode change from k = (4, 0, 0) to k = (1, 0.05, 1) at step 100 and a hypothetical rise in policy entropy and distance to the nearest ghost. No such experiment was run. The sketch does not demonstrate an observed behavioural response, behaviour change without weight updates, or a switching time.
The illustrated changes in policy entropy and hazard distance are conceptual. They cannot establish that a policy changes without weight updates, that caution increases, or that a response occurs within a particular number of steps. Those claims require recorded trajectories and a documented evaluation protocol for changing k; Figure 6 does not supply that evidence.
Sources and version notes
Slides: Knobs of the Mind: Dopamine, Serotonin, and a Maze-Running Rover (ICML 2025)
Research
Browse all research, analyses, and software.
Browse all research notes and technical analyses.
Research
Contents
Abstract
Mood Manifolds investigates how three global gains relate to impulse–caution behavior in deep reinforcement learning: a gain on the temporal-difference error, an entropy coefficient, and a hazard-penalty coefficient. The described protocol trains actor–critic agents separately for each gain configuration, resetting weights between runs. Those comparisons do not establish that changing the gains alone switches the behavior of a frozen network. Fixed-weight switching remains a research question; Figure 6 illustrates the proposed idea rather than a measured response.
Introduction
Deep-RL agents routinely eclipse humans in games and benchmark suites, yet they fracture when the reward map or threat landscape changes. Brains handle such non-stationarity with ease: a handful of neuromodulators diffuse through wide swathes of cortex and subcortex, retuning synaptic plasticity and circuit excitability within seconds. Emulating that chemical “control channel” could allow artificial controllers to adapt online without retraining or structural modifications.
Dopamine and serotonin dominate laboratory studies of behavioural flexibility. Phasic dopamine bursts encode reward-prediction errors (RPEs) that drive reinforcement learning, while tonic levels track opportunity cost and motor vigour. Serotonin projects almost ubiquitously and shapes patience, harm avoidance, and uncertainty sensitivity through multiple receptor families. Crucially, the two systems often push in opposite directions: dopamine favours appetitive, high-gain choices; serotonin biases toward cautious exploration, hinting that a low-dimensional neuromodulatory space may be enough to span a rich behavioural repertoire.
Most attempts to port these ideas into machine learning either hard-code exploration bonuses, hand-craft risk penalties, or meta-learn entire weight sets. All three approaches are heavy compared with biology’s minimalist broadcast.
Research question. We ask whether a fixed actor–critic agent, augmented only with three global scalars that mimic dopaminergic gain and serotonergic entropy- and risk-control, can switch on demand between impulsive and cautious policies while remaining stable.
The three gains act on the training signals and objective: k_DA scales the temporal-difference error, k_5HT^ent weights the entropy term, and k_5HT^risk weights a supplied hazard penalty. They are hyperparameters external to the network weights. In the algorithm described here, their effect on a learned policy operates through optimization; changing these values does not by itself establish a change in a frozen policy's action probabilities.
The note reports comparisons among separately trained gain configurations in Pac-Mind and MiniHack. These comparisons concern behavior after training under different settings. They should be distinguished from an inference-time switching experiment on one fixed set of network weights.
Related work
Neuromodulators as meta-parameters. Computational accounts have related neuromodulators to learning signals, exploration, and risk sensitivity. Here, those ideas motivate three scalar terms in an actor–critic objective. This computational analogy is not a claim that the model reproduces the underlying biological mechanisms.
Neuromodulated plasticity and continual adaptation. Some approaches place modulation inside a network's dynamics or plasticity rules. This note instead describes gains applied to learning signals and the training objective. Whether a separate inference-time control pathway can support frozen-weight switching requires its own implementation and evaluation.
Meta-gradient and meta-RL baselines. Methods that adapt hyperparameters or learn adaptation procedures provide relevant comparisons. The three-gain setup is a different parameterization of the training objective; the described sweep does not establish lower adaptation cost or better generalization than those baselines.
Robotics and safety-critical applications. Impulse–caution control motivates questions about systems operating near hazards. The reported tasks are simulations. They do not establish deployment readiness, safe behavior on physical robots, or adaptation without retraining.
Preliminaries
Markov decision process. The environment is a Markov decision process M = (S, A, P, r, γ). At step t the agent observes a state S_t ∈ S, samples an action A_t ~ π_θ(· | S_t), receives reward R_{t+1} = r(S_t, A_t, S_{t+1}) and transitions to S_{t+1} ~ P(· | S_t, A_t). The objective is to maximise the discounted return G_t = Σ_{k=0}^∞ γ^k · R_{t+k+1}.
Actor–critic baseline. A value network V_w estimates the state value v_π(s) = E_π[G_t | S_t = s]. The temporal-difference error is
The critic follows stochastic gradient descent on ½ · δ_t², while the actor ascends the policy gradient log π_θ(A_t | S_t) · δ_t. This backbone remains untouched in what follows; neuromodulation operates only through three global scalars applied to the signals in Eq. (1) and to the actor objective.
Neuromodulatory actor–critic model
The model adds three scalar gains to a standard actor–critic training procedure. The gains alter learning signals and objective terms while retaining the network architecture. The optimizer still updates the network weights, as shown in Algorithm 1; retaining the architecture is different from freezing the weights.
Serotonergic risk modulation (
k_5HT^risk). To promote harm avoidance, the immediate rewardR_{t+1}is adjusted based on proximity to hazards. A differentiable danger signal,ρ(S_{t+1})(for example, distance to a threat), is scaled byk_5HT^riskand subtracted from the reward (Algorithm 1, line 2). This reshaped rewardR′_{t+1}is then used to calculate the temporal-difference (TD) error (line 4), effectively creating “value valleys” around threats for cautious navigation.Dopaminergic gain (
k_DA). Mimicking phasic dopamine’s role in scaling reward-prediction errors (RPEs), the calculated TD errorδ_tis multiplied by a non-negative gaink_DA(Algorithm 1, line 6). This scaled error,δ′_t, serves as the learning signal for both the critic (line 8) and actor (line 11) updates, influencing the speed and intensity of learning.Serotonergic entropy drive (
k_5HT^ent). To encourage exploratory breadth, the actor’s objective is augmented with the policy entropyH_t, weighted byk_5HT^ent(Algorithm 1, line 11). Higher values of this coefficient promote wider action distributions, reflecting serotonin’s link to patience and uncertainty-driven exploration.
Figure 1. Where the three gains enter the actor–critic update. The environment reward R is reshaped to R′ = R − k_5HT^risk · ρ(S); the TD error δ computed from R′ is scaled to δ′ = k_DA · δ; the critic minimises ½ δ′² and the actor ascends log π(A|S) · δ′ + k_5HT^ent · H. The shared network (11 × 11 × 6 egocentric slice, two 3 × 3 convolutions with 32 and 64 filters, 256-d features, value head and 4-action policy head) is updated by the optimizer on every step; nothing is frozen.
Algorithm 1. Neuromodulatory actor–critic update
Mood manifold. The triplet k = (k_DA, k_5HT^ent, k_5HT^risk) defines a three-dimensional space of training configurations, with k = (1, 0, 0) as the baseline. The reported sweep compares agents trained at different points in that space. A continuous parameter space does not establish a continuous behavioral response or an inference-time switch within a single frozen network.
Experimental protocol
We evaluate neuromodulatory control in two domains: a custom grid-world, Pac-Mind, designed for fine-grained safety analysis, and the publicly available MiniHack HazardRooms benchmark, which adds sparse rewards and stochastic traps. Both tasks share the same perception stack, training loop, and hyper-parameters; only the raw observations differ.
Pac-Mind
Pac-Mind is a 20 × 20 toroidal maze. Cells may contain walls, pellets (+1), power-pellets (+10 plus 40 steps of ghost vulnerability), the agent, or one of four ghosts. A vulnerable ghost grants +50 when captured; contact with a non-vulnerable ghost ends the episode with −100. Ghosts pursue the agent with probability 0.8 and otherwise move randomly. The danger signal ρ(S_{t+1}) for Pac-Mind is defined as 1 / (1 + d), where d is the Manhattan distance from state S_{t+1} to the nearest non-vulnerable ghost; if no non-vulnerable ghosts are present, ρ(S_{t+1}) = 0. Episodes terminate on collision, after 3,000 steps, or when all pellets are cleared.
MiniHack HazardRooms
MiniHack rooms are 17 × 17 ASCII layouts containing lava tiles (instant death, −100), floor spikes (−10), and a single amulet goal (+100). The environment randomly samples one of eight room templates each episode, forcing the agent to recompute safe paths. Observation is an egocentric 15 × 15 × 8 tensor encoding glyphs, colours, and terrain types; we down-project it to the six-channel format used in Pac-Mind to keep networks identical. In MiniHack, the danger signal ρ(S_{t+1}) is a binary indicator: ρ(S_{t+1}) = 1 if the agent’s state S_{t+1} corresponds to a lava tile or floor spike, and ρ(S_{t+1}) = 0 otherwise.
Perception and control network
At every step the agent receives an 11 × 11 × 6 egocentric slice centred on its position. Two convolutional layers (kernels 3 × 3, strides 1, filters 32 and 64, ReLU activations) compress the slice to a 256-dimensional embedding φ(S_t). A linear value head outputs V_w(S_t); a parallel linear policy head produces π_θ(· | S_t) over the four cardinal actions. Parameters are initialised with Xavier uniform variance 2 / (n_in + n_out).
Training regime
We train with synchronous Advantage Actor–Critic (A2C). The Adam optimiser uses α_a = α_c = 10⁻⁴ and (β₁, β₂) = (0.9, 0.999). Batches comprise 20-step roll-outs from 16 parallel environments; gradients are clipped to unit norm. The discount is γ = 0.99.
Table 1. Hyperparameters shared by every mood configuration in both Pac-Mind and MiniHack HazardRooms.
Each setting of the mood vector k = (k_DA, k_5HT^ent, k_5HT^risk) is trained for 50,000 episodes under five random seeds, resetting weights between runs. Training for each of the 36 mood configurations took approximately 4–6 GPU-hours on an NVIDIA V100 GPU. The sweep spans k_DA ∈ {0.5, 1, 2, 4}, k_5HT^ent ∈ {0, 0.02, 0.05}, and k_5HT^risk ∈ {0, 0.2, 1}, yielding 36 distinct computational moods. The specific ranges for k_5HT^ent and k_5HT^risk were determined through preliminary experiments to explore distinct behavioural regimes effectively within a computationally feasible sweep.
Evaluation protocol
Every tenth episode runs in evaluation mode with greedy action selection; no learning occurs and statistics are logged. Performance is summarised by cumulative return, episode length, pellets (or amulets) collected, ghost or lava collisions, and ghosts eaten. Behavioural style is quantified by mean policy entropy and average Euclidean distance to the nearest hazard (defined as ghosts in Pac-Mind, and lava or spikes in MiniHack). Safety is the empirical collision probability. Metrics are averaged over seeds, and 95% confidence intervals are computed via bootstrap resampling.
Hypotheses. We expect larger k_DA to accelerate early learning and amplify return variance. Increasing k_5HT^ent or k_5HT^risk should extend survival and lower collision risk at the expense of slower reward accumulation. Intermediate moods ought to interpolate smoothly, forming a safety–performance frontier that is examined in “Reported training results”.
Reported training results
Learning dynamics
Figure 2 plots the average return over training episodes in Pac-Mind, illustrating the typical learning dynamics for different neuromodulatory moods. These curves, representing means over five random seeds, exhibit the characteristic variability inherent in deep reinforcement learning.
Figure 2. Learning dynamics in Pac-Mind for four separately trained mood configurations. Curves show average return (mean over five random seeds) against training episodes; shaded bands are bootstrap 95% confidence intervals. Labels at the right edge mark approximate plateau levels for Baseline k = (1, 0, 0) (about 134), High DA k = (4, 0, 0) (about 155) and High 5-HT k = (1, 0.05, 1) (about 124); Mixed k = (4, 0.05, 1) plateaus between them. The vertical line marks where High DA overtakes Baseline (about episode 11,800).
The baseline mood (k_DA, k_5HT^ent, k_5HT^risk) = (1, 0, 0) shows a generally steady climb after an initial learning phase, eventually approaching a fluctuating plateau averaging around 134 ± 4 after approximately 4 × 10⁴ episodes. Quadrupling the dopaminergic gain (k_DA = 4) markedly accelerates the initial learning rate: this curve overtakes the baseline around episode 11,800 and reaches a higher plateau averaging 155 ± 5. The confidence band for mean return is wider in the high-gain condition over this interval.
Serotonin-dominant moods show the opposite pattern. Setting k_5HT^ent = 0.05 and k_5HT^risk = 1 (with baseline k_DA = 1) delays the take-off by roughly 8,000 to 10,000 episodes, with learning appearing very slow initially. Yet eventual convergence leads to a more stable plateau, averaging only about 7% below baseline (around 124) and exhibiting considerably less variance. Mixed neuromodulation (k_DA = 4 plus full serotonin, that is, k_5HT^ent = 0.05, k_5HT^risk = 1) initially follows the rapid ascent characteristic of the high dopaminergic influence. It then levels off, achieving a plateau between those of the purely high-dopamine and high-serotonin conditions, illustrating how the effects of these scalars can combine.
A mixed-effects regression (return ~ k_DA × k_5HT^ent × k_5HT^risk + (1 | seed)) confirms a strong three-way interaction (F(6, 684) = 18.4, p < 10⁻⁴), supporting the claim that the scalars act as somewhat orthogonal control axes influencing the learning process and resultant behaviours.
Safety–performance frontier
Plotting catastrophic-collision probability against mean return across all 36 distinct neuromodulatory moods (Figure 3) reveals a well-defined, continuous frontier. The cloud of points illustrates a clear trade-off between reward acquisition and risk avoidance.
Figure 3. Safety–performance frontier in Pac-Mind across the 36 separately trained moods. Each marker is one k setting, plotting mean return against catastrophic collision probability. Fill density encodes k_DA (lightest 0.5, darkest 4); marker shape encodes k_5HT^risk (circle 0, square 0.2, triangle 1). The three k_5HT^ent values (0, 0.02, 0.05) produce the small local spread within each density–shape group. The arrow marks the impulsive corner (high return, high collision rate).
High-dopamine settings (darkest markers, k_DA = 4) predominantly cluster in the upper-right quadrant, achieving returns above 150 but at the cost of higher collision rates, some approaching 3.9% to 4.5%. Conversely, configurations emphasising high serotonin-like risk aversion (triangles, k_5HT^risk = 1), particularly when combined with lower dopamine, anchor the lower-left of the frontier. These moods yield more modest returns, typically around 100 to 110, but maintain excellent safety with collision probabilities often below 0.8%, and some near zero.
Intermediate gain configurations occupy the region between the reported return and collision-rate extremes. The reported Spearman correlation is 0.91 (p < 10⁻⁶). These comparisons concern separately trained configurations; they do not show that an operator can move one frozen policy along the plotted trade-off by changing three scalars.
Behavioral signatures
The neuromodulatory scalars imprint distinct behavioral signatures on the agent, affecting not only its learning and safety but also its moment-to-moment decision-making processes.
Entropy coefficients, particularly k_5HT^ent, demonstrably widen the policy. In our experiments, the average action entropy for agents with high serotonergic drive (for example, those with high k_5HT^ent and/or k_5HT^risk) settles at approximately 0.86 ± 0.02 nats. This contrasts sharply with dopamine-heavy agents (high k_DA, low serotonin coefficients), whose average action entropy is typically around 0.48 ± 0.03 nats, indicating more deterministic, exploitative policies.
The influence of these modulators extends to how the agent perceives and values its environment. As illustrated in the value-function heat-maps (Figure 4), the serotonergic risk coefficient k_5HT^risk plays a crucial role in shaping the agent’s aversion to threats. Figure 4B shows that when k_5HT^risk > 0 (specifically, k = (1, 0, 1) with baseline k_DA = 1), deep “value valleys” or depressions form around the ghost. This makes states proximal to the hazard significantly less attractive. In contrast, the baseline mood (Figure 4A, k = (1, 0, 0) with k_5HT^risk = 0) shows a less pronounced devaluation of states near the ghost. Furthermore, increasing dopaminergic gain alone (Figure 4C, k = (4, 0, 0) with k_5HT^risk = 0) primarily rescales the value surface, amplifying both positive and negative values, without creating the specific, deep hazard-avoidance depressions induced by k_5HT^risk.
Figure 4. Value-function landscapes V(S) in a 9 × 9 egocentric view from Pac-Mind under three separately trained moods. The agent (triangle) is central; a ghost (diamond) is two cells to its right. Denser fill indicates higher V(S). (A) Baseline, k = (1, 0, 0). (B) High serotonergic risk, k = (1, 0, 1), creates a deep value depression around the ghost. (C) High dopaminergic gain, k = (4, 0, 0), primarily rescales the value surface without the hazard depression seen in (B). Panels (A) and (B) share one colour scale; panel (C) uses a separate scale.
These differences in policy breadth and value perception manifest intuitively in the agent’s movement patterns, as demonstrated by the trajectory overlays in Figure 5. The figure presents two scenarios (A and B) within an identical maze layout, where agents start from the same position (blue diamond) and can target the same rewards, including a power-pellet (blue square) and other pellets (grey circles). Panel A of Figure 5 shows that dopamine-rich agents (representing high k_DA) exhibit impulsive behaviour, tending to dash straight for the power-pellet and accepting higher risk by “clipping ghost corners”, passing very close to the primary ghost (black triangle) through a narrow passage. In stark contrast, Panel B of Figure 5 demonstrates that serotonin-rich agents (representing high k_5HT^risk) display cautious navigation when approaching the same power-pellet; they arc wide around threats, taking a significantly longer and safer route, thereby maintaining a substantial buffer from the ghost. This cautious approach is consistent with broader evaluations showing such agents maintaining a median distance of 5.7 cells from the nearest hazard. The secondary trajectories (dashed black lines) in both panels, targeting another pellet, further reinforce these distinct impulsive versus cautious styles in the face of other potential hazards (secondary ghost, grey triangle).
Figure 5. Trajectory overlays illustrating behavioural styles in Pac-Mind. Both panels (A: Impulsive, B: Cautious) depict the identical maze layout, start position (blue diamond), power-pellet (blue square), primary ghost (black triangle), secondary ghost (grey triangle) and other pellets (grey circles). Trajectory 1 (solid blue) targets the power-pellet; Trajectory 2 (dashed black) targets an upper-right pellet. Panel (A) shows an agent trained with high k_DA (for example, k = (4, 0, 0)) taking direct, risky paths. Panel (B) shows an agent trained with high serotonergic gains (for example, k = (1, 0.05, 1)) taking wide, arcing paths. The two panels show separately trained agents, not one network under two gain settings.
Cross-task generalization
In MiniHack HazardRooms, the main behavioural trends related to dopamine and serotonin influence persist. Table 2 reports steady-state metrics over the final 5,000 evaluation episodes. High dopamine (k_DA = 4) settings generally yield higher returns (+24% against baseline) but at the cost of significantly increased risk (lava deaths triple relative to baseline). High serotonin settings (specifically high k_5HT^risk = 1, k_5HT^ent = 0.05 with baseline k_DA = 1) drastically reduce catastrophic failures (deaths reduced to 1.3%) and prolong episode duration by 38%, indicative of a cautious policy, though with tempered returns. The “Mixed” mood (k_DA = 4, k_5HT^ent = 0.05, k_5HT^risk = 1) presents an intermediate profile, outperforming the purely high-serotonin mood in returns but with a death rate slightly higher than the baseline, illustrating the combined influence of the scalars.
Table 2. Steady-state performance (mean ± 95% CI over the final 5,000 evaluation episodes, five seeds) on MiniHack HazardRooms.
The note reports both task families under the described gain sweep. Because configurations are trained separately, this comparison does not establish zero-shot transfer of a trained policy or fixed-weight adaptation between tasks.
Discussion
The described training procedure changes learning signals and objective terms using three scalar gains. The reported comparisons concern the policies learned under those configurations. They do not establish that the gains directly reroute a frozen policy, that the same weights transfer between tasks, or that changing k alone controls behavior during deployment.
The gains have distinct roles in the update rule: k_DA scales the temporal-difference learning signal, k_5HT^ent weights policy entropy, and k_5HT^risk weights the supplied hazard penalty. Distinct roles in an objective do not establish independent behavioral effects; that interpretation requires the recorded experiments and analysis.
A controller that changes behavior at inference time remains a possible research direction. The update rule described here does not demonstrate that capability. The risk gain is a chosen coefficient on a supplied penalty, not a measurement of perceived hazard or a validated safety indicator.
Limitations. The described tasks are discrete simulations, and the hazard signal is hand-crafted. The protocol holds k fixed within an episode and retrains each gain configuration. The preprocessing description and reported evaluation statistics also require reconciliation with the manuscript and run records before exact reproduction.
Future directions. A meta-controller that adjusts k online, driven by surprise, energy budgets, or formal safety constraints, would close the loop toward fully autonomous mood regulation. Extending the scheme to continuous-control robots will test scaling and energy efficiency, while porting it to spiking networks with local three-factor rules would let us compare directly to cortical data. Finally, incorporating noradrenaline (exploration temperature) and acetylcholine (learning-rate gating) could turn the current 3-D manifold into a richer, biologically grounded control atlas.
Conclusion
Mood Manifolds examines how three global gains relate to impulse–caution behavior in deep reinforcement learning. The described protocol compares separately trained configurations. It does not establish behavioral switching in a frozen network, a measured switching time, or safety in real-world environments. Those questions require a documented inference-time mechanism and recorded evaluation.
Appendix A. Supplementary results and conceptual illustration
This appendix presents supplementary ablation results and, separately, a conceptual illustration of mood switching. The illustrative traces in “Conceptual illustration of mood switching” should not be interpreted as recorded experimental trajectories.
Ablation studies: isolating serotonergic influences
To better understand the individual contributions of the serotonergic scalars, k_5HT^ent and k_5HT^risk, we conducted ablation studies in the Pac-Mind environment. We compared the baseline mood k = (1, 0, 0) with two ablated conditions:
Risk-only mood:
k = (1, 0, k_5HT^risk), withk_5HT^risk = 1. Here, only the risk penalty component is active.Entropy-only mood:
k = (1, k_5HT^ent, 0), withk_5HT^ent = 0.05. Here, only the entropy drive component is active.
All other experimental conditions, including the k_DA = 1 setting and training duration, were kept identical to the main experiments. Table 3 summarises key performance and behavioural metrics averaged over the final 5,000 evaluation episodes for five random seeds.
Table 3. Ablation results in Pac-Mind (mean ± 95% CI over the final 5,000 evaluation episodes, five seeds).
The results in Table 3 highlight distinct effects. The risk-only mood significantly reduces collision probability and increases the average distance to hazards, consistent with the role of k_5HT^risk in promoting cautious navigation, albeit with a reduction in mean return. Policy entropy remains similar to the baseline. Conversely, the entropy-only mood markedly increases policy entropy, leading to more explorative behaviour. This results in a slightly lower return and a marginal increase in collision risk compared to baseline, as the increased exploration does not inherently include hazard aversion without active k_5HT^risk. These findings support the hypothesis that k_5HT^ent primarily governs policy stochasticity, while k_5HT^risk directly implements a safety bias by penalising proximity to threats, demonstrating their somewhat orthogonal contributions to behaviour.
Conceptual illustration of mood switching
Figure 6 illustrates a proposed mid-episode change in the mood vector k. The illustrative settings change from k_impulsive = (4, 0, 0) to k_cautious = (1, 0.05, 1) at step 100. This scenario explains the proposed switching idea; the figure does not report a measured switching experiment.
Figure 6. Conceptual sketch only; not measured results. The traces illustrate a proposed mid-episode change from k = (4, 0, 0) to k = (1, 0.05, 1) at step 100 and a hypothetical rise in policy entropy and distance to the nearest ghost. No such experiment was run. The sketch does not demonstrate an observed behavioural response, behaviour change without weight updates, or a switching time.
The illustrated changes in policy entropy and hazard distance are conceptual. They cannot establish that a policy changes without weight updates, that caution increases, or that a response occurs within a particular number of steps. Those claims require recorded trajectories and a documented evaluation protocol for changing k; Figure 6 does not supply that evidence.
Sources and version notes
Slides: Knobs of the Mind: Dopamine, Serotonin, and a Maze-Running Rover (ICML 2025)
Research
Browse all research notes and technical analyses.
More from Hebula
//
[#hebula]
&
[#research]
//
[#hebula]
&
[#research]
//
[#hebula]
&
[#research]
//
[#hebula]
&
[#research]
Research and collaboration
Have a research question?
Tell us what you’d like to test.
//
[#hebula]
&
[#research]
//
[#hebula]
&
[#research]
//
[#hebula]
&
[#research]
//
[#hebula]
&
[#research]
//
[#hebula]
&
[#research]
//
[#hebula]
&
[#research]
//
[#hebula]
&
[#research]
//
[#hebula]
&
[#research]
//
[#hebula]
&
[#research]
Research and collaboration
Have a research question?
Tell us what you’d like to test.
//
[#hebula]
&
[#research]
//
[#hebula]
&
[#research]
//
[#hebula]
&
[#research]
//
[#hebula]
&
[#research]
//
[#hebula]
&
[#research]
//
[#hebula]
&
[#research]
//
[#hebula]
&
[#research]
//
[#hebula]
&
[#research]
//
[#hebula]
&
[#research]
Research and collaboration
Have a research question?
Tell us what you’d like to test.
//
[#hebula]
&
[#research]
//
[#hebula]
&
[#research]
//
[#hebula]
&
[#research]
//
[#hebula]
&
[#research]
//
[#hebula]
&
[#research]



