大模型
dev.to ·
@Lucian (LKB)
真正的游戏 AI 而非聊天机器人:这些对手为何不用 LLM
作者解释其游戏对手采用经典博弈树搜索(minimax、expectimax、广度优先搜索)而非大语言模型,理由是确定性、可证明正确性和亚帧级延迟。其井字棋引擎约 0.3ms 返回可证明最优解,1200 局测试 0 负,且无需网络调用;作者认为这些特性是 LLM 结构上无法提供的。
AI推荐理由 作者以自研井字棋引擎为例,说明为何游戏对手用经典博弈树搜索(minimax、expectimax、BFS)而非 LLM,并给出可复现数据:约 0.3ms 返回可证明最优解、1200 局测试 0 负、无网络调用。观点清晰、有具体数字,但属个人项目经验分享,非行业级证据,且测试规模有限。
62
正文
Syndicated from the original on lkforge.com. The engines are playable in your browser at lkforge.com/games; the harness that produced these numbers is public and seeded.
Every "AI" in a product now seems to mean a large language model. The AI that plays against you on my site doesn't — it's classical game-tree search: minimax, expectimax, breadth-first search. That's a deliberate engineering choice, and it's the difference between an opponent that's provably correct and instant and one that's plausible and slow.
The core point
My tic-tac-toe engine returns a provably-optimal move in about 0.3 ms, on your device, with zero network calls — and it has lost 0 of 1,200 test games. Those are properties a language model, by construction, cannot offer: determinism, a correctness proof, and sub-frame latency without a server.
"Why not just use an LLM?"
Fair question in 2026 — you could prompt a model with the board and ask for a move. The reason I don't: a language model is trained to predict the next token of text, not to search a game tree. It can explain tic-tac-toe strategy fluently and still play a losing move, because fluent text and optimal play are different objectives. Winning a solved game is a search problem, and we already have exact, fast algorithms for it.
The three engines — minimax + alpha-beta for tic-tac-toe, expectimax for 2048, and BFS for Color Lines — are textbook, deterministic, and run in well under a millisecond in a browser tab.
Search vs. a language model, point by point
Game-tree search (mine)
A language model
Decides a move by
searching the tree of legal positions
predicting likely next tokens
Correctness
provable at full depth
none — fluent ≠ optimal
Same board →
same move (deterministic)
varies with sampling/phrasing
Latency
sub-millisecond, on-device
a network round-trip
Needs a server
no
yes
Every row is an architectural difference — how each system decides — not a quoted benchmark. The only measured numbers here are mine.
The payoff: a strength number you can actually pin down
Because the engines are deterministic, I can put an exact figure on how strong they are — run the shipped code headlessly, hundreds of times, and count. That's far harder for a model whose output shifts with sampling and phrasing.
2048 solver, 250 self-play games: 69.6% of games reach the 2048 tile, 30% reach 4096, and none of the 250 reached 8192 — the honest ceiling of a corner-snake expectimax search at ~0.5 ms/move. A number, with error bars you could compute, precisely because the same board always drives the same search.
Tic-tac-toe is the cleaner case: full-depth minimax is provably optimal, so "unbeatable" is a theorem, not a vibe. Across 1,200 self-play games (1,000 vs random, 200 vs a perfect copy) it lost none. Alpha-beta keeps full depth cheap: 36,528 nodes instead of 549,945 at the opening move — a 93% cut — in about 0.3 ms.
The right tool, not the trendy one
None of this is anti-LLM. Language models are extraordinary at language — and a couple of the tools on my site that are genuinely language tasks could use one. But a board game with fixed rules and a finite tree is exactly the problem classical search was invented for.
Full write-up with charts: *lkforge.com/blog/game-ai-not-llms*. Related: Six Games, Three Classic Algorithms · Minimax & Alpha-Beta, Visualized · and the companion experiment, We Asked ChatGPT and Grok to Benchmark Our Game AI.