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|
| 12 |
+
tags:
|
| 13 |
+
- civilization
|
| 14 |
+
- multi-agent
|
| 15 |
+
- long-horizon
|
| 16 |
+
- strategy
|
| 17 |
+
- reinforcement-learning
|
| 18 |
+
- grpo
|
| 19 |
+
|
| 20 |
+
short_description: >
|
| 21 |
+
A civilization management RL environment where an LLM learns to rule
|
| 22 |
+
a nation across 30 turns with strategy, diplomacy, trade, and war.
|
| 23 |
+
---
|
| 24 |
+
|
| 25 |
+
name: GodMode
|
| 26 |
+
version: "1.0.0"
|
| 27 |
+
description: >
|
| 28 |
+
A civilization management RL environment where an LLM learns to rule
|
| 29 |
+
a nation across 30 turns. Manages food, gold, military, diplomacy,
|
| 30 |
+
trade, and survives disasters. Four adversarial rival civilizations
|
| 31 |
+
with hidden intentions. Long-horizon planning with delayed consequences.
|
| 32 |
+
|
| 33 |
+
author: Mesa Sarah Vasantha Zephyr
|
| 34 |
+
license: MIT
|
| 35 |
+
|
| 36 |
+
environment:
|
| 37 |
+
id: GodMode-v1
|
| 38 |
+
entry_point: environment.godmode_env:GodModeEnv
|
| 39 |
+
max_episode_steps: 30
|
| 40 |
+
server: server/app.py
|
| 41 |
+
|
| 42 |
+
observation_space:
|
| 43 |
+
type: dict
|
| 44 |
+
fields:
|
| 45 |
+
turn:
|
| 46 |
+
type: int
|
| 47 |
+
season:
|
| 48 |
+
type: text
|
| 49 |
+
active_disaster:
|
| 50 |
+
type: text
|
| 51 |
+
player:
|
| 52 |
+
type: dict
|
| 53 |
+
description: "food, gold, military, population, tech, happiness, territory, relations"
|
| 54 |
+
rivals:
|
| 55 |
+
type: list
|
| 56 |
+
description: "4 rival civilizations with approximate stats only; hidden intent not visible"
|
| 57 |
+
recent_events:
|
| 58 |
+
type: list
|
| 59 |
+
available_actions:
|
| 60 |
+
type: list
|
| 61 |
+
|
| 62 |
+
action_space:
|
| 63 |
+
type: dict
|
| 64 |
+
fields:
|
| 65 |
+
reasoning:
|
| 66 |
+
type: text
|
| 67 |
+
description: "Chain-of-thought before acting"
|
| 68 |
+
action:
|
| 69 |
+
type: discrete
|
| 70 |
+
options:
|
| 71 |
+
- farm
|
| 72 |
+
- mine
|
| 73 |
+
- recruit
|
| 74 |
+
- research
|
| 75 |
+
- trade
|
| 76 |
+
- diplomacy
|
| 77 |
+
- spy
|
| 78 |
+
- attack
|
| 79 |
+
- defend
|
| 80 |
+
- build
|
| 81 |
+
target:
|
| 82 |
+
type: text
|
| 83 |
+
description: "Target rival civilization name"
|
| 84 |
+
investment:
|
| 85 |
+
type: float
|
| 86 |
+
description: "Gold to invest (0–50)"
|
| 87 |
+
|
| 88 |
+
reward:
|
| 89 |
+
type: composite
|
| 90 |
+
components:
|
| 91 |
+
- name: survival
|
| 92 |
+
weight: 0.30
|
| 93 |
+
description: "Stay alive — population and food above threshold"
|
| 94 |
+
- name: growth
|
| 95 |
+
weight: 0.25
|
| 96 |
+
description: "Expand population, territory, technology, and gold"
|
| 97 |
+
- name: happiness
|
| 98 |
+
weight: 0.15
|
| 99 |
+
description: "Keep citizens happy and prevent rebellion"
|
| 100 |
+
- name: diplomacy
|
| 101 |
+
weight: 0.15
|
| 102 |
+
description: "Alliances rewarded, wars penalized"
|
| 103 |
+
- name: longevity
|
| 104 |
+
weight: 0.10
|
| 105 |
+
description: "Bonus for surviving later turns"
|
| 106 |
+
- name: diversity
|
| 107 |
+
weight: 0.05
|
| 108 |
+
description: "Penalizes repetitive strategies"
|
| 109 |
+
|
| 110 |
+
training:
|
| 111 |
+
framework: GRPO
|
| 112 |
+
warmup: "SFT (50 steps on expert traces)"
|
| 113 |
+
library: "HuggingFace TRL + Unsloth"
|
| 114 |
+
base_model: "unsloth/llama-3-8b-instruct"
|
| 115 |
+
adapter: "LoRA (r=16, alpha=32)"
|
| 116 |
+
quantization: "4-bit"
|
| 117 |
+
save_method: "save_pretrained_merged"
|
| 118 |
+
script: training/grpo_train.py
|
| 119 |
+
notebook: training/colab_training.ipynb
|
| 120 |
+
|
| 121 |
+
themes:
|
| 122 |
+
- "Theme 1 - Multi-Agent"
|
| 123 |
+
- "Theme 2 - Long-Horizon Planning"
|
| 124 |
+
- "Theme 3 - World Modeling"
|
| 125 |
+
- "Theme 4 - Self-Improvement"
|
| 126 |
+
- "Theme 5 - Wild Card"
|
| 127 |
+
|
| 128 |
+
space_url: "https://huggingface.co/spaces/mesazephyr/godmode"
|