KNARsack: Teaching Neural Algorithmic Reasoners to Solve Pseudo-Polynomial Problems

📅 2025-09-17
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work pioneers the application of neural algorithmic reasoning to the pseudo-polynomial-time 0–1 knapsack problem—a canonical dynamic programming task previously absent from existing benchmarks. We propose a two-stage supervised framework: the first stage supervises the row-wise construction of the dynamic programming table; the second stage supervises optimal solution reconstruction from the completed table. By explicitly modeling and supervising intermediate states, our approach enhances both model interpretability and generalization. Experiments demonstrate that our method significantly outperforms end-to-end prediction baselines on large-scale knapsack instances, achieving marked improvements in zero-shot generalization across problem sizes and weight/capacity distributions. This work establishes a new paradigm for extending neural algorithmic reasoning to broader classes of combinatorial optimization problems and provides empirical validation for its efficacy on pseudo-polynomial dynamic programming tasks.

Technology Category

Application Category

📝 Abstract
Neural algorithmic reasoning (NAR) is a growing field that aims to embed algorithmic logic into neural networks by imitating classical algorithms. In this extended abstract, we detail our attempt to build a neural algorithmic reasoner that can solve Knapsack, a pseudo-polynomial problem bridging classical algorithms and combinatorial optimisation, but omitted in standard NAR benchmarks. Our neural algorithmic reasoner is designed to closely follow the two-phase pipeline for the Knapsack problem, which involves first constructing the dynamic programming table and then reconstructing the solution from it. The approach, which models intermediate states through dynamic programming supervision, achieves better generalization to larger problem instances than a direct-prediction baseline that attempts to select the optimal subset only from the problem inputs.
Problem

Research questions and friction points this paper is trying to address.

Solving Knapsack as pseudo-polynomial algorithmic reasoning problem
Bridging classical algorithms with neural combinatorial optimization
Improving generalization through dynamic programming supervision approach
Innovation

Methods, ideas, or system contributions that make the work stand out.

Dynamic programming supervision for intermediate states
Two-phase pipeline mimicking classical algorithms
Generalization to larger problem instances
🔎 Similar Papers
No similar papers found.