From Recorded Demonstrations to an Inspectable Game-Playing Agent
How does a sequence of human game actions become a working artificial-intelligence agent, and what can a classroom experiment legitimately conclude about that agent? We developed Agent Arcade, a local browser game in which each player action is recorded with four interpretable sensor values, an action label, and the immediate reward. Six learning methods were compared on the same game and the same unseen test levels: a distance-weighted k-nearest-neighbors policy, a small sensor network that sees only the four numbers, a small convolutional network that sees only 48 by 24 pictures, tabular Q-learning that learns from reward alone, a fine-tuned SmolVLA vision-language-action model, the π0 vision-language-action model run zero-shot with no training on this game, and the same π0 model fine-tuned with LoRA on the same demonstrations. The expert rule policy scores 250.0 on the ten unseen test seeds. Q-learning reaches 249.0 in about one minute with no teacher. SmolVLA reaches 241.1 after 20,000 training steps. The four-number network reaches 236.6 in about six seconds. The k-nearest-neighbors policy reaches 235.4 with no training time. The picture network reaches 215 as a five-game mean. The zero-shot π0 model scores 5.3: a three-billion-parameter generalist that was never trained on this game cannot play it. The same π0 model, fine-tuned with LoRA for 20,000 steps on the same 240 demonstration episodes, scores 37.4 — seven times its zero-shot score, but still far below SmolVLA’s 241.1. A separate controlled experiment holds the model and 240-row data budget fixed while changing demonstration coverage from one training level seed to twelve. On 600 expert-labeled actions from twenty unseen seeds, the one-seed policy achieved 91.0% action accuracy and the twelve-seed policy 84.3%. The observed 6.7-percentage-point decrease contradicts a simple “more diverse is always better” expectation. It does not establish that diversity is harmful: with a fixed data budget, broader seed coverage also reduces the number of demonstrations available per seed. The study shows how recorded behavior can train an inspectable agent, how the choice of inputs can matter more than model size, and how a surprising result becomes a prompt for a better controlled experiment rather than a broad causal claim.
Plain-language takeaway
The agent does not watch the colorful screen or “understand” the game as a person does. Each method receives something different: four numbers, a small picture, or reward alone. The four numbers beat the picture, 236.6 to 215, and the reward-only learner nearly matches the teacher, 249.0 to 250.0. The biggest model in the room, never trained on this game, scores 5.3. Training on the game matters more than size. In our built-in fair test, spreading the same 240 demonstrations across more levels did not improve performance. That is a real result from this implementation—but one run is a clue, not a universal law.
1. Introduction
Classroom discussions of game-playing artificial intelligence often begin with an impressive animation and end before the evidence pipeline becomes visible. Agent Arcade reverses that order. A learner first plays a controlled three-lane game, creating a dataset through ordinary choices. The learner then trains an agent, watches the policy act, inspects its decision receipt, and tests it on an unseen level. The animation is therefore not the explanation. The explanation is the trace from a measured state, through recorded demonstrations and a reproducible decision rule, to an action and outcome.
This manuscript addresses three related questions. First, how are locally recorded human demonstrations represented and converted into a policy? Second, with the same game and the same unseen test levels, how do six different learning methods compare — copying a teacher, reading four numbers, reading pictures, learning from reward alone, and using large pretrained vision-language-action models? Third, with a fixed number of expert-labeled demonstration rows, does collecting those rows from more procedurally generated level seeds improve action accuracy on unseen seeds? The first question is instructional and descriptive. The second is a controlled comparison. The third is a controlled empirical experiment.
2. Environment and recorded data
2.1 Controlled three-lane game
The environment contains a player ship, collectible coins, and hazards. The player or agent may move one lane left, remain in the current lane, or move one lane right. A pseudorandom level seed determines the object sequence, making levels reproducible while allowing unseen seeds to create new arrangements. A run ends after 450 decision steps or when three lives are lost. Coins add 10 points, hazards subtract 12 points without allowing the score to fall below zero, and survival adds 0.02 per step. Reported game scores use the first 300 steps of a run, matching the evaluation protocol in Section 5.
2.2 One decision becomes one row
During Player Run, the browser records a row after a human decision. A row represents one decision—not an entire game. The comma-separated-values (CSV) export contains the following fields:
| Field | Meaning | Role in learning |
|---|---|---|
seed, step | Level identifier and decision time | Provenance; not policy inputs |
obs_dx | Horizontal obstacle offset: negative = left, zero = same lane, positive = right | Input feature |
obs_distance | Normalized forward distance to the nearest hazard: zero = near, one = far or absent | Input feature |
coin_dx | Horizontal coin offset relative to the player | Input feature |
coin_distance | Normalized forward distance to the nearest coin | Input feature |
action | Human choice: LEFT, STAY, or RIGHT | Training label |
reward | Immediate consequence after the action | Outcome for inspection; not the imitation-learning label |
The suffix dx means delta x, or horizontal displacement relative to the player. The four features are normalized values rather than screen pixels or physical distances.
2.3 Privacy and scope of the human records
Personal gameplay rows remain in the learner’s browser unless the learner explicitly chooses Export CSV. The activity requires no account, camera, microphone, or connection to a commercial game. Because the workshop does not centrally collect personal rows, this manuscript does not report a class-level sample size, average student performance, or a claim that training caused student learning. Those quantities do not exist in the project evidence.
3. From demonstrations to a policy: six methods
3.1 Distance-weighted k-nearest neighbors
Every personal policy begins with 180 balanced starter demonstrations: 60 LEFT, 60 STAY, and 60 RIGHT examples generated from nine seeds. The browser then adds up to the most recent 60 personal examples for each action class. This cap prevents a long sequence of STAY actions from overwhelming all LEFT and RIGHT examples. The displayed training receipt reports the resulting row count and action balance.
For each decision, the policy converts the current state into a four-element vector. It computes squared Euclidean distance to every training row, retains the nine nearest rows (k = 9), and gives closer rows more influence. It also applies inverse-frequency class weights so an action with fewer training examples is not automatically ignored.
vote(action) = Σ neighbors of that action class_weight ÷ (0.025 + √distance)
The action with the largest normalized vote is returned. The constant 0.025 prevents division by zero. The policy is an imitation learner: it learns to reproduce labeled actions in similar measured states. Reward is displayed for evaluation, but this version does not use reinforcement learning to optimize long-term reward. On the controlled 240-row comparison it reaches 87.0% action accuracy and a mean unseen-level score of 235.4, with no training time at all: training is remembering.
3.2 A small network that sees only four numbers
The same four sensor values feed a feed-forward network with layers 4, 64, 64, and 3 (4,675 parameters). Trained on 2,400 balanced demonstration rows, it reaches 89.2% action accuracy and a mean unseen-level score of 236.6 in about six seconds. It beats the picture network below while training roughly fifteen times faster. The lesson is about inputs, not size: four well-chosen numbers carry more of the game than a whole picture.
3.3 A small network that sees only pictures
The convolutional network receives one 48 by 24 game frame and nothing else — no sensor numbers. Its layers are Conv (16 filters, 3 by 3), Pool (2 by 2), Conv (32 filters, 3 by 3), Pool (2 by 2), Flatten (2,304), Dense (64), Dense (3, softmax): 152,803 parameters in total. It guesses the teacher’s move about 90% of the time, trains in the browser in about 100 seconds with no server, and scores 215 as a five-game mean on unseen levels. The same architecture, trained the same way, is the live browser demo in the workshop.
3.4 Learning from reward alone
Tabular Q-learning uses no teacher and no demonstrations. The bot plays 500 games by itself, tries actions, and remembers which moves raised the reward: a coin is worth 10 points, a hazard costs 12, survival adds 0.02 per step, and the whole run takes about one minute. Its greedy policy scores 249.0 on the ten unseen test seeds — one point below the expert, with no teacher at all.
3.5 Large pretrained models: SmolVLA and π0
Two vision-language-action models were run on the same game and the same ten test seeds. SmolVLA, a 450-million-parameter model, was fine-tuned for 20,000 steps on 240 episodes of expert demonstrations (about 70 minutes on the workshop GPU) and scores 241.1. π0, a three-billion-parameter model pretrained on more than 10,000 hours of robot data, was run zero-shot with no training on this game: each step, the first value of its action chunk is read as left, stay, or right. It scores 5.3. The same π0 model was then fine-tuned with LoRA for 20,000 steps on the same 240 demonstration episodes (about 7 hours 47 minutes on the workshop GPU) and scores 37.4 on the same ten test seeds — seven times its zero-shot score, but still far below SmolVLA’s 241.1. Training closes part of the gap; the rest is not closed by the bigger backbone under this setup. The contrast is the point of the comparison: a generalist that can drive a robot arm cannot play a trivial game it was never trained on. Training on the game matters more than parameter count.
4. Controlled generalization experiment
4.1 Research question and hypothesis
The research question is: With the same 240 demonstration rows, does training on more level seeds improve action accuracy on unseen levels? A reasonable preregistered hypothesis is that twelve-seed coverage will expose the policy to more varied situations and improve unseen-seed accuracy. The experiment must keep data quantity fixed; otherwise seed diversity would be confounded with the number of training examples.
4.2 Conditions and controls
| Component | One-seed condition | Twelve-seed condition |
|---|---|---|
| Training seeds | 101 | 101, 113, 127, 139, 151, 163, 179, 191, 211, 223, 239, 251 |
| Training rows | 240 | 240 total |
| Labels | Rule-based expert policy | Same expert policy |
| Features | Four normalized sensors | Same four sensors |
| Model | Class-balanced weighted k-NN, k = 9 | Same model and k |
| Accuracy test | The same 600 expert-labeled actions from 20 previously unseen seeds | |
| Score test | The same first 10 unseen seeds, up to 300 steps per seed | |
The controlled comparison deliberately uses reproducible expert-generated rows rather than the learners’ personal records. Personal demonstrations vary in quantity, action balance, timing, and strategy, so substituting them here would prevent the experiment from isolating seed coverage.
4.3 Outcomes
The primary outcome is action accuracy: the percentage of 600 held-out states for which the learned policy returns the same action as the expert label. Mean game score is secondary because score is sequential: one wrong action can change later states, making it informative but less direct as a measure of label imitation.
5. Results
5.1 Same game, eight ways to play it
All scores are means on the same ten unseen test seeds (the picture network is a five-game mean over five of them). Training demonstrations come from seeds 101 to 251; test levels are seeds 503 and above, so there is no overlap by construction.
| Who | How | Train time | Score |
|---|---|---|---|
| Expert (teacher) | Fixed rules | — | 250.0 |
| Reinforcement learning (Q-learning) | Reward only, no teacher | ~1 min · 500 games | 249.0 |
| SmolVLA (heavyweight) | Pictures + language, 20,000 steps | ~70 min · 5090 GPU | 241.1 |
| Small network (4 sensors) | 4 numbers only | ~6 s | 236.6 |
| k-NN | Copy the nearest demos | 0 s | 235.4 |
| Small CNN (pictures) | 48 × 24 images | ~100 s · your browser | 215 (5-game mean) |
| π0 (zero-shot) | Pictures + language, 3B params, no training on this game | — | 5.3 |
| π0 (fine-tuned) | Pictures + language, 3B params, LoRA, 20,000 steps | ~7h47m · 5090 GPU | 37.4 |
Two reminders belong with this table. First, no teacher is needed to come close to the teacher: reward alone reaches 249.0 in about a minute, past the 70-minute heavyweight at 241.1. Second, accuracy is not the game score: guessing the teacher’s move correctly does not guarantee surviving the level.
5.2 One seed versus twelve seeds
In the current deterministic reference run, the twelve-seed policy was 6.7 percentage points lower in action accuracy than the one-seed policy. Thus, the observed result did not support the simple directional hypothesis that broader seed coverage would improve performance under a fixed 240-row budget.
Evidence boundary. These numbers describe this implementation, its expert policy, its selected training and test seeds, one value of k, and one fixed row budget. No repeated resampling, confidence interval, or inferential test is currently included. The result is deterministic for the listed seeds; determinism is not the same as evidence of broad generality.
6. Discussion
6.1 What the result establishes
The experiment establishes that, for the specified seeds and evaluation set, distributing 240 expert demonstrations across twelve training seeds produced lower expert-action agreement than collecting 240 rows from one seed. It also demonstrates that a plausible classroom hypothesis can fail without the experiment itself failing. The scoreboard establishes two further points: the choice of inputs can matter more than model size (four numbers at 236.6 beat a picture at 215), and a large pretrained model with no training on the task scores near zero (5.3), so task-specific training, not parameter count, is what makes the game playable.
6.2 Possible explanations that remain hypotheses
Several mechanisms could produce the diversity pattern. First, the fixed data budget creates a coverage-density trade-off: twelve seeds provide only about twenty rows per seed, whereas one seed supplies a denser local trajectory. Second, the four-feature representation may map different underlying situations to similar vectors, producing conflicting neighbor labels. Third, the chosen expert policy and seed 101 may align unusually well with the held-out state distribution. Fourth, class balancing and inverse-distance weighting may interact with the action distribution differently across conditions. The present comparison does not distinguish among these possibilities.
6.3 Why personal demonstrations still matter
The controlled experiment is not a replacement for the personal-training activity. Human records reveal data-quality problems the synthetic comparison intentionally removes: incomplete action coverage, inconsistent labels, delayed key presses, rare failure states, and different play strategies. Those problems are central to understanding real imitation learning. They should be analyzed as their own study, with consent, a defined collection protocol, anonymization, and a preregistered unit of analysis.
7. Limitations
The environment is a small, authored browser game and not evidence about commercial-game agents. The expert label is a deterministic rule, not a gold-standard account of optimal play. Action accuracy measures agreement with that rule and may not perfectly track survival or score. The test uses twenty selected seeds and the score summary uses ten of them. Only one four-feature representation, one distance metric, and k = 9 were evaluated. The π0 zero-shot figure is a single ten-seed probe; the π0 fine-tuned figure is a single 20,000-step LoRA run; the SmolVLA figure is a single 20,000-step run; the picture network’s score is a five-game mean. The experiment does not compare against a majority-action baseline, a non-weighted k-NN model, or a decision tree. Finally, no personal demonstration records were centrally collected, so student-specific and class-level performance claims are outside the evidence.
8. Next experiments
- Coverage ladder: compare 1, 2, 4, 8, and 12 training seeds at several fixed row budgets rather than one 1-versus-12 contrast.
- Repeated seed sets: repeat each condition across many sampled training/test seed groups and report the distribution of accuracy differences.
- Learning curves: vary total rows to separate the effect of diversity from insufficient local density.
- Representation ablation: add player lane or time-to-contact features and test whether conflicting neighbor labels decrease.
- Policy comparison: extend the comparison to more SmolVLA checkpoints while keeping folds and data budgets identical. A LoRA fine-tune of π0 on the same demonstration data is complete: 20,000 steps, mean score 37.4 on the same ten unseen test seeds — seven times the zero-shot 5.3, but still far below SmolVLA’s 241.1. Training closes part of the gap; whether full fine-tuning, more data, or a different image bridge closes the rest is the next question.
- Human-data study: with explicit consent, compare personal-only, starter-only, and combined demonstrations using predefined unseen seeds and de-identified participant codes.
9. Reproducibility and terminology
The complete game, data export, policy, expert generator, listed seeds, and evaluation functions run in the browser from Agent Arcade. The picture-network demo runs at agent-arcade/bc.html and the reinforcement-learning demo at agent-arcade/rl-web.html. The experiment is deterministic because each seed initializes the same pseudorandom generator. CSV means comma-separated values; k-NN means k-nearest neighbors; AI means artificial intelligence; and a policy is a function that maps the measured state to an action.
10. Writing a claim the numbers can carry
A conclusion from this study has four parts: Scope + Result + Limit + Next test. For example: “In this three-lane game, the agent trained on 12 seeds achieved 84.3% versus 91.0% unseen-level accuracy with 240 rows each.” Then stop there: the conclusion holds only for this one game and this one model. If the result disagrees with the prediction, write that down honestly. A surprising result, with a fair comparison and a clear next step, is still a valuable result.
References
- Cobbe, K., Hesse, C., Hilton, J., & Schulman, J. (2020). Leveraging procedural generation to benchmark reinforcement learning. Proceedings of the 37th International Conference on Machine Learning. Procgen paper and benchmark.
- Perez-Liebana, D., et al. General Video Game AI (GVGAI) framework. Official repository.
- Hambro, E., et al. (2022). Insights from the NeurIPS 2021 NetHack Challenge. NeurIPS Datasets and Benchmarks. Dataset paper.
Artificial-intelligence-use disclosure. AI assisted with manuscript organization and wording. The implementation details and reported values were checked against the workshop’s local game code, the fast-model results file, and browser executions of the deterministic generalization test. No missing student results, inferential statistics, or causal claims were invented.