Lune

NeurIPS2025Top-tier venue

Teaching Transformers to Solve Combinatorial Problems through Efficient Trial & Error

Panagiotis Giannoulis, Yorgos Pantis, Christos Tzamos

Abstract

Despite their proficiency in various language tasks, Large Language Models (LLMs) struggle with combinatorial problems like Satisfiability, Traveling Salesman Problem, or even basic arithmetic. We address this gap through a novel trial & error approach for solving problems in the class NP, where candidate solutions are iteratively generated and efficiently validated using verifiers. We focus on the paradigmatic task of Sudoku and achieve state-of-the-art accuracy (99%) compared to prior neuro-symbolic approaches. Unlike prior work that used custom architectures, our method employs a vanilla decoder-only Transformer (GPT-2) without external tools or function calling. Our method integrates imitation learning of simple Sudoku rules with an explicit Depth-First Search (DFS) exploration strategy involving informed guessing and backtracking. Moving beyond imitation learning, we seek to minimize the number of guesses until reaching a solution. This is achieved using depth-1 guessing, showing empirically that almost all Sudoku can be solved using the puzzle's rules with at most one guess. We provide a rigorous analysis of this setup formalizing its connection to a contextual variant of Min-Sum Set Cover, a well-studied problem in algorithms and stochastic optimization.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

2 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Tree of Thoughts: Deliberate Problem Solving with Large Language Models cites Self-Refine: Iterative Refinement with Self-Feedback
  • Tree of Thoughts: Deliberate Problem Solving with Large Language Models cites Language Models are Few-Shot Learners
  • HONet: Data-Efficient Learning for Exact Cover Tasks via Hypergraph Optimization cites Faith and Fate: Limits of Transformers on Compositionality
  • The Expressive Power of Low Precision Softmax Transformers with (Summarized) Chain-of-Thought cites Language Models are Few-Shot Learners
  • Graph of Thoughts: Solving Elaborate Problems with Large Language Models cites Tree of Thoughts: Deliberate Problem Solving with Large Language Models
  • Graph of Thoughts: Solving Elaborate Problems with Large Language Models cites Language Models are Few-Shot Learners
  • Faith and Fate: Limits of Transformers on Compositionality cites Self-Refine: Iterative Refinement with Self-Feedback
  • Faith and Fate: Limits of Transformers on Compositionality cites Language Models are Few-Shot Learners
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers2

  1. HONet: Data-Efficient Learning for Exact Cover Tasks via Hypergraph OptimizationPengyang Huang, Zirui Zhuang, Haifeng Sun, Qi Qi et al.ICML 2026
  2. The Expressive Power of Low Precision Softmax Transformers with (Summarized) Chain-of-ThoughtMoritz Brösamle, Stephan EcksteinICML 2026

Builds on27

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. Tree of Thoughts: Deliberate Problem Solving with Large Language ModelsShunyu Yao, Dian Yu, Jeffrey Zhao, Izhak Shafran et al.NeurIPS 2023 · 5,068 citations
  3. Self-Refine: Iterative Refinement with Self-FeedbackAman Madaan, Niket Tandon, Prakhar Gupta, Skyler Hallinan et al.NeurIPS 2023 · 4,972 citations
  4. Graph of Thoughts: Solving Elaborate Problems with Large Language ModelsMaciej Besta, Nils Blach, Ales Kubicek, Robert Gerstenberger et al.AAAI 2024 · 1,292 citations
  5. Faith and Fate: Limits of Transformers on CompositionalityNouha Dziri, Ximing Lu, Melanie Sclar, Xiang Lorraine Li et al.NeurIPS 2023 · 728 citations

Related papers

  1. Causal language modeling can elicit search and reasoning capabilities on logic puzzlesKulin Shah, Nishanth Dikkala, Xin Wang, Rina PanigrahyNeurIPS 2024 · 44 citations
  2. Assessing SATNet's Ability to Solve the Symbol Grounding ProblemOscar Chang, Lampros Flokas, Hod Lipson, Michael SprangerNeurIPS 2020 · 25 citations
  3. Techniques for Symbol Grounding with SATNetSever Topan, David Rolnick, Xujie SiNeurIPS 2021 · 32 citations
  4. TrustTable: A Neuro-Symbolic Auditing Framework for Faithful Table QAGuangzhen Zhao, Dechang Kong, Tongyu Wu, Zhenjiang DongACL 2026
  5. Explaining Puzzle Solutions in Natural Language: An Exploratory Study on 6x6 SudokuAnirudh Maiya, Razan Alghamdi, Maria Leonor Pacheco, Ashutosh Trivedi et al.ACL Findings 2025 · 3 citations
Dusk over the sea between two cliffs drawn in fine vertical lines