Interstellar007 commited on
Commit
0c91099
·
verified ·
1 Parent(s): 0ce88f9

Update README with complete 4×L4 setup instructions

Browse files
Files changed (1) hide show
  1. README.md +116 -61
README.md CHANGED
@@ -1,88 +1,143 @@
1
- # 🏆 ARC-AGI-2 Solver — Dual-Track Program Synthesis + TTT
2
 
3
  **Competition:** [ARC Prize 2026 (ARC-AGI-2)](https://www.kaggle.com/competitions/arc-prize-2026-arc-agi-2)
4
 
5
- ## 🎯 Strategy
6
 
7
- This solver implements a dual-track approach based on the **top-3 winning methods** from ARC Prize 2025:
 
8
 
9
- ### Track A: SOAR Program Synthesis (Induction)
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
- ### Track B: Enhanced Heuristic Solvers (DSL)
16
- - 20+ pattern-matching heuristics: rotations, flips, color maps, gravity, fill, overlay, etc.
17
- - Instant execution catches ~2-5% of tasks with zero compute
18
- - No model needed
19
 
20
- ### Track C: Test-Time Training (Transduction)
21
- - Per-task LoRA fine-tuning with D8 augmentations
22
- - Leave-one-out task construction for TTT data
23
- - DFS candidate generation + Product-of-Experts scoring
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
- ### Ensemble
27
- Priority: **Verified programs > TTT predictions > Partial programs > Heuristics**
 
 
 
28
 
29
- ## 📊 Current Results
30
 
31
- | Dataset | Heuristics Only | With SOAR Model (expected) |
32
- |---------|----------------|---------------------------|
33
- | ARC-AGI-2 (1000 train) | 2.1% | ~15-25% |
34
- | ARC-AGI-1 (400 train) | 5.0% | ~30-50% |
35
 
36
- ## 📁 Files
 
 
 
 
 
 
 
37
 
38
- | File | Description |
39
- |------|-------------|
40
- | `kaggle_submission.py` | **Complete Kaggle submission script** drop-in ready |
41
- | `run_soar_eval.py` | SOAR evaluation with exact prompt format |
42
- | `arc_data.py` | Data loading + D8 augmentations + color permutations |
43
- | `program_synthesis.py` | SOAR-style evolutionary program synthesis engine |
44
- | `ttt_engine.py` | Test-Time Training with LoRA + augmented inference |
45
- | `arc_solver.py` | Ensemble solver combining all tracks |
46
- | `enhanced_heuristics.py` | 20+ pattern-matching heuristic solvers |
 
 
47
 
48
- ## 🚀 Competition Setup
 
49
 
50
- ### Hardware: 4× NVIDIA L4 GPUs, 12h time limit, no internet
51
 
52
- ```bash
53
- # Install dependencies
54
- pip install torch transformers datasets numpy accelerate peft
55
 
56
- # Run evaluation
57
- python run_soar_eval.py
58
- ```
 
 
 
 
 
 
 
 
 
 
59
 
60
- ### Kaggle Submission
61
- ```bash
62
- python kaggle_submission.py
63
- # Outputs: /kaggle/working/submission.json
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  ```
65
 
66
- ## 📚 Key References
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
 
68
- | Paper | Method | ARC-AGI-1 Score |
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 from Literature
77
 
78
- 1. **Test-Time Training is the foundation** — All top-3 2025 winners used TTT
79
- 2. **Program synthesis provides verifiable solutions** — Programs that pass training pairs are provably correct
80
- 3. **D8 augmentations are critical** — 16-point accuracy drop without geometric augmentations
81
- 4. **Product of Experts scoring** outperforms naive voting
82
- 5. **ARC-AGI-2 is dramatically harder** — o3 scores 53% on ARC-1 but only 3% on ARC-2
83
 
84
  ## Models & Datasets
85
 
86
- - **Model**: [julien31/Soar-qwen-7b](https://huggingface.co/julien31/Soar-qwen-7b) (7.6B params)
 
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 — 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 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)