Table of Contents
Fetching ...

Neural Algorithmic Reasoning with Multiple Correct Solutions

Zeno Kujawa, John Poole, Dobrik Georgiev, Danilo Numeroso, Henry Fleischmann, Pietro Liò

TL;DR

The paper tackles the limitation of Neural Algorithmic Reasoning (NAR) by enabling multiple correct solutions rather than a single output, focusing on graph algorithms like Bellman-Ford and DFS. It introduces a framework that (i) randomizes canonical algorithms to produce solution distributions, (ii) trains neural networks to predict these distributions, and (iii) samples from the predicted distributions to extract multiple valid solutions, accompanied by validity and diversity evaluations. The main contributions are a distribution-based training method, stochastic extraction techniques, and metrics for diversity, illustrating feasible multiple-solution recovery for BF within the studied graph sizes, while DFS remains substantially more challenging. This work lays groundwork for more flexible NAR deployments in cyber-physical systems and offers a framework that can extend to other CLRS benchmarks, potentially aiding explainability and robustness in neural reasoning about algorithms.

Abstract

Neural Algorithmic Reasoning (NAR) extends classical algorithms to higher dimensional data. 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.

Neural Algorithmic Reasoning with Multiple Correct Solutions

TL;DR

The paper tackles the limitation of Neural Algorithmic Reasoning (NAR) by enabling multiple correct solutions rather than a single output, focusing on graph algorithms like Bellman-Ford and DFS. It introduces a framework that (i) randomizes canonical algorithms to produce solution distributions, (ii) trains neural networks to predict these distributions, and (iii) samples from the predicted distributions to extract multiple valid solutions, accompanied by validity and diversity evaluations. The main contributions are a distribution-based training method, stochastic extraction techniques, and metrics for diversity, illustrating feasible multiple-solution recovery for BF within the studied graph sizes, while DFS remains substantially more challenging. This work lays groundwork for more flexible NAR deployments in cyber-physical systems and offers a framework that can extend to other CLRS benchmarks, potentially aiding explainability and robustness in neural reasoning about algorithms.

Abstract

Neural Algorithmic Reasoning (NAR) extends classical algorithms to higher dimensional data. 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.
Paper Structure (37 sections, 1 theorem, 2 equations, 16 figures, 11 tables, 5 algorithms)

This paper contains 37 sections, 1 theorem, 2 equations, 16 figures, 11 tables, 5 algorithms.

Key Result

Theorem A.1

Algorithm Alg:Henry accepts if and only if a forest $F$ is the output of some run of randomised DFS with ordered restarts (RDFSO) on $G$.

Figures (16)

  • Figure 1: Blueprint for NAR with multiple correct solutions. For Step 2 see Figure \ref{['fig:parent-dist']}. For Step 4 see Figure \ref{['fig:extract-solutions']} and Appendices \ref{['sec: Appendix: Randomness in Sampling (DFS)']}\ref{['sec: Appendix: Randomness in Sampling (BF)']}. Best viewed on a screen.
  • Figure 2: Parent Tree encoding of a single DFS solution. The start node, 0, is its own parent, represented by the value 0 at index 0. The value 2 at index 1 indicates that vertex 2 is the parent of vertex 1. Similarly, the value 0 at index 2 indicates that vertex 0 is the parent of vertex 2.
  • Figure 3: Parent Probability Distribution encoding of multiple DFS solutions. The value 0.5 in row $1$ column $2$ indicates that vertex 2 is a parent of vertex 1 in 50% of correct parent trees. We call the parent probabilities obtained by repeatedly running an algorithm the true parent distribution$\mathcal{P}$. The model outputs, which we aim to be as close as possible to $\mathcal{P}$, are denoted as $\Tilde{\mathcal{P}}$.
  • Figure 4: DFS tree extraction from a parent probability matrix: $\Tilde{\mathcal{P}}$ or $\mathcal{P}$. The parent tree [0,2,2] is incorrect because there is no solution in which 2 is its own parent. [0,0,0] is incorrect, despite there being solutions in which 0 is the parent of each vertex, because there is no solution in which 0 is the parent of every vertex: if 0 is the parent of 1, 1 must be the parent of 2. Best viewed on a screen.
  • Figure 5: A graph with multiple correct DFS solutions. Graph edges are drawn in black. The red tree would be the result if vertices were explored in alphabetical order, while the blue tree is one of multiple other posible valid DFS trees. Note also how the DFS-tree is encoded as a predecessor array (with the entry at position $i$ is the predecessor of the $i^{th}$ vertex in alphabetical order, which we henceforth call $\pi$.
  • ...and 11 more figures

Theorems & Definitions (1)

  • Theorem A.1