arc-agi-2-solver-qwen3-4b β€” GPU-day training + decoding toolkit

Staged toolkit for the Kaggle ARC Prize 2026 solver (NVARC lineage: sorokin/qwen3_4b_grids15_sft139 + per-task rank-256 rsLoRA + turbo-DFS). Weights are produced on GPU day by running train_lora_sft.py; this repo ships the complete executable pipeline, pinned configs and tests so the Kaggle run is a two-command operation.

Files

File Purpose
arc_vocabs.py 12-token ARC vocabulary + legal-grid grammar (v7)
decode_dfs.py turbo-DFS candidate decoder (exact audited port) + grammar hook + teacher-forced rescoring
selector.py score_kgmon (exact port) + shape-prior variant + top-2 distinct selection
train_lora_sft.py MODE A offline SFT on the HF dataset; MODE B per-task TTT (reference behaviour)
run_config.yaml pinned runtime configuration (model path, budgets, thresholds)

Companion dataset: Nabidnur/arc-agi-2-grids (canonical splits, 128k SFT sequences, features, folds, verified synthetic curriculum).

Reproduce the baseline (Kaggle, 4Γ—L4, offline)

python train_lora_sft.py --mode offline_sft \
    --data sft/train_sft128.jsonl.gz --out /kaggle/working/ckpt   # optional offline SFT
# per-task TTT + decode runs inside the Kaggle notebook (arc26-nvarc-v7)

Pinned baseline: LoRA r=256, rsLoRA alpha=32, dropout 0, targets q/k/v/o/gate/up/down + embed_tokens + lm_head; LR 5e-5 cosine, 1 epoch, bf16, max_seq_len 8192; search floor cum_NLL < -ln(0.2); selection score_kgmon = votes βˆ’ mean(augmented_NLL), top-2 distinct.

v7 deltas (each behind a flag, ablated before adoption β€” see

docs/MASTER_PLAN_INTEGRATION.md in the GitHub repo)

  1. Legal-grid grammar during DFS (no 31-row / ragged / mid-row-EOS branches).
  2. Two-stage search: cheap confident pass first, broadened floor on starved outputs.
  3. Adaptive scheduling: calibrated cost model + coverage-first deadlines (v4 lineage).
  4. Program branch: demo-verified primitives (off-center symmetry orbit fill, hole topology recolor, path propagation) join the candidate pool with 100% measured precision (3/3 public case tasks exact, incl. the 30Γ—30 that beat the neural pool).

Scoring

Output-level exact pass@2 over ALL test outputs (172 public eval outputs; one output = +0.5814 pts). Secondary diagnostics: task-mean, task-all.

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support