Simple Algorithm
Artificial Intelligence · Hidden Layer · 22 min

Agents in the World

Multi-agent systems, robots and LLM agents.

A Q-table masters one gridworld. An agent in the world must act on partial observations, plan with a model it learned itself, share the world with other learners, control a body whose physics no simulator gets exactly right, and, more and more often, run a language model inside its loop. This lesson builds the machinery for each: Dyna and model-predictive control, Markov games and mixed equilibria, imitation with DAgger, and the ReAct loop, along with the arithmetic of why long tasks fail.

What you’ll learn

  • Explain why agents act on histories rather than states, and compare reactive, model-based and hybrid agent architectures.
  • Implement Dyna-Q and model-predictive control with the cross-entropy method, and derive how the error of planning with a learned model and a learned value function depends on the horizon.
  • Define Markov games and Nash equilibria, compute a mixed equilibrium of a 2×22\times2 zero-sum game by indifference, and explain why independent learners face a non-stationary problem.
  • Explain domain randomization, the covariate shift of behavior cloning, and how DAgger turns its O(T2ϵ)\order{T^2\epsilon} worst case into O(Tϵ)\order{T\epsilon}.
  • Describe the ReAct loop of a language-model agent, and compute how per-step reliability compounds over a long task.

From percepts to actions: agent architectures

An agent maps the history of its percepts to actions. In the RL lessons so far the percept was the state of an MDP; in the world it rarely is. A camera frame does not show velocities, a web page does not show the database behind it, and two corridors can look identical. The formal model is the partially observable MDP: an MDP plus an observation kernel O(o∣s)O(o\mid s), where the agent sees only the history ht=(o0,a0,…,at−1,ot)h_t=(o_0,a_0,\dots,a_{t-1},o_t). A sufficient summary of hth_t is the belief state bt(s)=Pr⁡(St=s∣ht)b_t(s)=\Pr(S_t=s\mid h_t), updated by Bayesian filtering:

bt+1(s′) ∝ O(ot+1∣s′)∑sP(s′∣s,at) bt(s).b_{t+1}(s')\ \propto\ O(o_{t+1}\mid s')\sum_sP(s'\mid s,a_t)\,b_t(s).

The belief evolves as a Markov process, so planning over beliefs is again an MDP (POMDPs & Belief States). Exact beliefs are intractable beyond small problems, so practical agents compress the history into a learned memory: a recurrent state, a transformer over recent observations, or a language model's context window.

ArchitectureChooses actions byStrengthsWeaknessesExamples
Reactive (model-free policy)one forward pass, a∼πθ(⋅∣h)a\sim\pi_\theta(\cdot\mid h)fast at decision time; immune to model errordata-hungry; retrained when the goal changesDQN and PPO policies
Planner (model-based)optimizing actions inside a model at every stepsample-efficient; one model serves many goalscompute at decision time; the optimizer exploits model errorsMPC, PETS
Hybrida learned policy or value guiding search in a model, or a model generating training datagets both benefits when the model is goodtwo error sources to manageDyna, AlphaZero, MuZero, Dreamer
Hierarchical agents add another split: a high-level policy picks subgoals or skills that low-level controllers execute, which shortens the horizon each level must plan over.
Think first A robot drives down one of two corridors, equally likely, that look identical except for a colored sign at the entrance. At the far end it must turn left in one corridor and right in the other. Its policy sees only the current camera frame. What success rate at the junction can it guarantee in both corridors, and what would fix it?

50%. At the junction both corridors produce the same observation, so a memoryless policy uses the same action distribution in both: if it turns left with probability qq, it succeeds with probability qq in one corridor and 1−q1-q in the other. Remembering the sign, which is what a belief state or a learned memory does, restores perfect play. A bigger network or more exploration cannot recover information that is not in the input.

Model-based RL in practice: Dyna and MPC

A learned model P^(s′∣s,a)\hat P(s'\mid s,a), r^(s,a)\hat r(s,a) can be used in two ways. Background planning turns it into extra training data for a model-free learner. Decision-time planning optimizes actions inside it at every step. Dyna (Sutton, 1990) is the simplest instance of the first: after each real step, it replays nn simulated transitions drawn from the model.

text
function DYNA-Q(n, α, γ, ε):
    Q(s, a) ← 0;  Model ← empty
    loop over real time steps:
        S ← current state;  A ← ε-greedy action for Q in S
        take A; observe reward R and next state S′
        Q(S, A) ← Q(S, A) + α · (R + γ · max_a Q(S′, a) − Q(S, A))   # real update
        Model(S, A) ← (R, S′)                                       # deterministic world
        repeat n times:                                              # planning
            s, a ← a previously visited state and an action taken there
            r, s′ ← Model(s, a)
            Q(s, a) ← Q(s, a) + α · (r + γ · max_b Q(s′, b) − Q(s, a))

With n=0n=0 this is Q-learning. Each real transition is now used n+1n+1 times: in Sutton & Barto's maze example (§8.2), Dyna-Q with n=50n=50 found the shortest path in about 3 episodes, against about 25 without planning. The price is trusting the model; if the world changes, simulated updates keep teaching the old world until real experience corrects it.

Model-predictive control (MPC) plans at decision time. It searches for the best action sequence over a horizon HH in the model, executes only the first action, observes the real next state, and plans again, so feedback from the world keeps correcting the model's drift. With continuous actions, a common optimizer is the cross-entropy method (CEM), which refits a Gaussian over action sequences to the best samples.

text
function MPC-CEM(model f̂, reward r, value V̂, state s, H, N, K, I):
    μ[1..H] ← 0;  σ[1..H] ← σ0                 # Gaussian over action sequences
    repeat I times:
        sample N sequences a(j)[1..H] ~ Normal(μ, σ²)
        for each j:                             # imagined rollout from the real state
            ŝ ← s;  G(j) ← 0
            for t = 1..H:
                G(j) ← G(j) + γ^(t−1) · r(ŝ, a(j)[t]);  ŝ ← f̂(ŝ, a(j)[t])
            G(j) ← G(j) + γ^H · V̂(ŝ)            # optional terminal value
        E ← the K sequences with the largest G(j)
        μ, σ ← mean and standard deviation of E, per time step
    return μ[1]                                 # act, observe, then plan again

Each real step costs I⋅N⋅HI\cdot N\cdot H model evaluations, for example 5×500×30=75,0005\times500\times30=75{,}000, so MPC needs a fast model and batched rollouts. PETS (Chua et al., 2018) planned this way through an ensemble of probabilistic networks, averaging over the ensemble so that the errors of any single model are harder to exploit. MBPO (Janner et al., 2019) went the Dyna way instead, using short model rollouts branched from real states as training data for a model-free learner.

How far to trust a learned model

Planning HH steps with a model and then bootstrapping from a learned value V^\hat V, as the optional line in MPC-CEM does, mixes two sources of error. How the mix depends on HH follows from the rollout bound proved in World Models & Video Generation.

DerivationLookahead error: model versus value function
  1. ∣J^H(s)−Vπ(s)∣≤∑t=0H−1γt∣E^ r(s^t,at)−E r(st,at)∣+γH∣E^ V^(s^H)−E Vπ(sH)∣\big|\hat J_H(s)-V^\pi(s)\big|\le\sum_{t=0}^{H-1}\gamma^t\big|\hat\E\,r(\hat s_t,a_t)-\E\,r(s_t,a_t)\big|+\gamma^H\big|\hat\E\,\hat V(\hat s_H)-\E\,V^\pi(s_H)\big|

    Evaluate a policy π\pi from state ss by J^H(s)=E^[∑t<Hγtr(s^t,at)+γHV^(s^H)]\hat J_H(s)=\hat\E\big[\sum_{t<H}\gamma^tr(\hat s_t,a_t)+\gamma^H\hat V(\hat s_H)\big], where hats denote rollouts in the model. Rewards lie in [0,Rmax⁡][0,R_{\max}], the model's one-step error is sup⁡s,aTV(P(⋅∣s,a),P^(⋅∣s,a))≤ε\sup_{s,a}\mathrm{TV}\big(P(\cdot\mid s,a),\hat P(\cdot\mid s,a)\big)\le\varepsilon, and V^\hat V takes values in [0,Rmax⁡/(1−γ)][0,R_{\max}/(1-\gamma)] and is within δ\delta of π\pi's true value everywhere. Split the error into the simulated rewards and the terminal term:

  2. ∣J^H(s)−Vπ(s)∣≤εRmax⁡(∑t=0H−1tγt+HγH1−γ)+γHδ\big|\hat J_H(s)-V^\pi(s)\big|\le\varepsilon R_{\max}\Big(\sum_{t=0}^{H-1}t\gamma^t+\frac{H\gamma^H}{1-\gamma}\Big)+\gamma^H\delta

    After tt steps the simulated and real state distributions differ by at most tεt\varepsilon in total variation, and a function with range RR changes in expectation by at most RR times the total variation. So the reward at step tt is off by at most Rmax⁡tεR_{\max}t\varepsilon, and the terminal term by at most Rmax⁡1−γHε+δ\frac{R_{\max}}{1-\gamma}H\varepsilon+\delta:

  3. ∣J^H(s)−Vπ(s)∣ ≤ (1−γH) γ ε Rmax⁡(1−γ)2 + γH δ\big|\hat J_H(s)-V^\pi(s)\big|\ \le\ \big(1-\gamma^H\big)\,\frac{\gamma\,\varepsilon\,R_{\max}}{(1-\gamma)^2}\ +\ \gamma^H\,\delta

    The bracket has a closed form: start from ∑t≥0tγt=γ/(1−γ)2\sum_{t\ge0}t\gamma^t=\gamma/(1-\gamma)^2 and subtract the tail from t=Ht=H on. The bound then interpolates, with weight γH\gamma^H, between the error of a pure value function (H=0H=0) and the simulation-lemma error of a pure model (H→∞H\to\infty, Bellman Equations & Contraction):

  4. A planner that picks the best of its candidates loses at most twice this bound against the best candidate. Short lookahead leans on V^\hat V: with γ=0.99\gamma=0.99, ten steps of planning still leave weight 0.9910≈0.900.99^{10}\approx0.90 on the value error. Short-horizon planners with learned models, such as TD-MPC (Hansen, Wang & Su, 2022) and MuZero (Schrittwieser et al., 2020), therefore need a good value function, while long-horizon MPC without one needs a good model.

The bound is a worst case over all errors of size ε\varepsilon. A planner, however, does not meet errors at random: it seeks out actions the model overrates. The widget shows the extreme case, a model that is exactly right except that it leaves out slipping.

Many agents: Markov games and equilibria

When several agents learn in one environment, each one's best behavior depends on the others'. The model is a Markov game (Shapley, 1953; Littman, 1994): states S\mathcal S, players i=1,…,Ni=1,\dots,N with action sets Ai\mathcal A_i, a transition kernel P(s′∣s,a)P(s'\mid s,\mathbf a) driven by the joint action a=(a1,…,aN)\mathbf a=(a_1,\dots,a_N), and one reward function ri(s,a)r_i(s,\mathbf a) per player. A joint policy π=(π1,…,πN)\boldsymbol\pi=(\pi_1,\dots,\pi_N) gives each player a value ViπV_i^{\boldsymbol\pi}. A game is fully cooperative when all the rir_i are equal, zero-sum when two players have r1=−r2r_1=-r_2, and general-sum otherwise.

Kicker aimsKeeper dives leftKeeper dives right
left0.600.90
right0.950.70
A penalty kick as a zero-sum game. Each entry is the probability of a goal: the kicker maximizes it, the keeper minimizes it.
Predict before you look

In equilibrium, how often should the kicker aim left, in percent?

Show the answer

45 %

p=5/11≈45%p=5/11\approx45\%, from the keeper's indifference condition derived below. The kicker aims right more often, but not always: any predictable preference would be exploited.

DerivationMixed equilibrium by indifference
  1. 0.60 p+0.95 (1−p)=0.90 p+0.70 (1−p)⟹0.25=0.55 p⟹p=511≈0.450.60\,p+0.95\,(1-p)=0.90\,p+0.70\,(1-p)\quad\Longrightarrow\quad0.25=0.55\,p\quad\Longrightarrow\quad p=\tfrac5{11}\approx0.45

    No pure pair is stable: against a keeper who always dives left the kicker aims right, against which the keeper dives right, and so on around the cycle. So both players mix. In a mixed equilibrium each player's mix makes the opponent indifferent between its actions, since otherwise the opponent would play its better action purely. With pp the probability of aiming left, the keeper is indifferent when

  2. 0.60 q+0.90 (1−q)=0.95 q+0.70 (1−q)⟹0.20=0.55 q⟹q=411≈0.360.60\,q+0.90\,(1-q)=0.95\,q+0.70\,(1-q)\quad\Longrightarrow\quad0.20=0.55\,q\quad\Longrightarrow\quad q=\tfrac4{11}\approx0.36

    Likewise the keeper's probability qq of diving left makes the kicker indifferent:

  3. v=0.95−0.35⋅511=0.90−0.30⋅411=87110≈0.79v=0.95-0.35\cdot\tfrac5{11}=0.90-0.30\cdot\tfrac4{11}=\tfrac{87}{110}\approx0.79

    The value, the scoring probability under these mixes, comes out the same from either side, as the minimax theorem promises:

  4. Each mix is pinned by the opponent's options, not by the player's own favorite. Palacios-Huerta (2003) found professional penalty kicks consistent with minimax play.

The simplest way to learn in a Markov game gives each agent its own Q-learner and treats the others as part of the environment. From player ii's view the transition kernel is

Pi(s′∣s,ai)=∑a−iπ−i(a−i∣s) P(s′∣s,ai,a−i),P_i(s'\mid s,a_i)=\sum_{\mathbf a_{-i}}\boldsymbol\pi_{-i}(\mathbf a_{-i}\mid s)\,P(s'\mid s,a_i,\mathbf a_{-i}),

which changes whenever the other players' policies change. The environment is non-stationary: the convergence theorem of Convergence of Q-Learning no longer applies, replay buffers fill with experience against opponents that no longer exist, and learners can cycle or settle on poor coordination (Claus & Boutilier, 1998).

Two remedies dominate. Centralized training with decentralized execution gives critics access to all agents' observations and actions during training, which makes their targets stationary again, while each actor still acts on its own observations (MADDPG; QMIX for teams). Self-play trains against copies and past versions of oneself in zero-sum games, as in AlphaZero (AlphaGo & AlphaZero), and populations of diverse opponents guard against strategy cycles, as in AlphaStar's league for StarCraft II (Vinyals et al., 2019).

Check your understanding

Two warehouse robots each run tabular Q-learning, treating the other as part of the environment. Which assumption behind single-agent Q-learning's convergence guarantee breaks?

  1. That rewards are bounded
  2. That the discount factor is below 1
  3. That each agent's transition and reward probabilities stay fixed: they depend on the other robot's policy, which keeps changing
  4. That the state space is finite
Show the answer

C. That each agent's transition and reward probabilities stay fixed: they depend on the other robot's policy, which keeps changing

Averaged over the other robot's action, Pi(s′∣s,ai)P_i(s'\mid s,a_i) depends on π−i\pi_{-i}, which moves as the other robot learns. The stationarity behind the stochastic-approximation argument is gone, so convergence can fail even though each learner is sound on its own. A centralized critic that conditions on both actions restores stationary targets.

Robots: learning from simulators and demonstrations

A real robot practices slowly, breaks things and needs someone to reset it, so robot learning leans on two cheaper sources of data, each with its own error to control.

Simulation is fast and safe, but its physics and rendering differ from reality: contact and friction are approximate, actuators have unmodeled delays, and images look synthetic. A policy optimized in one simulator overfits its quirks, as the cliff example showed. Domain randomization trains across a distribution ν\nu of simulator parameters ξ\xi (masses, friction coefficients, latencies, textures, lighting, camera poses), solving

max⁡π Eξ∼ν[Jξ(π)],\max_\pi\ \E_{\xi\sim\nu}\big[J_\xi(\pi)\big],

in the hope that the real world looks like one more sample from ν\nu. Tobin et al. (2017) trained an object detector only on simulated images with random, deliberately unrealistic textures, and it localized real objects to within about 1.5 cm, enough for a robot arm to grasp them. Randomizing the dynamics as well transferred control policies (Peng et al., 2018), and a robot hand trained entirely in simulation manipulated a Rubik's cube through full solves, with the move sequence supplied by a standard solver (OpenAI et al., 2019).

Demonstrations come from a human teleoperating the robot or from an expert controller. Behavior cloning treats them as supervised learning, fitting πθ(a∣s)\pi_\theta(a\mid s) to the expert's state–action pairs; ALVINN (Pomerleau, 1989) learned to steer a van this way. The catch is distribution shift: a small mistake takes the robot to a state the expert never visited, where the policy was never trained, so mistakes compound. With per-step error ϵ\epsilon on the expert's own states, the expected extra cost of a TT-step task can grow as T2ϵT^2\epsilon (Ross & Bagnell, 2010; proved in Sequence-to-Sequence Models). DAgger (Ross, Gordon & Bagnell, 2011) removes the mismatch by collecting expert labels on the states the learner itself visits.

text
function DAGGER(expert π*, iterations N, episodes m):
    D ← state–action pairs demonstrated by π*
    π̂(1) ← TRAIN(D)
    for i = 1..N:
        run π̂(i) for m episodes; record every state s it visits
        D ← D ∪ { (s, π*(s)) }            # the expert labels the learner's states
        π̂(i+1) ← TRAIN(D)                 # supervised learning on all data so far
    return the best π̂(i) on validation runs

The original algorithm also lets the expert act with a probability βi\beta_i that decays to 0 over the iterations. Training on the learner's own state distribution gives J(π^)≤J(π∗)+uTϵNJ(\hat\pi)\le J(\pi^*)+uT\epsilon_N, where ϵN\epsilon_N is the training error on the aggregated data and uu bounds the extra cost of a single mistake if the expert takes over afterwards. When mistakes are recoverable, uu is a small constant and the gap is linear in TT; when one mistake can be fatal, uu can be of order TT, and DAgger's bound is quadratic too. The proof is in Robot Learning & Sim-to-Real.

Think first A behavior-cloned policy and a DAgger policy both err on 1% of steps, behavior cloning on the expert's states and DAgger on its own. What do the two worst-case bounds say about a 100-step task with costs in [0,1][0,1] per step and u=1u=1?

Behavior cloning: T2ϵ=1002×0.01=100T^2\epsilon=100^2\times0.01=100, the cost of failing every step, so the guarantee says nothing. DAgger: uTϵ=1×100×0.01=1uT\epsilon=1\times100\times0.01=1, one step's worth of cost. Doubling the horizon would quadruple the first bound and only double the second.

Language models as agents

A language-model agent puts an LLM in the agent loop. The context holds the instructions, the available tools and the history of actions and observations; the model generates text; a harness parses that text into a tool call (a search, a code execution, an API request, a click), runs it, and appends the result as the next observation. ReAct (Yao et al., 2023) interleaves free-text reasoning steps, or thoughts, with these actions, so the model can plan, track its progress and react to what the tools return. Toolformer (Schick et al., 2023) trained a model to decide for itself where an API call helps. Both were introduced in Prompting, Retrieval & Tool Use.

text
function REACT-AGENT(model M, task, tools, max_steps):
    context ← [instructions, tool descriptions, task]
    for t = 1..max_steps:
        output ← M.generate(context, stop before "Observation:")
        context.append(output)                  # "Thought: … Action: tool[args]"
        if output contains "Final answer: y": return y
        tool, args ← PARSE(output)              # malformed output is an error too
        observation ← tools[tool](args)         # untrusted text from the world
        context.append("Observation: " + observation)
    return FAIL                                  # step budget exhausted

The context window is the agent's memory and its stand-in for a belief state, and everything a tool returns enters it as text. Thoughts change only the context, never the environment: in this lesson's terms, ReAct adds free internal actions to the action space.

Predict before you look

An agent completes each step of a task correctly with probability 0.95, independently, and any error is fatal. What is the probability that it completes a 20-step task, in percent?

Show the answer

36 %

0.9520≈0.3580.95^{20}\approx0.358. Success decays like pn≈e−n(1−p)p^n\approx e^{-n(1-p)}, so a 5% per-step error rate is ruinous over 20 steps, and even 99% per step leaves only 0.99100≈37%0.99^{100}\approx37\% over 100 steps. Catching errors helps multiplicatively: if 80% of mistakes are detected and repaired, the effective per-step failure falls from 5% to 1%, and 20-step success rises to 0.9920≈82%0.99^{20}\approx82\%. Real errors are correlated across steps, so treat this as a lens, not a law.

Benchmarks for coding, web navigation and computer use have shown rapid progress, along with high variance across runs, sensitivity to the harness and prompts, and long tasks that still fail at some step. Careful evaluation reports repeated trials, costs and confidence intervals, not a single lucky run.

Key takeaways

  • Agents act on histories; a belief state, or a learned memory approximating one, restores the Markov property. Architectures range from reactive policies through model-based planners to hybrids such as Dyna and AlphaZero.
  • Dyna turns a model into extra updates and MPC re-plans at every step. With a terminal value, the error of HH-step lookahead is at most (1−γH)γεRmax⁡/(1−γ)2+γHδ(1-\gamma^H)\gamma\varepsilon R_{\max}/(1-\gamma)^2+\gamma^H\delta, and planners actively exploit model errors.
  • Markov games replace optima with equilibria. A mixed equilibrium makes the opponent indifferent, and independent learners face non-stationarity, which centralized critics and self-play address.
  • Behavior cloning can compound errors as T2ϵT^2\epsilon; DAgger's on-policy labels give uTϵNuT\epsilon_N. Domain randomization trains across simulators so that reality looks like one more sample.
  • LLM agents wrap a language model in an act–observe loop. Per-step reliability compounds as pnp^n, tool outputs are untrusted input, and evaluation must measure reliability rather than one lucky run.

Check yourself

In the interactive lesson these are scored with your confidence, and what you miss comes back for review.

Question 1

What does Dyna-Q do with its learned model?

  1. It plans a full action sequence before every real step and executes the first action
  2. Between real steps, it replays simulated transitions from the model as extra Q-learning updates
  3. It replaces the reward with the model's prediction error, to encourage exploration
  4. It uses the model only to choose ε\varepsilon
Show the answer

B. Between real steps, it replays simulated transitions from the model as extra Q-learning updates

Dyna is background planning: each real transition updates both the Q-table and the model, and then nn simulated transitions from previously seen state–action pairs receive the same Q-learning update. The model multiplies the value of each real sample. Decision-time planning, as in MPC, is the other way to use a model.

Question 2

A planner rolls a learned model HH steps and then bootstraps from a learned value V^\hat V. In the bound (1−γH)γεRmax⁡(1−γ)2+γHδ(1-\gamma^H)\frac{\gamma\varepsilon R_{\max}}{(1-\gamma)^2}+\gamma^H\delta, what does increasing HH do?

  1. It reduces both error terms
  2. It has no effect on the bound
  3. It shifts weight from the value function's error δ\delta to the model's error ε\varepsilon
  4. It shifts weight from the model's error to the value function's error
Show the answer

C. It shifts weight from the value function's error δ\delta to the model's error ε\varepsilon

The bound is a γH\gamma^H-weighted mixture of the value error δ\delta, which carries all the weight at H=0H=0, and the pure-model error γεRmax⁡/(1−γ)2\gamma\varepsilon R_{\max}/(1-\gamma)^2, which carries it all as H→∞H\to\infty. Longer lookahead trusts the model more and the value function less; which is better depends on which of the two is more accurate.

Question 3

In the mixed equilibrium of a 2×22\times2 zero-sum game that has no pure equilibrium, how is each player's mixing probability determined?

  1. It makes the opponent indifferent between the opponent's two actions
  2. It maximizes the player's payoff against the opponent's most likely action
  3. It puts more weight on whichever of the player's actions has the largest entry in the matrix
  4. It is always 50/50
Show the answer

A. It makes the opponent indifferent between the opponent's two actions

If the opponent strictly preferred one action, it would play that action purely and exploit the mix. So in equilibrium each mix equalizes the opponent's payoffs: the kicker's p=5/11p=5/11 comes from the keeper's indifference condition 0.60p+0.95(1−p)=0.90p+0.70(1−p)0.60p+0.95(1-p)=0.90p+0.70(1-p).

Question 4

Why does DAgger's guarantee grow linearly in the horizon TT, while behavior cloning's worst case grows quadratically?

  1. DAgger uses a larger network
  2. DAgger's expert labels the states the learner itself visits, so the learner is trained on the distribution it is tested on
  3. DAgger discounts future costs
  4. DAgger never makes mistakes after the first iteration
Show the answer

B. DAgger's expert labels the states the learner itself visits, so the learner is trained on the distribution it is tested on

Behavior cloning measures error on the expert's states. Once a mistake leaves that distribution nothing bounds the learner's behavior, and each early mistake can cost up to the rest of the episode, hence T2ϵT^2\epsilon. DAgger aggregates expert labels on the learner's own states, so its error ϵN\epsilon_N is measured where it acts, and the performance-difference lemma turns that into uTϵNuT\epsilon_N.

Question 5

An agent's per-step error rate drops from 5% to 1%, with independent errors and no recovery. Its success rate on a 50-step task goes from about…

  1. 95% to 99%
  2. 50% to 90%
  3. 8% to 61%
  4. 8% to 20%
Show the answer

C. 8% to 61%

0.9550≈0.0770.95^{50}\approx0.077 and 0.9950≈0.6050.99^{50}\approx0.605. A fivefold cut in the per-step error buys an eightfold gain in task success, because success decays exponentially in the number of steps. Per-step reliability is the quantity long-horizon agents live or die by.

Go deeper

Further reading

  • R. S. Sutton & A. G. Barto, Reinforcement Learning: An Introduction, ch. 8 and 17 (MIT Press, 2nd ed., 2018).
  • Y. Shoham & K. Leyton-Brown, Multiagent Systems: Algorithmic, Game-Theoretic, and Logical Foundations (Cambridge University Press, 2009).
  • S. Ross, G. J. Gordon & J. A. Bagnell, "A reduction of imitation learning and structured prediction to no-regret online learning," AISTATS (2011).
  • S. Yao, J. Zhao, D. Yu, N. Du, I. Shafran, K. Narasimhan & Y. Cao, "ReAct: Synergizing reasoning and acting in language models," ICLR (2023).