LLM Generates Procedural 3D World from Text

@karpathy· August 2, 2026 View original

Key takeaways

  • LLMs are capable of generating extensive and complex procedural code for 3D world creation.
  • This capability enables the creation of highly customized, on-demand virtual experiences.
  • The cost-effectiveness of LLMs allows for generating content that would be prohibitively expensive for humans.
  • A significant limitation of current LLMs is their difficulty in efficiently auditing their own visual or interactive outputs.

Who benefits

GamingSoftware DevelopmentMedia & EntertainmentVirtual Reality

Summary

An experiment used Opus 5 to generate a 5500-line 3D JavaScript rendering of the first paragraph of Lord of the Rings, demonstrating advanced code generation and asset orchestration capabilities. The experiment also revealed a current limitation: LLMs struggle with efficiently auditing their own visual output, leading to "janky" results.

The author describes an experiment pushing the boundaries of large language models beyond simple image generation. Using Opus 5, the LLM was tasked with procedurally rendering a 3D world based on the opening paragraph of "Lord of the Rings," consuming a significant token budget. Over two hours, the model produced 5500 lines of JavaScript code, orchestrating various polygon assets in 3D space to animate the story. This showcases an impressive capability for complex, custom code generation that a human would rarely undertake due to time constraints. The author envisions a future where LLMs can create "hyper custom worlds" or "ephemeral GTAs" on demand, allowing users to interact with stories as NPCs or characters. However, the experiment also exposed a key weakness: LLMs' inability to efficiently audit their visual output. Opus 5 had to slowly take screenshots to check its work, resulting in some "janky" elements, indicating a current deficiency in multimodal perception and self-correction within generated environments.

Why it matters

This demonstrates the evolving capabilities of LLMs in complex code generation and procedural content creation, opening new avenues for interactive experiences and custom software development, while also highlighting critical areas for future AI improvement.

How to implement this in your domain

  1. 1Explore using advanced LLMs for procedural content generation in game development or virtual reality projects.
  2. 2Investigate LLM capabilities for generating complex codebases that automate highly customized or niche tasks.
  3. 3Design experiments to test LLM performance in multimodal tasks, specifically focusing on visual feedback loops.
  4. 4Consider integrating human-in-the-loop auditing processes for AI-generated visual content to compensate for current LLM limitations.

Original post by @karpathy

"We're starting to leave the territory where you'd test an LLM by e.g. "create an svg of pelican on a bicycle". As one idea to generalize it, I was interested what Opus 5 would do if I gave it the first paragraph of the Lord of the Rings, a 1M token budget (~$10) and asked for thr…"

View on X

Originally posted by @karpathy on X · view source

Want to go deeper?

Turn these trends into skills with Learnijoy's hands-on AI & tech courses.

Explore courses