|
| 1 | +# JaxARC |
| 2 | + |
| 3 | +[JaxARC](https://github.com/aadimator/JaxARC) is a hardware-accelerated ARC (Abstraction and Reasoning Corpus) environment built on JAX. It enables massively parallel RL training on ARC puzzle tasks with full JIT compilation support. |
| 4 | + |
| 5 | +## Basic Usage |
| 6 | + |
| 7 | +To run PPO with JaxARC on the MiniARC dataset: |
| 8 | + |
| 9 | +```bash |
| 10 | +python stoix/systems/ppo/anakin/ff_ppo.py env=jaxarc/default |
| 11 | +``` |
| 12 | + |
| 13 | +This uses the `Mini` dataset (70 tasks) with point-based actions — a good starting point for prototyping. |
| 14 | + |
| 15 | +To train on the full ARC-AGI-1 training set (400 tasks): |
| 16 | + |
| 17 | +```bash |
| 18 | +python stoix/systems/ppo/anakin/ff_ppo.py env=jaxarc/agi1_train |
| 19 | +``` |
| 20 | + |
| 21 | +## Available Configs |
| 22 | + |
| 23 | +| Config | Dataset | Tasks | Action Mode | Description | |
| 24 | +|--------|---------|-------|-------------|-------------| |
| 25 | +| `jaxarc/default` | MiniARC | 70 | point | Small dataset for fast prototyping | |
| 26 | +| `jaxarc/agi1_train` | ARC-AGI-1 | 400 | point | Official ARC training benchmark | |
| 27 | +| `jaxarc/agi1_bbox` | ARC-AGI-1 | 400 | bbox | Bounding-box actions for structured edits | |
| 28 | +| `jaxarc/concept` | ConceptARC | ~40 | point | Tasks grouped by reasoning concept | |
| 29 | + |
| 30 | +## Customising Behaviour |
| 31 | + |
| 32 | +### Datasets |
| 33 | + |
| 34 | +JaxARC supports four ARC datasets. Set the dataset via the `env.scenario.name` config: |
| 35 | + |
| 36 | +- **Mini** (`env.scenario.name=Mini`): 70 simplified tasks from MiniARC. Good for debugging and prototyping. |
| 37 | +- **AGI1** (`env.scenario.name=AGI1-train`): 400 official ARC-AGI-1 training tasks. The standard RL benchmark. Use `AGI1-eval` for the evaluation split. |
| 38 | +- **AGI2** (`env.scenario.name=AGI2-train`): ARC-AGI-2 competition tasks. Use `AGI2-eval` for the evaluation split. |
| 39 | +- **ConceptARC** (`env.scenario.name=Concept-SameDifferent`): Tasks grouped by abstract reasoning concepts. Replace `SameDifferent` with any concept name. |
| 40 | + |
| 41 | +Available ConceptARC concepts: `AboveBelow`, `Center`, `CleanUp`, `CompleteShape`, `Copy`, `Count`, `ExtendToBoundary`, `ExtractObjects`, `FilledNotFilled`, `HorizontalVertical`, `InsideOutside`, `MoveToBoundary`, `Order`, `SameDifferent`, `TopBottom2D`, `TopBottom3D`. |
| 42 | + |
| 43 | +### Action Modes |
| 44 | + |
| 45 | +JaxARC offers three action modes. Override via `env.action.mode`: |
| 46 | + |
| 47 | +```bash |
| 48 | +# Point actions (default) — select individual cells |
| 49 | +python stoix/systems/ppo/anakin/ff_ppo.py env=jaxarc/default env.action.mode=point |
| 50 | + |
| 51 | +# Bounding-box actions — select rectangular regions |
| 52 | +python stoix/systems/ppo/anakin/ff_ppo.py env=jaxarc/default env.action.mode=bbox |
| 53 | +``` |
| 54 | + |
| 55 | +- **point**: Agent selects one cell at a time (row, col, color). Simple but large action space. |
| 56 | +- **bbox**: Agent selects rectangular regions (top-left, bottom-right, color). Enables structured edits. |
| 57 | +- **mask**: Full grid mask specification. Most expressive but largest action space. |
| 58 | + |
| 59 | +### Observation Wrappers |
| 60 | + |
| 61 | +Three observation components can be toggled independently: |
| 62 | + |
| 63 | +```yaml |
| 64 | +observation_wrappers: |
| 65 | + answer_grid: true # Include the current answer grid state |
| 66 | + input_grid: true # Include the input grid (task specification) |
| 67 | + contextual: true # Include task context (episode step, etc.) |
| 68 | +``` |
| 69 | +
|
| 70 | +## Key Metrics |
| 71 | +
|
| 72 | +JaxARC provides domain-specific metrics alongside the standard Stoix `episode_return` and `episode_length`: |
| 73 | + |
| 74 | +| Metric | Description | |
| 75 | +|--------|-------------| |
| 76 | +| `best_similarity` | Peak grid similarity achieved during the episode (0–1) | |
| 77 | +| `solved` | Whether the agent produced a perfect solution | |
| 78 | +| `steps_to_solve` | Number of steps taken to first solve (if solved) | |
| 79 | +| `final_similarity` | Grid similarity at episode termination (0–1) | |
| 80 | +| `was_truncated` | Whether the episode hit the step limit without solving | |
| 81 | + |
| 82 | +These are emitted via JaxARC's `ExtendedMetrics` wrapper and appear in `timestep.extras["episode_metrics"]`. |
0 commit comments