ARCANA: A Reflective Multi-Agent Program Synthesis Framework for ARC-AGI-2 Reasoning
Summary
ARCANA is a reflective multi-agent framework that decomposes ARC-AGI-2 abstract reasoning tasks into iterative perception, hypothesis generation, symbolic execution, and reflective refinement, improving reasoning efficiency under strict constraints.
View Cached Full Text
Cached at: 07/13/26, 07:52 AM
# ARCANA: A Reflective Multi-Agent Program Synthesis Framework for ARC-AGI-2 Reasoning
Source: [https://arxiv.org/html/2607.09059](https://arxiv.org/html/2607.09059)
###### Abstract
We present ARCANA, a collaborative multi agent framework for solving ARC AGI 2 tasks under strict test time and hardware constraints\. ARCANA decomposes each task into iterative perception, hypothesis generation, symbolic execution, and reflective refinement\. A perceptual grounding agent builds object centric scene graphs from raw grids, a latent program policy proposes diverse DSL programs, a symbolic executor verifies candidates on demonstrations, and a reflective agent synthesizes failure driven feedback for the next turn\. These agents communicate through a shared differentiable blackboard and are scheduled by a learned meta controller\. The design combines structured program search with adaptive multi turn correction, improving reasoning efficiency and solution quality on challenging abstract transformation tasks\.
## IIntroduction
Abstract reasoning on ARC AGI 2 remains difficult because successful solutions must infer compact transformation rules from only a few demonstrations, while handling variable grid sizes, object interactions, and severe ambiguity in the latent rule space\. Large pretrained models have improved broad pattern recognition, yet few shot generalization on compositional grid transformations still demands precise search, explicit verification, and strong inductive bias for structure discovery\[[2](https://arxiv.org/html/2607.09059#bib.bib1)\]\. Recent advances in reasoning have shown that intermediate deliberation can improve complex inference, but these gains do not directly solve ARC style tasks\. Chain based prompting helps expose reasoning steps, yet it does not guarantee executable consistency across demonstrations\[[11](https://arxiv.org/html/2607.09059#bib.bib2)\]\. Iterative self feedback further improves correction behavior, but pure text based refinement remains weak when the hypothesis space is symbolic, spatial, and tightly constrained by exact grid outputs\[[7](https://arxiv.org/html/2607.09059#bib.bib3)\]\. To address this challenge, we introduce ARCANA, an adaptive collaborative architecture that turns each task into a multi turn reasoning episode\. ARCANA separates object centric perception, latent program proposal, symbolic execution, and reflective refinement into specialized agents connected by a shared blackboard\. This design allows the system to generate diverse candidate programs, test them against demonstrations, diagnose failure patterns, and redirect search toward more promising regions of the program space\. The result is a practical framework for abstract visual reasoning under realistic compute limits\.
## IIRelated Work
Recent work on structured reasoning has increasingly revisited object centric representations and modular rule manipulation as a foundation for compositional generalization\. Slot based perceptual decomposition provides a differentiable route to discover entities and their attributes from raw inputs, which is especially useful when reasoning depends on object level transformations rather than dense pixels\[[6](https://arxiv.org/html/2607.09059#bib.bib4)\]\. In parallel, neural systems that emulate production style rule application have shown how explicit modular structure can support more systematic computation than monolithic end to end predictors\[[1](https://arxiv.org/html/2607.09059#bib.bib5)\]\. A second line of research emphasizes stronger reasoning behavior in neural models through explicit interaction between deliberation and action, or by casting reasoning steps into executable forms\.Hybrid architectures that combine multi\-granularity semantic encoders with graph attention have also shown strong results in structurally complex domains\[[12](https://arxiv.org/html/2607.09059#bib.bib12)\]\. ReAct couples intermediate reasoning with environment facing decisions, which improves controllability in sequential problem solving\[[16](https://arxiv.org/html/2607.09059#bib.bib6)\]\. Program of Thoughts extends this direction by separating symbolic computation from language generation, illustrating the value of executable intermediate programs when exact correctness matters\[[3](https://arxiv.org/html/2607.09059#bib.bib7)\]\. Our approach is also informed by several specific techniques that improve efficiency and robustness in structured inference\.Hardware\-conscious deployment on edge\-class CPUs also motivates mixed\-precision and kernel\-level optimization strategies for large language models\[[18](https://arxiv.org/html/2607.09059#bib.bib16)\]\.Our approach is also informed by several specific techniques that improve efficiency and robustness in structured inference\[[14](https://arxiv.org/html/2607.09059#bib.bib11)\]\. Rotary position encoding strengthens attention over spatial relations and is well suited to grid based inputs\[[8](https://arxiv.org/html/2607.09059#bib.bib8)\]\. Parameter efficient adaptation through low rank updates enables lightweight test time specialization without retraining the full model\[[4](https://arxiv.org/html/2607.09059#bib.bib9)\]\. Diverse decoding strategies such as self consistency further suggest that exploring multiple reasoning paths can outperform single trajectory prediction, an idea that aligns with our diverse program proposal and verification loop\[[10](https://arxiv.org/html/2607.09059#bib.bib10)\]\.Similarly, MERIT\-Net shows that a two\-stage retrieval\-and\-ranking pipeline with task\-specific calibration can benefit from explicit modular design and carefully reported training settings\[[9](https://arxiv.org/html/2607.09059#bib.bib17)\]\.Related work on retrieval\-augmented reasoning has also explored dynamic tool use and selective fallback mechanisms, as exemplified by DynaRAG, which improves robustness by routing to external APIs when retrieved evidence is insufficient\[[5](https://arxiv.org/html/2607.09059#bib.bib13)\]\.
## IIIMethodology
We introduce ARCANA \(Adaptive Reasoning with Collaborative Agent Network Architecture\), a multi\-agent framework that formulates each ARC\-AGI\-2 task as a multi\-turn agentic reasoning episode across four specialized agents \(Fig\.[1](https://arxiv.org/html/2607.09059#S3.F1)\)\. The Perceptual Grounding Agent uses a 2D\-aware Transformer with Slot Attention to build object\-centric scene graphs from raw grids\. The Hypothesis Generation Agent is a latent program policy based on a conditional VAE that auto\-regressively proposes diverse candidate transformation programs\. The Symbolic Execution Agent evaluates candidates on the demonstration pairs and records structured execution traces\. The Reflective Refinement Agent performs failure\-driven credit assignment via counterfactual analysis over these traces, producing gradient\-like feedback that steers subsequent hypothesis generation away from previously failed program regions\.
The four agents communicate through a shared differentiable blackboard, coordinated by a learned Meta\-Controller that adaptively allocates a limited compute budget across turns via a policy\-gradient\-trained activation strategy\. The framework is trained end\-to\-end with a novel Reasoning Trajectory Optimization \(RTO\) objective rewarding both final\-answer correctness and intermediate reasoning efficiency\. Under the official ARC Prize 2026 hardware constraints, ARCANA’s agentic multi\-turn refinement substantially outperforms both neural transductive baselines and standalone program synthesis methods, setting a new state\-of\-the\-art among open\-source solutions on ARC\-AGI\-2 and narrowing the gap to human\-level abstract reasoning\.This emphasis on adaptive resource allocation under strict latency and reliability constraints is reminiscent of recent work on adaptive GPU instance scaling for serverless AI inference\[[17](https://arxiv.org/html/2607.09059#bib.bib18)\]\.Under the official ARC Prize 2026 hardware constraints, ARCANA’s agentic multi\-turn refinement substantially outperforms both neural transductive baselines and standalone program synthesis methods, setting a new state\-of\-the\-art among open\-source solutions on ARC\-AGI\-2 and narrowing the gap to human\-level abstract reasoning\[[13](https://arxiv.org/html/2607.09059#bib.bib14)\]\.
Figure 1:Overall ARCANA framework\. Four specialized agents—Perceptual Grounding \(PGA\), Hypothesis Generation \(HGA\), Symbolic Execution \(SEA\), and Reflective Refinement \(RRA\)—communicate through a shared differentiable blackboardℬt\\mathcal\{B\}\_\{t\}under a learned Meta\-Controller\. The coral feedback arrow from RRA to HGA implements the multi\-turn refinement loop driving ARCANA’s improvements\.
## IVThe ARCANA Framework
### IV\-AProblem Formulation
We cast ARC\-AGI\-2 as a sequential decision\-making problem solved by a collaborative multi\-agent system\. Given a taskτ\\tauwithNNdemonstration pairs𝒟τ=\{\(𝐆nin,𝐆nout\)\}n=1N\\mathcal\{D\}\_\{\\tau\}=\\\{\(\\mathbf\{G\}\_\{n\}^\{\\mathrm\{in\}\},\\mathbf\{G\}\_\{n\}^\{\\mathrm\{out\}\}\)\\\}\_\{n=1\}^\{N\}and one or more test inputs\{𝐆tin\}\\\{\\mathbf\{G\}\_\{t\}^\{\\mathrm\{in\}\}\\\}, the goal is to produce the correct output𝐆tout\\mathbf\{G\}\_\{t\}^\{\\mathrm\{out\}\}for each test input\. Each grid𝐆∈\{0,1,…,9\}H×W\\mathbf\{G\}\\in\\\{0,1,\\ldots,9\\\}^\{H\\times W\}is a 2D array of discrete color symbols with dimensions from1×11\{\\times\}1to30×3030\{\\times\}30\.
ARCANA decomposes each task into a multi\-turn episodeℰ=\(s0,a1,s1,a2,…,sT\)\\mathcal\{E\}=\(s\_\{0\},a\_\{1\},s\_\{1\},a\_\{2\},\\ldots,s\_\{T\}\): at each turntt, a subset of agents is activated, messages pass through the blackboardℬ\\mathcal\{B\}, and the statests\_\{t\}is updated\. This design reflects the observation that the dominant theme in ARC\-AGI progress—the refinement loop—maps naturally to a multi\-agent architecture where perception, hypothesis generation, symbolic execution, and reflection are specialized modules that iteratively cooperate\.This design reflects the observation that the dominant theme in ARC\-AGI progress—the refinement loop—maps naturally to a multi\-agent architecture where perception, hypothesis generation, symbolic execution, and reflection are specialized modules that iteratively cooperate\[[15](https://arxiv.org/html/2607.09059#bib.bib15)\]\. The episode ends when a verified solution is found or the compute budget is exhausted\.
### IV\-BPerceptual Grounding Agent \(PGA\)
The Perceptual Grounding Agent \(Fig\.[2](https://arxiv.org/html/2607.09059#S4.F2)\) transforms raw grid representations into structured, object\-centric scene graphs that serve as the shared perceptual foundation for all downstream reasoning agents\. Its internal architecture comprises three stages: cell\-level encoding, object discovery, and relational scene graph construction\.
Figure 2:Perceptual Grounding Agent pipeline\. Raw grids are color\-embedded with RoPE\-2D positional encoding, contextualized by a 6\-layer 2D\-aware Transformer, parsed intoK=16K=16object slots via differentiable Slot Attention, and assembled into scene graphs whose pairwise transformations are aggregated by a cross\-demonstration Transformer into the task representation𝐑task\\mathbf\{R\}\_\{\\mathrm\{task\}\}\.#### IV\-B12D\-Aware Transformer Encoder
Each grid cell valuev∈\{0,…,9\}v\\in\\\{0,\\ldots,9\\\}is mapped to a dense vector via a learnable color embedding matrix𝐄color∈ℝ10×d\\mathbf\{E\}\_\{\\mathrm\{color\}\}\\in\\mathbb\{R\}^\{10\\times d\}\. To inject geometric inductive bias appropriate for 2D grid reasoning, we employ a factored 2D Rotary Position Encoding \(RoPE\-2D\), which encodes the row indexiiand column indexjjof each cell into rotation matrices applied directly within the self\-attention dot product\. The embedded cell representation is:
𝐱ij=𝐄color\[vij\]\+𝐩irow\+𝐩jcol\\mathbf\{x\}\_\{ij\}=\\mathbf\{E\}\_\{\\mathrm\{color\}\}\[v\_\{ij\}\]\+\\mathbf\{p\}\_\{i\}^\{\\mathrm\{row\}\}\+\\mathbf\{p\}\_\{j\}^\{\\mathrm\{col\}\}\(1\)The row and column positional encodings are defined through interleaved sinusoidal rotation pairs:
𝐩irow=⨁k=1d/4\(cos\(i⋅ωk\)sin\(i⋅ωk\)\),ωk=1100004k/d\\mathbf\{p\}\_\{i\}^\{\\mathrm\{row\}\}=\\bigoplus\_\{k=1\}^\{d/4\}\\begin\{pmatrix\}\\cos\(i\\cdot\\omega\_\{k\}\)\\\\ \\sin\(i\\cdot\\omega\_\{k\}\)\\end\{pmatrix\},\\;\\omega\_\{k\}=\\frac\{1\}\{10000^\{4k/d\}\}\(2\)𝐩jcol=⨁k=1d/4\(cos\(j⋅ωk\)sin\(j⋅ωk\)\),ωk=1100004k/d\\mathbf\{p\}\_\{j\}^\{\\mathrm\{col\}\}=\\bigoplus\_\{k=1\}^\{d/4\}\\begin\{pmatrix\}\\cos\(j\\cdot\\omega\_\{k\}\)\\\\ \\sin\(j\\cdot\\omega\_\{k\}\)\\end\{pmatrix\},\\;\\omega\_\{k\}=\\frac\{1\}\{10000^\{4k/d\}\}\(3\)where⨁\\bigoplusdenotes concatenation along the embedding dimension\. Within the self\-attention layers, the rotary encoding modulates the query\-key dot product such that attention scores become a function of relative position:
Attn\(𝐪ij,𝐤i′j′\)=\(𝐑i−i′row𝐑j−j′col𝐪ij\)⊤𝐤i′j′\\mathrm\{Attn\}\(\\mathbf\{q\}\_\{ij\},\\mathbf\{k\}\_\{i^\{\\prime\}j^\{\\prime\}\}\)=\\bigl\(\\mathbf\{R\}\_\{i\-i^\{\\prime\}\}^\{\\mathrm\{row\}\}\\mathbf\{R\}\_\{j\-j^\{\\prime\}\}^\{\\mathrm\{col\}\}\\mathbf\{q\}\_\{ij\}\\bigr\)^\{\\\!\\top\}\\mathbf\{k\}\_\{i^\{\\prime\}j^\{\\prime\}\}\(4\)where𝐑Δrow,𝐑Δcol\\mathbf\{R\}\_\{\\Delta\}^\{\\mathrm\{row\}\},\\mathbf\{R\}\_\{\\Delta\}^\{\\mathrm\{col\}\}are block\-diagonal rotation matrices parameterized by relative displacements\. For example:
𝐑Δrow=diag\(\(cosθ−sinθsinθcosθ\),…\)\\mathbf\{R\}\_\{\\Delta\}^\{\\mathrm\{row\}\}=\\mathrm\{diag\}\\\!\\left\(\\begin\{pmatrix\}\\cos\\theta&\-\\sin\\theta\\\\ \\sin\\theta&\\cos\\theta\\end\{pmatrix\},\\ldots\\right\)\(5\)whereθ=Δi⋅ωk\\theta=\\Delta\_\{i\}\\cdot\\omega\_\{k\}for each rotation block\.
The flattened cell embeddings𝐗∈ℝ\(H⋅W\)×d\\mathbf\{X\}\\in\\mathbb\{R\}^\{\(H\\cdot W\)\\times d\}are processed by a Transformer encoder withLpga=6L\_\{\\mathrm\{pga\}\}=6layers,h=8h=8attention heads, embedding dimensiond=256d=256, and GELU activation\. Each layer follows the pre\-norm residual structure:
𝐗~\(ℓ\)=𝐗\(ℓ\)\+MHSA\(LN\(𝐗\(ℓ\)\)\)\\tilde\{\\mathbf\{X\}\}^\{\(\\ell\)\}=\\mathbf\{X\}^\{\(\\ell\)\}\+\\mathrm\{MHSA\}\\\!\\left\(\\mathrm\{LN\}\\\!\\left\(\\mathbf\{X\}^\{\(\\ell\)\}\\right\)\\right\)\(6\)𝐗\(ℓ\+1\)=𝐗~\(ℓ\)\+FFN\(LN\(𝐗~\(ℓ\)\)\)\\mathbf\{X\}^\{\(\\ell\+1\)\}=\\tilde\{\\mathbf\{X\}\}^\{\(\\ell\)\}\+\\mathrm\{FFN\}\\\!\\left\(\\mathrm\{LN\}\\\!\\left\(\\tilde\{\\mathbf\{X\}\}^\{\(\\ell\)\}\\right\)\\right\)\(7\)whereLN\(⋅\)\\mathrm\{LN\}\(\\cdot\)denotes RMSNorm:
RMSNorm\(𝐱\)=𝐱1d∑i=1dxi2\+ϵ⊙𝜸\\mathrm\{RMSNorm\}\(\\mathbf\{x\}\)=\\frac\{\\mathbf\{x\}\}\{\\sqrt\{\\frac\{1\}\{d\}\\sum\_\{i=1\}^\{d\}x\_\{i\}^\{2\}\+\\epsilon\}\}\\odot\\boldsymbol\{\\gamma\}\(8\)with learnable scale𝜸∈ℝd\\boldsymbol\{\\gamma\}\\in\\mathbb\{R\}^\{d\}\. The feed\-forward network employs a SwiGLU gating mechanism:
FFN\(𝐱\)=\(SiLU\(𝐱𝐖gate\)⊙\(𝐱𝐖up\)\)𝐖down\\mathrm\{FFN\}\(\\mathbf\{x\}\)=\\bigl\(\\mathrm\{SiLU\}\(\\mathbf\{x\}\\mathbf\{W\}\_\{\\mathrm\{gate\}\}\)\\odot\(\\mathbf\{x\}\\mathbf\{W\}\_\{\\mathrm\{up\}\}\)\\bigr\)\\mathbf\{W\}\_\{\\mathrm\{down\}\}\(9\)where𝐖gate,𝐖up∈ℝd×dff\\mathbf\{W\}\_\{\\mathrm\{gate\}\},\\mathbf\{W\}\_\{\\mathrm\{up\}\}\\in\\mathbb\{R\}^\{d\\times d\_\{\\mathrm\{ff\}\}\}and𝐖down∈ℝdff×d\\mathbf\{W\}\_\{\\mathrm\{down\}\}\\in\\mathbb\{R\}^\{d\_\{\\mathrm\{ff\}\}\\times d\}withdff=⌊83d⌋d\_\{\\mathrm\{ff\}\}=\\lfloor\\frac\{8\}\{3\}d\\rfloorrounded to the nearest multiple of 64\. The encoder output is the contextualized cell feature map𝐙∈ℝ\(H⋅W\)×d\\mathbf\{Z\}\\in\\mathbb\{R\}^\{\(H\\cdot W\)\\times d\}\.
#### IV\-B2Object Discovery via Differentiable Slot Attention
Rather than relying on hard\-coded connected component analysis, we employ a differentiable Slot Attention module to discover objects in an unsupervised, gradient\-friendly manner\. We initializeKKlearnable slot vectors\{𝝁k\(0\)\}k=1K\\\{\\boldsymbol\{\\mu\}\_\{k\}^\{\(0\)\}\\\}\_\{k=1\}^\{K\}from a Gaussian prior𝝁k\(0\)∼𝒩\(𝝁init,σinit2𝐈\)\\boldsymbol\{\\mu\}\_\{k\}^\{\(0\)\}\\sim\\mathcal\{N\}\(\\boldsymbol\{\\mu\}\_\{\\mathrm\{init\}\},\\sigma\_\{\\mathrm\{init\}\}^\{2\}\\mathbf\{I\}\), whereK=16K=16is set to exceed the maximum expected object count\. At each refinement iterationr=1,…,Rr=1,\\ldots,R\(we useR=3R=3\), the slots compete to explain the cell features via a softmax attention followed by weighted aggregation and a GRU state update:
Aki\(r\)=exp\(q\(𝝁k\(r−1\)\)⊤k\(𝐙i\)dk\)∑k′exp\(q\(𝝁k′\(r−1\)\)⊤k\(𝐙i\)dk\)A\_\{ki\}^\{\(r\)\}=\\frac\{\\exp\\\!\\left\(\\frac\{q\(\\boldsymbol\{\\mu\}\_\{k\}^\{\(r\-1\)\}\)^\{\\\!\\top\}k\(\\mathbf\{Z\}\_\{i\}\)\}\{\\sqrt\{d\_\{k\}\}\}\\right\)\}\{\\sum\_\{k^\{\\prime\}\}\\exp\\\!\\left\(\\frac\{q\(\\boldsymbol\{\\mu\}\_\{k^\{\\prime\}\}^\{\(r\-1\)\}\)^\{\\\!\\top\}k\(\\mathbf\{Z\}\_\{i\}\)\}\{\\sqrt\{d\_\{k\}\}\}\\right\)\}\(10\)whereq\(⋅\)q\(\\cdot\)andk\(⋅\)k\(\\cdot\)are learned linear projections\. The attention weights are then column\-normalized to produce assignment probabilities:
A^ki\(r\)=Aki\(r\)∑i′=1HWAki′\(r\)\+ϵ\\hat\{A\}\_\{ki\}^\{\(r\)\}=\\frac\{A\_\{ki\}^\{\(r\)\}\}\{\\sum\_\{i^\{\\prime\}=1\}^\{HW\}A\_\{ki^\{\\prime\}\}^\{\(r\)\}\+\\epsilon\}\(11\)Each slot aggregates its assigned features and updates its state through a GRU cell:
𝐮k\(r\)=∑i=1HWA^ki\(r\)⋅v\(𝐙i\)\\mathbf\{u\}\_\{k\}^\{\(r\)\}=\\sum\_\{i=1\}^\{HW\}\\hat\{A\}\_\{ki\}^\{\(r\)\}\\cdot v\(\\mathbf\{Z\}\_\{i\}\)\(12\)𝝁k\(r\)=GRU\(𝝁k\(r−1\),𝐮k\(r\)\)\\boldsymbol\{\\mu\}\_\{k\}^\{\(r\)\}=\\mathrm\{GRU\}\\\!\\left\(\\boldsymbol\{\\mu\}\_\{k\}^\{\(r\-1\)\},\\;\\mathbf\{u\}\_\{k\}^\{\(r\)\}\\right\)\(13\)AfterRRiterations, the final slot representations𝝁k\(R\)∈ℝd\\boldsymbol\{\\mu\}\_\{k\}^\{\(R\)\}\\in\\mathbb\{R\}^\{d\}serve as object\-level features, each capturing the appearance and local structure of a discovered entity\.
#### IV\-B3Scene Graph Construction and Cross\-Demonstration Encoding
Each object slot𝝁k\(R\)\\boldsymbol\{\\mu\}\_\{k\}^\{\(R\)\}is augmented with explicit geometric attributes computed from its soft attention mask—centroid\(x¯k,y¯k\)\(\\bar\{x\}\_\{k\},\\bar\{y\}\_\{k\}\), bounding box dimensions\(wk,hk\)\(w\_\{k\},h\_\{k\}\), areaAkA\_\{k\}, and dominant colorckdomc\_\{k\}^\{\\mathrm\{dom\}\}—producing a node feature:
𝐡k=\[𝝁k\(R\)∥x¯k∥y¯k∥wk∥hk∥Ak∥onehot\(ckdom\)\]\\begin\{split\}\\mathbf\{h\}\_\{k\}=\\bigl\[\\,\\boldsymbol\{\\mu\}\_\{k\}^\{\(R\)\}\\;\\\|\\;\\bar\{x\}\_\{k\}\\;\\\|\\;\\bar\{y\}\_\{k\}\\;\\\|\\;w\_\{k\}\\\\ \\;\\\|\\;h\_\{k\}\\;\\\|\\;A\_\{k\}\\;\\\|\\;\\mathrm\{onehot\}\(c\_\{k\}^\{\\mathrm\{dom\}\}\)\\,\\bigr\]\\end\{split\}\(14\)Pairwise spatial relations are computed via a relation network:
𝐞kl=ϕrel\(\[𝐡k∥𝐡l∥𝐡k−𝐡l∥𝐡k⊙𝐡l\]\)\\begin\{split\}\\mathbf\{e\}\_\{kl\}=\\phi\_\{\\mathrm\{rel\}\}\\\!\\bigl\(\\bigl\[\\,\\mathbf\{h\}\_\{k\}\\;\\\|\\;\\mathbf\{h\}\_\{l\}\\;\\\|\\;\\mathbf\{h\}\_\{k\}\-\\mathbf\{h\}\_\{l\}\\\\ \\;\\\|\\;\\mathbf\{h\}\_\{k\}\\odot\\mathbf\{h\}\_\{l\}\\,\\bigr\]\\bigr\)\\end\{split\}\(15\)whereϕrel\\phi\_\{\\mathrm\{rel\}\}is a two\-layer MLP with SiLU activation\. We construct scene graphs𝒢nin,𝒢nout\\mathcal\{G\}\_\{n\}^\{\\mathrm\{in\}\},\\mathcal\{G\}\_\{n\}^\{\\mathrm\{out\}\}for all2N2Ngrids and compute a delta representation capturing the transformation pattern for each demonstration pair:
𝜹n=1K∑k=1KMLPδ\(\[𝐡n,kin∥𝐡n,kout∥𝐡n,kout−𝐡n,kin\]\)\\begin\{split\}\\boldsymbol\{\\delta\}\_\{n\}=\\frac\{1\}\{K\}\\sum\_\{k=1\}^\{K\}\\mathrm\{MLP\}\_\{\\delta\}\\\!\\bigl\(\\bigl\[\\,\\mathbf\{h\}\_\{n,k\}^\{\\mathrm\{in\}\}\\;\\\|\\;\\mathbf\{h\}\_\{n,k\}^\{\\mathrm\{out\}\}\\\\ \\;\\\|\\;\\mathbf\{h\}\_\{n,k\}^\{\\mathrm\{out\}\}\-\\mathbf\{h\}\_\{n,k\}^\{\\mathrm\{in\}\}\\,\\bigr\]\\bigr\)\\end\{split\}\(16\)The delta representations are aggregated across demonstrations using a cross\-demonstration Transformer withLcross=2L\_\{\\mathrm\{cross\}\}=2layers that attends over allNNpairs to produce a permutation\-invariant task representation:
𝐑task=Pool\(CrossDemoTF\(𝜹1,…,𝜹N\)\)∈ℝdr\\begin\{split\}\\mathbf\{R\}\_\{\\mathrm\{task\}\}=\\mathrm\{Pool\}\\\!\\bigl\(\\mathrm\{CrossDemoTF\}\\\!\\left\(\\boldsymbol\{\\delta\}\_\{1\},\\ldots,\\boldsymbol\{\\delta\}\_\{N\}\\right\)\\bigr\)\\in\\mathbb\{R\}^\{d\_\{r\}\}\\end\{split\}\(17\)wherePool\(⋅\)\\mathrm\{Pool\}\(\\cdot\)applies attention\-weighted mean pooling with a learnable query vector\. This𝐑task\\mathbf\{R\}\_\{\\mathrm\{task\}\}captures the invariant transformation pattern shared across all demonstrations and is written to the blackboardℬ\\mathcal\{B\}as the primary input for downstream agents\.
### IV\-CHypothesis Generation Agent \(HGA\)
The Hypothesis Generation Agent \(Fig\.[3](https://arxiv.org/html/2607.09059#S4.F3)\) operates as a latent program policy: it consumes the task representation and any refinement feedback from previous turns, and produces a diverse set of candidate transformation programs\. Its architecture combines a conditional variational auto\-encoder \(CVAE\) with an auto\-regressive program decoder, enabling both structured exploration and exploitation of the program space\.
Figure 3:Hypothesis Generation Agent\. The conditioning context𝐜=\[𝐑task∥𝐅refine\]\\mathbf\{c\}=\[\\mathbf\{R\}\_\{\\mathrm\{task\}\}\\,\\\|\\,\\mathbf\{F\}\_\{\\mathrm\{refine\}\}\]feeds parallel paths: a conditional priorpθp\_\{\\theta\}used at inference and an amortized posteriorqϕq\_\{\\phi\}used during training \(dashed\)\. Sampled latent codes𝐳π\\mathbf\{z\}\_\{\\pi\}are decoded auto\-regressively into typed DSL programs, and akk\-DPP selects a maximally diverse candidate subset\.#### IV\-C1Conditional Variational Latent Program Space
We define a latent program space𝒵π⊆ℝdz\\mathcal\{Z\}\_\{\\pi\}\\subseteq\\mathbb\{R\}^\{d\_\{z\}\}equipped with a learned conditional prior and an inference\-time posterior\. The prior is conditioned on the task representation and the optional refinement signal𝐅refine\\mathbf\{F\}\_\{\\mathrm\{refine\}\}from the Reflective Refinement Agent \(set to𝟎\\mathbf\{0\}at the first turn\):
pθ\(𝐳π∣𝐑task,𝐅refine\)=𝒩\(𝝁θ\(𝐜\),diag\(𝝈θ2\(𝐜\)\)\)\\begin\{split\}p\_\{\\theta\}\(\\mathbf\{z\}\_\{\\pi\}\\mid\\mathbf\{R\}\_\{\\mathrm\{task\}\},\\mathbf\{F\}\_\{\\mathrm\{refine\}\}\)=\\mathcal\{N\}\\\!\\bigl\(\\boldsymbol\{\\mu\}\_\{\\theta\}\(\\mathbf\{c\}\),\\;\\mathrm\{diag\}\(\\boldsymbol\{\\sigma\}\_\{\\theta\}^\{2\}\(\\mathbf\{c\}\)\)\\bigr\)\\end\{split\}\(18\)where𝐜=\[𝐑task∥𝐅refine\]\\mathbf\{c\}=\[\\mathbf\{R\}\_\{\\mathrm\{task\}\}\\\|\\mathbf\{F\}\_\{\\mathrm\{refine\}\}\]and𝝁θ,𝝈θ\\boldsymbol\{\\mu\}\_\{\\theta\},\\boldsymbol\{\\sigma\}\_\{\\theta\}are parameterized by a two\-layer MLP with LayerNorm\. During training, an amortized posterior network incorporates the ground\-truth program embedding:
qϕ\(𝐳π∣𝐜,π∗\)=𝒩\(𝝁ϕ\(𝐜,𝐞π∗\),diag\(𝝈ϕ2\(𝐜,𝐞π∗\)\)\)\\begin\{split\}q\_\{\\phi\}\(\\mathbf\{z\}\_\{\\pi\}\\mid\\mathbf\{c\},\\pi^\{\*\}\)=\\mathcal\{N\}\\\!\\bigl\(\\boldsymbol\{\\mu\}\_\{\\phi\}\(\\mathbf\{c\},\\mathbf\{e\}\_\{\\pi^\{\*\}\}\),\\;\\mathrm\{diag\}\(\\boldsymbol\{\\sigma\}\_\{\\phi\}^\{2\}\(\\mathbf\{c\},\\mathbf\{e\}\_\{\\pi^\{\*\}\}\)\)\\bigr\)\\end\{split\}\(19\)Sampling employs the reparameterization trick𝐳π=𝝁\+𝝈⊙ϵ,ϵ∼𝒩\(𝟎,𝐈\)\\mathbf\{z\}\_\{\\pi\}=\\boldsymbol\{\\mu\}\+\\boldsymbol\{\\sigma\}\\odot\\boldsymbol\{\\epsilon\},\\;\\boldsymbol\{\\epsilon\}\\sim\\mathcal\{N\}\(\\mathbf\{0\},\\mathbf\{I\}\)\. The refinement signal𝐅refine\\mathbf\{F\}\_\{\\mathrm\{refine\}\}conditions the prior to shift away from previously failed program regions, implementing the key insight from the reflective refinement loop\.
#### IV\-C2Auto\-Regressive Program Decoder Network
A latent code𝐳π\\mathbf\{z\}\_\{\\pi\}is decoded into a symbolic programπ=\(p1,p2,…,pT\)\\pi=\(p\_\{1\},p\_\{2\},\\ldots,p\_\{T\}\)as an ordered sequence of typed DSL primitives\. The decoder is aLdec=4L\_\{\\mathrm\{dec\}\}=4layer causal Transformer with cross\-attention to the conditioning context\. At each decoding steptt:
𝐨t=CausalDec\(Embed\(p1:t−1\),\[𝐳π∥𝐑task\]\)\\mathbf\{o\}\_\{t\}=\\mathrm\{CausalDec\}\\\!\\left\(\\mathrm\{Embed\}\(p\_\{1:t\-1\}\),\\;\[\\mathbf\{z\}\_\{\\pi\}\\;\\\|\\;\\mathbf\{R\}\_\{\\mathrm\{task\}\}\]\\right\)\(20\)The causal Transformer decoder consists of masked self\-attention \(MMHSA\), cross\-attention to the conditioning context, and a SwiGLU feed\-forward block\. Let𝐇\(ℓ\)\\mathbf\{H\}^\{\(\\ell\)\}denote the hidden states at layerℓ\\ell:
𝐇~\(ℓ\)=𝐇\(ℓ\)\+MMHSA\(LN\(𝐇\(ℓ\)\)\)\\tilde\{\\mathbf\{H\}\}^\{\(\\ell\)\}=\\mathbf\{H\}^\{\(\\ell\)\}\+\\mathrm\{MMHSA\}\\\!\\left\(\\mathrm\{LN\}\(\\mathbf\{H\}^\{\(\\ell\)\}\)\\right\)\(21\)𝐇¯\(ℓ\)=𝐇~\(ℓ\)\+CrossAttn\(LN\(𝐇~\(ℓ\)\),𝐂ctx\)\\bar\{\\mathbf\{H\}\}^\{\(\\ell\)\}=\\tilde\{\\mathbf\{H\}\}^\{\(\\ell\)\}\+\\mathrm\{CrossAttn\}\\\!\\left\(\\mathrm\{LN\}\(\\tilde\{\\mathbf\{H\}\}^\{\(\\ell\)\}\),\\;\\mathbf\{C\}\_\{\\mathrm\{ctx\}\}\\right\)\(22\)𝐇\(ℓ\+1\)=𝐇¯\(ℓ\)\+FFNSwiGLU\(LN\(𝐇¯\(ℓ\)\)\)\\mathbf\{H\}^\{\(\\ell\+1\)\}=\\bar\{\\mathbf\{H\}\}^\{\(\\ell\)\}\+\\mathrm\{FFN\}\_\{\\mathrm\{SwiGLU\}\}\\\!\\left\(\\mathrm\{LN\}\(\\bar\{\\mathbf\{H\}\}^\{\(\\ell\)\}\)\\right\)\(23\)where𝐂ctx=MLPctx\(\[𝐳π∥𝐑task\]\)∈ℝnctx×d\\mathbf\{C\}\_\{\\mathrm\{ctx\}\}=\\mathrm\{MLP\}\_\{\\mathrm\{ctx\}\}\(\[\\mathbf\{z\}\_\{\\pi\}\\\|\\mathbf\{R\}\_\{\\mathrm\{task\}\}\]\)\\in\\mathbb\{R\}^\{n\_\{\\mathrm\{ctx\}\}\\times d\}are the context vectors\. The cross\-attention mechanism computes:
CrossAttn\(𝐐,𝐂\)=softmax\(𝐐𝐖Qc\(𝐂𝐖Kc\)⊤dk\)𝐂𝐖Vc\\begin\{split\}\\mathrm\{CrossAttn\}\(\\mathbf\{Q\},\\mathbf\{C\}\)=\\mathrm\{softmax\}\\\!\\left\(\\frac\{\\mathbf\{Q\}\\mathbf\{W\}\_\{Q\}^\{c\}\(\\mathbf\{C\}\\mathbf\{W\}\_\{K\}^\{c\}\)^\{\\\!\\top\}\}\{\\sqrt\{d\_\{k\}\}\}\\right\)\\mathbf\{C\}\\mathbf\{W\}\_\{V\}^\{c\}\\end\{split\}\(24\)
The probability of selecting primitiveptp\_\{t\}from vocabulary𝒫\\mathcal\{P\}is:
Pψ\(pt∣p<t,𝐳π,𝐑task\)=exp\(𝐨t⊤𝐞p/τ\)∑p′exp\(𝐨t⊤𝐞p′/τ\)P\_\{\\psi\}\(p\_\{t\}\\mid p\_\{<t\},\\mathbf\{z\}\_\{\\pi\},\\mathbf\{R\}\_\{\\mathrm\{task\}\}\)=\\frac\{\\exp\(\\mathbf\{o\}\_\{t\}^\{\\top\}\\mathbf\{e\}\_\{p\}/\\tau\)\}\{\\sum\_\{p^\{\\prime\}\}\\exp\(\\mathbf\{o\}\_\{t\}^\{\\top\}\\mathbf\{e\}\_\{p^\{\\prime\}\}/\\tau\)\}\(25\)where𝐞p∈ℝd\\mathbf\{e\}\_\{p\}\\in\\mathbb\{R\}^\{d\}is the embedding of primitiveppandτ\\tauis a temperature parameter\. The full program probability factorizes auto\-regressively:
Pψ\(π∣𝐳π,𝐑task\)=∏t=1TPψ\(pt∣p<t,𝐳π,𝐑task\)P\_\{\\psi\}\(\\pi\\mid\\mathbf\{z\}\_\{\\pi\},\\mathbf\{R\}\_\{\\mathrm\{task\}\}\)=\\prod\_\{t=1\}^\{T\}P\_\{\\psi\}\(p\_\{t\}\\mid p\_\{<t\},\\mathbf\{z\}\_\{\\pi\},\\mathbf\{R\}\_\{\\mathrm\{task\}\}\)\(26\)
#### IV\-C3Diverse Hypothesis Sampling via DPP
At inference, we drawMMlatent codes\{𝐳π\(m\)\}m=1M\\\{\\mathbf\{z\}\_\{\\pi\}^\{\(m\)\}\\\}\_\{m=1\}^\{M\}from the conditional prior and decode each into a candidate program\. To maximize coverage of the program space, we apply akk\-DPP \(determinantal point process\) kernel to select a maximally diverse subset𝒮⊆\{1,…,M\}\\mathcal\{S\}\\subseteq\\\{1,\\ldots,M\\\}:
PDPP\(𝒮\)∝det\(𝐋𝒮\),Lmm′=qmqm′exp\(−‖𝐳π\(m\)−𝐳π\(m′\)‖22σdpp2\)\\begin\{split\}P\_\{\\mathrm\{DPP\}\}\(\\mathcal\{S\}\)&\\propto\\det\(\\mathbf\{L\}\_\{\\mathcal\{S\}\}\),\\\\ L\_\{mm^\{\\prime\}\}&=q\_\{m\}q\_\{m^\{\\prime\}\}\\exp\\\!\\left\(\-\\frac\{\\\|\\mathbf\{z\}\_\{\\pi\}^\{\(m\)\}\-\\mathbf\{z\}\_\{\\pi\}^\{\(m^\{\\prime\}\)\}\\\|^\{2\}\}\{2\\sigma\_\{\\mathrm\{dpp\}\}^\{2\}\}\\right\)\\end\{split\}\(27\)whereqm=Pψ\(π\(m\)∣𝐳π\(m\),𝐑task\)q\_\{m\}=P\_\{\\psi\}\(\\pi^\{\(m\)\}\\mid\\mathbf\{z\}\_\{\\pi\}^\{\(m\)\},\\mathbf\{R\}\_\{\\mathrm\{task\}\}\)is the quality score measuring program coherence\. This balances quality and diversity: high\-probability programs are preferred, but redundant candidates are penalized\.
### IV\-DSymbolic Execution Agent \(SEA\)
SEA executes each HGA candidate on demonstrations, scores it, and emits a structured trace for RRA consumption\.
DSL and execution\.Our DSL𝒫\\mathcal\{P\}has 47 typed primitives spanning geometric transforms, color ops, object manipulation, structural ops, and control flow\. A programπ=\(p1,…,pT\)\\pi=\(p\_\{1\},\\ldots,p\_\{T\}\)with eachp:𝒢nin×Θp→𝒢p:\\mathcal\{G\}^\{n\_\{\\mathrm\{in\}\}\}\\\!\\times\\\!\\Theta\_\{p\}\\to\\mathcal\{G\}runs compositionally:
𝐆^n\(m\)=\(pT\(m\)∘⋯∘p1\(m\)\)\(𝐆nin\)\\hat\{\\mathbf\{G\}\}\_\{n\}^\{\(m\)\}=\(p\_\{T\}^\{\(m\)\}\\circ\\cdots\\circ p\_\{1\}^\{\(m\)\}\)\(\\mathbf\{G\}\_\{n\}^\{\\mathrm\{in\}\}\)\(28\)
Hierarchical verification\.We combine exact\-match, cell accuracy, and SSIM \(on one\-hot grids\) into:
V\(π\(m\),𝒟τ\)=1N∑n\[𝟙\[𝐆^n\(m\)=𝐆nout\]\+γ1CellAccn\+γ2SSIM\(𝐆^n\(m\),𝐆nout\)\]\\begin\{split\}V\(\\pi^\{\(m\)\},\\mathcal\{D\}\_\{\\tau\}\)=\\frac\{1\}\{N\}\\sum\_\{n\}\\Bigl\[&\\mathbb\{1\}\[\\hat\{\\mathbf\{G\}\}\_\{n\}^\{\(m\)\}\{=\}\\mathbf\{G\}\_\{n\}^\{\\mathrm\{out\}\}\]\+\\gamma\_\{1\}\\mathrm\{CellAcc\}\_\{n\}\\\\ &\+\\gamma\_\{2\}\\,\\mathrm\{SSIM\}\(\\hat\{\\mathbf\{G\}\}\_\{n\}^\{\(m\)\},\\mathbf\{G\}\_\{n\}^\{\\mathrm\{out\}\}\)\\Bigr\]\\end\{split\}\(29\)withγ1=0\.3,γ2=0\.1\\gamma\_\{1\}\{=\}0\.3,\\gamma\_\{2\}\{=\}0\.1\.
Trace encoding\.Each step\(pt,𝐆tbefore,𝐆tafter\)\(p\_\{t\},\\mathbf\{G\}\_\{t\}^\{\\mathrm\{before\}\},\\mathbf\{G\}\_\{t\}^\{\\mathrm\{after\}\}\)is embedded by an MLP over\[𝐞pt‖AvgPool\(Enc\(𝐆tbefore\)\)‖AvgPool\(Enc\(𝐆tafter\)\)\]\[\\mathbf\{e\}\_\{p\_\{t\}\}\\\|\\mathrm\{AvgPool\}\(\\mathrm\{Enc\}\(\\mathbf\{G\}\_\{t\}^\{\\mathrm\{before\}\}\)\)\\\|\\mathrm\{AvgPool\}\(\\mathrm\{Enc\}\(\\mathbf\{G\}\_\{t\}^\{\\mathrm\{after\}\}\)\)\]\(Enc\\mathrm\{Enc\}reuses the frozen PGA encoder\); steps are summarized by a BiGRU into𝐞trace\(m\)\\mathbf\{e\}\_\{\\mathrm\{trace\}\}^\{\(m\)\}and written to the blackboardℬ\\mathcal\{B\}\.
### IV\-EReflective Refinement Agent \(RRA\)
RRA—the core innovation—diagnoses failures and reshapes the hypothesis distribution in the next turn\.
Error diagnosis\.For each failed candidate, the binary error mapEn,ij\(m\)=𝟙\[G^n,ij\(m\)≠Gn,ijout\]E\_\{n,ij\}^\{\(m\)\}=\\mathbb\{1\}\[\\hat\{G\}\_\{n,ij\}^\{\(m\)\}\\\!\\neq\\\!G\_\{n,ij\}^\{\\mathrm\{out\}\}\]is averaged across demos, concatenated with the predicted and target one\-hot grids, and passed through a 4\-layer residual ConvNet \(GN\+GELU\), then globally pooled to𝐞err\(m\)∈ℝde\\mathbf\{e\}\_\{\\mathrm\{err\}\}^\{\(m\)\}\\in\\mathbb\{R\}^\{d\_\{e\}\}\.
Counterfactual credit assignment\.We blame stepttby replacing it with identity:
ρt\(m\)=V\(π\(m\),𝒟τ\)−V\(π\\t\(m\),𝒟τ\)\\rho\_\{t\}^\{\(m\)\}=V\(\\pi^\{\(m\)\},\\mathcal\{D\}\_\{\\tau\}\)\-V\\\!\\left\(\\pi^\{\(m\)\}\_\{\\backslash t\},\\mathcal\{D\}\_\{\\tau\}\\right\)\(30\)Negative values indicate harmful steps;ρ^t\(m\)=softplus\-norm\(−ρt\(m\)\)\\hat\{\\rho\}\_\{t\}^\{\(m\)\}=\\mathrm\{softplus\\text\{\-\}norm\}\(\-\\rho\_\{t\}^\{\(m\)\}\)is the normalized blame overtt\.
Feedback synthesis\.Per\-candidate feedback fuses error, blame\-weighted primitives, and trace via a 3\-layer residual MLP:
𝐟\(m\)=MLPfb\(\[𝐞err\(m\)‖∑tρ^t\(m\)𝐞pt‖𝐞trace\(m\)\]\)\\mathbf\{f\}^\{\(m\)\}=\\mathrm\{MLP\}\_\{\\mathrm\{fb\}\}\\\!\\Bigl\(\\bigl\[\\mathbf\{e\}\_\{\\mathrm\{err\}\}^\{\(m\)\}\\,\\\|\\,\\textstyle\\sum\_\{t\}\\hat\{\\rho\}\_\{t\}^\{\(m\)\}\\mathbf\{e\}\_\{p\_\{t\}\}\\,\\\|\\,\\mathbf\{e\}\_\{\\mathrm\{trace\}\}^\{\(m\)\}\\bigr\]\\Bigr\)\(31\)Candidates are aggregated by attention with query𝐑task\\mathbf\{R\}\_\{\\mathrm\{task\}\}:
𝐅refine=∑m∈ℱsoftmaxm\(𝐑task⊤𝐖f𝐟\(m\)/d\)𝐟\(m\)\\mathbf\{F\}\_\{\\mathrm\{refine\}\}=\\sum\_\{m\\in\\mathcal\{F\}\}\\mathrm\{softmax\}\_\{m\}\\\!\\bigl\(\\mathbf\{R\}\_\{\\mathrm\{task\}\}^\{\\top\}\\mathbf\{W\}\_\{f\}\\mathbf\{f\}^\{\(m\)\}/\\sqrt\{d\}\\bigr\)\\,\\mathbf\{f\}^\{\(m\)\}\(32\)𝐅refine\\mathbf\{F\}\_\{\\mathrm\{refine\}\}feeds the HGA prior \(Eq\.[18](https://arxiv.org/html/2607.09059#S4.E18)\) to steer the latent distribution away from failed regions\.
### IV\-FMeta\-Controller and Agentic Orchestration
The Meta\-Controller decides per turn which agents to fire, how much compute to spend, and when to stop\.
Blackboard\.ℬt=ℬt−1∪\{\(κt\(a\),𝐯t\(a\)\):a∈𝒜t\}\\mathcal\{B\}\_\{t\}=\\mathcal\{B\}\_\{t\-1\}\\cup\\\{\(\\kappa\_\{t\}^\{\(a\)\},\\mathbf\{v\}\_\{t\}^\{\(a\)\}\):a\\in\\mathcal\{A\}\_\{t\}\\\}is a key\-value memory read by scaled\-dot\-product attention\.
Controller state\.A GRU tracks state:
𝐬t\\displaystyle\\mathbf\{s\}\_\{t\}=GRUctrl\(𝐬t−1,Read\(ℬt,𝐪ctrl\)\\displaystyle=\\mathrm\{GRU\}\_\{\\mathrm\{ctrl\}\}\\Bigl\(\\mathbf\{s\}\_\{t\-1\},\\;\\mathrm\{Read\}\(\\mathcal\{B\}\_\{t\},\\mathbf\{q\}\_\{\\mathrm\{ctrl\}\}\)\(33\)∥Embed\(Vbest,t\)∥Embed\(t/Tmax\)\)\\displaystyle\\qquad\\qquad\\\|\\,\\mathrm\{Embed\}\(V\_\{\\mathrm\{best\},t\}\)\\\|\\,\\mathrm\{Embed\}\(t/T\_\{\\max\}\)\\Bigr\)
withVbest,t=maxmV\(πt\(m\),𝒟τ\)V\_\{\\mathrm\{best\},t\}=\\max\_\{m\}V\(\\pi\_\{t\}^\{\(m\)\},\\mathcal\{D\}\_\{\\tau\}\);t/Tmaxt/T\_\{\\max\}provides budget awareness\.
Activation, budget, and termination\.Agentsa∈\{PGA,HGA,SEA,RRA\}a\\in\\\{\\mathrm\{PGA,HGA,SEA,RRA\}\\\}fire under a multi\-label Bernoulli policyP\(𝒜t\+1∣𝐬t\)=∏aBern\(σ\(𝐰a⊤𝐬t\+ba\)\)P\(\\mathcal\{A\}\_\{t\+1\}\\mid\\mathbf\{s\}\_\{t\}\)=\\prod\_\{a\}\\mathrm\{Bern\}\(\\sigma\(\\mathbf\{w\}\_\{a\}^\{\\top\}\\mathbf\{s\}\_\{t\}\+b\_\{a\}\)\); PGA typically fires only att=1t\{=\}1\. Per\-turn compute is allocated asbt\+1=𝒞rem,t⋅σ\(𝐰b⊤𝐬t\+bb\)b\_\{t\+1\}=\\mathcal\{C\}\_\{\\mathrm\{rem\},t\}\\cdot\\sigma\(\\mathbf\{w\}\_\{b\}^\{\\top\}\\mathbf\{s\}\_\{t\}\+b\_\{b\}\), enforcing the $0\.42/task ceiling∑tct≤𝒞max\\sum\_\{t\}c\_\{t\}\\leq\\mathcal\{C\}\_\{\\max\}\. Termination fires on full verification, or whenΔVt=Vbest,t−Vbest,t−1<ηstop\\Delta V\_\{t\}=V\_\{\\mathrm\{best\},t\}\-V\_\{\\mathrm\{best\},t\-1\}<\\eta\_\{\\mathrm\{stop\}\}witht\>tmin=2t\>t\_\{\\min\}\{=\}2, or when𝒞rem,t<cmin\\mathcal\{C\}\_\{\\mathrm\{rem\},t\}<c\_\{\\min\}\(ηstop\\eta\_\{\\mathrm\{stop\}\}learnable\)\.
### IV\-GTest\-Time Adaptation via LoRA
Before the agentic loop, we fine\-tune a LoRA adapter on the PGA attention weights:𝐖′=𝐖\+\(α/r\)𝐁𝐀\\mathbf\{W\}^\{\\prime\}=\\mathbf\{W\}\+\(\\alpha/r\)\\,\\mathbf\{B\}\\mathbf\{A\}with𝐀∈ℝr×din\\mathbf\{A\}\\\!\\in\\\!\\mathbb\{R\}^\{r\\times d\_\{\\mathrm\{in\}\}\},𝐁∈ℝdout×r\\mathbf\{B\}\\\!\\in\\\!\\mathbb\{R\}^\{d\_\{\\mathrm\{out\}\}\\times r\}, rankr=8r\{=\}8\. Only𝐀,𝐁\\mathbf\{A\},\\mathbf\{B\}are updated by minimizingℒTTT=1N∑nℒfocal\(Decode\(PGALoRA\(𝐆nin\)\),𝐆nout\)\\mathcal\{L\}\_\{\\mathrm\{TTT\}\}=\\frac\{1\}\{N\}\\sum\_\{n\}\\mathcal\{L\}\_\{\\mathrm\{focal\}\}\(\\mathrm\{Decode\}\(\\mathrm\{PGA\}\_\{\\mathrm\{LoRA\}\}\(\\mathbf\{G\}\_\{n\}^\{\\mathrm\{in\}\}\)\),\\mathbf\{G\}\_\{n\}^\{\\mathrm\{out\}\}\)forSTTT=50S\_\{\\mathrm\{TTT\}\}\{=\}50AdamW steps \(lr=3×10−4\\mathrm\{lr\}\{=\}3\{\\times\}10^\{\-4\}\) withD8D\_\{8\}symmetry augmentation to prevent overfitting\.
TABLE I:Consolidated results on ARC\-AGI\-2\. Top: main comparison on the semi\-private evaluation set \(120 tasks\)\. Middle: ablation on the public set \(120 tasks\)\. Bottom: Pass@kk\(%\)\. All constrained methods: 4×\\timesL4, 12h, offline\.
### IV\-HLoss Functions and Training
ARCANA is trained end\-to\-end via Reasoning Trajectory Optimization \(RTO\):
ℒtotal=λ1ℒfocal\+λ2ℒVAE\+λ3ℒPG\+λ4ℒcontra\\mathcal\{L\}\_\{\\mathrm\{total\}\}=\\lambda\_\{1\}\\mathcal\{L\}\_\{\\mathrm\{focal\}\}\+\\lambda\_\{2\}\\mathcal\{L\}\_\{\\mathrm\{VAE\}\}\+\\lambda\_\{3\}\\mathcal\{L\}\_\{\\mathrm\{PG\}\}\+\\lambda\_\{4\}\\mathcal\{L\}\_\{\\mathrm\{contra\}\}\(34\)withλ1:4=\(1\.0,0\.5,0\.1,0\.3\)\\lambda\_\{1:4\}\{=\}\(1\.0,0\.5,0\.1,0\.3\)\. The four terms:
\(i\) Focal reconstruction:class\-balanced focal loss on the decoder with inverse\-sqrt frequency weightsαc=1/fc0\.5\\alpha\_\{c\}\{=\}1/f\_\{c\}^\{0\.5\}and focusingβ=2\\beta\{=\}2:
ℒfocal=−1H′W′∑i,j,cαc\(1−y^ijc\)βyijclog\(y^ijc\+ϵ\)\\mathcal\{L\}\_\{\\mathrm\{focal\}\}=\-\\tfrac\{1\}\{H^\{\\prime\}W^\{\\prime\}\}\\textstyle\\sum\_\{i,j,c\}\\alpha\_\{c\}\(1\-\\hat\{y\}\_\{ijc\}\)^\{\\beta\}\\,y\_\{ijc\}\\log\(\\hat\{y\}\_\{ijc\}\+\\epsilon\)\(35\)
\(ii\) Variational program loss:standard Gaussian\-prior ELBO with closed\-form KL,
ℒVAE=−𝔼qϕ\[logPψ\(π∗∣𝐳π,𝐑task\)\]\+βklDKL\(qϕ∥pθ\)\\mathcal\{L\}\_\{\\mathrm\{VAE\}\}=\-\\mathbb\{E\}\_\{q\_\{\\phi\}\}\[\\log P\_\{\\psi\}\(\\pi^\{\*\}\\mid\\mathbf\{z\}\_\{\\pi\},\\mathbf\{R\}\_\{\\mathrm\{task\}\}\)\]\+\\beta\_\{\\mathrm\{kl\}\}\\,D\_\{\\mathrm\{KL\}\}\(q\_\{\\phi\}\\\|p\_\{\\theta\}\)\(36\)withβkl\\beta\_\{\\mathrm\{kl\}\}linearly annealed0→10\{\\to\}1over 10K steps to avoid posterior collapse\.
\(iii\) Policy gradient:REINFORCE with learned baselineb=Vω\(𝐬0\)b=V\_\{\\omega\}\(\\mathbf\{s\}\_\{0\}\)and rewardR\(ℰ\)=Vfinal−λcTused/TmaxR\(\\mathcal\{E\}\)=V\_\{\\mathrm\{final\}\}\-\\lambda\_\{c\}\\,T\_\{\\mathrm\{used\}\}/T\_\{\\max\}:
ℒPG=−𝔼ℰ\[\(R−b\)∑t=1TusedlogP\(𝒜t∣𝐬t−1\)\]\\mathcal\{L\}\_\{\\mathrm\{PG\}\}=\-\\mathbb\{E\}\_\{\\mathcal\{E\}\}\\bigl\[\(R\{\-\}b\)\\textstyle\\sum\_\{t=1\}^\{T\_\{\\mathrm\{used\}\}\}\\log P\(\\mathcal\{A\}\_\{t\}\\mid\\mathbf\{s\}\_\{t\-1\}\)\\bigr\]\(37\)
\(iv\) Contrastive refinement:InfoNCE pulling𝐅refine\\mathbf\{F\}\_\{\\mathrm\{refine\}\}toward the latent𝐳π\+\\mathbf\{z\}\_\{\\pi^\{\+\}\}of an improving program against other candidates as negatives:
ℒcontra=−logexp\(cos\(𝐅refine,𝐳π\+\)/τc\)∑mexp\(cos\(𝐅refine,𝐳π\(m\)\)/τc\)\\mathcal\{L\}\_\{\\mathrm\{contra\}\}=\-\\log\\frac\{\\exp\(\\cos\(\\mathbf\{F\}\_\{\\mathrm\{refine\}\},\\mathbf\{z\}\_\{\\pi^\{\+\}\}\)/\\tau\_\{c\}\)\}\{\\sum\_\{m\}\\exp\(\\cos\(\\mathbf\{F\}\_\{\\mathrm\{refine\}\},\\mathbf\{z\}\_\{\\pi^\{\(m\)\}\}\)/\\tau\_\{c\}\)\}\(38\)
Training schedule\.Three phases: \(i\) pre\-train PGA\+decoder withℒfocal\\mathcal\{L\}\_\{\\mathrm\{focal\}\}\(100K steps\); \(ii\) joint HGA\+SEA withℒfocal\+ℒVAE\\mathcal\{L\}\_\{\\mathrm\{focal\}\}\{\+\}\\mathcal\{L\}\_\{\\mathrm\{VAE\}\}\(80K steps\); \(iii\) end\-to\-endℒtotal\\mathcal\{L\}\_\{\\mathrm\{total\}\}\(50K steps\)\.
## VExperiments
All experiments follow ARC Prize 2026 constraints: 4×\\timesNVIDIA L4 GPUs, 12h wall\-clock, offline\.
### V\-AEvaluation Metrics
We adopt the official ARC Prize 2026 protocol with supplementary metrics:Acc\(task solved if any ofA=2A\{=\}2candidates is pixel\-perfect\),CellAcc\(per\-cell correctness\),CNE=Acc/log2\(1\+Cavg/Chuman\)=\\mathrm\{Acc\}/\\log\_\{2\}\(1\+C\_\{\\mathrm\{avg\}\}/C\_\{\\mathrm\{human\}\}\),Pass@kk, andRER\(accuracy gained per agentic turn\)\.
### V\-BBaselines and Results
We compare ARCANA against six representative baselines covering the main ARC\-AGI\-2 paradigms: NVARC \(LongT5\+TTT\), TRM \(recursive transductive net\), CompressARC \(per\-task VAE\), SOAR \(evolutionary synthesis\), EPS\-Grok \(Grok\-4 evolutionary synthesis\), and OmniARC \(Qwen2\.5\-0\.5B\)\. The results are in Table[I](https://arxiv.org/html/2607.09059#S4.T1); the training dynamics is shown in Fig\.[4](https://arxiv.org/html/2607.09059#S5.F4)\.
Figure 4:Model indicator change chart\.With only 48M parameters, ARCANA reaches 32\.5% accuracy \(\+6\.5 over EPS\-Grok\) and the best CNE \(7\.90\) among constrained methods\. Ablations identify RRA \(−\-10\.8%\) and TTT\-LoRA \(−\-7\.5%\) as the two most critical components, and the steeper Pass@kkcurve confirms that CVAE\+DPP yields a more diverse candidate pool\.
ARCANA uses on average 3\.7 refinement turns \(up toTmax=8T\_\{\\max\}\{=\}8for hard tasks, as few as 2 for easy ones\), withVbestV\_\{\\mathrm\{best\}\}rising monotonically \(0\.42→0\.58→0\.67→0\.710\.42\{\\to\}0\.58\{\\to\}0\.67\{\\to\}0\.71\)\. Largest gains over EPS\-Grok appear on multi\-rule composition \(\+8\.8%\) and multi\-step sequential tasks \(\+8\.9%\); symbolic interpretation remains hardest for all methods\.
## VIConclusion
We presented ARCANA, a multi\-agent framework casting ARC\-AGI\-2 reasoning as a multi\-turn episode in which four specialized agents—Perceptual Grounding, Hypothesis Generation, Symbolic Execution, and Reflective Refinement—collaborate via a shared differentiable blackboard under a learned Meta\-Controller\. Under ARC Prize 2026 constraints, ARCANA attains 32\.5% on the semi\-private set \(\+6\.5 over the strongest Kaggle baseline\) at $0\.16 per task, with RRA and TTT\-LoRA together contributing over 18 points\. A substantial gap to human performance \(∼\\sim75%\) persists,
## References
- \[1\]A\. G\. ALIAS PARTH GOYAL, A\. Didolkar, N\. R\. Ke, C\. Blundell, P\. Beaudoin, N\. Heess, M\. C\. Mozer, and Y\. Bengio\(2021\)Neural production systems\.Advances in Neural Information Processing Systems34,pp\. 25673–25687\.Cited by:[§II](https://arxiv.org/html/2607.09059#S2.p1.1)\.
- \[2\]T\. Brown, B\. Mann, N\. Ryder, M\. Subbiah, J\. D\. Kaplan, P\. Dhariwal, A\. Neelakantan, P\. Shyam, G\. Sastry, A\. Askell,et al\.\(2020\)Language models are few\-shot learners\.Advances in neural information processing systems33,pp\. 1877–1901\.Cited by:[§I](https://arxiv.org/html/2607.09059#S1.p1.1)\.
- \[3\]W\. Chen, X\. Ma, X\. Wang, and W\. W\. Cohen\(2022\)Program of thoughts prompting: disentangling computation from reasoning for numerical reasoning tasks\.arXiv preprint arXiv:2211\.12588\.Cited by:[§II](https://arxiv.org/html/2607.09059#S2.p1.1)\.
- \[4\]E\. J\. Hu, Y\. Shen, P\. Wallis, Z\. Allen\-Zhu, Y\. Li, S\. Wang, L\. Wang, W\. Chen,et al\.\(2022\)Lora: low\-rank adaptation of large language models\.\.Iclr1\(2\),pp\. 3\.Cited by:[§II](https://arxiv.org/html/2607.09059#S2.p1.1)\.
- \[5\]P\. Liang, M\. Yuan, J\. Liu, J\. Yang, X\. Li, W\. Yan, and Y\. Wu\(2026\)DynaRAG: bridging static and dynamic knowledge in retrieval\-augmented generation\.In2026 9th International Symposium on Big Data and Applied Statistics \(ISBDAS\),pp\. 442–445\.Cited by:[§II](https://arxiv.org/html/2607.09059#S2.p1.1)\.
- \[6\]F\. Locatello, D\. Weissenborn, T\. Unterthiner, A\. Mahendran, G\. Heigold, J\. Uszkoreit, A\. Dosovitskiy, and T\. Kipf\(2020\)Object\-centric learning with slot attention\.Advances in neural information processing systems33,pp\. 11525–11538\.Cited by:[§II](https://arxiv.org/html/2607.09059#S2.p1.1)\.
- \[7\]A\. Madaan, N\. Tandon, P\. Gupta, S\. Hallinan, L\. Gao, S\. Wiegreffe, U\. Alon, N\. Dziri, S\. Prabhumoye, Y\. Yang,et al\.\(2023\)Self\-refine: iterative refinement with self\-feedback\.Advances in neural information processing systems36,pp\. 46534–46594\.Cited by:[§I](https://arxiv.org/html/2607.09059#S1.p1.1)\.
- \[8\]J\. Su, M\. Ahmed, Y\. Lu, S\. Pan, W\. Bo, and Y\. Liu\(2024\)Roformer: enhanced transformer with rotary position embedding\.Neurocomputing568,pp\. 127063\.Cited by:[§II](https://arxiv.org/html/2607.09059#S2.p1.1)\.
- \[9\]S\. Tang\(2025\)Two\-stage multimodal retrieval and multi\-task ranking for e\-commerce recommendation\.In2025 6th International Conference on Information Science, Parallel and Distributed Systems \(ISPDS\),pp\. 126–130\.Cited by:[§II](https://arxiv.org/html/2607.09059#S2.p1.1)\.
- \[10\]X\. Wang, J\. Wei, D\. Schuurmans, Q\. Le, E\. Chi, S\. Narang, A\. Chowdhery, and D\. Zhou\(2022\)Self\-consistency improves chain of thought reasoning in language models\.arXiv preprint arXiv:2203\.11171\.Cited by:[§II](https://arxiv.org/html/2607.09059#S2.p1.1)\.
- \[11\]J\. Wei, X\. Wang, D\. Schuurmans, M\. Bosma, F\. Xia, E\. Chi, Q\. V\. Le, D\. Zhou,et al\.\(2022\)Chain\-of\-thought prompting elicits reasoning in large language models\.Advances in neural information processing systems35,pp\. 24824–24837\.Cited by:[§I](https://arxiv.org/html/2607.09059#S1.p1.1)\.
- \[12\]Y\. Xu\(2026\)Pyramid convolution and bidirectional graph attention for cyber threat detection from unstructured text\.InProceedings of the 2026 International Conference on Artificial Intelligence and Control,pp\. 561–567\.Cited by:[§II](https://arxiv.org/html/2607.09059#S2.p1.1)\.
- \[13\]Z\. Xue, M\. Huo, and Y\. Wang\(2026\)EAGLE: edge\-aware graph learning for proactive delivery delay prediction in smart logistics networks\.arXiv preprint arXiv:2604\.05254\.Cited by:[§III](https://arxiv.org/html/2607.09059#S3.p2.1)\.
- \[14\]Z\. Xue, S\. Zhao, Y\. Qi, X\. Zeng, and Z\. Yu\(2026\)Resilient routing: risk\-aware dynamic routing in smart logistics via spatiotemporal graph learning\.arXiv preprint arXiv:2601\.13632\.Cited by:[§II](https://arxiv.org/html/2607.09059#S2.p1.1)\.
- \[15\]W\. Yan, Y\. Wu, P\. Liang, M\. Yuan, J\. Liu, J\. Yang, and X\. Li\(2026\)PRISM: pipeline for root\-cause investigation via specialized multi\-agents\.In2026 International Conference on Generative Artificial Intelligence and Information Security \(GAIIS\),pp\. 709–712\.External Links:[Document](https://dx.doi.org/10.1109/GAIIS69281.2026.11519347)Cited by:[§IV\-A](https://arxiv.org/html/2607.09059#S4.SS1.p2.4)\.
- \[16\]S\. Yao, J\. Zhao, D\. Yu, N\. Du, I\. Shafran, K\. Narasimhan, and Y\. Cao\(2022\)React: synergizing reasoning and acting in language models\.arXiv preprint arXiv:2210\.03629\.Cited by:[§II](https://arxiv.org/html/2607.09059#S2.p1.1)\.
- \[17\]Q\. Zhou\(2026\)AdaScale: predictive and utility\-aware autoscaling for serverless ai inference\.In2026 6th International Conference on Artificial Intelligence and Industrial Technology Applications \(AIITA\),pp\. 544–550\.Cited by:[§III](https://arxiv.org/html/2607.09059#S3.p2.1)\.
- \[18\]Q\. Zhou\(2026\)Roofline\-guided mixed quantization and kernel co\-optimization for efficient large language model inference on arm cpus\.In2026 3rd International Conference on Digital Image Processing and Computer Applications \(DIPCA\),pp\. 123–129\.Cited by:[§II](https://arxiv.org/html/2607.09059#S2.p1.1)\.Similar Articles
Cost-Effective Agent Harnesses for Abstract Reasoning and Generalization on ARC-AGI-1
This paper presents cost-effective agent harnesses for ARC-AGI-1 that achieve strong performance using DeepSeek V3.2 without fine-tuning, via an Explorer-Definer Pipeline and a Reflective Orchestrator, achieving 67.25% pass@2 at low cost.
Argus: A General-Purpose Agentic Runtime for Long-Horizon Reasoning
Argus is a persistent, self-evolving agentic runtime designed for long-horizon reasoning, using Manager, Planner, Engineer, and Reviewer roles with verification-gated persistence and pivoting. It demonstrates strong results across seven benchmark arenas, including ~78% on SWE-Bench Pro, while reducing token usage after runtime self-evolution.
GraphARC: A Comprehensive Benchmark for Graph-Based Abstract Reasoning
GraphARC is a new benchmark for abstract reasoning on graph-structured data, extending the ARC paradigm to graphs. Evaluations of state-of-the-art language models reveal a comprehension-execution gap and performance degradation on larger instances, highlighting scaling challenges.
Do Coding Agents Need Executable World Models, Simplification, and Verification to Solve ARC-AGI-3?
This paper investigates whether coding agents require executable world models, simplification, and verification to solve the ARC-AGI-3 benchmark, contributing to research on AGI and reasoning.
Adaptive Latent Agentic Reasoning
This paper introduces Adaptive Latent Agentic Reasoning (ALAR), a dual-mode framework for LLM agents that uses compact latent reasoning for routine turns and selectively escalates to explicit chain-of-thought for harder decisions, achieving up to 84.6% token reduction while maintaining task accuracy.