--- pretty_name: WeightProgramBench language: - en task_categories: - text-generation size_categories: - n<1K tags: - reinforcement-learning - weight-space-programming - games - benchmark configs: - config_name: default data_files: - split: train path: data/train.jsonl - split: test path: data/test.jsonl --- # WeightProgramBench Write the weights of a small game-playing neural network in one response, without tools. Each task provides the game rules, observation layout, game source, and network format. A CPU scorer reads numeric tensor assignments and plays the resulting policy; it never executes model-written code or trains the submitted network. Reinforcement learning can train the language model between submissions. This dataset preserves the expanded MinAtar Synth v4 corpus: **317 training games and five held-out original MinAtar games**. It contains task prompts, game implementations, the frozen scorer, and source attribution. It does not contain reference solutions, model weights, or model-generated trajectories. ## Splits | Split | Games | Family | | --- | ---: | --- | | Train | 51 | Atari-style synthetic Python conversions | | Train | 266 | Crisp-inspired synthetic Python conversions | | Test | 5 | Original MinAtar: Asterix, Breakout, Freeway, Seaquest, Space Invaders | Training environments are compact Python adaptations, not Atari ROM emulation or native Crisp gameplay. All use `10 × 10 × 6` binary observations. The five original MinAtar games have their observation channels mapped into the same six-channel input. The split holds out game identities; it does not establish that every test mechanic is absent from training. ## Load the tasks ```python from datasets import load_dataset tasks = load_dataset("neilkale/WeightProgramBench") print(len(tasks["train"]), len(tasks["test"])) # 317, 5 task = tasks["test"][0] messages = [ {"role": "system", "content": task["system_prompt"]}, {"role": "user", "content": task["prompt"]}, ] ``` Each row preserves the original fields `name`, `split`, `game`, `source`, `prompt`, `system_prompt`, and `episodes`. Additional columns are: - `task_id`: zero-based index in the original 322-row task file. These IDs are not renumbered within splits. - `family`: `atari_synthetic`, `crisp_synthetic`, or `minatar_original`. - `upstream_source_url` and `upstream_revision`: implementation provenance. - `native_source_url`: pinned native Crisp source, where applicable. For reproducible experiments, pin the same dataset commit using `revision=` when loading tasks and downloading runtime files. ## Policy and scoring Every task uses a **600 → 32 → 32 → 6** network with **20,486 float32 parameters**, two tanh hidden layers, and softmax-sampled actions. All parameters start at zero. The model supplies numeric tensor assignments in a fenced `edits` block, following the task's format. The scorer validates assignments with Python's AST and literal parser; it does not execute the response as Python. Each submitted policy plays **1,000 episodes**: - Environment seed: `1729 + episode_index`, covering `1729–2728`. - Independent action RNG seed: `7919 + episode_index`, covering `7919–8918`. - Sticky-action probability: `0.1`. - Episode limit: termination or **10,000 actions**. - Original MinAtar difficulty ramping: disabled. Seeds are fixed across games and submissions. The reward is `clip(mean_game_score, 0, game_score_cap) / game_score_cap`. Each synthetic game declares its own cap. Original MinAtar caps are 1,000, except Freeway's cap of 100. These scales do not make games equally difficult. Invalid submissions receive zero. Keep raw scores alongside normalized rewards when comparing policies. The frozen runtime uses **NumPy 2.3.4** and **MinAtar 1.0.15**. Policy inference and replay run on CPU. One policy's 1,000 episodes are one language-model sample, not 1,000 independent model generations. ## Score a saved response locally Install the replay dependencies; installing MinAtar without dependencies avoids adding optional visualization and training packages: ```bash python -m pip install huggingface_hub 'numpy==2.3.4' python -m pip install --no-deps 'MinAtar==1.0.15' ``` Save the model's complete response, including its `edits` block, in `answer.txt`. Then evaluate it against the matching game: ```python import json from pathlib import Path import sys from huggingface_hub import snapshot_download snapshot = Path(snapshot_download("neilkale/WeightProgramBench", repo_type="dataset")) runtime = snapshot / "runtime" sys.path.insert(0, str(runtime)) from verify import apply_edits, evaluate, score_cap tasks = [json.loads(line) for line in (runtime / "tasks.jsonl").read_text().splitlines()] task = next(task for task in tasks if task["game"] == "breakout" and task["source"] == "original") answer = Path("answer.txt").read_text() weights, edit_count = apply_edits(answer) raw_score, mean_episode_length = evaluate(task["game"], task["source"], weights, task["episodes"]) cap = score_cap(task["game"], task["source"]) reward = min(max(raw_score, 0.0), cap) / cap print({"raw_score": raw_score, "reward": reward, "mean_episode_length": mean_episode_length}) ``` This example raises on malformed responses so local debugging is explicit. For the benchmark's invalid-submission handling, use `verify.grade_answer(game, source, answer, episodes)`, which returns a reward and grading metadata. Full 1,000-episode replay can take several minutes, depending on the game and CPU. The Trajectory integration lives in the [WeightProgramBench cookbook PR](https://github.com/Trajectorylabs/trajectory-cookbook/pull/104). Model inference and training are separate from the local scorer. ## Files and integrity - `data/train.jsonl`, `data/test.jsonl`: Hugging Face task splits with provenance columns added. - `runtime/tasks.jsonl`: byte-identical frozen task records in their original order, without added columns. - `runtime/minatar_synth/games/`: the 317 frozen Python training environments. - `runtime/verify.py`: frozen policy parser and CPU scorer. - `runtime/source.json`: SHA-256 digests for the original task file, scorer, and all 317 game files. - `TASK_ORIGINS.json`: per-game source mappings, pinned revisions, and prompt and implementation digests. - `THIRD_PARTY_NOTICES.md`, `runtime/NOTICE.txt`, and `runtime/LICENSE-*`: credits and applicable upstream notices. Synthetic source revision: `4038830175c4201ca10e004ed4441985f2acddf2`. Frozen task-file SHA-256: `cc2d728fc3c820f217ecf43a4fdc0c9e2a5e292fcdd8b4afb0cb1d34774691e6`. ## Credits and licensing The weight-space programming setup follows [Rikiya Takehi, Jayden Teoh, Alex Zhang, and Omar Khattab's experiments](https://rikiyat.github.io/blog/weight-space-programming/), particularly Experiment 5. The expanded training environments come from [Trajectory Labs, Jerry Chan, and contributors to MinAtar Synth](https://github.com/Trajectorylabs/minatar-synth/tree/4038830175c4201ca10e004ed4441985f2acddf2). Crisp game designs and sources are credited to **ABA Games** and contributors, and the portable SDL/C versions to **Joyrider3774** and contributors. Original **MinAtar** is by **Kenny Young and Tian Tian**. Licensing differs by component: original MinAtar source is GPL-3.0, the cited native Crisp source collections carry MIT notices, and the original experiment's prompt/log materials are attributed under CC BY 4.0. The pinned MinAtar Synth repository does not declare a license for its converted implementations. This dataset does not assert a blanket license for those files. See [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md) for the exact scopes and source links; the original MinAtar source embedded in prompts retains its GPL scope.