Do Geometry-Aware Positional Encodings Help Transformers in Spatial Imperfect-Information Games?
Organizations: Research Institute of Economics and Management Southwestern University of Finance and Economics
Abstract
Transformers applied to spatial imperfect-information games must represent map geometry while tracking hidden entities through time. We ask whether geometry-aware positional encodings improve these capabilities, without claiming a new positional encoding. We construct a four-level benchmark on a hexagonal naval pursuit game: controlled geometry and topology probes, an exact-Bayes hidden-target tracking task, offline policy imitation at 1k and 10k games, and 7,200 fixed-seed games against three legacy opponents. Across matched Transformer backbones, HexRoPE reduces exact-belief posterior cross-entropy relative to no positional encoding by 0.278 on D6-transformed test orbits and 0.329 on a larger map; both hierarchical-bootstrap confidence intervals exclude zero, and both Holm-adjusted p-values are below 0.001. At 1k games, HexRoPE improves policy action accuracy by 4.63 percentage points over no encoding and 2.05 points over rectangular relative bias; the gains shrink to 1.55 and 0.41 points at 10k games. However, HexRoPE does not improve aggregate gameplay win rate: its paired effect over no encoding is -1.56 percentage points (95% CI [-4.50, 1.17]). Rectangular relative bias is strongest on D6 belief consistency but fails sharply when extrapolating from radius 3 to radius 4, while graph bias provides only a small blocked-edge gain. The results show that geometric inductive bias improves belief estimation and data-efficient imitation, but those representation gains do not automatically produce stronger closed-loop play.
Figures & tables
| IID radius-3 | D6 transforms | radius-4 OOD | blocked | |||||
|---|---|---|---|---|---|---|---|---|
| Encoding | CE | KL | CE | Top-1 | JS | CE | KL | CE |
| None | 2.095 | 0.245 | 2.247 | 0.362 | 0.0172 | 2.529 | 0.471 | 2.203 |
| RectRel | 1.856 | 0.005 | 1.956 | 0.381 | 0.0047 | 11.008 | 8.949 | 1.858 |
| AxialRoPE | 1.853 | 0.003 | 1.949 | 0.378 | 0.0033 | 2.096 | 0.038 | 1.855 |
| HexRoPE | 1.853 | 0.003 | 1.969 | 0.380 | 0.0095 | 2.200 | 0.141 | 1.852 |
| HexRoPE+Graph | 1.853 | 0.002 | 1.962 | 0.372 | 0.0074 | 2.177 | 0.118 | 1.850 |
| 1k games | 10k games | |||
|---|---|---|---|---|
| Encoding | Acc. | CE | Acc. | CE |
| None | 0.379 | 1.888 | 0.464 | 1.574 |
| RectRel | 0.405 | 1.910 | 0.475 | 1.541 |
| HexRoPE | 0.425 | 1.794 | 0.479 | 1.521 |
| German policy | British policy | |||||
|---|---|---|---|---|---|---|
| Encoding | Random | V11 | Yanfu | Random | V11 | Yanfu |
| None | 0.897 | 0.670 | 0.543 | 0.717 | 0.777 | 0.457 |
| RectRel | 0.910 | 0.700 | 0.610 | 0.727 | 0.657 | 0.500 |
| HexRoPE | 0.910 | 0.727 | 0.550 | 0.723 | 0.720 | 0.337 |
| HexRoPE+Graph | 0.910 | 0.760 | 0.513 | 0.723 | 0.690 | 0.340 |
Positional Encoding
Positional encoding gives Transformers signals about token order, distance, and spatial or temporal relationships.
See all 117 papers