Reinforcement Learning from LLM-Generated (Suboptimal) Demonstrations

Anurag Kadkol, Lawson L. S. WongarXiv 2026

Imagine you’re trying to teach a robot to bake a soufflé. If you let it wander around the kitchen at random (the "tabula rasa" approach), it’ll spend three years bumping into the fridge before it even touches a whisk. Usually, we fix this by having a human expert show it the ropes. But human experts are expensive, and—let’s be honest—sometimes we’re a bit clumsy ourselves.

This paper asks a fascinating question: Can we use a Large Language Model (LLM) to write the "cheat sheet" for the robot instead? And more importantly, if the LLM’s advice is a bit rubbish, can the robot still learn to be great?

TL;DR

Training reinforcement learning (RL) agents from scratch is painfully slow, but human demonstrations are expensive to collect. This paper shows that we can use LLMs to generate "advice policies" that—while often suboptimal—provide a massive head start, especially when we teach the agent to recognize "good states" rather than just blindly mimicking the LLM's potentially flawed actions.

What Problem Does This Paper Address?

Reinforcement Learning is famous for its "blank slate" problem. In environments with sparse rewards—where you only get a "good job" signal at the very end of a long sequence of actions—an agent can spend millions of steps doing absolutely nothing useful.

The standard solution is Learning from Demonstrations (LfD). You show the agent a few successful runs, and it tries to copy them. However, gathering human data is a bottleneck. LLMs seem like a perfect alternative: they have vast "common sense" knowledge about how tasks (like "pick up the key to open the door") should work. But LLMs aren't perfect; they can produce "suboptimal" advice that might lead an agent in circles. The authors tackle how to bridge this gap: using cheap, imperfect LLM advice to train high-performing agents.

Methods

The authors propose a two-pronged strategy:

  1. LLM Advice Generation: Instead of asking an LLM for a list of moves, they ask it to write a program in RLang, a specialized language for describing task knowledge. This turns the LLM's fuzzy ideas into an executable "advice policy."
  2. Method 1: Warmstarting from Demos: They use the LLM's policy to generate a bunch of successful trajectories. They then "warmstart" a Deep Q-Network (DQN) agent by pre-training it on this data. During actual training, the agent follows a three-way split: sometimes it acts randomly, sometimes it follows the LLM's advice, and sometimes it uses its own learned logic.
  3. Method 2: Value Warmstart (The Secret Sauce): If the LLM's advice is bad, copying its actions can be disastrous. To fix this, the authors introduce "Value Warmstart." Instead of learning what the LLM did, the agent learns how good the states were that the LLM visited. By initializing the agent’s Q-values to represent the "potential" of a state rather than a specific action, the agent starts with a sense of direction but remains free to find better actions than the LLM suggested.

Datasets

The researchers put their methods to the test in the MiniGrid environment suite. These are grid-world challenges that are deceptively difficult because of their long horizons and sparse rewards.

  • Empty: Simple navigation.
  • Unlock: Find a key, then open a door.
  • UnlockPickup: A complex 8-step sequence involving keys, doors, and moving objects between rooms.
  • BlockedUnlockPickup: The "boss level," where the agent must clear an obstacle before even starting the unlock sequence.

Key Insights and Ideas

  • The "Don't Copy My Homework" Insight: Direct imitation is brittle. If the LLM suggests a move that leads to a dead end, a standard imitation agent might get stuck. Value Warmstarting (Method 2) is action-agnostic. It’s like telling a student, "The library is a good place to be," without forcing them to take the exact (and perhaps congested) path you took to get there.
  • LLMs as Code-Generators for RL: By using RLang, the authors treat the LLM as a high-level strategist. This is much more efficient than trying to get an LLM to output raw coordinates or motor torques.
  • Graceful Degradation: One of the most surprising findings was how robust the system is. The authors intentionally "broke" parts of the LLM's advice (e.g., making the "pick up key" sub-skill act randomly). Even with this "brain-damaged" advice, the agents learned significantly faster than those starting from scratch.

Key Results

The results show a clear "speed boost" across the board.

Figure 1: DQN Exploration Advice Warmstart. Curves show the mean over 5 seeds; shaded regions denote standard error.

As seen in Figure 1 (above), the warmstarted agents (purple lines) consistently reach high performance much earlier than the standard DQN (blue lines). In the most complex task, BlockedUnlockPickup (d), the standard DQN barely gets off the ground, while the LLM-aided agent steadily climbs toward success.

In the "Value Warmstart" experiments (Figure 2 in the paper), the authors showed that even when the advice was substantially degraded (e.g., the LLM didn't know how to find the box), the agent eventually exceeded the performance of its "teacher," proving that the RL agent can successfully "unlearn" the LLM's mistakes while keeping the useful bits.

Limitations and Future Work

  • The Prompting Loop: While the process is "effectively no human cost," the authors note that some tasks required a few rounds of "re-prompting" the LLM with natural language hints to get a working RLang policy.
  • Grid-World Constraints: The current work is in 2D grid worlds. While the authors argue that RLang scales to 3D robotics (by defining skills like go_to(object)), this hasn't been demonstrated in a high-fidelity physics simulator yet.
  • Suboptimality Types: The paper focuses on "random action" perturbations. Real-world LLM errors might be more "insidious"—like an agent that consistently tries to put a square peg in a round hole—which might be harder to recover from.

In short: the next time you're training an AI, don't wait for it to discover the wheel. Ask an LLM to write a rough draft of the manual, and let the RL agent take it from there.

Summary updated

Abstract

Reinforcement learning (RL) has achieved substantial progress across many domains, but training an agent \textit{tabula rasa} remains highly sample-inefficient. A common remedy is to initialize the agent using a neural network pretrained on demonstrations. However, collecting demonstrations is expensive, and the demonstrations themselves can be suboptimal. In this work, we use a large language model (LLM) to generate an advice policy that produces demonstration data with effectively no human cost. We use this data to warmstart a DQN agent, and use the advice policy itself to guide exploration during training. Because LLM-generated advice is often suboptimal, we further introduce a value warmstart method that initializes the agent to recognize promising states from the advice policy's behavior, without directly copying its actions. To characterize the robustness of this method, we systematically perturb individual sub-skills of an LLM-generated advice policy for a long-horizon, sparse-reward task. Degraded advice still meaningfully accelerates learning relative to unaided baselines. These results suggest that LLM-generated advice, though suboptimal, can be a cheap alternative to costly human demonstrations.
BibTeX
@misc{kadkol2026reinforcement,
  author = {Anurag Kadkol and Lawson L. S. Wong},
  title = {{Reinforcement Learning from LLM-Generated (Suboptimal) Demonstrations}},
  year = {2026},
  eprint = {2611.29732},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.29732},
}
Figure