Simple Algorithm
Reinforcement Learning · Fixed Point · 26 min

RL in the Real World

Case studies from plasma control to recommender systems, and why deployment is hard.

Reinforcement learning has shaped fusion plasmas, steered stratospheric balloons, cooled buildings, recommended videos and fine-tuned language models. Each success came wrapped in a simulator, a safety layer, logged data or a human in the loop, and one celebrated claim is still disputed. This lesson studies the cases closely: what worked, what it required, what failed or remains contested, and the challenges that still separate a benchmark result from a deployed system.

What you’ll learn

  • Name the challenges of real-world RL identified by Dulac-Arnold et al. and recognize them in concrete systems.
  • Analyze case studies, from tokamak control to recommendation and language models, by what made them work: simulators, privileged training information, logged data, safety layers and human oversight.
  • Distinguish results reported by companies from peer-reviewed and independently checked ones, and describe the chip-placement dispute neutrally.
  • Identify the open problems of deployment: trustworthy off-policy evaluation, safe exploration, reward specification, feedback loops and transfer from simulation.

From benchmark to deployment: the challenges

A benchmark offers a fast simulator, a fixed reward, free resets and no consequences. A real system offers none of these. Dulac-Arnold, Mankowitz and Hester (2019) listed nine challenges that separate the two, and Dulac-Arnold et al. (2021) formalized eight of them, leaving explainability for future work, in realworldrl-suite, a version of the DeepMind Control Suite built to study them.

ChallengeWhat it looks like in practiceWhere this course treats it
Training offline from the fixed logs of an existing behavior policya running controller has produced years of data, and that data is where learning must startLearning from Demonstrations & Data: offline RL and off-policy evaluation
Learning on the real system from limited samplesreal time cannot be sped up, and every trial costs money or wearModel-Based RL; Bandits & the Explore–Exploit Dilemma
High-dimensional continuous states and actionshundreds of sensors and many actuatorsFunction Approximation & Deep Q-Learning; Policy Gradients & Actor–Critic
Safety constraints that must never, or only rarely, be violatedequipment limits, comfort bands, regulationsConstrained MDPs & Lagrangian Methods
Partial observability, non-stationarity, stochasticitywear, weather, seasons, users whose tastes changePartial Observability & POMDPs; Generalization in RL
Unspecified, multi-objective or risk-sensitive rewardsenergy against comfort against wear; rare disasters that matter more than averagesThe Reward Hypothesis; Risk-Sensitive RL
Explainable policiesoperators must understand and trust decisions before they hand over controlan open problem
Inference in real time, at the control frequencya policy may have a fraction of a millisecond to answerthis lesson: small, fast actors
Large or unknown delays in actuators, sensors or rewardsa setting changes a temperature twenty minutes later; a recommendation pays off weeks laterTemporal Credit Assignment
The nine challenges of Dulac-Arnold, Mankowitz and Hester (2019), paraphrased, with pointers into this course.
Check your understanding

A chiller setting changes the temperature in a building's zones only after about twenty minutes, and the energy bill that the operator cares about arrives once a month. Which challenge dominates?

  1. High-dimensional continuous action spaces
  2. Large and unknown delays in actuators, sensors or rewards
  3. Explainability
  4. Real-time inference at the control frequency
Show the answer

B. Large and unknown delays in actuators, sensors or rewards

Delayed effects make credit assignment hard: by the time the consequence of a decision is observed, many other decisions have been made, and the state the agent sees no longer reflects what it just did. Remedies include adding recent actions to the state, modeling the delay, and shaping the reward with faster proxies such as metered power.

Trained in simulation: plasmas, balloons, robots, drones

Tokamak plasma control. Degrave et al. (2022) replaced a tokamak's hand-designed magnetic controllers with a single neural network that commanded all 19 control coils of TCV, the research tokamak of the Swiss Plasma Center at EPFL. The policy was trained with MPO, an actor–critic algorithm, entirely in a simulator, and deployed without any further tuning of its weights. It held a range of configurations: an elongated plasma, a shape close to one proposed for ITER, a negative-triangularity plasma, a "snowflake", and "droplets", two separate plasmas kept in the vessel at once. Each configuration came from training with a reward that specified its target, rather than from designing a new controller.

Stratospheric balloons. Bellemare et al. (2020) trained a controller for Loon's superpressure balloons, which steer only by changing altitude to find winds going their way. A distributional Q-learning agent, whose network outputs 51 quantiles of the return, was trained in simulation, with data augmentation to cope with imperfect wind data, and in a 39-day controlled experiment over the Pacific Ocean it outperformed Loon's previous controller, StationSeeker; Loon reported that it stayed in range more often while using less power. Loon itself was shut down by Alphabet in 2021, for business reasons.

Robot hands, legs and drones. OpenAI (Akkaya et al., 2019) trained a policy for a five-fingered robot hand entirely in simulation with automatic domain randomization, which widens the range of simulated physics as the policy masters it. RL learned the manipulation, while a standard solver chose the sequence of face turns. In ten trials on one scramble, whose solution takes 43 steps (26 quarter turns of the faces, the most any scramble can require, and 17 flips of the cube), the best policy averaged 26.8 successful steps: it got through the first 15 face rotations in 60% of the trials and solved the cube completely in 20%. That was with the face angles read from sensors in the cube; reading them from cameras alone, it averaged 12.8 steps and never completed the solve. Locomotion controllers trained in simulation have been transferred to quadruped robots, including over rough terrain (Hwangbo et al., 2019; Lee et al., 2020). And Swift (Kaufmann et al., 2023), trained with PPO in a simulator augmented with residual models of perception and dynamics fitted to real flights, won 15 of 25 races against three champion human drone pilots and set the fastest race time.

Check your understanding

What do the tokamak controller, the balloon controller, the robot hand and the racing drone have in common?

  1. Each learned by trial and error on the real system, with a human resetting it after failures
  2. Each was trained from logs of an earlier controller, without a simulator
  3. Each used a model-based planner at deployment time
  4. Each was trained mostly or entirely in a simulator made accurate enough, or randomized enough, to transfer, and deployed as a compact policy fast enough for the real system
Show the answer

D. Each was trained mostly or entirely in a simulator made accurate enough, or randomized enough, to transfer, and deployed as a compact policy fast enough for the real system

Learning by trial and error on a tokamak, a balloon fleet or a racing drone would be too slow, costly or dangerous. Each team invested in simulation, physics models, data augmentation for imperfect wind data, domain randomization or residual models fitted to real data, so that the policy could be trained where failure is free and then transferred.

Learning from logs, behind a safety net

Cooling. In 2016 DeepMind reported a system that cut the energy used for cooling a Google data center by up to 40%, which it equated to a 15% reduction in power usage effectiveness overhead. It was a recommendation system, not described as reinforcement learning: ensembles of neural networks predicted the plant's efficiency, and operators vetted and carried out its suggestions. In 2018 the system took autonomous control behind eight safety mechanisms, among them uncertainty estimates that discard low-confidence actions, a check of every action against constraints set by the operators and again by the local control system, and the operators' ability to fall back to the existing rules at any time. DeepMind reported savings that grew from about 12% at launch to about 30% on average over nine months. These figures come from company blog posts, not from peer-reviewed evaluations. Published papers on related systems report other numbers under their own conditions: model-predictive control with learned linear models cost 94% and 90.7% of the existing PID controllers in two tests (Lazic et al., 2018), and a controller that started from logged data of the existing controllers, was retrained daily on everything collected so far, and discarded actions predicted to break constraints saved about 9% and 13% of energy in three-month live A/B tests against the rule-based controllers of two commercial buildings (Luo et al., 2022).

Recommendation. Chen et al. (2019) trained a REINFORCE policy inside a production candidate generator for YouTube, from logs of earlier recommendation policies. Because the logs came from other policies, each example was weighted by the ratio of the new policy's probability to that of a behavior policy, itself estimated by a second head of the same network, and they derived a top-K correction for recommending several videos at once. In live experiments the top-K correction raised viewing time by 0.85% relative to the standard off-policy correction. The reward, viewing time, is a proxy for what users value, and the policy changes the behavior it will later learn from.

DerivationWhere a top-K correction comes from
  1. α(a∣s)=1−(1−π(a∣s))K,J=∑sd(s)∑aα(a∣s) R(s,a)\alpha(a \mid s) = 1 - \big(1 - \pi(a \mid s)\big)^K,\qquad J = \sum_s d(s)\sum_a \alpha(a \mid s)\,R(s,a)

    Model a page of KK recommendations as KK independent draws from π(⋅∣s)\pi(\cdot \mid s). Item aa is shown with probability α(a∣s)\alpha(a \mid s), and with R(s,a)R(s,a) the reward for showing it, the objective, holding the state distribution fixed as REINFORCE with a surrogate does, is linear in α\alpha:

  2. ∇J=∑sd(s)∑aπ(a∣s) λK(s,a) R(s,a) ∇log⁡π(a∣s),λK(s,a)=K(1−π(a∣s))K−1\nabla J = \sum_s d(s)\sum_a \pi(a \mid s)\,\lambda_K(s,a)\,R(s,a)\,\nabla\log\pi(a \mid s),\qquad \lambda_K(s,a) = K\big(1 - \pi(a \mid s)\big)^{K-1}

    Differentiate through α\alpha, and use ∇π=π ∇log⁡π\nabla\pi = \pi\,\nabla\log\pi:

  3. ∇J=Es∼d, a∼β(⋅∣s)[π(a∣s)β(a∣s) λK(s,a) R(s,a) ∇log⁡π(a∣s)]\nabla J = \E_{s\sim d,\ a\sim\beta(\cdot \mid s)}\Big[\frac{\pi(a \mid s)}{\beta(a \mid s)}\,\lambda_K(s,a)\,R(s,a)\,\nabla\log\pi(a \mid s)\Big]

    The logged actions come from a behavior policy β\beta, so reweight by the importance ratio π/β\pi/\beta. Compared with the standard off-policy REINFORCE gradient, each example gets the extra factor λK\lambda_K: about KK for an item the policy rarely shows, pushing it up harder, and near 0 for an item already shown almost surely, which needs no more push. This is the form of Chen et al.'s top-K correction.

Discovered artifacts. Sometimes what is deployed is not the agent but what it found. AlphaDev searched over assembly programs with RL and discovered sorting routines for 3 to 5 elements that are now part of LLVM's libc++ standard library (Mankowitz et al., 2023). MuZero has been applied to rate control in VP9 video compression (Mandhane et al., 2022): the paper reports a 6.28% reduction in bitrate at equal quality in an offline evaluation, and DeepMind reported about 4% on a portion of YouTube's live traffic.

Language models, and a contested result

The most widely deployed use of RL is the fine-tuning of language models. Christiano et al. (2017) showed that agents can learn behaviors from human comparisons of short clips of their behavior, by fitting a reward model to the preferences and optimizing it with RL. Ouyang et al. (2022) applied the recipe to GPT-3 in three stages: imitate human-written answers, fit a reward model to labelers' rankings of the model's own answers, then run PPO on that reward with a penalty for drifting from the imitation policy. Labelers preferred the outputs of the 1.3-billion-parameter InstructGPT model to those of the 175-billion-parameter GPT-3. Here an episode is one response to a prompt, and the reward is a learned model that a strong enough policy can exploit (RL from Human Feedback; Reward Overoptimization & Goodhart's Law).

What it takes, and what is still missing

CaseWhat made it workLimits and open questions
Tokamak controlan accurate simulator, a reward per target shape, an asymmetric actor–critic, a small fast policyeach new configuration still needs simulation and careful testing; experiment time is scarce
Balloon navigationsimulation with data augmentation for imperfect wind data; distributional Q-learningthe Loon program ended in 2021 for business reasons
Robot handautomatic domain randomization; sensors in the cubefar from reliable on hard scrambles
Drone racinga simulator corrected with residual models fitted to real flightstrained for one track under fixed conditions
Building and data-center coolinglogs of existing controllers, constraints, uncertainty filters, fallbacks, operator overrideheadline savings are company reports; published studies report smaller, condition-dependent gains
Video recommendationoff-policy corrections from logs, the top-K correction, live A/B testsa proxy reward and feedback loops between policy and users
Language-model fine-tuninghuman preferences or checkable answers as reward, a penalty for drifting from a reference modellearned rewards can be exploited; how much RL adds beyond pretraining is debated
Chip floorplanningpre-training on many designs; a graph networkcontested
The common thread: learning happens where mistakes are cheap (a simulator, logs, a reward model), and what reaches the real system is constrained, monitored and reversible.

Key takeaways

  • Real systems differ from benchmarks in nine recurring ways: fixed logs, limited samples, large continuous spaces, safety constraints, partial observability and drift, unclear rewards, explainability, real-time limits and delays.
  • Simulation-trained successes (tokamak, balloons, robot hands, drones) rest on simulators made good or randomized enough to transfer, privileged information at training time, and compact, fast deployed policies.
  • Log-based successes (cooling, recommendation) rest on offline data, off-policy corrections, constraints, fallbacks and staged live tests, and many headline numbers are company reports rather than independent evaluations.
  • The most widely deployed use of RL is the fine-tuning of language models against learned or checkable rewards, with a penalty for drifting from a reference model; learned rewards can be exploited.
  • Treat contested and company-reported results as such: the chip-placement dispute shows how hard it is to verify industrial RL claims that others cannot reproduce.

Check yourself

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

Question 1

Why did the cooling systems learn from logged data and filter every action through constraints, instead of exploring freely?

  1. Because exploration is unnecessary when rewards are dense
  2. Because a building or data center cannot be put at risk for the sake of learning: logs supply data without new risk, and constraints and fallbacks bound the damage any learned action can do
  3. Because RL algorithms cannot explore in continuous action spaces
  4. Because offline learning always finds better policies than online learning
Show the answer

B. Because a building or data center cannot be put at risk for the sake of learning: logs supply data without new risk, and constraints and fallbacks bound the damage any learned action can do

Real equipment, comfort and energy bills make every exploratory action costly. Starting from the logs of the existing controller, filtering actions through operator-defined constraints and uncertainty estimates, and keeping the old controller as a fallback is the pattern of nearly every deployed controller of this kind.

Question 2

In the tokamak controller the critic had 718,337 parameters and was recurrent, while the actor had 266,280 and was feedforward. Why could the critic be so much larger?

  1. Because critics always need more parameters than actors
  2. Because the critic ran on faster hardware during the experiments
  3. Because the critic is needed only during training in simulation; on the machine only the actor runs, and it must answer at 10 kHz
  4. Because a recurrent network has fewer effective parameters
Show the answer

C. Because the critic is needed only during training in simulation; on the machine only the actor runs, and it must answer at 10 kHz

Deployment constraints bind only what is deployed. The critic exists to train the actor, so it can be large, recurrent and slow, and it may use information the actor will never see. This asymmetry is a general design pattern for systems trained in simulation.

Question 3

Why does this lesson describe the 2016 and 2018 data-center savings as "reported"?

  1. Because the systems were never deployed
  2. Because the numbers come from company blog posts without peer-reviewed methods or independent measurement, while published work on related systems reports different numbers under different conditions
  3. Because the savings were later shown to be negative
  4. Because data centers cannot be controlled by learned systems
Show the answer

B. Because the numbers come from company blog posts without peer-reviewed methods or independent measurement, while published work on related systems reports different numbers under different conditions

A blog post can describe a real deployment and still leave out what an evaluation needs: baselines, conditions, duration, variability. That does not make the claims false; it means they cannot be checked, which is why this course states them with their source.

Question 4

What is the status of the chip-floorplanning result of Mirhoseini et al. (2021), as of the mid-2020s?

  1. Retracted by Nature
  2. Confirmed by independent replications at full scale
  3. Withdrawn by its authors
  4. Contested: independent assessments found other methods as good or better in their settings, the authors argue those studies left out pre-training and used too little compute, and Nature kept the paper after a review, with an addendum
Show the answer

D. Contested: independent assessments found other methods as good or better in their settings, the authors argue those studies left out pre-training and used too little compute, and Nature kept the paper after a review, with an addendum

Both sides have published detailed arguments, and the journal's post-publication review ended with an addendum rather than a retraction. Without an independent replication at the original scale, the honest summary is that the result is contested.

Further reading

  • A. Mirhoseini, A. Goldie, M. Yazgan et al., "A graph placement methodology for fast chip design," Nature 594, 207–212 (2021).
  • G. Dulac-Arnold, N. Levine, D. J. Mankowitz, J. Li, C. Paduraru, S. Gowal & T. Hester, "Challenges of real-world reinforcement learning: Definitions, benchmarks and analysis," Machine Learning 110(9), 2419–2468 (2021).
  • J. Degrave, F. Felici, J. Buchli et al., "Magnetic control of tokamak plasmas through deep reinforcement learning," Nature 602, 414–419 (2022).
  • M. G. Bellemare, S. Candido, P. S. Castro, J. Gong, M. C. Machado, S. Moitra, S. S. Ponda & Z. Wang, "Autonomous navigation of stratospheric balloons using reinforcement learning," Nature 588, 77–82 (2020).
  • M. Chen, A. Beutel, P. Covington, S. Jain, F. Belletti & E. H. Chi, "Top-K off-policy correction for a REINFORCE recommender system," WSDM, 456–464 (2019).