GRACE: A Language Model Framework for Explainable Inverse Reinforcement Learning
Silvia Sapora, R. Devon Hjelm, Omar Attia, Alexander Toshev, Bogdan Mazoure
Abstract
Inverse Reinforcement Learning aims to recover reward models from expert demonstrations, but traditional methods yield black-box models that are difficult to interpret and debug. In this work, we introduce GRACE (Generating Rewards As CodE), a method for using Large Language Models within an evolutionary search to reverse-engineer an interpretable, code-based reward function directly from expert trajectories. The resulting reward function is executable code that can be inspected and verified. We empirically validate GRACE on the MuJoCo, BabyAI and AndroidWorld benchmarks, where it efficiently learns highly accurate rewards, even in complex, multi-task settings. Further, we demonstrate that the resulting reward leads to strong policies, compared to both competitive Imitation Learning and online RL approaches with ground-truth rewards. Finally, we show that GRACE is able to build complex reward APIs in multi-task setups.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
Lineage
- Language Agent Tree Search Unifies Reasoning, Acting, and Planning in Language Models cites Self-Refine: Iterative Refinement with Self-Feedback
- CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesis cites InCoder: A Generative Model for Code Infilling and Synthesis
- Self-Refine: Iterative Refinement with Self-Feedback cites CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesis
- Self-Refine: Iterative Refinement with Self-Feedback cites Training language models to follow instructions with human feedback
- InCoder: A Generative Model for Code Infilling and Synthesis cites Training language models to follow instructions with human feedback
Builds on12
- Training language models to follow instructions with human feedbackLong Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida et al.NeurIPS 2022 · 24,707 citations
- Self-Refine: Iterative Refinement with Self-FeedbackAman Madaan, Niket Tandon, Prakhar Gupta, Skyler Hallinan et al.NeurIPS 2023 · 4,972 citations
- Language Agent Tree Search Unifies Reasoning, Acting, and Planning in Language ModelsAndy Zhou, Kai Yan, Michal Shlapentokh-Rothman, Haohan Wang et al.ICML 2024 · 443 citations
- CodeGen: An Open Large Language Model for Code with Multi-Turn Program SynthesisErik Nijkamp, Bo Pang, Hiroaki Hayashi, Lifu Tu et al.ICLR 2023 · 234 citations
- InCoder: A Generative Model for Code Infilling and SynthesisDaniel Fried, Armen Aghajanyan, Jessy Lin, Sida Wang et al.ICLR 2023 · 140 citations
Related papers
- Text2Reward: Reward Shaping with Language Models for Reinforcement LearningTianbao Xie, Siheng Zhao, Chen Henry Wu, Yitao Liu et al.ICLR 2024 · 142 citations
- REvolve: Reward Evolution with Large Language Models using Human FeedbackRishi Hazra, Alkis Sygkounas, Andreas Persson, Amy Loutfi et al.ICLR 2025
- Mapping Language to Programs using Multiple Reward Components with Inverse Reinforcement LearningSayan Ghosh, Shashank SrivastavaEMNLP Findings 2021 · 2 citations
- GRACE: Generative Representation Learning via Contrastive Policy OptimizationJiashuo Sun, Shixuan Liu, Zhaochen Su, Xianrui Zhong et al.ICLR 2026 · 7 citations
- Master Skill Learning with Policy-Grounded Synergy of LLM-based Reward Shaping and ExploringYanbin Chang, Junfan Lin, Jie Jiang, Runhao Zeng et al.ICLR 2026
