Chapter 0: The Worked Example

0.1 Why We Start With An Example

Consider a platform that recommends content to users. At any moment, the platform maintains three things: a strategy for which items to promote, a running estimate of how valuable each recommendation is (based on accumulated engagement data), and a picture of the user population — who is visiting, what they want, how their browsing patterns are distributed across different user types.

These three quantities are coupled in a way that creates a feedback loop. When the platform changes its strategy, users see different content, which changes their behavior, which shifts the population mix. The new population mix makes some recommendations more or less effective, which updates the value estimates. And updated value estimates feed back into the next strategy revision. The loop closes on itself: strategy influences population, population influences value estimates, value estimates influence strategy.

This feedback pattern is not special to recommendation systems. It appears whenever a learning agent’s behavior influences the environment it learns from: a trading algorithm that moves prices by its own volume, a routing policy that redirects traffic into new patterns, a treatment protocol that shifts the distribution of patient health states. In each case, the distribution of situations the agent encounters is not a fixed background — it responds to the agent’s choices, and the agent’s choices respond to it.

In reinforcement learning, these three quantities have standard names. The strategy is a policy controlled by tunable parameters — the actor. The running value estimate is the critic. And the distribution of states the agent visits is the state distribution. A standard actor-critic algorithm updates all three at once, and after averaging out the stochastic noise inherent in individual interactions, the updates become a deterministic system of coupled differential equations.

Throughout these notes, that deterministic mean-field ODE is the primary object. We are not analyzing the raw stochastic recursion step by step. We are studying the averaged flow that the stochastic algorithm tracks on finite time horizons and whose attractors govern its asymptotic possibilities.

These notes ask a simple question: if we run the system long enough, where do all three quantities end up?

Answering that question rigorously will eventually require softmax policies, occupancy measures, matrix-valued critic coefficients, and an explicit confinement mechanism for the actor. Before those formal ingredients appear, we want to see the smallest nontrivial finite-dimensional instance of that ODE, with one actor coordinate, one critic coordinate, and a two-state law, so that every formula can be checked by hand.

The purpose of this chapter is therefore to fix the simplest nontrivial instance of the model and to compute everything explicitly. Later chapters will return to it repeatedly: to verify abstract lemmas, to check that the general definitions specialize correctly, and to see qualitative phenomena that the formalism alone might obscure.

By the end of the chapter, we will have seen what the state space looks like, why the actor drift does not generally close on the actor parameter alone, where the dissipative mechanism lives, and what kinds of long-time behavior the system makes visible.

0.2 Model Overview

The full actor-critic systems that motivate these notes are usually much larger than the model of this chapter. In a neural-network implementation, the actor parameter Code Test may have thousands or millions of coordinates, the critic parameter Code Test may be another large vector, and the state law may live on a high-dimensional simplex. Chapter 0 deliberately compresses that larger picture to its smallest nontrivial mean-field ODE:

  • two states and two actions,
  • one actor coordinate,
  • one critic coordinate,
  • one scalar law coordinate Code Test, because in a two-state simplex the second component is Code Test.

The point of the reduction is to make every coupling visible by hand. Chapter 2 restores the general finite-state model with Code Test-dimensional actor, Code Test-dimensional critic, and Code Test-state distribution, and Section 2.8 works through a three-state routing example where the chain dynamics are explicit.

Two modeling moves are on the table from the start.

First, we replace the stochastic actor-critic recursion by its deterministic mean-field ODE. Second, within that ODE class, we choose a deliberately low-dimensional worked example. The first move explains why differential equations appear at all. The second explains why Chapter 0 speaks in scalar coordinates.

With that framing in place, the worked example has three evolving coordinates and five groups of fixed data. Before defining anything precisely, here is the full inventory.

State coordinates of the worked example (what evolves in time):

  • Actor parameter Code Test: lives in Code Test, is confined to Code Test, and controls the policy.
  • Critic parameter Code Test: lives in Code Test and estimates the value function.
  • State distribution Code Test: lives in Code Test and records the fraction of time in state 1.

Data (what we choose once and hold fixed):

  • Finite environment: the states Code Test and actions Code Test.
  • Rewards: a number Code Test for each state-action pair.
  • Actor features: a number Code Test that links Code Test to the policy.
  • Critic features: a number Code Test that links Code Test to value estimates.
  • Closure map: a rule Code Test that assigns a reference distribution to each Code Test.

A reader coming from the dynamical-systems side may still ask why an ODE appears at all. The underlying actor-critic algorithm is a stochastic discrete-time recursion, and we replace it by its deterministic mean-field limit — the averaged drift obtained after smoothing out the interaction noise. Chapter 1 returns to that stochastic-approximation bridge and explains what the ODE does and does not tell us about the original algorithm. In Chapter 0 we take the resulting mean-field ODE as the object to compute explicitly.

In the general model, the ODE lives on Code Test. In the present reduction, the environment has only two states and two actions, the actor and critic each have one coordinate, and the simplex Code Test is one-dimensional. So the worked example lives in Code Test. The distribution variable Code Test is not a derived equilibrium statistic frozen in advance; it is a genuine state coordinate.

The rest of the chapter defines each ingredient, writes out the ODE, and studies its structural properties. In the symmetric example studied first, an accidental cancellation leaves the Code Test subsystem autonomous while Code Test relaxes toward a Code Test-dependent target. Section 0.15 breaks that symmetry and restores the full three-way coupling.

0.3 The Environment

We work with the smallest nontrivial finite-state controlled environment:

  • States: Code Test.
  • Actions: Code Test.

At each state Code Test, the agent chooses an action Code Test. The choice is governed by a policy that depends on the actor parameter Code Test. The environment responds with a reward that depends on the state-action pair.

We fix the following rewards:

  • At state Code Test, the rewards are Code Test and Code Test.
  • At state Code Test, the rewards are Code Test and Code Test.

The reward structure is simple: each state has a “matching” action that yields reward Code Test, and the other action yields reward Code Test. In the recommendation-system language of Section 0.1, “matching” means the platform promotes the right content for the current audience: type-1 users respond to content type 1, and type-2 users respond to content type 2. A match generates engagement (reward 1); a mismatch generates none (reward 0). The agent’s task is to learn which action fits which state, using only the cumulative reward signal.

This symmetric choice will produce clean formulas. Later in the chapter, we will break the symmetry to see how the coupling changes.

0.4 The Policy

The policy maps the actor parameter Code Test to a probability distribution over actions at each state. We use a softmax (Boltzmann) policy with temperature Code Test and linear logits.

The softmax is the standard differentiable bridge between a real-valued parameter and a probability distribution over finitely many actions. For our two-action setup with antisymmetric features, the entire policy will be controlled by a single scalar Code Test: positive Code Test pushes the agent toward the matching action at each state (specialization), negative Code Test pushes it toward the wrong action (anti-specialization), and Code Test produces a uniform policy that ignores state identity. The scalar Code Test is a single knob controlling how decisively the platform commits to tailoring its recommendations.

Actor features. Fix the following feature vectors (scalars, since Code Test):

  • At state Code Test, the actor features are Code Test and Code Test.
  • At state Code Test, the actor features are Code Test and Code Test.

These features have an antisymmetric structure: the feature at state Code Test for action Code Test is the negative of the feature at state Code Test for the same action. The sign convention means that increasing Code Test pushes the policy toward action Code Test at state Code Test and toward action Code Test at state Code Test.

Logits. For each state-action pair, the logit is

Code Test

Explicitly:

Code Test

Softmax policy. With temperature Code Test, the policy at state Code Test is

Code Test

Because there are only two actions and the logits differ by sign, the softmax reduces to the standard logistic sigmoid. Define

Code Test

Then:

Code Test

Code Test

The function Code Test is the probability of the “matching” action at either state: action Code Test at state Code Test, or action Code Test at state Code Test. When Code Test, one has Code Test, so the policy favors the matching action. When Code Test, the policy is uniform: Code Test. Since Code Test is a sigmoid, it is strictly increasing, smooth, and satisfies Code Test for every finite Code Test.

In the recommendation system, when Code Test is large and positive, the platform recommends content type 1 to type-1 users and content type 2 to type-2 users with high confidence — it is a specialist. When Code Test, the platform hedges, recommending both content types with equal probability regardless of the audience. The function Code Test therefore measures the quality of the platform’s targeting: Code Test near 1 means precise recommendations, Code Test near 1/2 means the platform is guessing.

We will often write Code Test for the complementary probability.

0.5 The State Distribution And The Occupancy Measure

The policy tells us how the agent acts at each state, but it does not tell us how often the agent visits each state. That information is carried by the state distribution Code Test, a probability vector on Code Test.

Because Code Test, the distribution is determined by a single scalar:

Code Test

In the recommendation system, Code Test is the share of type-1 users in the current audience. It is not a fixed background statistic — it changes as the platform’s strategy changes, because different recommendation policies attract different user mixes.

The state distribution simplex Code Test is therefore the interval Code Test in the coordinate Code Test.

The occupancy measure. Many quantities in reinforcement learning — rewards, gradients, critic errors — are expectations over state-action pairs. To compute any such expectation, we need to know two things: how often the agent is in each state, and what action it takes there. The occupancy measure packages both into a single probability distribution on Code Test.

Concretely, if the agent is in state Code Test with probability Code Test and then picks action Code Test with probability Code Test, the probability of seeing the pair Code Test is just the product:

Code Test

This is the occupancy measure Code Test. It depends on two inputs: the policy parameter Code Test (which determines how the agent acts) and the state distribution Code Test (which determines where the agent is). Any expected reward, any gradient, any critic target can be written as a sum weighted by Code Test.

In our example:

Code Test

Code Test

where Code Test and Code Test. These four entries are nonnegative and sum to Code Test, so Code Test is a probability measure on Code Test.

There is an important point to absorb early. The occupancy Code Test is determined by the current policy parameter Code Test and the current state distribution Code Test. At this stage, nothing requires Code Test to be the invariant law of any Markov chain. The variable Code Test is a genuine dynamical state coordinate that evolves in time, and Code Test is its derived product with the policy. This distinction will matter throughout the notes.

0.6 Why The Actor Drift Does Not Close On Alone

Before writing down the full system, let us see informally why the mean actor update cannot be expressed as a function of Code Test alone. In a policy-gradient-type update, the actor drift has the schematic form

Code Test

where the advantage-like quantity is a signal combining the reward, the critic estimate, and an entropy penalty — defined precisely in Section 0.8. Even in our scalar example, the occupancy Code Test depends on Code Test, and the advantage-like quantity may depend on a critic variable Code Test. If we try to eliminate Code Test and Code Test by assuming they are always at their equilibrium values, we are making a substitution that has not been justified. In general, Code Test and Code Test evolve on their own timescales and may not have reached equilibrium. The correct description is therefore a coupled system in the three variables Code Test.

In the specific symmetric example we are about to write down, an accident of the feature structure will cause the Code Test-dependence in the actor drift to cancel. We will exploit that simplification for the initial analysis, and then immediately break the symmetry to restore the full coupling. The point of the general theory, however, stands: the actor drift is not closed on Code Test alone whenever the occupancy or the critic introduces state dependence, and treating the system as if it were scalar in Code Test can miss genuine dynamical phenomena.

0.7 The Critic Equation

The critic variable Code Test (a scalar, since Code Test) is an auxiliary variable that tracks how much reward the current policy is earning. In the recommendation system, it is the platform’s running scorecard: a summary of how well the current recommendation strategy is performing, updated continuously as engagement data arrives. The critic feeds into the actor drift — it is the signal that tells the actor whether to specialize further or pull back.

In these notes, the critic equation is introduced directly as a linear response law rather than derived from a Bellman or temporal-difference recursion. We are concerned only with the deterministic mean-field system and its structural properties; the stochastic-approximation origin of the critic update is part of the background the reader brings.

Critic features. Fix:

  • At state Code Test, the critic features are Code Test and Code Test.
  • At state Code Test, the critic features are Code Test and Code Test.

These features assign weight Code Test to the matching state-action pair and weight Code Test to the other. With the regularization constant Code Test, the critic coefficients are:

Code Test

The sum has four terms, but the Code Test and Code Test terms vanish: Code Test and Code Test. Only the matching-action terms survive:

Code Test

Code Test

Both Code Test and Code Test depend on Code Test through Code Test, but the dependence on Code Test has cancelled because the matching-action occupancy weights are Code Test at state Code Test and Code Test at state Code Test, and these sum to Code Test. This is a direct consequence of the feature symmetry. In the general model, or when the symmetry is broken, both Code Test and Code Test will depend on Code Test.

The critic equation is

Code Test

For frozen Code Test, this is a scalar linear ODE with coefficient Code Test. Because Code Test for every Code Test, the equation is uniformly coercive: the critic relaxes exponentially toward its unique equilibrium

Code Test

Let us record a few values:

  • If Code Test, then Code Test and Code Test.
  • If Code Test, then Code Test and Code Test.
  • If Code Test, then Code Test and Code Test.
  • If Code Test, then Code Test and Code Test.

These values show the critic tracking the policy’s effectiveness. When Code Test is small and the policy is nearly uniform, the agent sees the matching action succeed only about half the time, so the critic’s estimate is low. As Code Test grows and the policy concentrates on matching, the reward rate rises and Code Test climbs toward Code Test. It never reaches Code Test because the regularization constant Code Test pulls the critic toward zero, creating a permanent gap. The critic is therefore a running scorecard: it reflects how much reward the current policy is actually generating, discounted by the regularization.

The equilibrium value Code Test is strictly between Code Test and Code Test for every finite Code Test, and it increases monotonically with Code Test.

0.8 The Actor Equation

The actor parameter lives in the box

Code Test

The raw actor drift is a score-type field that sums over all state-action pairs the product of the occupancy, an advantage-like reward signal, and the policy score.

Score functions. The score Code Test is the direction in parameter space that makes action Code Test more likely at state Code Test. It is the building block of any policy-gradient update: the agent adjusts Code Test along the score, weighted by how good the action turned out to be. In the softmax policy with temperature Code Test, the score at state-action pair Code Test is

Code Test

At state Code Test:

Code Test

Therefore

Code Test

At state Code Test:

Code Test

Therefore

Code Test

The same antisymmetric feature structure makes this state-Code Test computation a mirror image of the state-Code Test case, and we will see later in this section, when the drift simplifies, that this symmetry is what causes the Code Test-dependence to cancel.

Entropy-regularized advantage. For each state-action pair, the advantage-like signal appearing in the actor drift is

Code Test

The first two terms measure how good action Code Test is at state Code Test: the immediate reward plus the critic’s estimate. The third term, Code Test, is the entropy penalty. It is large and positive when the policy assigns low probability to action Code Test (because Code Test is a large negative number), and small when the policy already favors Code Test. The effect is to reward the agent for keeping its options open: an action the policy rarely takes gets a bonus, discouraging the policy from collapsing onto a single action too quickly. This is the mechanism that keeps the agent exploring.

To evaluate the entropy terms, write

Code Test

Then

Code Test

Code Test

The advantage-like terms at the four state-action pairs are therefore:

Code Test

Code Test

Code Test

Code Test

The raw actor drift. The raw drift is

Code Test

Since Code Test, the entropy term simplifies to Code Test. Grouping the four terms by their advantage-like factor, and using the occupancy formulas from Section 0.5, gives

Code Test

Both brackets simplify because the occupancy weights for matching pairs sum to Code Test and for non-matching pairs sum to Code Test, independently of Code Test. Continuing:

Code Test

This is the key formula for the symmetric example. The raw actor drift depends on Code Test and Code Test but not on Code Test. The cancellation is not a general feature of the model; it is a consequence of the antisymmetric feature structure. We will break it in Section 0.15.

Let us read the three factors of Code Test separately, because each one carries a distinct piece of the dynamics.

The factor Code Test is the policy’s exploration variance. It is maximal when Code Test (uniform policy, Code Test) and it vanishes as the policy becomes deterministic (Code Test or Code Test). This is the softmax analogue of a familiar fact: a deterministic policy has zero score and therefore receives no gradient signal. A platform that has already fully committed to one recommendation strategy has no room to learn from the reward it observes. The exploration variance imposes a built-in speed limit: the more the agent has already learned, the slower it adjusts.

The factor Code Test is the advantage-like signal. It is positive when the critic’s value estimate Code Test exceeds twice the current actor parameter, which happens when Code Test is not yet large enough to justify the reward the critic is reporting. It is negative when Code Test has overshot — when the policy is more specialized than the critic’s estimate warrants. The zero crossing Code Test will turn out to define the interior equilibrium of the actor.

The drift therefore pushes Code Test in the direction that aligns the policy with the critic’s assessment, but the push weakens as the policy becomes more certain. The system cannot accelerate indefinitely: high specialization suppresses the gradient, and the actor slows down before it overshoots.

Boundary damping. The effective actor drift includes a confinement factor that keeps the parameter inside the box Code Test:

Code Test

The factor Code Test vanishes on the boundary Code Test and is strictly positive in the interior. Its effect is to damp the drift as the parameter approaches the boundary, ensuring that no trajectory can leave the box. This confinement is not a physical constraint on the agent — it is a modeling device that keeps the parameter in a compact set, which is the precondition for the attractor theory developed in later chapters.

0.9 The Distribution Equation

The state distribution Code Test evolves by relaxation toward a prescribed policy-dependent target law Code Test. For this example, define

Code Test

In the recommendation system, this map says: when the platform uses policy parameter Code Test, the long-run fraction of type-1 users is Code Test. The linear dependence reflects a mild population response — as the platform specializes toward matching (increasing Code Test), it attracts more repeat visits from the user type that benefits most from accurate recommendations, tilting the population toward state 1. The coefficient Code Test keeps this response moderate: even at the extreme Code Test, the population split is 75/25, not 100/0. We prescribe Code Test as data in this chapter; the identification of Code Test with the invariant law of a controlled Markov chain is a separate theorem, deferred to Chapter 6.

Since Code Test, the first component lies in Code Test, so Code Test belongs to the interior of the simplex Code Test for every Code Test. Each component of Code Test is Lipschitz with constant Code Test; in the Code Test-distance on Code Test, the standing metric for distributions from Chapter 2 onward, the two component changes add, so the Lipschitz constant of Code Test is Code Test.

The scalar distribution equation is

Code Test

where we have set the relaxation rate Code Test. For frozen Code Test, this is a linear equation that drives Code Test exponentially toward the target Code Test.

For now, Code Test is simply a Lipschitz function from the actor box to the simplex, and the distribution equation relaxes toward it.

0.10 The Full Coupled System

Collecting the three components, the full coupled system in our example is the three-dimensional autonomous ODE with component equations

Code Test

Code Test

Code Test

The phase space is

Code Test

In the symmetric case, the Code Test subsystem is autonomous: the first two equations do not involve Code Test. The population coordinate is still part of the full state, but in this special reduction it responds to Code Test without feeding back into the first two equations. This decoupling is accidental and should not be expected in general.

The system is autonomous, and the only irregularity is Code Test at the boundary Code Test, which is precisely the confinement mechanism we want.

Let us read the system once more in the language of the recommendation platform. The first equation says: the platform adjusts its recommendation strategy based on how the reward signal (Code Test) compares to the current level of specialization (Code Test), but the adjustment weakens as the strategy becomes more decisive (the Code Test factor) and as it nears the boundary of the allowed range (the Code Test factor). The second equation says: the scorecard Code Test updates to track the reward that the current policy actually generates, relaxing exponentially toward its target. The third equation says: the user population drifts toward the mix that the current strategy induces, with the closure map Code Test prescribing that target mix. All three quantities from Section 0.1 are now present in equations, but one feedback arrow has disappeared in the symmetric reduction: the policy still drives the population, while the population does not feed back into the actor or critic until we break the symmetry in Section 0.15.

0.11 Forward Invariance

Before we study equilibria or long-run behavior, we need to verify that the system is well-posed on its intended domain. The actor parameter should stay in its box, the distribution should remain a probability, and the critic should not blow up. These properties are not automatic — each requires a separate argument. The three checks below are the concrete version of the forward-invariance arguments that Chapter 4 will develop in full generality.

The phase space Code Test is not all of Code Test, so we check each component separately.

The actor box. The factor Code Test vanishes at Code Test. If a trajectory starts with Code Test, set Code Test; then Code Test, a bounded continuous quantity along the trajectory, so Code Test stays finite on every finite interval and therefore Code Test for all forward time. If Code Test, then Code Test and uniqueness of solutions forces Code Test for all Code Test; if Code Test, the same uniqueness argument gives Code Test for all Code Test. Chapter 4 carries this barrier argument in the general setting. The mechanism is that Code Test acts as a barrier that makes the boundary Code Test invariant.

The simplex. The distribution equation Code Test has, by variation of constants, the explicit solution

Code Test

The weights in this expression sum to Code Test:

Code Test

Since they are nonnegative, Code Test is a convex combination of Code Test and the values Code Test, so Code Test remains in Code Test for all Code Test.

The critic. The critic equation Code Test satisfies

Code Test

using Code Test and Code Test. The function Code Test therefore satisfies Code Test, and since Code Test whenever Code Test, the level set Code Test is forward invariant for any Code Test. We fix the critic radius Code Test once and for all; Chapter 2 derives this choice from the general formula Code Test, where Code Test bounds the critic forcing — here Code Test, so Code Test. The ball Code Test is therefore forward invariant. In practice, the critic relaxes much faster: the equilibrium Code Test lies in Code Test, and any trajectory with large Code Test is pulled back exponentially.

0.12 The Absorbing Set And Boundedness

Forward invariance tells us that trajectories stay in the phase space, but it does not tell us they are eventually confined to a small region. An absorbing set is a compact region that every trajectory eventually enters and never leaves. Its existence is the key prerequisite for the global attractor: once a flow has a compact absorbing set, the attractor construction follows from general dynamical-systems theory (Chapter 1 for the definitions, Chapter 5 for the construction). In our three-dimensional system, the absorbing set turns out to be the box Code Test defined below.

The compact set

Code Test

is forward invariant by the analysis above. Moreover, it absorbs every bounded subset of Code Test: if the initial critic value satisfies Code Test, the exponential decay Code Test — obtained by comparing Code Test with the scalar ODE Code Test (using Code Test and rearranging) — guarantees that Code Test after a finite time depending on Code Test: the asymptotic level Code Test sits strictly below Code Test, so choosing Code Test with Code Test gives Code Test, hence Code Test, for all Code Test. (The actor and distribution components are already confined.) In the language of dynamical systems, Code Test is a compact absorbing set.

The existence of a compact absorbing set is the main structural prerequisite for the global attractor theorem. In finite dimensions, once the semiflow has a compact absorbing set, the omega-limit set of that absorber is a compact invariant set that attracts every bounded set. That set is the global attractor. In later chapters, we will prove this construction in full generality. Here, we note that the example satisfies the necessary boundedness property.

0.13 Equilibria

An equilibrium of the system is a point Code Test at which all three components of the vector field vanish simultaneously.

The distribution equation gives Code Test.

The critic equation gives Code Test.

The actor equation gives Code Test. This vanishes if and only if at least one of the three factors is zero:

  1. Code Test: the actor sits on the boundary, Code Test.
  2. Code Test: impossible, because Code Test for every finite Code Test.
  3. Code Test: the actor drift vanishes at an interior point.

Boundary equilibria. At Code Test:

Code Test

At Code Test:

Code Test

In behavioral terms, the equilibrium at Code Test is a strong specialist: the platform assigns approximately 88% probability to the matching action at each state, and the user population is 75% type 1. The equilibrium at Code Test is the mirror image — an anti-specialist that recommends the wrong content type 88% of the time, with the population tilted the other way.

These boundary equilibria exist because the damping factor Code Test vanishes at Code Test. They are equilibria of the damped system, not of the raw actor field Code Test. In general, Code Test, so the boundary equilibria should not be confused with stationary points of an undamped policy gradient. At Code Test the raw drift is in fact negative: Code Test, because the entropy penalty (the Code Test term in the advantage-like signal) outweighs the reward-plus-critic signal Code Test at the wall. If the damping were removed, the agent at Code Test would retreat toward the interior rather than push further out; it is the confinement factor Code Test, not a balance in the reward signal, that makes the boundary points equilibria. Exercise 0.6 carries out this computation.

Interior equilibrium. The third factor vanishes when Code Test. Combined with the critic equilibrium condition Code Test, the interior equilibrium solves

Code Test

At Code Test, the left side is Code Test and the right side is Code Test, so the difference is positive. At Code Test, the left side is approximately Code Test and the right side is Code Test, so the difference is negative. By the intermediate value theorem, there is a root in Code Test. Numerical computation gives

Code Test

At this equilibrium, the actor is in the interior of its box, the critic is at its frozen equilibrium, and the distribution is at its target.

In the recommendation system, Code Test describes a platform that has settled on a moderate level of specialization: it assigns about 81% probability to the matching content type, leaving roughly one recommendation in five “exploratory.” The critic estimate Code Test reflects the moderate reward this strategy earns. Unlike the boundary equilibria, this point is a genuine zero of the raw drift Code Test: the advantage-like signal Code Test vanishes, meaning the critic’s assessment and the policy’s commitment are in balance. This is the equilibrium where the gradient itself says “stop adjusting,” not where the box wall says “you cannot go further.”

Whether this equilibrium is stable, and how it relates to the boundary equilibria, are questions that the general attractor theory will help answer.

0.14 The Phase Portrait

The equilibrium analysis tells us where the system can rest; the phase portrait organizes the directions of motion between those equilibria. Because the Code Test subsystem is autonomous in the symmetric case, we can read the essential geometry in the Code Test plane and then recover Code Test from its linear relaxation equation.

Two curves organize the picture. The first is the critic nullcline Code Test, the set of points where Code Test. The second is the actor nullcline Code Test, the set of points where the advantage-like signal vanishes and Code Test. These two curves intersect at the interior equilibrium Code Test.

Above the actor nullcline (where Code Test), the raw drift Code Test is positive, so the actor parameter increases. Below the nullcline (Code Test), the drift is negative and the actor retreats. Inside the actor box, the damping factor Code Test is positive, so Code Test has the same sign as Code Test. Relative to the critic nullcline, the sign is just as simple: Code Test below Code Test and Code Test above it. The critic therefore points toward its nullcline from both sides, while the actor points right above its own nullcline and left below it.

These sign rules already explain why the interior intersection is the natural candidate for the dominant attractor of the planar subsystem. A short numerical experiment is consistent with that picture: representative trajectories in the absorbing set Code Test bend toward the interior equilibrium rather than toward the boundary points. Exercise 0.9 asks the reader to reproduce that phase portrait. What Chapter 0 does not do is prove global convergence or classify the boundary equilibria rigorously; that stability analysis belongs later.

The distribution coordinate Code Test adds no new planar geometry in the symmetric case. Once Code Test is known, Code Test follows from the forced linear equation Code Test. The graph Code Test is therefore the distribution nullcline: it marks the instantaneous target toward which Code Test is pulled, rather than an additional autonomous source of recurrence.

The repository file submission/rebuild_attractor_figure.py generates a phase portrait and time-series plot for a closely related asymmetric variant of this system. Exercise 0.9 asks the reader to adapt that script to the symmetric case.

0.15 Breaking The Symmetry

The decoupling of Code Test from the Code Test subsystem was a consequence of the antisymmetric feature structure combined with symmetric rewards. To see the full coupling, change the reward at state Code Test from Code Test to Code Test for some Code Test. In the recommendation system, this corresponds to one user type being more or less valuable than the other: a type-2 match now generates engagement Code Test instead of Code Test.

With this modification, the critic coefficient becomes

Code Test

while Code Test is unchanged. The critic now depends explicitly on Code Test whenever Code Test.

The raw actor drift becomes

Code Test

The term Code Test is the coupling that was invisible in the symmetric case. When Code Test, increasing Code Test (more mass on state Code Test) increases the actor drift, because the higher-reward state-action pair Code Test receives more weight. Conversely, when Code Test, the coupling reverses sign.

The full asymmetric system is determined by the three component equations

Code Test

Code Test

Code Test

Now the three equations are genuinely coupled: Code Test enters all three, Code Test enters the first, and Code Test enters the first two. No two-dimensional reduction is available without further analysis. This is the generic situation, and it is why the enlarged state space Code Test is needed.

The structural properties still hold, with one constant to recheck. The actor box and the simplex are unchanged by the reward modification, because they depend only on the confinement factor Code Test and the convexity of Code Test; the coercivity bound Code Test is also untouched. The critic forcing, however, is now Code Test, and the bracket is a convex combination of Code Test (at Code Test) and Code Test (at Code Test), so the forcing bound becomes Code Test and the critic radius becomes Code Test. For Code Test — including the value Code Test of Exercise 0.5 — this gives Code Test and Code Test, so the compact absorbing set is the same Code Test. For Code Test the critic interval enlarges to Code Test, and the global attractor theorem will apply to the asymmetric system by exactly the same argument.

0.16 What The Attractor Contains

The terms used in this section — global attractor, omega-limit set, complete bounded trajectory — will be defined precisely in Chapter 1. Here we use them informally to describe what the example’s long-time behavior looks like.

For a reader coming from reinforcement learning, the usual asymptotic question is: “does the algorithm converge, and if so, to what?” The global attractor generalizes that question. It captures the full set of long-run behaviors the system can exhibit, including cases where the outcome depends on initial conditions or where connecting orbits join multiple equilibria. If the attractor is a single point, the system converges in the usual sense. If it is richer — containing several equilibria and orbits between them — the long-run behavior is richer, and a single convergence statement is too narrow. The attractor is the sharpest answer to “what can happen eventually?”

When Chapter 1 defines the global attractor precisely, it will collect the full set of long-run behaviors in one compact invariant object. The Chapter 0 computations already show some of the ingredients that object must reflect: the compact absorbing box Code Test, the three equilibria found in Section 0.13, and the planar sign structure described in Section 0.14.

Since, in the symmetric reduction, the Code Test subsystem is autonomous and two-dimensional, the Poincare-Bendixson theorem (limits of bounded planar trajectories are equilibria, periodic orbits, or connections between them; see Coddington and Levinson, Chapter 16) sharply restricts its long-time behavior. No such planar reduction is available for the asymmetric system of Section 0.15, where Code Test feeds back into the first two equations. Chapter 0 does not decide which of those possibilities actually occur for this parameter choice. It only places the example in a setting where those alternatives can be stated concretely.

On the distribution side, Code Test does not generate independent long-time behavior. It solves a forced linear equation driven by Code Test, so any complete bounded trajectory of the full system has its third coordinate tied to the history of the Code Test coordinates. The graph Code Test remains the natural organizing nullcline for that coordinate.

The purpose of this section is therefore modest. The worked example is already rich enough to display several equilibrium candidates, a compact region that contains all long-time behavior, and a nontrivial distinction between the full three-dimensional system and the planar subsystem that organizes its symmetric reduction.

0.17 Summary And Bridge Forward

This chapter has built a complete explicit instance of the model with a prescribed closure map:

  • a two-state, two-action environment with scalar actor, scalar critic, and scalar distribution coordinate;
  • a softmax policy reducing to the logistic sigmoid;
  • a uniformly coercive linear critic equation;
  • an actor drift with boundary damping that confines the parameter to a box;
  • a distribution equation relaxing toward a prescribed target law.

The resulting three-dimensional autonomous ODE has a compact absorbing set, at least three equilibria (two on the boundary of the actor box, one in the interior), and structural properties–box invariance, simplex invariance, critic coercivity–that guarantee global existence and boundedness. Along the way, the chapter has traced the behavioral meaning of each component: what the agent does at each equilibrium, why the drift slows near certainty, and how the opening three-quantity story becomes a concrete ODE, first in a symmetric reduction and then in the fully coupled asymmetric variant.

What the chapter has not done is prove these properties in full generality, define the asymptotic vocabulary precisely, or construct the global attractor as a theorem. Those are the tasks of the chapters that follow. Chapter 1 will introduce the bridge between RL and dynamical-systems language: semiflows, absorbing sets, omega-limit sets, and the role of the enlarged state space. Chapters 2 through 5 will prove the general attractor theorem for the prescribed-closure model and return to the present example to verify each step.

Exercises

Exercise 0.1 (Policy computation). Verify that Code Test satisfies Code Test. Use this to show that the score functions in Section 0.8 are correct.

Exercise 0.2 (Critic equilibrium). Show that for each fixed Code Test, the critic equation Code Test has exactly one equilibrium, and that every solution converges to it exponentially with rate Code Test. Compute the equilibrium explicitly when Code Test.

Exercise 0.3 (Simplex invariance by explicit formula). Using the variation of constants formula for Code Test in Section 0.11, verify directly that Code Test for all Code Test whenever Code Test and Code Test.

Exercise 0.4 (Interior equilibrium equation). Define Code Test. Show that Code Test and Code Test. Conclude that the system has an interior equilibrium. Estimate Code Test to two decimal places by evaluating Code Test at a few points.

Exercise 0.5 (Breaking symmetry). Set Code Test and recompute the critic coefficient Code Test and the raw actor drift Code Test. Verify that both now depend explicitly on Code Test. Find the equilibrium conditions for the asymmetric system.

Exercise 0.6 (Boundary equilibria are not undamped stationary points). At the boundary equilibrium Code Test, compute Code Test. Verify that it is nonzero and determine its sign. Explain in one sentence why Code Test is still an equilibrium of the full system despite Code Test.

Exercise 0.7 (Effect of the closure map). Replace the closure map Code Test with the constant map Code Test. How does this change the equilibrium structure? Does the absorbing set change?

Exercise 0.8 (Absorbing set entry time). Suppose Code Test and Code Test, Code Test. Using the exponential decay bound from Section 0.12, estimate the time Code Test after which Code Test.

Exercise 0.9 (Phase portrait). Implement a numerical integrator (e.g., fourth-order Runge-Kutta) for the symmetric system of Section 0.10. Plot trajectories in the Code Test plane from three initial conditions: Code Test, Code Test, and Code Test. Verify that all three converge to the interior equilibrium. On the same plot, draw the actor nullcline Code Test and the critic equilibrium curve Code Test, and confirm that they intersect at Code Test. The repository file submission/rebuild_attractor_figure.py implements a related plot for the asymmetric variant and can serve as a starting point.