Cortex Quake BC release checkpoint + model card
Browse files- README.md +63 -0
- cortex_quake_bc.pt +3 -0
README.md
CHANGED
|
@@ -1,3 +1,66 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
+
library_name: pytorch
|
| 4 |
+
pipeline_tag: reinforcement-learning
|
| 5 |
+
tags:
|
| 6 |
+
- behavior-cloning
|
| 7 |
+
- imitation-learning
|
| 8 |
+
- game-playing
|
| 9 |
+
- quake
|
| 10 |
+
- dinov3
|
| 11 |
+
datasets:
|
| 12 |
+
- elefantai/p2p-full-data
|
| 13 |
+
base_model: facebook/dinov3-vits16plus-pretrain-lvd1689m
|
| 14 |
---
|
| 15 |
+
|
| 16 |
+
# Cortex — compact behavioral-cloning Quake policy
|
| 17 |
+
|
| 18 |
+
Cortex is a compact behavioral-cloning game policy: **10.98M trainable parameters** over frozen [DINOv3 ViT-S+/16](https://huggingface.co/facebook/dinov3-vits16plus-pretrain-lvd1689m) features (39.7M parameters executed per decision including the frozen encoder). Trained with pure behavior cloning on the ~475-hour Quake subset of the public [Pixels2Play corpus](https://huggingface.co/datasets/elefantai/p2p-full-data) on a single consumer GPU (RTX 5080, 16 GB), it reaches deeper engine-verified route progress on Quake E1M1 than the released P2P-150M and NitroGen (~500M) generalist gaming agents evaluated under the same protocol.
|
| 19 |
+
|
| 20 |
+
Model code and action schema: **[github.com/kvark/cortex-actor](https://github.com/kvark/cortex-actor)**.
|
| 21 |
+
|
| 22 |
+
## Architecture
|
| 23 |
+
|
| 24 |
+
Per 100 ms decision: each 640×400 frame is encoded by frozen DINOv3 into a CLS token plus an ordered 5×8 spatial sample of the 25×40 patch grid (41 tokens × 384-d). The last 4 frames (300 ms) pass through a 6-layer, 384-d, 6-head bidirectional transformer encoder; the last frame's CLS position feeds two heads: 36 independent held-state logits (33 keys + 3 mouse buttons, absolute state, temperature-1 sampled at deploy) and tanh-squashed continuous mouse dx/dy. There is no previous-action input, pose, map, text, auxiliary loss, or game-specific rule.
|
| 25 |
+
|
| 26 |
+
## Files
|
| 27 |
+
|
| 28 |
+
- `cortex_quake_bc.pt` — release checkpoint (fp32, 43.9 MB): model weights, architecture arguments, and the embedded action schema (active keys, held-state channel layout, training-alignment constants). The frozen DINOv3 encoder is **not** included; download it separately from Meta under its own license.
|
| 29 |
+
|
| 30 |
+
## Usage
|
| 31 |
+
|
| 32 |
+
```bash
|
| 33 |
+
pip install git+https://github.com/kvark/cortex-actor
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
```python
|
| 37 |
+
import torch
|
| 38 |
+
from huggingface_hub import hf_hub_download
|
| 39 |
+
from cortex_actor import cortex_from_args
|
| 40 |
+
|
| 41 |
+
path = hf_hub_download("mad-bot/cortex", "cortex_quake_bc.pt")
|
| 42 |
+
ck = torch.load(path, map_location="cpu", weights_only=False)
|
| 43 |
+
model = cortex_from_args(ck["args_dict"])
|
| 44 |
+
model.load_state_dict(ck["model"])
|
| 45 |
+
model.eval()
|
| 46 |
+
|
| 47 |
+
# Per step: cls (B, T, 384) and patches (B, T, 5, 8, 384) from frozen
|
| 48 |
+
# DINOv3 ViT-S+/16 at 640x400, T = 4 most recent frames at 10 Hz.
|
| 49 |
+
out = model(cls, patches=patches)
|
| 50 |
+
out["held_logits"] # (B, 36) — sample at temperature 1
|
| 51 |
+
out["mouse_dx"], out["mouse_dy"] # tanh outputs; scale by 500 / 250 mickeys
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
The action-channel contract (key roster order, held-state layout, mouse scales) is defined in [`cortex_actor/schema.py`](https://github.com/kvark/cortex-actor/blob/main/cortex_actor/schema.py) and is part of the architecture: the index of a key in `KEYS` is its channel in the logits tensor.
|
| 55 |
+
|
| 56 |
+
## Results
|
| 57 |
+
|
| 58 |
+
On Quake E1M1 under an engine-verified evaluation protocol (completion counted only on the engine's level-transition event; N=20 stochastic episodes across 5 seeds, independently replicated), Cortex passes the opening door–button–gate sequence 20/20 and reaches route waypoint median 5–6 (max 9) with 28–32 kills per batch. The released P2P-150M and NitroGen baselines, run in the same environment with their official inference code and published settings at matched duration, stall at route waypoint median 1. Results generalize across additional maps and shared mid-map start states. No system, including ours, completes the level. Full numbers, controls, and negative results are in the paper (link forthcoming).
|
| 59 |
+
|
| 60 |
+
## Authors
|
| 61 |
+
|
| 62 |
+
Dzmitry Malyshau, Claude, Codex.
|
| 63 |
+
|
| 64 |
+
## License
|
| 65 |
+
|
| 66 |
+
MIT for the model weights and code. The DINOv3 encoder is distributed by Meta under its own license; the Pixels2Play corpus belongs to Elefant AI.
|
cortex_quake_bc.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:29c0e453fdfe7255bc6d8e64a0024fe9b617ed79917f5cd71b41f1173f1aa14b
|
| 3 |
+
size 43934541
|