TL;DR
Prompted Policy Optimization (PromptPO) explores whether Large Language Models (LLMs) can replace traditional reinforcement learning (RL) algorithms by iteratively generating and refining executable Python policies. Across 19 diverse environments, PromptPO matches or outperforms standard RL baselines in 15 tasks while demonstrating massive improvements in sample efficiency, though it struggles with fine-grained continuous control.
What Problem Does This Paper Address?
Classical reinforcement learning algorithms (like PPO or SAC) are notoriously sample-inefficient and brittle. Training a policy from scratch requires millions of environment interactions and tedious hyperparameter tuning.
This paper investigates a compelling alternative: Can we use the massive prior knowledge embedded in LLMs to act as black-box policy optimizers? Instead of learning from a blank slate, an LLM can reason about the structure of a task to generate a high-performing policy directly. The authors tackle the challenge of evaluating whether LLMs can serve as a true drop-in replacement for standard RL algorithms across sequential decision-making tasks without being given the environment's transition dynamics.
Methods
The authors introduce Prompted Policy Optimization (PromptPO), an iterative framework that treats policy generation as a code-generation and optimization problem.
The process operates in a closed loop:
- Input: PromptPO receives Python-formatted descriptions of the environment's state space, action space, and reward function. Crucially, it is not given the transition dynamics.
- Generation: The LLM (Gemini 3 Pro) generates an evaluation function (
Feedbackclass) and a set of $N$ candidate policies implemented in Python code. - Rollout & Evaluation: The candidate policies are executed in the environment. Trajectory-level feedback (returns and custom evaluation metrics) is collected.
- Reflection: The best-performing policy is fed back to the LLM, which generates a natural language reflection on its performance.
- Iteration: The LLM uses this history to propose a refined set of policies for the next round.
Datasets
The method was evaluated across four distinct categories of environments:
- Exploration Environments: NoiseWorld (a newly introduced suite of 5 randomly generated gridworlds with stochastic cell types to prevent LLM memorization) and a custom layout of Point Maze.
- Robotics Benchmarks: Six continuous control tasks from MuJoCo (Ant, Half-Cheetah, Hopper, Swimmer, Reacher, Inverted Pendulum) and four manipulation tasks from Meta-World (Button Press, Door Open, Drawer Open, Pick and Place).
- Real-World Control Tasks: Three environments simulating real-world challenges: Glucose Monitoring (insulin administration), Pandemic Mitigation (lockdown scheduling), and Traffic Control (autonomous vehicle merging).
Key Insights and Ideas
- Emergent Algorithmic Generation: Amazingly, without explicit prompting, PromptPO generated policies that implemented complex classical algorithms. For instance, in NoiseWorld, it wrote code for Value Iteration and Dijkstra’s algorithm using an empirically estimated transition model. In continuous environments, it naturally opted to implement and tune Proportional Controllers.
- Semantic vs. Low-Level Action Spaces: LLMs excel when the action space aligns with natural language reasoning (e.g., end-effector displacements in Meta-World or macro-level policy decisions in Pandemic Mitigation). However, they fail when forced to reason about low-level, non-intuitive physics, such as joint torques in MuJoCo.
- Pretraining as a Substitute for Exploration: PromptPO achieves its sample efficiency not by exploring every state-action pair, but by leveraging strong inductive biases from its pretraining data to guess effective optimization strategies immediately.
Key Results
PromptPO proved to be highly competitive with state-of-the-art model-free RL baselines (PPO, SAC, DQN, TD3):
- Performance: PromptPO matched or outperformed the best RL baseline in 15 out of 19 environments.
- Sample Efficiency: It was substantially more sample-efficient in 14 environments, often outperforming baselines by more than an order of magnitude (11/19 environments). For example, in the Pandemic Mitigation environment, PromptPO was over 60× more sample-efficient than PPO.
- The MuJoCo Exception: Traditional RL significantly outperformed PromptPO in MuJoCo environments (except Reacher), confirming the LLM's limitation in fine-grained continuous control.
Limitations and Future Work
- Fine-Grained Control: Current LLMs struggle to synthesize policies for low-level motor control (e.g., joint torques). Future work could explore reformulating these action spaces into higher-level primitives.
- Non-Semantic Spaces: If state spaces or reward functions are parameterized as neural networks (such as those learned via RLHF) rather than clean code or text, PromptPO's performance will likely degrade.
- Long-Horizon Transitions: PromptPO currently relies on trajectory-level feedback. Incorporating state-action level feedback (like temporal difference errors) into the prompt could help, though current LLMs may struggle to reason over thousands of individual step transitions.
Summary updated