‹ papers
Playful Agentic Robot Learning  ·  robots that invent their own tasks, then reuse the skills

Paper explainer Robot learning Playful-RATs.github.io · 2026 preprint

Playful Agentic Robot Learning

Junyi Zhang*, Jiaxin Ge*, Hanjun Yoo, Letian Fu, Zihan Yang, Yaowei Liu, Raj Saravanan, and 13 others, incl. Ken Goldberg, Angjoo Kanazawa, Ion Stoica, Trevor Darrell  ·  UC Berkeley & Impossible Research  ·  2026 (*project leads)

RATs (Robotics Agent Teams) is a multi-agent Code-as-Policy robot that, before anyone gives it a task, spends a play phase inventing its own curiosity-driven practice tasks, attempting each one as executable Python with dense per-step checking, and distilling what works into a persistent, reusable code-skill library. At test time the frozen library is retrieved and reused on held-out tasks: it beats a single-agent code baseline by +20.6 points on LIBERO-PRO and +17.0 on MolmoSpaces, and the same inspectable code transfers with no finetuning to a new simulator (+8.9) and to a real robot (+8.8).

Two-panel overview: Play-Time shows the robot practicing self-proposed tasks and distilling code skills; Test-Time shows the frozen skills reused on a held-out task
Figure 1. The whole thesis in one picture. At play-time (left), the robot proposes its own goals, attempts them as Code-as-Policy programs, and files successful behaviors into a skill library and a failure memory. At test-time (right, the pink panel), that frozen library is retrieved and reused to solve a held-out task. The point is the order: proactive skill acquisition before any instruction arrives, not reactive skill accumulation as a byproduct of being told what to do.

01The reactive trap: robots that only learn when told

Today's most capable agentic robots are surprisingly good at one thing: given an instruction, they write an executable program that strings together perception and control primitives, watch it run, and revise across a few attempts. This is the Code-as-Policy (CaP) paradigm. The robot does not output low-level motor torques; it writes Python that calls segment, plan_grasp, goto_pose, and so on, then reads back what happened.

But all of that learning is reactive. The agent only starts working after it receives an explicit external instruction. Even when a successful execution gets saved as a reusable skill, that skill is an accidental leftover of solving an assigned task, not the product of any deliberate practice. The paper asks the question these systems never do: what should a robot practice and accumulate before anyone asks it to do anything?

◆ the gap, stated plainly

Standard CaP synthesizes a program $\pi$ from a scene context $c$, a set of primitives $f$, and an instruction $l$. The whole loop is keyed on $l$. Remove $l$ and the system has nothing to do. The paper's move is to remove the instruction and replace it with a task the robot proposes to itself, turning play into a continual skill-learning phase that runs before deployment.

The alternative everyone reaches for, end-to-end vision-language-action (VLA) policies, folds perception, dynamics, and control into opaque weights. They generalize poorly under perturbation: on the robustness benchmark LIBERO-PRO, the strongest VLA tested (π_0.5) reaches only 12.8% average, and OpenVLA and π_0 both score 0.0. Something more inspectable and more reusable is needed.

02Children play before they're told: the developmental bet

A three or four year old is not handed a chore list. It picks objects up, opens drawers, stacks blocks, and pushes things off tables purely for fun. In doing so it discovers controllable effects and builds a toolkit of motor skills, near the edge of what it can already do, that it later deploys when finally asked to accomplish something. This is the long tradition of developmental robotics and intrinsic motivation: curiosity, learning progress, goal babbling, the Goldilocks effect from infant attention studies.

The bet of this paper is that these old ideas are newly powerful in the foundation-model era for one specific reason: a coding agent can express its goals in language, run them as programs, and save successes as callable code. Earlier intrinsic-motivation work explored fixed sensorimotor or feature spaces. RATs explores a space of language-described, program-executed tasks, and the skills it saves are inspectable functions, not weights.

★ the new setting

Playful Agentic Robot Learning: an embodied coding agent uses self-directed play, self-proposed and self-executed tasks with no external instruction, as a continual skill-learning phase before downstream tasks are specified. The question shifts from how should the robot solve this task to what skills should it practice and stockpile before being asked.

03Three teams at play: the RATs architecture

RATs stands for Robotics Agent Teams, and the name is literal: it is a multi-agent system organized into three cooperating teams that turn play into an explicit skill-acquisition process. The whole thing runs in two phases. In Phase 1 (play), the system loops for $N$ iterations, maintaining a skill library $\mathcal{L}$ and a failure memory $\mathcal{M}$. In Phase 2 (evaluation), the library is frozen and reused on held-out tasks.

RATs at play: per-scenario scene context feeds the Task Proposer, Planner, Policy Writer, Executor, Verifier, Per-Step Verifier and Diagnoser, with a persistent Skill Library and Failure Memory
Figure 2. RATs at play. A per-scenario scene context feeds the Task Proposer (what to practice), then the Planner, Policy Writer, Quality Checker, and Executor write and run the robot code, and the Verifier, Per-Step Verifier, and Feedback Generator/Diagnoser grade it. Two persistent stores on the right, the Skill Library and Failure Memory, are written on success (a new skill) and on failure (a distilled lesson). On success the system selects a new task; on failure it retries. After $N$ iterations the library is frozen for test time.

Each play iteration runs three steps. The Task Proposer team generates and selects a self-directed task $\tau_t$ using a curiosity rule, then builds the play environment. The Execution team runs that task through a bounded Write-Execute-Verify-Diagnose loop, planning, writing code, verifying both the goal and every step, and diagnosing failures, with a default budget of 5 attempts per task. The Memory-Management team distills successful code into the library, records compact lessons from failures, updates reliability tiers, and periodically curates everything.

★ the design thesis

The single idea that makes this work is dense, step-level feedback instead of a sparse task-level reward. A lone "task failed" signal cannot tell you which substep broke or what reusable behavior to save. By grading every step and diagnosing failures, RATs can preserve the substeps that worked, localize the capability that is missing, and turn recurring physical bottlenecks into named, reusable helper functions. Dense feedback is what makes play informative.

04Choosing what to practice: the Goldilocks proposer

Play is only useful if the robot practices the right things. The Task Proposer is prompted to role-play a curious toddler: it looks at what objects are visibly within reach, what skills it already has and how reliable they are, and what it recently tried, then brainstorms a handful of candidate tasks (typically $K=5$). The trick is in how it picks one. Each candidate $\tau$ is scored by the product of two terms, and the winner is the argmax.

$$\tau_t = \arg\max_{\tau \in \mathcal{T}_t} \big[\, \mathcal{N}(\tau)\cdot \mathcal{F}(\tau) \,\big]$$
In words: pick the candidate that maximizes novelty $\mathcal{N}$ times learnability $\mathcal{F}$. Because it is a product, a task wins only if it scores on both axes: it must be something new and something the robot has a fighting chance at. This is exactly how children gravitate to activities that are fresh yet achievable.

The first term rewards trying things the robot has rarely drilled. It is a count-based novelty bonus over the object-skill pairs the task touches.

$$\mathcal{N}(\tau) = \frac{1}{|O(\tau)\times S(\tau)|}\sum_{(o,s)} \frac{1}{\sqrt{N(o,s)+1}}$$
In words: each object-skill pair $(o,s)$ contributes $1/\sqrt{N(o,s)+1}$, where $N(o,s)$ is how many times that pair has been attempted. Rarely-tried pairs score high; over-drilled pairs decay toward zero. Averaging over all pairs the task touches gives its overall freshness, steering exploration toward unexplored corners of the object-skill space.

The second term is the competence frontier: a difficulty thermostat that peaks where the robot succeeds about half the time.

$$\mathcal{F}(\tau) = 4\,\bar r(\tau)\,(1-\bar r(\tau)), \qquad \bar r(\tau)=\frac{1}{|S(\tau)|}\sum_{s} \hat r(s)$$
An inverted parabola peaking at $\bar r = 0.5$ (value 1) and zero at $\bar r = 0$ or $1$. This is the zone of proximal development: trivially easy ($\bar r\to 1$) and hopeless ($\bar r\to 0$) tasks teach nothing, while a task you win about half the time is maximally informative to practice. Crucially $\hat r(s)$ uses the Wilson lower bound on the success rate, not the raw rate, so a single lucky win does not fake competence: one success in one attempt is a raw rate of 1.0 but a Wilson-bounded $\hat r\approx0.21$, which keeps the skill in the learnable zone instead of the "mastered" dead end.

The widget below is the proposer's decision in miniature, wired to the paper's Table 7. Drag the tissue box's success rate $\bar r$ (and how many times it has been practiced) and watch its dot ride the competence parabola while the SELECTED badge jumps to whichever candidate currently maximizes $\mathcal{N}\cdot\mathcal{F}$. On load it reproduces the worked example: lifting a brown tissue box wins at about 0.62 over the two nearly-mastered drawer moves at 0.36.

◆ a worked example (MolmoSpaces, iteration 15)

Scene grounding proposes five candidate tasks; one (an unsupported cloth pick) is vetoed as unreachable, leaving four. Because none of these object-skill pairs has been attempted yet, all four carry the same novelty $\mathcal{N}=1.0$, so the choice is decided entirely by learnability $\mathcal{F}$. Lift brown tissue box scores $\mathcal{F}=4(0.1933)(0.8067)=\mathbf{0.6236}$ because its grasp-and-lift family has a Wilson-bounded reliability of only $\sim0.19$, squarely in the learnable zone. It beats two nearly-mastered drawer moves ($\bar r\approx0.9$, so $\mathcal{F}=0.36$) and a near-hopeless cloth place ($\bar r=0.05$, $\mathcal{F}=0.19$). The robot deliberately chooses the semi-familiar task over the ones it has already nailed.

The full deployed ranker adds two more terms, $s(\tau) = \mathcal{N}(\tau)\mathcal{F}(\tau) + w_B\,B_{\text{retry}}(\tau) - w_P\,P_{\text{fail}}(\tau)$: a small surprise bonus $B_{\text{retry}}$ for promising past near-misses worth re-attempting, and a penalty $P_{\text{fail}}$ for tasks too similar to recent failures. In a clean proposal turn both are zero and the score collapses back to pure $\mathcal{N}\cdot\mathcal{F}$.

Test yourself: why a product 𝒩·ℱ, and not a sum 𝒩+ℱ?
A sum would let a task win on one axis alone: a wildly novel but hopeless task (𝒩 high, ℱ≈0) or a perfectly learnable but stale one (ℱ high, 𝒩≈0) could still top the list. A product vetoes either failure: if either factor is near zero the score is near zero, so a task must be both fresh and winnable about half the time to be chosen. Try it in the widget: crank a candidate to maximally novel but drag its success rate to the hopeless end, and watch it still lose.

05Trying, failing, and fixing one step at a time

Once a task is chosen, an Environment Creator turns the abstract idea into a real, runnable scene (in LIBERO it writes a BDDL goal specification and instantiates a MuJoCo environment), sanity-checks it over two reset seeds, and only then hands it to the Execution team. That team runs the accepted task as a Code-as-Policy program inside a bounded retry loop with a clear division of labor.

The Planner writes an ordered plan and predicts likely failure points. A Planner Verifier checks the plan is grounded in what the camera actually sees. The Policy Writer turns the verified plan into Python using only the listed primitives and learned helpers. A Quality Checker statically lint-screens that code (syntax, unavailable APIs, unbounded loops) before any robot time is spent. After execution, two graders run: a Goal Verifier for overall success, and, the key piece, a Per-Step Verifier that issues a localized pass/fail verdict for each step using its objective, code slice, runtime values, and before/after visual evidence. On failure, a Failure Diagnoser names the failure category, the first failed step, and a concrete repair, and routes the fix.

◆ sparse vs dense, explained by grading

A single "task failed" is like a teacher writing only "wrong" on a multi-step problem. The per-step verifier instead grades every line and the diagnoser writes "you set up the equation right but dropped a sign on line 3", so the next attempt fixes the exact broken step instead of redoing the whole thing. Dense feedback makes retries surgical; sparse feedback forces blind full rewrites.

The widget makes this concrete. A four-step manipulation (localize, grasp, lift, place) fails at the grasp. Toggle between Sparse and Dense feedback and run the retry: under Sparse only a final pass/fail is available, so every step gets rewritten; under Dense, per-step verdicts plus a "WHEN/WRONG/DO" diagnosis rewrite only the broken step and freeze the ones that already worked.

When one sub-action keeps failing, say a tricky grasp, the Diagnoser can spawn a SubAgent: a focused agent that drills just that move in isolation from the same reset state, often trying 2-3 distinct physical strategies in parallel (top-down vs side grasp, different localization paths), and returns the first visually verified helper. But that helper earns a permanent spot in the library only after it contributes to a real end-to-end success, keeping the library free of overfitted local fixes. It is a batting cage: you drill the missed swing off to the side, then only add it to your repertoire once it helps win an actual game.

06Building a trustworthy toolbox and a notebook of mistakes

The Memory-Management team is what makes play accumulate. On a successful end-to-end trajectory it extracts at most two self-contained, parameterized helper functions from the executed policy, with docstrings and type hints, never a "do-everything" composite, and never a duplicate of an existing skill. Each new skill enters the library $\mathcal{L}$ as experimental, storing its source, preconditions, expected effects, usage counts, success counts, and a reliability tier.

$$\text{experimental} \xrightarrow[\;\text{uses}\ge 3,\ \text{succ}\ge 0.5\;]{} \text{verified} \xrightarrow[\;\text{uses}\ge 10,\ \text{succ}\le 0.2\;]{} \text{deprecated}$$
A probation system. A new skill is on probation (experimental), earns tenure (verified, prioritized in retrieval) after sustained success, and is retired (deprecated, hidden) after sustained failure. Retrieval prioritizes verified skills using Wilson-bounded reliability. Importantly the lifecycle is not a one-way ratchet: a verified skill can be demoted again if its performance later degrades, so the library stays honest as it grows.

The lifecycle is yours to drive below. Pick a skill, log a success or a failure, and watch its tier move with its Wilson-bounded reliability: a fresh skill earns "verified" after three uses at 50%+, and a verified skill is demoted again the moment it starts failing.

Failures are not thrown away either. Each one is recorded in the failure memory $\mathcal{M}$ and distilled into a compact lesson in the form WHEN <condition> | WRONG <approach> | DO <correction>. The Planner retrieves these lessons by task and object overlap, so later attempts avoid old mistakes without replaying long traces. Every $K=5$ iterations a Memory Curator merges, rewrites, or deletes near-duplicate or contradicted lessons. And when recurring failures reveal a missing capability, an anticipatory Skill Proposer drafts a brand-new helper as a hypothesis, which enters as experimental and earns reliability only through later use.

Two line plots over play iterations 10 to 50: left, learned helpers growing 6 to 27 split by verified/experimental/deprecated tier; right, failure memory growing to 70 episodes and 121 distilled lessons
Figure 7. Play accumulates capability and negative evidence over a 50-iteration MolmoSpaces run. Left: the learned library grows from 6 helpers (iteration 10) to 27 (iteration 50), with the three reliability tiers evolving, not a monotonic code-dump (some skills get deprecated). Right: the failure memory grows to 70 raw episodes and 121 distilled lessons. The system remembers both what to do and what not to do.

07Freeze and reuse: does play pay off?

At test time the playing stops. Intrinsic exploration and memory updates are disabled, the library $\mathcal{L}$ is frozen, and held-out tasks arrive. The frozen toolbox is used two ways. In plug-and-play mode, each selected skill's signature, description, and source are simply dropped into the context of a vanilla single-agent baseline, CaP-Agent0, isolating the transfer value of the code itself. In full-system mode (RATs Exec.), the same frozen library is given to the entire execution team with its verification, diagnosis, and retry machinery intact.

43.8%
RATs avg on held-out LIBERO-PRO vs 23.2% for CaP-Agent0, a +20.6 pp gain
+31.0
points over the best VLA (π_0.5 at 12.8%); OpenVLA and π_0 both score 0.0
38.0%
RATs avg on MolmoSpaces vs 21.0% for CaP-Agent0, +17.0 pp, up on every category
+37
points on MolmoSpaces "Close" tasks (73.0 vs 36.0), the largest single-category gain

The improvement shows up on the object splits most (Object Pos +34, Object Task +32 on LIBERO-PRO) but is present on goal and spatial splits too, evidence the learned skills generalize beyond the exact tasks practiced. The why is visible in the paper's side-by-side code panels: where CaP-Agent0 re-derives segmentation, grasp selection, approach geometry, and motion from low-level operations every single episode, RATs calls a named helper like execute_top_down_grasp_and_lift or grasp_and_pull_horizontal_handle.

▮ a kitchen of named recipes

CaP-Agent0 cooks every dish from raw ingredients (query points, segment, build a point cloud, plan a grasp, write waypoints) every time. RATs writes the recipe down once as a named function and just calls it, so it stops rediscovering "how to grasp from above" from pixels in every episode. That is what makes the skills both reliable and portable: they are parameterized code, not weights.

The whole thesis is that a skill is inspectable, parameterized code and not opaque weights, so it is worth seeing one. Here is a single learned skill beside the two ways to call on it: RATs makes one named call, while the baseline re-derives the same behavior from pixels every episode.

a learned skill verified
# promoted to verified: uses 7, succ 0.86
def execute_top_down_grasp_and_lift(obj, lift_z=0.15):
    """Grasp obj from above at its verified
    contact point, then lift it by lift_z.
    pre:  obj visible & reachable, gripper empty
    post: obj grasped and raised lift_z m"""
    pts   = segment(obj)
    grasp = plan_grasp(pts, approach="top_down")
    goto_pose(grasp.pre_grasp); close_gripper()
    goto_pose(grasp.pose.lift(lift_z))
    return verify_held(obj)
calling on it play vs baseline
# RATs: one verified, named call
execute_top_down_grasp_and_lift("tissue_box")

# CaP-Agent0: re-derives it every episode
pts  = query_points("tissue box")
mask = segment(pts)
pc   = build_pointcloud(mask)
g    = plan_grasp(pc, approach="top_down")
for p in waypoints(g.pre_grasp, g.pose):
    goto_pose(p)
close_gripper(); goto_pose(g.pose.lift(0.15))

08Skills travel: cross-simulator, cross-embodiment, real robot

The strongest argument that code is a better substrate than weights is that the skills move. Skills learned during LIBERO-PRO play, plugged into CaP-Agent0 with no finetuning, lift performance on simulators and hardware the system never played in.

+8.9 pp
on RoboSuite, a never-seen simulator: 40.3% → 49.1% average (172/350)
+24.0
on two-arm lifting, a cross-embodiment jump: single-arm play skills help a two-arm task
+8.8 pp
on a real robot: 30.0% → 38.8% (31/80), with no real-world play or finetuning
+21.7 pp
real-world transfer of MolmoSpaces skills on harder tasks: 3.3% → 25.0% (15/60)

The ledger below makes the honesty interactive. Toggle the frozen library on and off: every transfer is measured against the same CaP-Agent0 baseline, the gains stacking up in green and the one regression (a mis-retrieved skill on the two-arm handover) dropping below in red.

The cross-embodiment result is the headline: skills practiced on the single-arm LIBERO-PRO robot transfer to a two-arm collaborative lift in a different simulator, a transfer that is hard to imagine for opaque policy weights but natural for inspectable, parameterized code. On the harder real-world rearrangement tasks, the standard baseline fails "Swap Cubes" entirely (0/30) while the skill-augmented agent succeeds 7/30. Not everything improves, though: a two-arm handover regressed by 4.0 points when a retrieved skill did not fit the task, an honest reminder that better retrieval still matters.

09Was it really the play? Ablations and honest costs

It would be easy to suspect the gains come from "more compute at test time" rather than from play. The paper rules this out carefully, and is candid about what play costs.

Curiosity matters; mere play does not

On LIBERO-PRO under the CaP-Agent0 baseline, random play adds only +1.5 pp (23.2 → 24.7) while curious play adds +9.1 pp (23.2 → 32.3). The Goldilocks selection, not the act of playing, drives the gain. Play-time skills and the test-time execution loop are also complementary: improving only execution gets you from 23.2 to 36.3, improving only play gets you to 32.3, and combining both reaches the best result of 44.3. Cramming at random the night before helps a little; practicing the right things, and banking them as reusable code, helps a lot.

● honest costs and limits

Play is token-heavy: roughly 30M tokens for a 50-iteration phase, and the Failure Diagnoser alone consumes 40.5% of play tokens (policy writing another 28.8%), so the Write-Execute-Verify-Diagnose loop dominates cost. Other limits: skill diversity is bounded by what the simulator can express; improper skill reuse can hurt (the two-arm handover regression); reliability tiers are noisy early (3 uses to verify, 10 to deprecate); skills are extracted only from successful trajectories plus anticipatory proposals; the system is capped by primitive-level control APIs (no learned low-level geometric perception, since camera calibration is deliberately not exposed); and real-world evaluation remains preliminary (40 or 30 trials per task on a handful of tasks).

10Where this sits, and where it goes

RATs is, in effect, Voyager for physically-grounded robotics: it ports the automatic-curriculum and executable-skill-library idea from Minecraft to real manipulation, and operationalizes "sleep-time compute", spending effort before queries arrive. It extends the Code-as-Policy line (CaP, ProgPrompt, CaP-X) by bolting on a proactive skill-acquisition phase, and it directly instantiates classical developmental-robotics ideas (Schmidhuber-style curiosity, Oudeyer-Kaplan learning progress, the Goldilocks effect), but expresses goals in language and behaviors as programs rather than in fixed sensorimotor spaces.

The contrast with VLAs is the through-line of the whole paper. Where OpenVLA, π_0, and π_0.5 fold perception, dynamics, and policy into opaque weights that crumble under LIBERO-PRO perturbations, RATs keeps skills as inspectable, composable, verified code and never finetunes the backbone. The dense per-step verification and diagnosis loop is, conceptually, a reasoning-acting-reflecting agent specialized to embodied control.

▲ implementation note

The main RATs play uses gemini-3.1pro-preview as the backbone; the appendix token-cost analysis used gpt-5.5. Play runs 50 iterations on each of LIBERO-PRO and MolmoSpaces, with up to 5 attempts per task. The LIBERO library ends play with 47 learned skills, MolmoSpaces with 27; across 400 MolmoSpaces eval trials, 391 invoke at least one learned skill.


The one-sentence takeaway: a self-built library of verified, reusable code skills, accumulated through curiosity-driven play with dense per-step feedback, is a practical, finetuning-free path to more capable and more transferable agentic robots, a step toward machines that, like children, learn what to do before they are asked.