Generating Code World Models with Large Language Models Guided by Monte Carlo Tree Search

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Dainese, Nicola, Merler, Matteo, Alakuijala, Minttu, Marttinen, Pekka
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866916460313444352
author Dainese, Nicola
Merler, Matteo
Alakuijala, Minttu
Marttinen, Pekka
author_facet Dainese, Nicola
Merler, Matteo
Alakuijala, Minttu
Marttinen, Pekka
contents In this work we consider Code World Models, world models generated by a Large Language Model (LLM) in the form of Python code for model-based Reinforcement Learning (RL). Calling code instead of LLMs for planning has potential to be more precise, reliable, interpretable, and extremely efficient. However, writing appropriate Code World Models requires the ability to understand complex instructions, to generate exact code with non-trivial logic and to self-debug a long program with feedback from unit tests and environment trajectories. To address these challenges, we propose Generate, Improve and Fix with Monte Carlo Tree Search (GIF-MCTS), a new code generation strategy for LLMs. To test our approach in an offline RL setting, we introduce the Code World Models Benchmark (CWMB), a suite of program synthesis and planning tasks comprised of 18 diverse RL environments paired with corresponding textual descriptions and curated trajectories. GIF-MCTS surpasses all baselines on the CWMB and two other benchmarks, and we show that the Code World Models synthesized with it can be successfully used for planning, resulting in model-based RL agents with greatly improved sample efficiency and inference speed.
format Preprint
id arxiv_https___arxiv_org_abs_2405_15383
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Generating Code World Models with Large Language Models Guided by Monte Carlo Tree Search
Dainese, Nicola
Merler, Matteo
Alakuijala, Minttu
Marttinen, Pekka
Artificial Intelligence
In this work we consider Code World Models, world models generated by a Large Language Model (LLM) in the form of Python code for model-based Reinforcement Learning (RL). Calling code instead of LLMs for planning has potential to be more precise, reliable, interpretable, and extremely efficient. However, writing appropriate Code World Models requires the ability to understand complex instructions, to generate exact code with non-trivial logic and to self-debug a long program with feedback from unit tests and environment trajectories. To address these challenges, we propose Generate, Improve and Fix with Monte Carlo Tree Search (GIF-MCTS), a new code generation strategy for LLMs. To test our approach in an offline RL setting, we introduce the Code World Models Benchmark (CWMB), a suite of program synthesis and planning tasks comprised of 18 diverse RL environments paired with corresponding textual descriptions and curated trajectories. GIF-MCTS surpasses all baselines on the CWMB and two other benchmarks, and we show that the Code World Models synthesized with it can be successfully used for planning, resulting in model-based RL agents with greatly improved sample efficiency and inference speed.
title Generating Code World Models with Large Language Models Guided by Monte Carlo Tree Search
topic Artificial Intelligence
url https://arxiv.org/abs/2405.15383