DiReCL: Learning Differentiable Reward Code with Inverse Reinforcement Learning
Aoran Wang, Jingtao Zhang, Maosen Li, Zongzhang Zhang
NeurIPS page · OpenReview · Open on the map
Category: Reinforcement Learning & Games › Reward-Shaped Reinforcement Learning · Type: new method · Keywords: differentiable reward learning, inverse reinforcement learning, LLM prompting, reward interpretability, MuJoCo locomotion, autonomous driving
Areas: AI Agents › Agent Optimization and Evaluation › Agentic System Reinforcement Learning; RL for LLMs & Agents › Language Model Reinforcement Learning › Reward Specification
Summary
DiReCL learns a differentiable reward code by prompting an LLM for reward templates, converting numeric elements into trainable parameters, and aligning them with expert demonstrations via IRL, achieving over 1.25× the performance of standard IRL and LLM-assisted baselines.
Explained to a 5-year-old
In reinforcement learning, robots need to know what good behavior looks like. Usually, people write a number that says how good something is, but that can be hard to get right. DiReCL helps by using a language model to write a template for the reward, then makes the numbers easy to adjust. It also checks if the reward template is working and fixes it when needed. This makes robots learn faster and understand why they are being rewarded.
Explained to a 5-year-old, longer
Reinforcement learning is a way to teach computers, like robots, how to do tasks by giving them feedback. The feedback is called a reward, and it tells the robot whether it did something good or bad. Writing a good reward by hand can be tricky because you have to pick the right numbers. Some researchers use big language models to help write reward descriptions, but those numbers still need to be set correctly. DiReCL is a new method that combines two ideas: using a language model to write a template and making the numbers easy to change. First, it asks the language model to create a reward template that looks like a piece of code with placeholders. Then it turns those placeholders into numbers that can be adjusted while the robot learns. The robot learns from examples of good behavior, just like a student learns from a teacher. DiReCL also has a checking step that looks at how well the reward works and suggests changes if needed. This way, the reward stays easy to understand and can be fixed when it makes mistakes. In experiments, the method performed better than older ways of designing rewards on tasks like walking and driving. Overall, DiReCL makes it simpler to create clear, flexible rewards that help robots learn faster.
For a technical reader
DiReCL learns a reward function by first generating a template with an LLM that describes the desired behavior in code form. The numeric parts of this template are turned into differentiable parameters that can be optimized using inverse reinforcement learning from expert demonstrations. A reflection module monitors the learned reward’s performance and uses diagnostic feedback to suggest revisions to the template, improving interpretability. Experiments on MuJoCo locomotion and autonomous driving benchmarks show the approach outperforms standard IRL and LLM-based reward designs by more than 25 %. The result is a reward that is both explicit and flexible, allowing practitioners to inspect and adjust the reward logic without retraining the whole model.
Problem
Reward specification in reinforcement learning is crucial but difficult; neural-network rewards lack interpretability, while LLM-generated reward code is hard to calibrate numerically.
Method
The approach prompts an LLM to generate reward code templates, converts numeric elements into differentiable parameters, and aligns them with expert demonstrations using IRL. It also incorporates a reflection mechanism that uses IRL diagnostics to detect reward inadequacies and guide template revision.
Results
The approach achieves over 1.25× the performance of standard IRL and LLM-assisted reward design baselines on the evaluated tasks.
Contributions
It introduces a differentiable reward code space that unifies neural-network rewards and LLM-generated templates, and adds a reflection mechanism for diagnosing and revising reward structures.
Research questions this paper is counted under
This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction