JSON-Bag: A generic game trajectory representation

📅 2025-08-01
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the challenge of universal representation and classification of game-playing trajectories. We propose the JSON-Bag model: it tokenizes JSON-formatted trajectory descriptions into a bag-of-tokens representation and constructs a metric strategy space using the Jensen–Shannon divergence. To our knowledge, this is the first method to transform raw JSON sequences into prototype-based representations endowed with computable distances. The resulting space enables cross-game agent identification, policy parameter inference, and seed recovery—unifying multiple classification tasks. Integrated with prototype-based nearest-neighbor retrieval and random forest feature analysis, the model significantly outperforms handcrafted-feature baselines across six board games, demonstrating strong few-shot generalization. Crucially, pairwise distances between learned prototypes exhibit high alignment with human-perceived strategic differences, yielding an interpretable and transferable representation framework for behavioral analysis in game AI.

Technology Category

Application Category

📝 Abstract
We introduce JSON Bag-of-Tokens model (JSON-Bag) as a method to generically represent game trajectories by tokenizing their JSON descriptions and apply Jensen-Shannon distance (JSD) as distance metric for them. Using a prototype-based nearest-neighbor search (P-NNS), we evaluate the validity of JSON-Bag with JSD on six tabletop games -- extit{7 Wonders}, extit{Dominion}, extit{Sea Salt and Paper}, extit{Can't Stop}, extit{Connect4}, extit{Dots and boxes} -- each over three game trajectory classification tasks: classifying the playing agents, game parameters, or game seeds that were used to generate the trajectories. Our approach outperforms a baseline using hand-crafted features in the majority of tasks. Evaluating on N-shot classification suggests using JSON-Bag prototype to represent game trajectory classes is also sample efficient. Additionally, we demonstrate JSON-Bag ability for automatic feature extraction by treating tokens as individual features to be used in Random Forest to solve the tasks above, which significantly improves accuracy on underperforming tasks. Finally, we show that, across all six games, the JSD between JSON-Bag prototypes of agent classes highly correlates with the distances between agents' policies.
Problem

Research questions and friction points this paper is trying to address.

Represent game trajectories generically using JSON tokenization
Evaluate JSON-Bag with JSD for trajectory classification tasks
Improve accuracy via automatic feature extraction in underperforming tasks
Innovation

Methods, ideas, or system contributions that make the work stand out.

Tokenizes JSON game trajectories for representation
Uses Jensen-Shannon distance for trajectory comparison
Employs prototype-based nearest-neighbor search for classification
🔎 Similar Papers
No similar papers found.