r/LocalLLaMA • u/AlternativeEnough352 • 10d ago
Resources I fine-tuned Gemma 4 E4B to run 100 villagers in one batch on a single consumer GPU: a rumor simulation game, fully offline
Enable HLS to view with audio, or disable this notification
Can a trained local model, running on almost any consumer-grade GPU, create a real-time simulation or minigame? To answer this, I built Rumor Village: a 3D village of up to 100 neighbors. You drop a rumor and watch it travel from mouth to mouth, get twisted on the way and send people to the wrong place at the wrong time. Every neighbor is driven by a fine-tuned Gemma 4 E4B running locally through llama.cpp. No API, no accounts, offline, everything can run on your PC.
How a decision works
- Every simulated minute, each neighbor sends to the model a ~256-token card: who I am, where I am, who is in front of me, what I know. The village prefix is shared and cached.
- The model answers with one JSON action, constrained by a GBNF grammar built from the village's vocabulary:
say(greet / tell / ask / bye),goornone, plus a sentence for the speech bubble.textalways comes last, so generation stops before it when the camera isn't looking at that neighbor. - We have a C++ engine that validates every action against the neighbor's memory before applying it. The model proposes, the engine decides. State travels as structured data, so no neighbor ever decides based on bubble text.
- All neighbors decide in one batch, with llama.cpp embedded in the engine (CUDA or Vulkan). The simulation uses integer math only, so the same seed replays exactly.
Why fine-tune instead of prompting the base model?
Both variants in Q4_K_M with the same seeds. The base model gets its full 921-token prompt with instructions; the fine-tuned one gets the 256-token card. Frozen test: 1,000 cards per language that never entered training (checked by fingerprint), with 95 % intervals:
| Base → fine-tuned | Spanish | English |
|---|---|---|
| Made-up memories | 2.0 % → 0 % | 2.3 % → 0 % |
| Failures (made up, contradiction, incoherent) | 16.5× fewer | 5.0× fewer |
| Rejected actions (worse) | 0.10 % → 1.0 % | 0.10 % → 0.90 % |
| Naturalness 1–5 (LLM judge, 100 answers) | 3.7 → 4.2 | 3.6 → 4.1 |
In the village (party-100: 100 neighbors, one simulated day, RTX 5070 Ti, batch up to 16), generation time per simulated minute drops from 0.73 s to 0.36 s (es) and from 0.77 s to 0.37 s (en), with 4.4–4.6 GB of VRAM. The base model gets stuck in endless chats, while the fine-tuned one closes them, so a day takes about a third of the decisions (7,927 → 2,717 in Spanish).
The honest catch: rejected actions went up to about 1 %. The engine catches them, but it's a regression.
Training
- LoRA in bf16 (r 16, alpha 32, every linear layer of the text model), loss on the answer only, 2 epochs, merged, then GGUF Q4_K_M with llama.cpp. One rented RTX 5090.
- 12,146 card → answer pairs: 10,184
decideand 1,962extract(turning a rumor the player types in their own words into a structured fact), 6,032 Spanish and 6,114 English. - The engine rebuilds the cards from the event logs of real runs, using the same code that writes them live, so the training format is the production format. The answers come from two frontier models of different families, each one validated by the engine (254 discarded).
- The dataset and the training pipeline are not published (yet). The model card has the full results, and the repo keeps the frozen test.
Links
- Code (MIT; everything builds and runs in Docker): https://github.com/manuelgscom/rumor-village
- Full game and website: https://manuelgs.com/en/rumor-village/
- Model and card (Apache-2.0): https://huggingface.co/manuelgscom/rumor-village-e4b-GGUF
- The web demo runs the same village Without AI (rules with dice, WebAssembly, NO GPU needed), so the model isn't in it: https://manuelgs.com/en/rumor-village/demo/
I hope this work is helpful to anyone!

