ARC-AGI-2 solver using geometric embeddings and adversarial structure probing
Project description
arc-prize
ARC-AGI-2 solver using geometric embeddings, hyperbolic rule inference, and adversarial structure probing.
Approach
This solver combines three key ideas:
-
Hyperbolic Rule Encoding — ARC transformation rules are hierarchical (e.g., "tile the pattern" contains "repeat", "mirror", "offset"). The Poincaré ball naturally represents this hierarchy: general rules near the origin, specific sub-rules near the boundary.
-
Radar-like Structure Probing — Parametric transforms at controllable intensity [0,1] are applied to grids and the model's latent response is measured. Transforms the model is invariant to reveal learned symmetries; transforms it's sensitive to reveal structural features it uses. This is adapted from the Bond Index adversarial fuzzing framework.
-
Test-Time Refinement — Per-task fine-tuning on augmented training pairs (the dominant winning pattern from ARC Prize 2025). Leave-one-out training on dihedral augmentations provides more signal per task.
Architecture
Training Pairs → PairEncoder → z_pairs → HyperbolicRuleEncoder → h_rules
↓
Attention Aggregation
↓
Test Input → GridEncoder ─────────────────────────→ GridDecoder ← z_rule
↓
Output Grid
The adversarial training component (gradient reversal) forces the encoder to be invariant to surface features (color palette, position) while remaining sensitive to structural features (pattern, symmetry, count).
Installation
pip install arc-prize
Or for development:
git clone https://github.com/ahb-sjsu/arc-prize.git
cd arc-prize
pip install -e ".[dev]"
Quick Start
from arc_prize.solver import ARCSolver, SolverConfig
from arc_prize.data import load_arckit_tasks
# Load ARC-AGI-1 tasks
train_tasks, eval_tasks = load_arckit_tasks()
# Initialize solver
solver = ARCSolver(SolverConfig(device="cuda"))
# Solve a task
task = eval_tasks[0]
train_pairs = [(p.input, p.output) for p in task.train]
test_inputs = [p.input for p in task.test]
predictions = solver.solve_task(train_pairs, test_inputs, refine=True)
# predictions[i] = [candidate_1, candidate_2] for test input i
Structure Probing
The radar-like probe system reveals what the model has learned:
from arc_prize.fuzzer import StructureProbe, make_transform_suite
from arc_prize.encoder import GridEncoder
encoder = GridEncoder(z_dim=128)
probe = StructureProbe(encoder, transforms=make_transform_suite())
report = probe.scan(task_id="abc123", grid=input_grid, device="cuda")
# What is the model invariant to?
print(report.invariance_profile)
# {'color_permute': 0.95, 'rotate': 0.88, 'add_noise': 0.12, ...}
# How well does it separate structure from surface?
print(f"Robustness Index: {report.robustness_index:.3f}")
Modules
| Module | Description |
|---|---|
grid.py |
Grid ↔ tensor conversion, padding, object extraction |
encoder.py |
CNN + attention pooling grid encoder, pair encoder |
geometric.py |
Poincaré ball operations, hyperbolic rule encoder |
decoder.py |
FiLM-conditioned CNN grid decoder |
fuzzer.py |
Parametric structure probing (the "radar") |
adversarial.py |
Gradient reversal for surface-invariant encoding |
augment.py |
Dihedral group + color permutation augmentations |
solver.py |
End-to-end solver with test-time refinement |
data.py |
Task loading from JSON / arckit |
evaluate.py |
Exact-match scoring |
submit.py |
Kaggle submission generator |
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file arc_prize-0.1.0.tar.gz.
File metadata
- Download URL: arc_prize-0.1.0.tar.gz
- Upload date:
- Size: 24.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b34efd14ad84889531da7284d40a5f137d5a4676ffcdc69567bfe2e73d33998
|
|
| MD5 |
b6b442774982d9bbc1edd23350a714e0
|
|
| BLAKE2b-256 |
7d994f333dce1fe189f366c92a4549ee2eb56ffa7afbb7fa45fac3f942468525
|
File details
Details for the file arc_prize-0.1.0-py3-none-any.whl.
File metadata
- Download URL: arc_prize-0.1.0-py3-none-any.whl
- Upload date:
- Size: 24.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b5e841daf8c6a0a1822c9c6b07e3c15b6d47000b529eafe0175ed92a6453d0c
|
|
| MD5 |
62560f41c7a80db148c5896aa8676f72
|
|
| BLAKE2b-256 |
4a3b8136ff81f60fc484cb6badf268c7ab9e5e1ad7fa876d582ca89c6580acf5
|