30 億パラメータモデル上でマルチエージェント経済を稼働:Thousand Token Wood の実装
本文の状態
日本語全文を表示中
詳細モードで約7分の本文を読めます。
同じ出来事の情報源
この情報源を基点に整理
Hugging Face Blog
Hugging Face は、30 億パラメータの軽量モデルを用いて複数のエージェントが経済活動を行うシステム「Thousand Token Wood」の実装と配送を発表した。
Source Article
元記事を日本語で読む
本文に関係しない購読案内、埋め込み通知、サイト内プロモーションは除いています。
*30 億パラメータの取引者評議会が何ができ、何ができないかについての「Build Small Hackathon」フィールドレポート。
まずはお試しください:Space と、オープンな エージェント・トレース。
私は Build Small Hackathon のためにThousand Token Woodを構築しました。これは小さな経済です:5 匹の森の生き物がそれぞれ独立したエージェントとなり、Qwen2.5-3B上で 5 つの商品を小石と取引し、噂話をし、財を蓄積し、パニックを起こします。木々を刺激すると、バブルや暴落、そして拡大する格差が自然に現れる様子を観察できます。このモデルは Modal 上の vLLM で提供され、Gradio アプリがその森への窓となっています。
これは小規模なモデルで構築する人々のために書かれたエンジニアリングに関するフィールドレポートです。要約すると:30 億パラメータのモデルは信頼できるフォーマット生成器ですが、推論においては信頼性が低く、創発的なシステムには設計された希少性が必要であり、最も優れたデモは技術的制約とあなたがすでに深く理解している何かが交差する場所に存在します。
なぜ「小ささ」が制限ではなくデザインなのか
生きた経済では、1 回の実行中に多数のエージェントが何度も思考する必要があります。まさにそこが最先端モデルが不適切なツールとなる理由です:取引者評議会を毎ティック(時間単位)で実行するには遅すぎ、コストが高すぎます。リアルタイムのマルチエージェント・シミュレーションを可能にするのは小規模なモデルなのです。各生き物は、ターンごとに単一のバッチ処理された GPU 呼び出し内で意思決定を行います。
最初の経済は到着した瞬間に死んでいた
素朴なバージョンは何も機能しませんでした。生産が消費を上回ったため、すべての生物は自給自足となり、取引する理由がありませんでした。市場は一度だけ清算され、その後沈黙しました。解決策は希少性を設計することでした:
- 食事の多様性:生物は1回の食事で単一の食品を1単位しか食べられないため、生存するには自分が生産していない食品を購入する必要があります。
- 腐敗:保存食は放置すると腐るため、余剰分は価値があるうちに売却しなければなりません。
- 冬の燃料危機:すべての生物はターンごとに薪を燃やす必要があり、その需要は時間とともに増加しますが、薪を作るのはたった1体の生物だけです。
最後のメカニズムがドラマを生み出します。1人の供給者では増大する需要を満たせないため、樵夫が富を得て、他のすべての生物が暖かさを求めて競い合います。
有効なJSONだが、判断力は弱い
希少性が導入されたことで、小規模モデルの正直な教訓が浮き彫りになりました。3B モデルは呼び出しの100% で有効な JSON を出力しましたが、その経済的判断は劣っていました。例えば、ドングリを生産する生物が、自身が余らせているドングリを購入するという注文を投稿してしまうのです。
解決策はより大きなモデルではなく、より鋭いプロンプトでした。各エージェントに対して、自分が生産したものと決して購入してはいけないものを伝え、不足している物資のリストを正確に計算し、1 つの実例を示しました。意思決定の質が向上し、生物たちはそれぞれの役割に応じて取引を行うようになりました。全体のループは、許容性の高い JSON パースおよび修復レイヤーで囲まれており、不正な応答が発生してもシミュレーションがクラッシュするのではなく、何もしない操作(no-op)として処理されます。
2 つ目の教訓はウェルビーイングから得られました。当初、私はこれを蓄積器としてモデル化しましたが、慢性的な不足があると、すべての生物がランを通じてゼロにまで落ち込み、見るにも耐えられない死の螺旋となり、エージェントの不完美な最適化を罰することになりました。そこで、これは生物が餌を与えられ暖かい状態になれば回復し、決してゼロに達しない平均回帰的な気分として再定義しました。リスクは飢餓ではなく、小石や価格、ステータスの中に存在すべきです。
物語が語り始めた
私が最も満足している機能は、このプロジェクトを市場の歴史と結びつけるものです。プレイヤーは「ウッド・レジェンド(森の伝説)」を引き当てることができます。これは有名なエピソードを森の民話として再着せしたものです。チューリップ狂気は「大ドングリ狂気」に、南海泡沫事件は「空洞丸取引会社」に、1929 年の銀行取り付け騒ぎは「オーナ貯蔵庫への取り付け」に変換されます。
これらは単なる装飾テキストではありません。各伝説は実際のショックを引き起こし、エージェントが反応します。あるランで私は「オーナ貯蔵庫への取り付け」、つまりフクロウの金庫が空であるという噂を描きました。オーナは小石を調達するために蜂蜜を売却し始め、供給の洪水によって蜂蜜の価格は次のターンにかけて 10 から 3 に暴落しました。再着せされた銀行取り付け騒ぎにより、エージェントは資産を投げ売りし、市場価格を変動させました。これらすべてが事前にスクリプト化されていたわけではありません。
それが可視化されるためには、価格の変動が必要でした。エージェントたちは私が見せた基準価格を引用し返したために価格は凍結されていました。解決策は、各ラウンド後の残余の需給に応じて市場参照価格が変動するようにすることです:大量の未消化買い注文は価格を上押しし、過剰供給はそれを下押しします。現在、価格不足時には価格がトレンドを示し、均衡した取引時には落ち着きを保っています。
実際に何が起こったか
干ばつと冬の噂を途中から組み込んだ代表的な 15 ラウンドの実行結果:
Metric
Result
Valid JSON actions
100% (75 of 75 calls)
Trades per turn
sustained 3 to 9, never silent
Honey price
crashed 10 to 3 during the bank-run legend
Firewood price
rose 4 to 7 as winter scarcity bit
Wealth gap (Gini)
widened 0.14 to 0.38
Outcome
the woodcutter ended richest, the hoarder broke
これらの動きのすべてに関する推論は、オープンな traces dataset にあります:各行には、各生物の完全なプロンプト、生レスポンス、解析されたアクション、そして思考が記録されています。
小型モデルでの構築に向けた教訓
エンジニアリングの大部分は、規模ではなく構造とプロンプトによって、小型モデルの信頼できるフォーマットと不確かな推論との間のギャップを埋めることにあります。創発的なシステムには設計された希少性が必要であり、豊かさは退屈です。そして、最も魅力的な小型モデルのデモに必要なのは、でっち上げられたドラマではありません。3 世紀にわたる市場史がそれをすでに用意しており、3B のエージェントによる評議会だけで十分にその様子を再現できました。
小さなモデル、大きな冒険。Space でお試しください。
元々は Medium に掲載されました。
原文を表示
*A Build Small Hackathon field report on what a 3-billion-parameter council of traders can and cannot do.*
Try it first: the Space, and the open agent traces.
I built Thousand Token Wood for the Build Small Hackathon. It is a tiny economy: five woodland creatures, each its own agent on Qwen2.5-3B, trade five goods for pebbles, gossip, hoard, and panic. You poke the wood and watch bubbles, crashes, and a widening wealth gap appear on their own. The model is served with vLLM on Modal; a Gradio app is the window onto the wood.
This is a field report on the engineering, written for people who build with small models. The short version: a 3B model is a reliable format generator and an unreliable reasoner, emergent systems need designed scarcity, and the best demos sit where a technical constraint meets something you already understand deeply.
Why small is the design, not the limit
A living economy needs many agents thinking many times per run. That is exactly where a frontier model is the wrong tool: too slow and too costly to run a council of traders every tick. A small model is what makes a real-time multi-agent simulation feasible. Every creature decides in a single batched GPU call per turn.
The first economy was dead on arrival
The naive version did nothing. Production outran consumption, so every creature was self-sufficient and never had a reason to trade. The market cleared once and went silent. The fix was to engineer scarcity:
- Diet variety: a creature can eat only one unit of any single food per meal, so surviving means buying foods it does not grow.
- Spoilage: perishable food rots if hoarded, forcing surplus to be sold while it still has value.
- A winter fuel crisis: every creature must burn firewood each turn, the need rises over time, and only one creature makes firewood.
That last mechanic drives the drama. One supplier cannot meet rising demand, so the woodcutter gets rich and everyone else competes for warmth.
Valid JSON, weak judgment
With scarcity in place, the honest small-model lesson surfaced. The 3B emitted valid JSON on 100% of calls, but its economic judgment was poor: a creature that produced acorns would post an order to buy acorns, the one thing it had in surplus.
The fix was not a bigger model, it was a sharper prompt. I told each agent what it produced and must never buy, computed the exact list of goods it was short on, and gave it one worked example. Decision quality jumped and the creatures began trading to their roles. The whole loop is wrapped in a tolerant JSON parse-and-repair layer, so a malformed response degrades to a no-op instead of crashing the simulation.
A second lesson came from wellbeing. I first modeled it as an accumulator, and any chronic shortfall ground every creature to zero over a run, a death spiral that was no fun to watch and that punished the agents' imperfect optimization. I reframed it as a mean-reverting mood that recovers when a creature is fed and warm and never hits zero. Stakes belong in pebbles, prices, and status, not starvation.
Then it started telling stories
The feature I am most pleased with ties the project to market history. The player can draw a Wood Legend: a famous episode reskinned as woodland folklore. Tulip Mania becomes the Great Acorn Mania. The South Sea Bubble becomes the Hollow Log Trading Company. The 1929 bank runs become the Run on Oona's Hoard.
These are not flavor text. Each legend fires real shocks, and the agents react. In one run I drew the Run on Oona's Hoard, the rumor that the owl's vault was empty. Oona began liquidating her honey to raise pebbles, and the flood of supply crashed the honey price from 10 to 3 over the next turns. A reskinned bank run made an agent dump assets and moved a market price. None of it was scripted.
For that to be visible, prices had to move. They were frozen because the agents quoted back the reference price I showed them. The fix was to let the market reference drift with residual supply and demand after each round: heavy unfilled buying pushes a price up, a glut pushes it down. Prices now trend during scarcity and stay calm in balanced trade.
What actually happened
A representative fifteen-turn run, with a drought and a winter rumor injected partway:
| Metric | Result |
|---|---|
| Valid JSON actions | 100% (75 of 75 calls) |
| Trades per turn | sustained 3 to 9, never silent |
| Honey price | crashed 10 to 3 during the bank-run legend |
| Firewood price | rose 4 to 7 as winter scarcity bit |
| Wealth gap (Gini) | widened 0.14 to 0.38 |
| Outcome | the woodcutter ended richest, the hoarder broke |
The reasoning behind every one of those moves is in the open traces dataset: each row is a creature's full prompt, raw response, parsed actions, and private thought.
Takeaways for building with small models
Most of the engineering is closing the gap between a small model's reliable formatting and its unreliable reasoning, with structure and prompting rather than scale. Emergent systems need designed scarcity; abundance is boring. And the most compelling small-model demos do not need invented drama. Three centuries of market history had it ready, and a council of 3B agents was enough to play it out.
Small models, big adventures. Try the Space.
*Originally published on Medium.*
今日のまとめ
AIデイリーブリーフで今日の重要ニュースをまとめ読み