Update README with complete 4×L4 setup instructions
Browse files
README.md
CHANGED
|
@@ -1,88 +1,143 @@
|
|
| 1 |
-
# 🏆 ARC-AGI-2 Solver —
|
| 2 |
|
| 3 |
**Competition:** [ARC Prize 2026 (ARC-AGI-2)](https://www.kaggle.com/competitions/arc-prize-2026-arc-agi-2)
|
| 4 |
|
| 5 |
-
##
|
| 6 |
|
| 7 |
-
|
|
|
|
| 8 |
|
| 9 |
-
|
| 10 |
-
- Uses **[julien31/Soar-qwen-7b](https://huggingface.co/julien31/Soar-qwen-7b)** — a Qwen-2.5-Coder-7B model fine-tuned on 5M ARC program traces
|
| 11 |
-
- Evolutionary search: Sample → Execute → Refine → Vote
|
| 12 |
-
- **Verified solutions**: Programs that pass ALL training examples are provably correct
|
| 13 |
-
- Based on [SOAR (arxiv:2507.14172)](https://arxiv.org/abs/2507.14172) — 52% on ARC-AGI-1
|
| 14 |
|
| 15 |
-
###
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
|
| 20 |
-
###
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
- Based on [Akyürek et al. (arxiv:2411.07279)](https://arxiv.org/abs/2411.07279) and [Franzen et al. (arxiv:2505.07859)](https://arxiv.org/abs/2505.07859)
|
| 25 |
|
| 26 |
-
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
-
|
| 30 |
|
| 31 |
-
|
| 32 |
-
|---------|----------------|---------------------------|
|
| 33 |
-
| ARC-AGI-2 (1000 train) | 2.1% | ~15-25% |
|
| 34 |
-
| ARC-AGI-1 (400 train) | 5.0% | ~30-50% |
|
| 35 |
|
| 36 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
|
|
|
|
|
|
| 47 |
|
| 48 |
-
##
|
|
|
|
| 49 |
|
| 50 |
-
|
| 51 |
|
| 52 |
-
|
| 53 |
-
# Install dependencies
|
| 54 |
-
pip install torch transformers datasets numpy accelerate peft
|
| 55 |
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
```
|
| 65 |
|
| 66 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
|
| 68 |
-
|
| 69 |
-
|-------|--------|----------------|
|
| 70 |
-
| [SOAR (2507.14172)](https://arxiv.org/abs/2507.14172) | Evolutionary program synthesis | 52% |
|
| 71 |
-
| [Product of Experts (2505.07859)](https://arxiv.org/abs/2505.07859) | DFS + PoE scoring | 71.6% |
|
| 72 |
-
| [TTT (2411.07279)](https://arxiv.org/abs/2411.07279) | Test-time training + augmentation | 61.9% |
|
| 73 |
-
| [ARC-AGI-2 (2505.11831)](https://arxiv.org/abs/2505.11831) | Benchmark paper | — |
|
| 74 |
-
| [ARC Prize 2025 Report (2601.10904)](https://arxiv.org/abs/2601.10904) | Competition results | 24% on ARC-2 |
|
| 75 |
|
| 76 |
-
## 🔑 Key Insights
|
| 77 |
|
| 78 |
-
1. **
|
| 79 |
-
2. **Program synthesis
|
| 80 |
-
3. **
|
| 81 |
-
4. **
|
| 82 |
-
5. **
|
| 83 |
|
| 84 |
## Models & Datasets
|
| 85 |
|
| 86 |
-
- **
|
|
|
|
| 87 |
- **Training data**: [julien31/soar_arc_train_5M](https://huggingface.co/datasets/julien31/soar_arc_train_5M)
|
| 88 |
- **Benchmark**: [arc-agi-community/arc-agi-2](https://huggingface.co/datasets/arc-agi-community/arc-agi-2)
|
|
|
|
| 1 |
+
# 🏆 ARC-AGI-2 Solver — 4× L4 GPU Production Pipeline
|
| 2 |
|
| 3 |
**Competition:** [ARC Prize 2026 (ARC-AGI-2)](https://www.kaggle.com/competitions/arc-prize-2026-arc-agi-2)
|
| 4 |
|
| 5 |
+
## 🚀 Quick Start (Kaggle 4× L4 GPUs)
|
| 6 |
|
| 7 |
+
### Step 1: Add Model as Kaggle Dataset
|
| 8 |
+
Go to [julien31/Soar-qwen-14b](https://huggingface.co/julien31/Soar-qwen-14b) and add it as a Kaggle dataset (or use the Kaggle Models integration). Mount it at `/kaggle/input/soar-qwen-14b`.
|
| 9 |
|
| 10 |
+
**Alternative (smaller):** Use [julien31/Soar-qwen-7b](https://huggingface.co/julien31/Soar-qwen-7b) — set `USE_14B = False` in the script.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
+
### Step 2: Install SGLang (in notebook first cell)
|
| 13 |
+
```python
|
| 14 |
+
!pip install "sglang[all]>=0.4.7" aiohttp requests --quiet
|
| 15 |
+
```
|
| 16 |
|
| 17 |
+
### Step 3: Run the Solver
|
| 18 |
+
```python
|
| 19 |
+
!python kaggle_notebook.py
|
| 20 |
+
```
|
|
|
|
| 21 |
|
| 22 |
+
That's it! The script handles everything:
|
| 23 |
+
- Launches 2× SGLang servers (14B model, TP=2 each) across 4 GPUs
|
| 24 |
+
- Solves tasks in parallel using SOAR program synthesis
|
| 25 |
+
- Falls back to heuristics for easy tasks
|
| 26 |
+
- Outputs `submission.json` in Kaggle format
|
| 27 |
|
| 28 |
+
---
|
| 29 |
|
| 30 |
+
## 🎯 Architecture
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
+
### GPU Utilization: 2× Soar-qwen-14b (TP=2)
|
| 33 |
+
```
|
| 34 |
+
GPU 0 + GPU 1 → SGLang Server A (14B model, tensor parallel)
|
| 35 |
+
GPU 2 + GPU 3 → SGLang Server B (14B model, tensor parallel)
|
| 36 |
+
```
|
| 37 |
+
- **14B scores 42.75% vs 7B's 36.25%** on ARC-AGI-1 (SOAR paper Table 1)
|
| 38 |
+
- 2 servers = parallel task solving, no PCIe bottleneck
|
| 39 |
+
- Each server handles 120 tasks independently
|
| 40 |
|
| 41 |
+
### Solving Pipeline (per task)
|
| 42 |
+
```
|
| 43 |
+
1. Heuristic check (instant) → 12+ pattern matchers
|
| 44 |
+
↓ (if no match)
|
| 45 |
+
2. SOAR Program Synthesis:
|
| 46 |
+
a. Sample 60 programs from Soar-qwen-14b
|
| 47 |
+
b. Execute each → check against training examples
|
| 48 |
+
c. Refine top programs with execution feedback
|
| 49 |
+
d. Weighted majority vote → top-2 answers
|
| 50 |
+
3. Submit pass@2 predictions
|
| 51 |
+
```
|
| 52 |
|
| 53 |
+
### Key Innovation: Verified Solutions
|
| 54 |
+
Programs that produce correct outputs for ALL training examples are **provably correct** for the test input (assuming the task has a unique transformation). This gives us high-confidence predictions that other approaches (direct grid prediction) cannot guarantee.
|
| 55 |
|
| 56 |
+
---
|
| 57 |
|
| 58 |
+
## 📊 Expected Performance
|
|
|
|
|
|
|
| 59 |
|
| 60 |
+
| Component | ARC-AGI-2 | ARC-AGI-1 |
|
| 61 |
+
|-----------|-----------|-----------|
|
| 62 |
+
| Heuristics only | 2.1% | 5.0% |
|
| 63 |
+
| SOAR-7B (30 samples) | ~5-10% | ~15-25% |
|
| 64 |
+
| SOAR-14B (60 samples + refinement) | ~10-20% | ~30-42% |
|
| 65 |
+
| SOAR-14B + full 6K budget | ~20-30% | ~42%+ |
|
| 66 |
+
| 2025 competition winner (NVARC) | 24% | — |
|
| 67 |
+
|
| 68 |
+
**Key factors for higher scores:**
|
| 69 |
+
- More samples per task (budget 3000-6000 vs our 60)
|
| 70 |
+
- Multiple SOAR self-improvement iterations
|
| 71 |
+
- Ensemble with TTT transduction model
|
| 72 |
+
- Larger model (32B or 72B)
|
| 73 |
|
| 74 |
+
---
|
| 75 |
+
|
| 76 |
+
## 📁 Files
|
| 77 |
+
|
| 78 |
+
| File | Purpose |
|
| 79 |
+
|------|---------|
|
| 80 |
+
| **`kaggle_notebook.py`** | **🎯 Main submission script** — run this on Kaggle |
|
| 81 |
+
| `run_soar_eval.py` | Standalone SOAR evaluation (for benchmarking) |
|
| 82 |
+
| `arc_data.py` | D8 augmentations, color permutations, TTT data |
|
| 83 |
+
| `program_synthesis.py` | SOAR evolutionary search engine |
|
| 84 |
+
| `ttt_engine.py` | Test-Time Training with LoRA + PoE scoring |
|
| 85 |
+
| `enhanced_heuristics.py` | 20+ pattern-matching heuristics |
|
| 86 |
+
| `arc_solver.py` | Multi-track ensemble solver |
|
| 87 |
+
| `kaggle_submission.py` | Alternative single-file submission |
|
| 88 |
+
|
| 89 |
+
---
|
| 90 |
+
|
| 91 |
+
## 🔧 Configuration Options
|
| 92 |
+
|
| 93 |
+
Edit the top of `kaggle_notebook.py`:
|
| 94 |
+
|
| 95 |
+
```python
|
| 96 |
+
USE_14B = True # True = 2×14B (TP=2), False = 4×7B (TP=1)
|
| 97 |
+
PROGRAMS_PER_TASK = 60 # More = better accuracy, slower
|
| 98 |
+
REFINEMENTS_PER_TASK = 30
|
| 99 |
+
TEMPERATURE_SAMPLE = 0.9 # Higher = more diverse programs
|
| 100 |
+
TEMPERATURE_REFINE = 0.7 # Lower = more focused fixes
|
| 101 |
```
|
| 102 |
|
| 103 |
+
**Time budget estimation:**
|
| 104 |
+
- 240 tasks × 60 samples × ~2s/sample = ~8 hours with 2 parallel servers
|
| 105 |
+
- Plus refinement + heuristics: ~10 hours total (within 12h limit)
|
| 106 |
+
|
| 107 |
+
---
|
| 108 |
+
|
| 109 |
+
## 📚 Literature Foundation
|
| 110 |
+
|
| 111 |
+
This solver is built on the exact methods from the top ARC Prize 2025 winners:
|
| 112 |
+
|
| 113 |
+
| Paper | Key Contribution | Score |
|
| 114 |
+
|-------|-----------------|-------|
|
| 115 |
+
| [SOAR (2507.14172)](https://arxiv.org/abs/2507.14172) | Evolutionary program synthesis + self-improvement | 52% ARC-1 |
|
| 116 |
+
| [Product of Experts (2505.07859)](https://arxiv.org/abs/2505.07859) | DFS + multi-augmentation scoring | 71.6% ARC-1 |
|
| 117 |
+
| [TTT (2411.07279)](https://arxiv.org/abs/2411.07279) | Per-task LoRA + augmented inference | 61.9% ARC-1 |
|
| 118 |
+
| [ARC-AGI-2 (2505.11831)](https://arxiv.org/abs/2505.11831) | Benchmark definition | — |
|
| 119 |
+
| [ARC Prize 2025 Report (2601.10904)](https://arxiv.org/abs/2601.10904) | Competition winner analysis | 24% ARC-2 |
|
| 120 |
+
|
| 121 |
+
### SOAR Model Performance (from paper Table 1)
|
| 122 |
+
| Model | 1-shot | Sample-6k | Sample&Refine-6k | SOAR-6k |
|
| 123 |
+
|-------|--------|-----------|------------------|---------|
|
| 124 |
+
| **Soar-7B** | 1.0% | 5.6% | 14.25% | **36.25%** |
|
| 125 |
+
| **Soar-14B** | 1.0% | 12.6% | 19.87% | **42.75%** |
|
| 126 |
+
| Soar-32B | 1.5% | 12.9% | 25.25% | 44.37% |
|
| 127 |
|
| 128 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 129 |
|
| 130 |
+
## 🔑 Key Insights
|
| 131 |
|
| 132 |
+
1. **ARC-AGI-2 is dramatically harder than ARC-1** — o3 drops from 53% to 3%
|
| 133 |
+
2. **Program synthesis > direct prediction** — verifiable solutions are the key advantage
|
| 134 |
+
3. **Refinement is critical** — SOAR Sample&Refine outperforms pure sampling by 2-3×
|
| 135 |
+
4. **14B > 7B** — 42.75% vs 36.25% with same compute budget
|
| 136 |
+
5. **L4 PCIe limits TP** — independent copies (TP=1 or TP=2) beat TP=4 due to no NVLink
|
| 137 |
|
| 138 |
## Models & Datasets
|
| 139 |
|
| 140 |
+
- **Primary model**: [julien31/Soar-qwen-14b](https://huggingface.co/julien31/Soar-qwen-14b) (14.7B params)
|
| 141 |
+
- **Fallback model**: [julien31/Soar-qwen-7b](https://huggingface.co/julien31/Soar-qwen-7b) (7.6B params)
|
| 142 |
- **Training data**: [julien31/soar_arc_train_5M](https://huggingface.co/datasets/julien31/soar_arc_train_5M)
|
| 143 |
- **Benchmark**: [arc-agi-community/arc-agi-2](https://huggingface.co/datasets/arc-agi-community/arc-agi-2)
|