Image-Text-to-Text
Transformers
Safetensors
English
gamescaling
game-agent
embodied-agent
keyboard-mouse
continued-pretraining
qwen3_5
Instructions to use THUSI-Lab/GameScaling with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use THUSI-Lab/GameScaling with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="THUSI-Lab/GameScaling")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("THUSI-Lab/GameScaling", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use THUSI-Lab/GameScaling with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "THUSI-Lab/GameScaling" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "THUSI-Lab/GameScaling", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/THUSI-Lab/GameScaling
- SGLang
How to use THUSI-Lab/GameScaling with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "THUSI-Lab/GameScaling" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "THUSI-Lab/GameScaling", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "THUSI-Lab/GameScaling" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "THUSI-Lab/GameScaling", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use THUSI-Lab/GameScaling with Docker Model Runner:
docker model run hf.co/THUSI-Lab/GameScaling
Model card: plain title, compact authors, file tree, deployment and evaluation focus
Browse files
README.md
CHANGED
|
@@ -21,26 +21,16 @@ tags:
|
|
| 21 |
|
| 22 |
<div align="center">
|
| 23 |
|
| 24 |
-
|
| 25 |
|
| 26 |
-
<
|
| 27 |
-
|
| 28 |
-
<p align="center" style="font-size:1.08em;line-height:1.8;">
|
| 29 |
-
<b>Kuan Zhang</b><sup>1,2,*,β‘</sup> <b>Yukun Chen</b><sup>1,3,*,β‘</sup> <b>Zhihao Yang</b><sup>1,3,*,β‘</sup> Yue Su<sup>4</sup><br>
|
| 30 |
-
Xiangnan Wu<sup>3</sup> Zirong Chen<sup>2</sup> Run Luo<sup>1,5,β‘</sup> Jinkun Hou<sup>6</sup><br>
|
| 31 |
-
Tao Tan<sup>1</sup> <b>Yinhe Zheng</b><sup>1,β </sup> <b>Yiming Li</b><sup>2,β </sup>
|
| 32 |
-
</p>
|
| 33 |
-
|
| 34 |
-
<p align="center" style="font-size:0.9em;line-height:1.75;white-space:nowrap;">
|
| 35 |
-
<sup>1</sup>miHoYo Honkai AI R&D Team Β· <sup>2</sup>College AI, Tsinghua University<br>
|
| 36 |
-
<sup>3</sup>University of Chinese Academy of Sciences Β· <sup>4</sup>MMLab, The University of Hong Kong<br>
|
| 37 |
-
<sup>5</sup>National University of Singapore Β· <sup>6</sup>Peking University
|
| 38 |
</p>
|
| 39 |
|
| 40 |
-
<p align="center" style="font-size:0.
|
| 41 |
-
<sup>
|
|
|
|
| 42 |
</p>
|
| 43 |
-
|
| 44 |
<p align="center">
|
| 45 |
<img src="https://huggingface.co/THUSI-Lab/GameScaling/resolve/main/assets/logos/affiliations.png" alt="miHoYo Β· Tsinghua University Β· University of Chinese Academy of Sciences Β· The University of Hong Kong" width="100%" style="width:100%;max-width:100%;">
|
| 46 |
</p>
|
|
@@ -60,99 +50,75 @@ Tao Tan<sup>1</sup> <b>Yinhe Zheng</b><sup>1,β </sup> <b>Yiming L
|
|
| 60 |
<img src="https://huggingface.co/THUSI-Lab/GameScaling/resolve/main/assets/teaser.jpg" alt="From one physical world to diverse virtual worlds" width="100%">
|
| 61 |
</p>
|
| 62 |
|
| 63 |
-
<p align="center"><i>Embodied learning in the physical world benefits from shared physics, visuals and controls. Virtual worlds break that assumption: every game brings its own. Does scaling still carry over?</i></p>
|
| 64 |
-
|
| 65 |
## Overview
|
| 66 |
|
| 67 |
-
GameScaling models are Qwen3.5 vision-language models with continued pre-training
|
| 68 |
-
keyboard-and-mouse gameplay. Each call
|
| 69 |
-
frames and actions) and
|
| 70 |
-
33 ms each, plus one mouse movement and scroll for the whole chunk. The model
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
moves from worlds in the training corpus (MCU / Minecraft, ViZDoom) to unseen related 3D worlds
|
| 77 |
-
(OmniGameArena) and unseen distant, mostly 2D worlds (GameWorld).
|
| 78 |
-
|
| 79 |
-
This repository releases eight checkpoints (four model sizes Γ two mixtures, all at 1,600 h), the
|
| 80 |
-
inference client, and the standard system-prompt template.
|
| 81 |
-
|
| 82 |
-
**Key findings**
|
| 83 |
-
|
| 84 |
-
- **Data, diversity and size help different worlds.** More data improves play in worlds from the
|
| 85 |
-
training corpus. Diversity improves transfer to related unseen worlds, with limited gains in
|
| 86 |
-
distant ones.
|
| 87 |
-
- **Small and fast wins in real time.** GameScaling takes 0.13β0.69 s per step, versus 4β24 s for
|
| 88 |
-
frontier models, and scores highest when the world does not pause.
|
| 89 |
-
- **More steps help, but only after pre-training.** Raising the MCU step cap from 600 to 3,000
|
| 90 |
-
lifts GameScaling-9B-S1 from 50.9% to 69.3%; the untrained Qwen3.5-9B stays at 4.0%.
|
| 91 |
-
|
| 92 |
-
## Results
|
| 93 |
-
|
| 94 |
-
Average time-paused score (%) of the released 1,600 h checkpoints, as reported on the
|
| 95 |
-
[project page](https://gamescaling.github.io).
|
| 96 |
-
|
| 97 |
-
| Size | Model | MCU | ViZDoom | OmniGameArena | GameWorld |
|
| 98 |
-
|---|---|:---:|:---:|:---:|:---:|
|
| 99 |
-
| 0.8B | Qwen3.5 (no CPT) | 0.0 | 0.9 | 1.7 | 13.8 |
|
| 100 |
-
| | GameScaling-S1 | **44.0** | 5.4 | 7.1 | 14.4 |
|
| 101 |
-
| | GameScaling-S3 | 36.0 | **11.9** | **10.2** | **20.3** |
|
| 102 |
-
| 2B | Qwen3.5 (no CPT) | 0.0 | 0.9 | 1.8 | **19.8** |
|
| 103 |
-
| | GameScaling-S1 | **49.3** | 10.7 | 5.9 | 15.1 |
|
| 104 |
-
| | GameScaling-S3 | 48.0 | **11.2** | **13.9** | 19.5 |
|
| 105 |
-
| 9B | Qwen3.5 (no CPT) | 3.3 | 2.8 | 5.2 | **29.2** |
|
| 106 |
-
| | GameScaling-S1 | **54.7** | 8.1 | 6.0 | 17.0 |
|
| 107 |
-
| | GameScaling-S3 | 44.7 | **15.9** | **27.3** | 26.2 |
|
| 108 |
-
| 27B | Qwen3.5 (no CPT) | 9.3 | 5.6 | 9.7 | **29.3** |
|
| 109 |
-
| | GameScaling-S1 | **63.3** | 5.3 | 7.9 | 12.5 |
|
| 110 |
-
| | GameScaling-S3 | 54.0 | **14.7** | **25.7** | 25.3 |
|
| 111 |
-
|
| 112 |
-
S1 is the specialist: it is best on Minecraft (MCU). S3 trades some Minecraft score for clear
|
| 113 |
-
gains in unseen 3D worlds (OmniGameArena). Neither closes the gap in distant 2D worlds (GameWorld),
|
| 114 |
-
which suggests that CPT alone is not enough for a generalist agent. Base and S3 numbers come from
|
| 115 |
-
the paper's tables; S1 numbers are read from the 1,600 h column of the paper's Figure 4.
|
| 116 |
|
| 117 |
## Checkpoints
|
| 118 |
|
| 119 |
-
| Model | Folder |
|
| 120 |
-
|---|---|---|
|
| 121 |
-
| GameScaling-0.8B-S1 | `models/0p8b_s1_1600h_gs6736` |
|
| 122 |
-
| GameScaling-0.8B-S3 | `models/0p8b_s3_1600h_gs6760` |
|
| 123 |
-
| GameScaling-2B-S1 | `models/2b_s1_1600h_gs6736` |
|
| 124 |
-
| GameScaling-2B-S3 | `models/2b_s3_1600h_gs6760` |
|
| 125 |
-
| GameScaling-9B-S1 | `models/9b_s1_1600h_gs6736` |
|
| 126 |
-
| GameScaling-9B-S3 | `models/9b_s3_1600h_gs6760` |
|
| 127 |
-
| GameScaling-27B-S1 | `models/27b_s1_1600h_gs6995` |
|
| 128 |
-
| GameScaling-27B-S3 | `models/27b_s3_1600h_gs7020` |
|
| 129 |
-
|
| 130 |
-
- **S1**: trained on Minecraft gameplay only.
|
| 131 |
-
- **S3**: a balanced mixture. Minecraft is cut to 27%, and the rest comes from other games in an
|
| 132 |
-
80-game, mostly 3D corpus.
|
| 133 |
-
- Folder names: `<size>_<mixture>_<hours of gameplay>_gs<training steps>`.
|
| 134 |
-
- All weights are bfloat16. Every folder has its own `chat_template.jinja`; keep it (see below).
|
| 135 |
-
|
| 136 |
-
In the paper, more data helps most in worlds that are in the training corpus. More diversity (S3)
|
| 137 |
-
helps most in unseen 3D worlds whose actions resemble training. See the
|
| 138 |
-
[project page](https://gamescaling.github.io) for the full results.
|
| 139 |
-
|
| 140 |
-
## Repository layout
|
| 141 |
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 156 |
```
|
| 157 |
|
| 158 |
## 1. Download and serve
|
|
@@ -163,6 +129,7 @@ Download only the checkpoint you need:
|
|
| 163 |
pip install -U huggingface_hub
|
| 164 |
huggingface-cli download THUSI-Lab/GameScaling \
|
| 165 |
--include "models/9b_s1_1600h_gs6736/*" "gamescaling/*" "prompts/*" "scripts/*" \
|
|
|
|
| 166 |
--local-dir ./GameScaling
|
| 167 |
cd GameScaling
|
| 168 |
```
|
|
@@ -175,10 +142,28 @@ bash scripts/serve_vllm.sh models/9b_s1_1600h_gs6736 8000 # 0.8B-9B fit o
|
|
| 175 |
bash scripts/serve_vllm.sh models/27b_s1_1600h_gs6995 8000 2 # 27B: tensor parallel 2
|
| 176 |
```
|
| 177 |
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 182 |
|
| 183 |
## 2. System prompt template
|
| 184 |
|
|
@@ -334,14 +319,16 @@ Training key vocabulary (74 tokens, case-sensitive, `gamescaling.action.KEY_VOCA
|
|
| 334 |
Tokens outside the vocabulary are dropped and recorded in `Action.dropped`.
|
| 335 |
`keymaps.TO_PLAYWRIGHT` maps them to browser key names.
|
| 336 |
|
| 337 |
-
## 6.
|
| 338 |
|
| 339 |
-
The paper evaluates on MCU (Minecraft), ViZDoom, OmniGameArena and GameWorld.
|
| 340 |
-
|
| 341 |
-
executes. The project page also reports a real-time setting, where the game keeps running during
|
| 342 |
-
inference. Scores from different clocks are not comparable.
|
| 343 |
|
| 344 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 345 |
|
| 346 |
| Preset | Frame | `<think>` prefill | Other |
|
| 347 |
|---|---|---|---|
|
|
@@ -349,13 +336,25 @@ Client presets for reproducing the paper:
|
|
| 349 |
| `vizdoom` | resized to 854Γ480, JPEG | yes | no stop string; 4 maps Γ 10 episodes, at most 350 chunks each |
|
| 350 |
| `gameworld` | height 480, PNG (Lanczos) | no | `max_tokens=4096`, lenient parsing; use `build_gameworld_system_prompt(..., reasoning=False)` |
|
| 351 |
|
| 352 |
-
All presets keep 5 history turns (frame + action) at temperature 1.0.
|
| 353 |
-
|
| 354 |
-
|
| 355 |
-
|
| 356 |
-
|
| 357 |
-
|
| 358 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 359 |
|
| 360 |
## 7. Adding a new game
|
| 361 |
|
|
|
|
| 21 |
|
| 22 |
<div align="center">
|
| 23 |
|
| 24 |
+
# Scaling in Games: Continued Pre-Training for Embodied Agents in Diverse Virtual Worlds
|
| 25 |
|
| 26 |
+
<p align="center" style="line-height:1.5;margin:0.4em 0 0.3em;">
|
| 27 |
+
<b>Kuan Zhang</b><sup>1,2,*,β‘</sup>, <b>Yukun Chen</b><sup>1,3,*,β‘</sup>, <b>Zhihao Yang</b><sup>1,3,*,β‘</sup>, Yue Su<sup>4</sup>, Xiangnan Wu<sup>3</sup>, Zirong Chen<sup>2</sup>, Run Luo<sup>1,5,β‘</sup>, Jinkun Hou<sup>6</sup>, Tao Tan<sup>1</sup>, <b>Yinhe Zheng</b><sup>1,β </sup>, <b>Yiming Li</b><sup>2,β </sup>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
</p>
|
| 29 |
|
| 30 |
+
<p align="center" style="font-size:0.85em;line-height:1.45;margin:0 0 0.6em;">
|
| 31 |
+
<sup>1</sup>miHoYo Honkai AI R&D Team <sup>2</sup>College AI, Tsinghua University <sup>3</sup>University of Chinese Academy of Sciences <sup>4</sup>MMLab, The University of Hong Kong <sup>5</sup>National University of Singapore <sup>6</sup>Peking University<br>
|
| 32 |
+
<sup>*</sup>Equal contribution <sup>β </sup>Corresponding author <sup>β‘</sup>Work done while interning at miHoYo
|
| 33 |
</p>
|
|
|
|
| 34 |
<p align="center">
|
| 35 |
<img src="https://huggingface.co/THUSI-Lab/GameScaling/resolve/main/assets/logos/affiliations.png" alt="miHoYo Β· Tsinghua University Β· University of Chinese Academy of Sciences Β· The University of Hong Kong" width="100%" style="width:100%;max-width:100%;">
|
| 36 |
</p>
|
|
|
|
| 50 |
<img src="https://huggingface.co/THUSI-Lab/GameScaling/resolve/main/assets/teaser.jpg" alt="From one physical world to diverse virtual worlds" width="100%">
|
| 51 |
</p>
|
| 52 |
|
|
|
|
|
|
|
| 53 |
## Overview
|
| 54 |
|
| 55 |
+
GameScaling models are Qwen3.5 vision-language models with continued pre-training on
|
| 56 |
+
keyboard-and-mouse gameplay. Each call takes the current game frame (plus a short history of past
|
| 57 |
+
frames and actions) and returns the next **200 ms of keyboard and mouse actions**: 6 steps of
|
| 58 |
+
33 ms each, plus one mouse movement and scroll for the whole chunk. The model may think before it
|
| 59 |
+
acts.
|
| 60 |
+
|
| 61 |
+
This repository contains eight checkpoints, the inference client, and the standard system-prompt
|
| 62 |
+
template. It is everything needed to serve a checkpoint and run it in a game; it contains no
|
| 63 |
+
training code. Paper results and analysis are on the [project page](https://gamescaling.github.io).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
|
| 65 |
## Checkpoints
|
| 66 |
|
| 67 |
+
| Model | Folder | Weights | GPUs (bf16) |
|
| 68 |
+
|---|---|---:|:---:|
|
| 69 |
+
| GameScaling-0.8B-S1 | `models/0p8b_s1_1600h_gs6736` | 2.2 GB | 1 |
|
| 70 |
+
| GameScaling-0.8B-S3 | `models/0p8b_s3_1600h_gs6760` | 2.2 GB | 1 |
|
| 71 |
+
| GameScaling-2B-S1 | `models/2b_s1_1600h_gs6736` | 5.4 GB | 1 |
|
| 72 |
+
| GameScaling-2B-S3 | `models/2b_s3_1600h_gs6760` | 5.4 GB | 1 |
|
| 73 |
+
| GameScaling-9B-S1 | `models/9b_s1_1600h_gs6736` | 18.8 GB | 1 |
|
| 74 |
+
| GameScaling-9B-S3 | `models/9b_s3_1600h_gs6760` | 18.8 GB | 1 |
|
| 75 |
+
| GameScaling-27B-S1 | `models/27b_s1_1600h_gs6995` | 54.7 GB | 2 (tensor parallel) |
|
| 76 |
+
| GameScaling-27B-S3 | `models/27b_s3_1600h_gs7020` | 54.7 GB | 2 (tensor parallel) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
|
| 78 |
+
- **S1** is trained on Minecraft gameplay only. **S3** is a balanced mixture: 27% Minecraft, the
|
| 79 |
+
rest from other games. All checkpoints use 1,600 h of gameplay.
|
| 80 |
+
- Folder names are `<size>_<mixture>_<hours>h_gs<training steps>`. Weights are bfloat16, from the
|
| 81 |
+
Qwen3.5-0.8B / 2B / 9B / 27B backbones.
|
| 82 |
+
|
| 83 |
+
## File tree
|
| 84 |
+
|
| 85 |
+
```text
|
| 86 |
+
THUSI-Lab/GameScaling
|
| 87 |
+
βββ models/
|
| 88 |
+
β βββ 0p8b_s1_1600h_gs6736/ one folder per checkpoint (eight in total)
|
| 89 |
+
β β βββ config.json Qwen3_5ForConditionalGeneration, bfloat16
|
| 90 |
+
β β βββ model.safetensors weights (27B: model-0000{1,2}-of-00002 + index.json)
|
| 91 |
+
β β βββ chat_template.jinja REQUIRED: renders history turns exactly as in training
|
| 92 |
+
β β βββ tokenizer.json
|
| 93 |
+
β β βββ tokenizer_config.json
|
| 94 |
+
β β βββ generation_config.json
|
| 95 |
+
β β βββ preprocessor_config.json image processor
|
| 96 |
+
β β βββ processor_config.json
|
| 97 |
+
β β βββ video_preprocessor_config.json
|
| 98 |
+
β βββ 0p8b_s3_1600h_gs6760/
|
| 99 |
+
β βββ 2b_s1_1600h_gs6736/
|
| 100 |
+
β βββ 2b_s3_1600h_gs6760/
|
| 101 |
+
β βββ 9b_s1_1600h_gs6736/
|
| 102 |
+
β βββ 9b_s3_1600h_gs6760/
|
| 103 |
+
β βββ 27b_s1_1600h_gs6995/
|
| 104 |
+
β βββ 27b_s3_1600h_gs7020/
|
| 105 |
+
βββ prompts/
|
| 106 |
+
β βββ system_prompt_template.txt standard system prompt with 3 placeholders (Β§2)
|
| 107 |
+
β βββ example_doom_battle1.txt a filled-in example
|
| 108 |
+
βββ gamescaling/ inference client (requests + Pillow only)
|
| 109 |
+
β βββ __init__.py
|
| 110 |
+
β βββ prompt.py build_system_prompt / build_gameworld_system_prompt
|
| 111 |
+
β βββ policy.py GameScalingPolicy, PolicyConfig, presets, request body
|
| 112 |
+
β βββ action.py action format, parser, 74-token key vocabulary
|
| 113 |
+
β βββ keymaps.py training key names <-> browser / Playwright keys
|
| 114 |
+
βββ scripts/
|
| 115 |
+
β βββ serve_vllm.sh start an OpenAI-compatible vLLM server
|
| 116 |
+
βββ tests/
|
| 117 |
+
β βββ test_core.py offline tests: prompts, requests, parsing (no GPU)
|
| 118 |
+
βββ assets/ images used in this card
|
| 119 |
+
βββ requirements.txt client dependencies
|
| 120 |
+
βββ LICENSE Apache License 2.0
|
| 121 |
+
βββ README.md
|
| 122 |
```
|
| 123 |
|
| 124 |
## 1. Download and serve
|
|
|
|
| 129 |
pip install -U huggingface_hub
|
| 130 |
huggingface-cli download THUSI-Lab/GameScaling \
|
| 131 |
--include "models/9b_s1_1600h_gs6736/*" "gamescaling/*" "prompts/*" "scripts/*" \
|
| 132 |
+
"tests/*" "requirements.txt" \
|
| 133 |
--local-dir ./GameScaling
|
| 134 |
cd GameScaling
|
| 135 |
```
|
|
|
|
| 142 |
bash scripts/serve_vllm.sh models/27b_s1_1600h_gs6995 8000 2 # 27B: tensor parallel 2
|
| 143 |
```
|
| 144 |
|
| 145 |
+
`serve_vllm.sh CKPT [PORT] [TP]` starts vLLM with `--served-model-name gamescaling`, bfloat16,
|
| 146 |
+
`--max-model-len 32768` (system prompt + 5 history frames + reasoning budget) and
|
| 147 |
+
`--limit-mm-per-prompt '{"image": 8}'` (5 history frames + the current one, with headroom). Set
|
| 148 |
+
`GPU_MEM_UTIL` to change the memory fraction (default 0.85).
|
| 149 |
+
|
| 150 |
+
Check that the server is up and the client can reach it:
|
| 151 |
+
|
| 152 |
+
```bash
|
| 153 |
+
curl -s http://127.0.0.1:8000/v1/models # should list "gamescaling"
|
| 154 |
+
pip install -r requirements.txt
|
| 155 |
+
python tests/test_core.py # offline checks, no server needed
|
| 156 |
+
```
|
| 157 |
+
|
| 158 |
+
Things to keep as shipped:
|
| 159 |
+
|
| 160 |
+
- **Chat template.** Use the `chat_template.jinja` in the checkpoint folder (vLLM loads it by
|
| 161 |
+
default). Do not replace it with the stock Qwen template: this one renders past turns without
|
| 162 |
+
reasoning as `<think>\n\n</think>\n\n<|action_start|>...`, token-for-token as in training.
|
| 163 |
+
- **Special tokens.** Requests must set `skip_special_tokens: false`, or the server strips the
|
| 164 |
+
`<|action_start|>` / `<|action_end|>` tags. `build_request` already does this.
|
| 165 |
+
- **One server per GPU group.** One vLLM replica can serve several games at once, but long
|
| 166 |
+
prefills (one image per history turn) make each step slower when many games share it.
|
| 167 |
|
| 168 |
## 2. System prompt template
|
| 169 |
|
|
|
|
| 319 |
Tokens outside the vocabulary are dropped and recorded in `Action.dropped`.
|
| 320 |
`keymaps.TO_PLAYWRIGHT` maps them to browser key names.
|
| 321 |
|
| 322 |
+
## 6. Evaluation
|
| 323 |
|
| 324 |
+
The paper evaluates on four benchmarks: MCU (Minecraft), ViZDoom, OmniGameArena and GameWorld.
|
| 325 |
+
To get comparable numbers, keep these settings fixed.
|
|
|
|
|
|
|
| 326 |
|
| 327 |
+
**Clock.** The standard setting is **time-paused**: the game freezes while the model thinks and
|
| 328 |
+
advances only while a chunk executes. In a real-time setting the game keeps running during
|
| 329 |
+
inference, so latency becomes part of the score. Do not compare scores across clocks.
|
| 330 |
+
|
| 331 |
+
**Client presets.** Each benchmark has a preset in `PolicyConfig.preset(...)`:
|
| 332 |
|
| 333 |
| Preset | Frame | `<think>` prefill | Other |
|
| 334 |
|---|---|---|---|
|
|
|
|
| 336 |
| `vizdoom` | resized to 854Γ480, JPEG | yes | no stop string; 4 maps Γ 10 episodes, at most 350 chunks each |
|
| 337 |
| `gameworld` | height 480, PNG (Lanczos) | no | `max_tokens=4096`, lenient parsing; use `build_gameworld_system_prompt(..., reasoning=False)` |
|
| 338 |
|
| 339 |
+
All presets keep 5 history turns (frame + action, no reasoning) at temperature 1.0. Run at least
|
| 340 |
+
3 episodes per game; single episodes vary a lot.
|
| 341 |
+
|
| 342 |
+
**Checklist before reading a score:**
|
| 343 |
+
|
| 344 |
+
- [ ] The system prompt is the template from Β§2 (or `build_system_prompt`), with
|
| 345 |
+
`reasoning=True` when the client prefills `<think>`, and `reasoning=False` for `gameworld`.
|
| 346 |
+
- [ ] The parse rate is high. `Decision.action.parsed` is `False` for unparseable replies, and
|
| 347 |
+
`Action.truncated` is `True` when `<think>` was never closed. Many of either usually means a
|
| 348 |
+
wrong template, a stripped special token, or a too-small `max_tokens`.
|
| 349 |
+
- [ ] Executed actions actually move the game. Each chunk runs in wall-clock time (6 Γ 33 ms), so
|
| 350 |
+
a slow or shared renderer makes held keys barely move, with no error message. For
|
| 351 |
+
OmniGameArena, run **one UE5 instance per GPU**.
|
| 352 |
+
- [ ] Episodes are real. In OmniGameArena, start a fresh UE5 process for every `solo_craft`
|
| 353 |
+
episode; a reused instance ends episodes 2 and 3 immediately and repeats the first score.
|
| 354 |
+
|
| 355 |
+
**Scoring.** On OmniGameArena, `solo_craft` is scored as `min(V/50, 1)` from the raw points `V`;
|
| 356 |
+
the overall score is the mean over the seven games. ViZDoom counts kills on the battle maps and
|
| 357 |
+
kills minus deaths on the defend maps.
|
| 358 |
|
| 359 |
## 7. Adding a new game
|
| 360 |
|