Neural Algorithmic Reasoning (NAR) aims to optimize classical algorithms. However, canonical implementations of NAR train neural networks to return only a single solution, even when there are multiple correct solutions to a problem, such as single-source shortest paths. For some applications, it is desirable to recover more than one correct solution. To that end, we give the first method for NAR with multiple solutions. We demonstrate our method on two classical algorithms: Bellman-Ford (BF) and Depth-First Search (DFS), favouring deeper insight into two algorithms over a broader survey of algorithms. This method involves generating appropriate training data as well as sampling and validating solutions from model output. Each step of our method, which can serve as a framework for neural algorithmic reasoning beyond the tasks presented in this paper, might be of independent interest to the field and our results represent the first attempt at this task in the NAR literature.
翻译:神经算法推理(NAR)旨在优化经典算法。然而,即使问题存在多个正确解(例如单源最短路径问题),NAR的典型实现方式也仅训练神经网络返回单一解。对于某些应用场景,期望能获取不止一个正确解。为此,我们提出了首个支持多重解的NAR方法。我们以两种经典算法——贝尔曼-福特算法(BF)和深度优先搜索(DFS)——验证该方法,旨在通过对这两种算法的深入剖析替代广泛的算法普查。该方法涉及生成合适的训练数据、从模型输出中采样并验证解。本方法的每个步骤均可作为超越本文所述任务的神经算法推理框架,其各环节可能对该领域具有独立研究价值,我们的成果代表了NAR文献中对此类任务的首次尝试。