Abstract
Neural Algorithmic Reasoning (NAR) aims to enable neural networks to execute discrete algorithms with strong out-of-distribution (OOD) generalization. Traditionally, achieving high performance required "hint" supervision—providing the model with every intermediate step of an algorithm's execution trajectory. This paper demonstrates that such labor-intensive supervision is not only unnecessary but can be suboptimal. By introducing architectural alignments that preserve computational graph structure and a novel contrastive self-supervised objective based on algorithmic equivalence, the authors develop "no-hint" models that outperform state-of-the-art supervised counterparts. Notably, their approach achieves a 98.7% F1 score on sorting tasks while generalizing to problem sizes significantly larger than those seen during training.
Introduction
The primary challenge in NAR is Out-of-Distribution (OOD) generalization: training a model on small instances (e.g., size 16) and ensuring it functions correctly on much larger ones (e.g., size 64 or 1024). Historically, the most successful models relied on "hints"—step-by-step intermediate states of the algorithm. However, hints require manual design, may impose suboptimal sequential constraints on neural architectures that favor parallelism, and can lead to a "dependency gap" where models fail to link intermediate steps to the final output. This work investigates whether competitive OOD generalization can be achieved using only final input-output pairs.
Methodology
The authors propose two key innovations to enable effective learning without intermediate supervision.
Computational Graph Alignment
Standard hint-based models feed intermediate predictions back into the processor. In contrast, typical "no-hint" models often omit this feedback loop. The authors found that maintaining an "encoded-decoded" feedback loop—even without supervising the intermediate values—is critical. By passing a latent state back into the processor, the model's computational graph remains robust and aligned with the iterative nature of algorithms.
Self-supervised Contrastive Regularization
To provide a strong inductive bias without explicit hints, the authors utilize algorithmic equivalence. For many tasks, different inputs are structurally identical; for example, in comparison-based sorting, arrays with the same relative ordering should follow the same execution path. A contrastive loss term ($L_t$) is introduced to force the model to produce similar latent representations for inputs within the same equivalence class, encouraging the network to focus on underlying structure rather than raw values.
Results
The models were evaluated on the CLRS Algorithmic Reasoning Benchmark, training on instances of size 4 to 16 and testing on size 64 to evaluate OOD performance.
The results significantly challenge the necessity of intermediate supervision. On the sorting task, the contrastive "no-hint" model achieved an F1 score of 98.7%, surpassing the previous state-of-the-art of 95.2%. Furthermore, the "no-hint" models often reached the correct final answer in fewer execution steps than their hint-supervised counterparts, avoiding the "hint trap" where models struggle to connect intermediate sequences to the final output.
Discussion and Conclusion
This research demonstrates that "no-hint" models can naturally gravitate toward efficient parallel processing when not constrained by human-designed sequential trajectories. By replacing explicit step-by-step instructions with high-level logical constraints (invariance), the researchers achieved superior performance and efficiency. While defining equivalence classes for complex graph problems remains a challenge, this work paves the way for more scalable and flexible neural algorithmic reasoners that do not require exhaustive manual supervision.
Summary updated