# Voyager: An Open-Ended Embodied Agent with Large Language Models

Guanzhi Wang, Yuqi Xie, Yunfan Jiang, Ajay Mandlekar, Chaowei Xiao, Yuke Zhu and 2 more · arXiv · 2023-5-25

- **Problem** Open-ended Minecraft requires skills that accumulate over long time spans, which LLM agents that plan from fixed prompts do not retain.
- **Method** VOYAGER pairs an automatic curriculum with a code skill library and an iterative prompting loop that uses environment feedback, execution errors and self-verification, with GPT-4 used as a black box.
- **Results** Discovered 63 unique items within 160 prompting iterations, 3.3× more novel items than the baselines, and unlocked the diamond tool tier in one of three trials.

## Why open-ended Minecraft tests lifelong learning

Minecraft has no predefined end goal or fixed storyline. The player explores procedurally generated 3D terrain and uses gathered resources to unlock a tech tree. Players usually begin with simple tasks such as collecting wood and cooking food, and only later move on to combat and crafting diamond tools, so progress is staged by the player's own choices.

Reinforcement learning and imitation learning act on primitive actions, which makes systematic exploration, interpretability and generalization difficult. LLM-based agents draw on the world knowledge stored in pre-trained models to produce coherent plans or executable policies, but they do not progressively acquire, update and transfer knowledge over long spans of time.

The authors list three behaviours that a lifelong agent should show: proposing tasks that fit its current skill level and surroundings, refining skills from feedback and storing mastered skills for reuse in similar situations, and exploring on its own to find new goals. Each behaviour corresponds to a component that the method later implements.

## Three components and the code action space

VOYAGER combines an automatic curriculum, a skill library and an iterative prompting mechanism, and it queries GPT-4 through prompts and in-context learning. Because GPT-4 is accessed as a black box, the method needs no access to model parameters and no gradient-based training or finetuning.

Actions are expressed as code rather than low-level motor commands, because programs can represent temporally extended and compositional behaviour, which many long-horizon Minecraft tasks require. The control layer is Mineflayer's JavaScript API, so the generated code calls high-level functions instead of issuing keyboard and mouse inputs.

In one loop, the curriculum proposes a task, the skill library is queried, GPT-4 writes a program, the program runs in Minecraft, a critic decides whether the task is complete, and a verified program is added to the library. Each task receives at most 4 rounds of code generation before the agent moves on to another task.

## How the next task is chosen

Tasks are produced in a bottom-up order, so each new objective depends on what the agent has already done and where it is.

It also lists previously completed and failed tasks, which indicate the current frontier of what the agent can do.

The directives ask for one concise task phrase per step, such as a mining, crafting, smelting or killing task, and forbid building, placing, planting and trading tasks. The directives also tell the model not to pick tasks that are too hard for the resources the agent holds.

GPT-3.5 asks and answers its own questions about the agent's state to add context, and a wiki knowledge base can supply documents for those answers. The authors use GPT-3.5 for these routine language steps because of budget, and they note that the wiki is optional since GPT-3.5 already knows much of the game.

A warm-up schedule adds information gradually: nearby entities appear after 5 completed tasks, the full inventory after 7, and biome and recently seen blocks after 10, while health, hunger, time and extra context appear after 15. The curriculum samples at temperature 0.1 to encourage diverse tasks, while other calls use temperature 0.

Figure 3 shows examples of the tasks the curriculum proposes from a partial prompt.

## Storing and retrieving skills as code

Each skill is an executable function that wraps temporally extended actions for one curriculum task, and the prompt asks GPT-4 to keep these functions generic so later programs can reuse them. The authors motivate this with the generality, interpretability and universality of programs.

After a program is verified, the skill is stored in a vector database: GPT-3.5 embeds a description of the program as the key, and the program itself is the value. Storing the description rather than the task name means that retrieval can match a new task to a skill that is described in similar terms.

To retrieve skills, GPT-3.5 first writes a general suggestion for the new task, and this suggestion is combined with environment feedback to form the query. The query returns the top-5 relevant skills, which are then placed in the GPT-4 prompt for code generation. Figure 4 shows both the adding step and the retrieval step of the skill library.

Complex skills are built by composing simpler programs, which the authors argue compounds the agent's abilities over time and reduces catastrophic forgetting seen in other continual learning methods. The stated benefit is a hypothesis of the authors' design. The excerpt presents it as the expected effect of composition, and the tech tree ablation below is the measured evidence for the library.

## Feedback, errors and self-verification in the loop

The loop uses three kinds of feedback: environment feedback produced by bot.chat() inside the control primitives, execution errors from the interpreter, and a self-verification verdict. Environment feedback reports intermediate progress, for example that an iron chestplate needs 7 more iron ingots, and execution errors point out invalid operations or syntax faults.

Self-verification uses another GPT-4 agent as a critic that receives the current state and the task, and returns a success verdict together with a critique when the task was not achieved. The authors contrast this with self-reflection, since the critic both checks success and reflects on the mistake.

Figure 6 gives examples where the critic judges a spyglass task and a sheep-killing task as failed and proposes what to collect or kill next. A verdict of success adds the program to the skill library and records the task as completed, while a failed verdict records the task as failed.

The loop repeats generation and execution until verification passes, and if the agent is stuck after 4 rounds of code generation, the curriculum supplies another task. The authors say this lets the agent keep acquiring diverse skills without human intervention.

## Models, baselines and evaluation setup

The experiments use gpt-4-0314 and gpt-3.5-turbo-0301 for text completion and text-embedding-ada-002 for embeddings. The simulator is built on MineDojo, and the agent's motor controls come from Mineflayer JavaScript APIs.

ReAct generates reasoning traces and action plans with chain-of-thought prompting, and it is given environment feedback and agent state. Reflexion is built on ReAct with self-reflection and is given execution errors and the self-verification module. In the adapted runs, each of ReAct and Reflexion receives one round of code generation followed by three rounds of refinement, repeated until the iteration limit.

AutoGPT is reimplemented with GPT-4 performing task decomposition, and it receives agent state, feedback and errors, but it has no skill library, self-verification or automatic curriculum. All baselines share the task of exploring the world and getting as many items as possible.

The authors do not compare with methods that take screen pixels and output low-level controls, because those methods do not use the same high-level API. The authors note that VOYAGER is orthogonal to gradient-based methods, which could be combined with it when the controller provides a code API.

## Exploration and tech tree progress

Within 160 prompting iterations, VOYAGER discovered 63 unique items, which the authors report as 3.3× more novel items than its counterparts. AutoGPT discovers new items much more slowly, and ReAct and Reflexion make little progress on the open-ended exploration goal. Figure 1 plots the discovery curves against prompting iterations.

The tech tree runs from wooden tools to stone, iron and diamond tools, so each tier depends on the tools below it. VOYAGER reached the wooden tier in 6±2 prompting iterations with 3 of 3 successful trials, while AutoGPT needed 92±72 with 3 of 3. The authors report that VOYAGER unlocks the wooden tier 15.3× faster than the baselines in prompting iterations.

For the stone tier, VOYAGER needed 11±2 iterations and AutoGPT needed 94±72, and the authors report this as 8.5× faster.

VOYAGER is the only evaluated method to unlock the diamond tier, which it did in one of three trials at a mean of 102 prompting iterations. ReAct and Reflexion did not unlock any tier, and AutoGPT did not unlock the diamond tier. The diamond result therefore rests on a single successful trial.

Map coverage was measured separately, and VOYAGER traversed distances 2.3× longer than the baselines while crossing varied terrain. Figure 7 shows bird's eye views of the maps that the agents covered.

## Reusing skills in unseen tasks

The evaluation places the agent in a new Minecraft world and gives it novel tasks, with a maximum of 50 prompting iterations and three attempts per method. The agent carries the skill library learned earlier and must solve each task from scratch.

On the diamond pickaxe task, VOYAGER needed 19±3 prompting iterations and succeeded in 3 of 3 trials. VOYAGER without the skill library needed 36 iterations and succeeded in 2 of 3 trials, and AutoGPT with the skill library needed 39 iterations and succeeded in 1 of 3.

On the golden sword task, VOYAGER needed 18±7 iterations, while on the lava bucket and compass tasks it needed 21±5 and 18±2 iterations, each with 3 of 3 successful trials. ReAct, Reflexion and the plain AutoGPT did not succeed on any of the four tasks.

Figure 8 visualizes intermediate progress on two of the four tasks, and ReAct and Reflexion are omitted because they made no meaningful progress. The comparison with AutoGPT with the skill library is the only evaluated transfer of the library to another baseline, so it isolates the library's contribution only partly.

## What the skill library contributes in the tech tree

The ablations cover the manual curriculum, a random curriculum over 101 items, the skill library, environment feedback, execution errors, self-verification, and GPT-3.5 in place of GPT-4 for code generation. Each variant removes one design choice while keeping the rest of VOYAGER in place.

Without the skill library, the iron tier needed 29±11 prompting iterations, compared with 21±7 for full VOYAGER. The wooden and stone tiers were reached in 7±2 and 9±4 iterations without the library, compared with 6±2 and 11±2 for full VOYAGER.

The effect of removing the library is therefore concentrated in the iron tier, and the early tiers show no consistent gap in the same direction. The excerpt gives numeric results only for this skill library ablation. The other ablation variants are described in the appendix, and their numbers are not reported in the text used here.

## Limitations

The GPT-4 API is 15× more expensive than GPT-3.5, and the authors say the code quality they need from GPT-4 is not matched by GPT-3.5 or by open-source LLMs. The cost comparison is stated without a per-run figure in this excerpt.

The agent can get stuck and fail to produce the correct skill, and the curriculum may return to the task later. The self-verification module can also fail, for example by not recognizing spider string as a sign that a spider was beaten.

The curriculum sometimes asks for items that do not exist, such as a copper sword or copper chestplate. During code generation, GPT-4 sometimes uses cobblestone as fuel, which is not a valid fuel in the game, and sometimes calls functions that are not in the control primitive APIs.

The authors expect that improvements in GPT API models and finetuning of open-source LLMs will address these limitations. That expectation is the authors' view and was not tested in the experiments reported here.

## Positioning against related LLM agents

Prior LLM planners for robots, such as Code as Policies and ProgPrompt, generate executable policies, and text agents such as ReAct, Reflexion and AutoGPT generate reasoning and subgoals. The authors note that these works lack a skill library for building increasingly complex behaviours.

Execution-guided program synthesis and verifier-based methods also use execution results, for example through majority voting or a learned verifier. VOYAGER differs by combining environment feedback, execution errors and self-verification into one iterative prompting mechanism for embodied control.

## Paper info

- **Authors**: Guanzhi Wang, Yuqi Xie, Yunfan Jiang, Ajay Mandlekar, Chaowei Xiao, Yuke Zhu, Linxi Fan, Anima Anandkumar
- **Venue**: arXiv · Preprint
- **First published**: 2023-5-25
- **Added**: 2026-10-20
- **Updated**: 2023-10-19
- **Version**: v2
- **arXiv**: 2305.16291
- **Category**: cs.AI · cs.LG
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/2305.16291v2) · [PDF ↗](https://arxiv.org/pdf/2305.16291v2)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Guanzhi Wang, Yuqi Xie, Yunfan Jiang, Ajay Mandlekar, Chaowei Xiao, Yuke Zhu, Linxi Fan, Anima Anandkumar (2023). Voyager: An Open-Ended Embodied Agent with Large Language Models. arXiv:2305.16291v2. https://arxiv.org/abs/2305.16291v2

**BibTeX**

```
@misc{wang2023voyager,
  title = {{Voyager: An Open-Ended Embodied Agent with Large Language Models}},
  author = {Guanzhi Wang and Yuqi Xie and Yunfan Jiang and Ajay Mandlekar and Chaowei Xiao and Yuke Zhu and Linxi Fan and Anima Anandkumar},
  year = {2023},
  eprint = {2305.16291},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2305.16291v2}
}
```

## Other paper commentary

- [Finetuned Language Models Are Zero-Shot Learners](https://refivu.com/en/papers/3dedf278-64d7-4653-93ff-bf4504ae70ac-finetuned-language-models-are-zero-shot-learners.md)
- [Scaling Instruction-Finetuned Language Models](https://refivu.com/en/papers/6f9b141d-190c-4397-9e41-4f796f4ef56e-scaling-instruction-finetuned-language-models.md)
- [LLM.int8(): 8-bit Matrix Multiplication for Transformers at Scale](https://refivu.com/en/papers/263598fd-8186-4bb8-858a-0eba8ecdb369-llm-int8-8-bit-matrix-multiplication-for-transformers.md)
- [Efficient Memory Management for Large Language Model Serving with PagedAttention](https://refivu.com/en/papers/a69a26aa-a470-4bff-9c73-2a7fe8ffd528-efficient-memory-management-for-large-language-model-serving.md)
- [Retentive Network: A Successor to Transformer for Large Language Models](https://refivu.com/en/papers/ca4ee5c6-87cf-427b-ae91-b593c10e0b48-retentive-network-a-successor-to-transformer-for-large.md)
- [OLMo: Accelerating the Science of Language Models](https://refivu.com/en/papers/674dc7cc-bbc8-47b3-a55b-69c562d96047-olmo-accelerating-the-science-of-language-models.md)
- [Image-to-Image Translation with Conditional Adversarial Networks](https://refivu.com/en/papers/92d09be2-7a1b-4f53-9d24-569d7cc94149-image-to-image-translation-with-conditional-adversarial.md)
- [HexaShell: A Thin Harness for Exploring the Limits of VLM Agents as Robot Coding Agents](https://refivu.com/en/papers/987b0722-81e4-41f3-8104-a1d8a65def66-hexashell-a-thin-harness-for-exploring-the-limits.md)
- [Prefix-Tuning: Optimizing Continuous Prompts for Generation](https://refivu.com/en/papers/01cf041e-b71c-444b-8b44-e94ac976a9db-prefix-tuning-optimizing-continuous-prompts-for-generation.md)
- [WebGPT: Browser-assisted question-answering with human feedback](https://refivu.com/en/papers/b41258c0-ce1e-478c-ad2b-6bccd936ae34-webgpt-browser-assisted-question-answering-with-human.md)
- [Reflexion: Language Agents with Verbal Reinforcement Learning](https://refivu.com/en/papers/a572f458-b121-4d38-bfc9-7a77309a3aba-reflexion-language-agents-with-verbal-reinforcement-learning.md)
- [SparseGPT: Massive Language Models Can Be Accurately Pruned in One-Shot](https://refivu.com/en/papers/98e70bdf-a832-4686-b3f8-e3eefd5887c4-sparsegpt-massive-language-models-can-be-accurately-pruned.md)

## Terms in this paper

- [GPT-4](https://refivu.com/en/terms/1e2d0d2cdc44-gpt-4)
- [ReAct](https://refivu.com/en/terms/420780a0fd8c-react)
- [GPT-3.5](https://refivu.com/en/terms/30414fb33dba-gpt-3-5)
- [Reflexion](https://refivu.com/en/terms/ae549dc1c40e-reflexion)
- [AutoGPT](https://refivu.com/en/terms/84b91e52d879-autogpt)
- [Minecraft](https://refivu.com/en/terms/a17fe6d4b27c-minecraft)
- [Self-verification](https://refivu.com/en/terms/beaa0d12cee7-self-verification)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/39fe0a31-1bf8-4ca2-bc7b-151ae7a6faa4-voyager-an-open-ended-embodied-agent-with-large)
