Karpathy:Opus 5 用 100 万 token、5500 行代码程序化渲染《指环王》
Karpathy 分享了一个实验:Opus 5 用约 10 美元的 100 万 token 预算和约两小时,写出 5500 行代码,把《指环王》第一段程序化渲染出来;他也指出,LLM 仍缺少高效感知视频和实际玩游戏的能力。
中文译文
Andrej Karpathy 在 X 上写道,他们正在逐渐离开那种用「让 LLM 生成一只骑自行车的鹈鹕 SVG」来测试模型的阶段。作为把这个方向推广开来的一种想法,他很好奇:如果把《指环王》的第一段文字、100 万 token 的预算(约 10 美元)交给 Opus 5,再让它用 three.js 把这段内容渲染出来,它会做出什么?1
Opus 花了大约 2 个小时,写了 5500 行代码,以程序化的方式把这个故事渲染出来。成品有点粗糙,但挺有趣。更让人难以置信的是,LLM 得把各种多边形资产放置并编排在
(x,y,z) 坐标中,再写代码让这一切动起来;而且它居然真的能产出某种东西。他喜欢这类例子,还有一个原因:正常情况下,没人会花时间去写这么定制化的东西;但 LLM 有的是耐力和耐心,所以这展示了一种变化——从「没人会做这个」变成「行啊,为什么不呢,反正几乎免费」。
这样的例子可能还有很多。Karpathy 期待做出高度定制的世界:你可以想象把玩家直接放进去,比如在这里作为一个旁观者 NPC 参与《指环王》的故事,或者扮演其中一个角色,等等。就像按需生成一个转瞬即逝的 X 版 GTA。
最后一个想法是,世界和游戏这个领域暴露了 LLM 的一个弱点:它们很难审查自己的作品,因为还无法高效、原生地感知视频,也无法在自己生成的游戏里玩起来。这里,Opus 5 只能非常缓慢、费力地在不同时间点截取屏幕截图;它还搞砸了几次,弄出了一堆粗糙的东西。就 Karpathy 看来,这是一个例子,说明 LLM 在基础能力——多模态感知和游戏操作——上仍然明显欠缺。
英文原文
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 three js render of it. Opus went off for ~2 hours and wrote 5500 lines of code that (procedurally) rendered the story. It's kind of janky but fun. But it's a bit mindboggling that the LLM has to place and orchestrate various polygon assets in (x,y,z) coordinates and write code that animates it all, and that it even does anything at all.I also like this kind of examples because no one in their right mind would ever spend the time to write something this custom but LLMs have all the stamina and patience in the world, so it's an example where we go from "no one would ever do this" to "sure, why not, it's ~free". There might be a lot more. But I'm excited about creating hyper custom worlds that you can imagine dropping players into, e.g. here to participate in the LoTR story as a spectator NPC, or one of the characters, or etc. Something like an ephemeral GTA of X on demand.Last thought is that the domain of worlds/games exposes a weakness in LLMs: they can't easily audit their work because they aren't able to efficiently and natively perceive videos or play games within them. Here, Opus 5 had to very slowly and painstakingly take screenshots at different points, and it messed up a few times and created a bunch of jank. An example of raw capability (multimodal, gameplay) that I think is still quite lacking.
原帖发布于北京时间 2026 年 8 月 2 日 11:00。1
Karpathy 的原帖:
Loading content card…
References
Related content
- Sign in to comment.