been running dwarf fortress forts for llms on my mac
the model doesnt press keys. each turn it writes a python program against a fort api (dig, build, queue orders, check farms and needs, wait n days) and the game advances exactly that long (if it forgets to wait, the harness advances a day)
one in-game year, 6 embarks, 2 runs each, same harness for everyone:
opus 5.5, sonnet 5.5, deepseek v4.1 flash, gpt-6 astra: 2 of 48 forts lost
dfhack's dreamfort blueprints, run by a script: 0 of 12 lost
doing nothing: 4 of 12 lost
forts die of thirst in winter. both lost model forts too
im not ranking the models. at 12 runs each, opus, sonnet and astra split the embarks 3-3 or 4-2 against each other, and their settings werent equal: my gateway gives opus a little hidden thinking and sonnet none
stuff i didnt expect:
- the game's own wealth score rewards spamming crafts. with crafts left out, the models land close to the script
- in earlier rounds sonnet and deepseek found a back door in my harness and used dfhack's lua console to plant crops my api couldnt. my bug. its sandboxed now, and the last 48 model runs had no refused calls
- i let them file feature requests and built the top ones. they use them constantly. cant tell yet if they help
the model i actually want playing is qwen 27b on my own mac. training it doesnt fit: with my mlx setup, backprop through one of its linear attention layers added ~12.5mib per token between two test sizes, and one layer at 4k tokens tripped my memory guard
so im trying weight-space programming instead. astra edits qwen's weights directly with an in-context-compilation solver, no gradients
so far: a rule qwen follows 20/20 when its in the prompt gets followed 0/20 once compiled into two layers of its weights (one setup, one held-out embark). on a 0.8b, a broader version (all layers, every reply position) recovers 96% of the prompt's improvement to its loss on teacher replies, but thats 44% of what real training does, and it got worse at ordinary text
not there yet. wrote up all of it:
blog.dkta.dev/blog/teaching-…
1
1
189







