Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
tags:
|
| 4 |
+
- counter-strike
|
| 5 |
+
- world-model
|
| 6 |
+
- v-jepa2
|
| 7 |
+
- video
|
| 8 |
+
library_name: pytorch
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# CS2 Match-Level Hierarchical World Model (scale300)
|
| 12 |
+
|
| 13 |
+
A causal, action-conditioned latent world model over frozen V-JEPA2 embeddings of
|
| 14 |
+
**single-POV Counter-Strike 2 gameplay**. Sequences span a player's whole match
|
| 15 |
+
(rounds concatenated, round-number embedding per token), so the belief state can
|
| 16 |
+
carry cross-round context. Trained on 300 matches of
|
| 17 |
+
[RekaAI/CS2-10k](https://huggingface.co/datasets/RekaAI/CS2-10k)
|
| 18 |
+
(mirage + dust2), 6.94M one-second windows at 0.5s stride.
|
| 19 |
+
|
| 20 |
+
Screen-only contract: the encoder sees POV pixels with no HUD, radar, or parsed
|
| 21 |
+
game state. Positions and actions are used as training targets and for
|
| 22 |
+
evaluation, never as inference inputs.
|
| 23 |
+
|
| 24 |
+
## Files
|
| 25 |
+
|
| 26 |
+
| file | what it is |
|
| 27 |
+
|---|---|
|
| 28 |
+
| `hwm_ckpt_scale300.pt` | the world model (12.25M params) + latent norm stats + action norm |
|
| 29 |
+
| `demo_heads.pt` | readout heads on the same latents: position, position@+8s, behaviour cloning (9 keys), 30s zone intent, zone-transition prior |
|
| 30 |
+
| `reports/*.json` | every number below, as produced by the scripts |
|
| 31 |
+
|
| 32 |
+
## Results (match-disjoint holdout, 450 sequences)
|
| 33 |
+
|
| 34 |
+
Latent MSE against the true future latent, versus a persistence ("nothing
|
| 35 |
+
changes") baseline:
|
| 36 |
+
|
| 37 |
+
| horizon | model | persistence |
|
| 38 |
+
|---|---|---|
|
| 39 |
+
| 0.5 s | 0.279 | 0.417 |
|
| 40 |
+
| 1 s | 0.436 | 0.765 |
|
| 41 |
+
| 2 s | 0.617 | 1.091 |
|
| 42 |
+
| 4 s | 0.765 | 1.369 |
|
| 43 |
+
| 8 s | 0.882 | 1.608 |
|
| 44 |
+
| 30 s | 0.976 | 1.893 |
|
| 45 |
+
|
| 46 |
+
## The limitation that matters most
|
| 47 |
+
|
| 48 |
+
Shuffling the action input and re-measuring gives the share of the model's
|
| 49 |
+
headroom over persistence that actually comes from knowing the action:
|
| 50 |
+
|
| 51 |
+
| horizon | 0.5 s | 1 s | 2 s | 4 s | 8 s | 30 s |
|
| 52 |
+
|---|---|---|---|---|---|---|
|
| 53 |
+
| action share of headroom | **24.4%** | 11.6% | 6.6% | 3.1% | 1.2% | **β0.0%** |
|
| 54 |
+
|
| 55 |
+
At 30 s the model is **provably action-blind**, and its MSE of 0.976 on
|
| 56 |
+
~unit-variance latents means it is close to a mean predictor there. It beats
|
| 57 |
+
persistence at 30 s only because persistence is a poor baseline at that range.
|
| 58 |
+
|
| 59 |
+
Structurally: `forward(z, a, rnd)` is causally masked, so token *t* sees actions
|
| 60 |
+
only up to *t* and each horizon head predicts z*t+h* directly β **there is no
|
| 61 |
+
slot for a candidate future action sequence**. Counterfactual "what if I do X"
|
| 62 |
+
requires autoregressive rollout through the h=1 head and is only meaningful for
|
| 63 |
+
~0.5β2 s. Macro intent must come from the destination/intent heads, not rollouts.
|
| 64 |
+
|
| 65 |
+
Reproduce with `scripts/hwm/hwm_action_sensitivity.py`.
|
| 66 |
+
|
| 67 |
+
## 30 s intent probe
|
| 68 |
+
|
| 69 |
+
| features | top-1 | top-3 | moved top-1 |
|
| 70 |
+
|---|---|---|---|
|
| 71 |
+
| latent | 0.420 | 0.781 | 0.269 |
|
| 72 |
+
| HWM context | 0.413 | 0.776 | 0.303 |
|
| 73 |
+
| latent + context | 0.407 | 0.771 | 0.299 |
|
| 74 |
+
| *persistence baseline* | *0.371* | β | β |
|
| 75 |
+
| *zone-transition prior (moved subset)* | β | β | *0.318* |
|
| 76 |
+
|
| 77 |
+
Latent top-1 clears the persistence baseline. On the **moved** subset (63% of
|
| 78 |
+
cases, where the player actually changes zone β the ones that matter for
|
| 79 |
+
next-action) all three feature sets still **lose to a trivial zone-transition
|
| 80 |
+
prior**. `beats_transition_prior` is false everywhere. Scaling 100 β 300 matches
|
| 81 |
+
narrowed that gap but did not close it, and improved the dynamics model only
|
| 82 |
+
~2%, so scaling in this range is sublinear.
|
| 83 |
+
|
| 84 |
+
## Demo: verified on holdout video
|
| 85 |
+
|
| 86 |
+
`scripts/hwm/demo_pov_video.py` replays a holdout match as real video through
|
| 87 |
+
the frozen encoder and this checkpoint, with the action input supplied by the BC
|
| 88 |
+
head reading the same pixels. Ground truth is overlaid only to check.
|
| 89 |
+
|
| 90 |
+
| metric | result | baseline |
|
| 91 |
+
|---|---|---|
|
| 92 |
+
| self-localization (median) | 1.99 m | β |
|
| 93 |
+
| 8 s position forecast | 6.03 m | 9.68 m stand-still |
|
| 94 |
+
| 30 s intent top-3 | 60.3% | 55.8% zone-transition prior |
|
| 95 |
+
| 2 s counterfactual, true action closest | 46.2% | 16.7% chance |
|
| 96 |
+
|
| 97 |
+
Caveats, in the interest of not overstating: the 8 s figure shown is a **direct**
|
| 98 |
+
forecast head β decoding the HWM's own h=16 latent scores slightly worse (6.53 m),
|
| 99 |
+
so the world model is not what drives that panel. The counterfactual is scored in
|
| 100 |
+
**latent space**; scored on map positions it falls to 18.6%, i.e. chance, because
|
| 101 |
+
the position head's ~99 u error swamps the 238 u candidate spread. It is an
|
| 102 |
+
aggregate claim, not a per-frame one. The position head is unconstrained and
|
| 103 |
+
emits off-map coordinates on ~1% of frames.
|
| 104 |
+
|
| 105 |
+
## Intended use
|
| 106 |
+
|
| 107 |
+
Research on latent world models and intent prediction from egocentric video.
|
| 108 |
+
Not a cheat, not an aim assist: it consumes recorded POV video offline and
|
| 109 |
+
predicts where a player will be, at metre-to-zone granularity.
|
| 110 |
+
|
| 111 |
+
## Provenance
|
| 112 |
+
|
| 113 |
+
Derived from RekaAI/CS2-10k; that dataset's terms apply upstream. Encoder is
|
| 114 |
+
`facebook/vjepa2-vitl-fpc64-256`, frozen. Match split is deterministic
|
| 115 |
+
(md5 of `match_id`), so the holdout is reproducible. The checkpoint itself is
|
| 116 |
+
**not** bit-reproducible: training seeds the RNGs but GPU nondeterminism means a
|
| 117 |
+
re-run yields a statistically equivalent, not identical, model.
|
| 118 |
+
|
| 119 |
+
Code: https://github.com/cristibctr/HWM-CS2
|