Teaching Transformers to Solve Combinatorial Problems through Efficient Trial & Error
On the map: Offline RL and imitation learning from data → Imitation learning methods
Abstract (arXiv)
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.
Key facts. Cited by 3 papers in the map (data through 14 Oct 2026). Placed in Imitation learning methods, one of 13 directions in Offline RL and imitation learning from data. Builds on 59 of its 90 references that are in the map. First posted on arXiv 26 Sep 2025.
Builds on
59 of 90 references.
References · 59
- 2017Attention Is All You Needcited by 60,361
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,305
- 2023GPT-4 Technical Reportcited by 18,396
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
- 2022Self-Consistency Improves Chain of Thought Reasoning in Language Modelscited by 5,708
- 2021Measuring Mathematical Problem Solving With the MATH Datasetcited by 5,371
- 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,442
- 2023Tree of Thoughts: Deliberate Problem Solving with Large Language Modelscited by 3,211
- 2022Least-to-Most Prompting Enables Complex Reasoning in Large Language Modelscited by 1,407
- 2022Program of Thoughts Prompting: Disentangling Computation from Reasoning for Numerical Reasoning Taskscited by 1,076
- 2021Show Your Work: Scratchpads for Intermediate Computation with Language Modelscited by 886
38 more
- 2023Graph of Thoughts: Solving Elaborate Problems with Large Language Modelscited by 886
- 2022Decomposed Prompting: A Modular Approach for Solving Complex Taskscited by 558
- 2023Faith and Fate: Limits of Transformers on Compositionalitycited by 503
- 2022Emergent World Representations: Exploring a Sequence Model Trained on a Synthetic Taskcited by 431
- 2022PlanBench: An Extensible Benchmark for Evaluating Large Language Models on Planning and Reasoning about Changecited by 382
- 2017A simple neural network module for relational reasoningcited by 346
- 2023Emergent Linear Representations in World Models of Self-Supervised Sequence Modelscited by 319
- 2022Transformers Learn Shortcuts to Automatacited by 268
- 2025Train for the Worst, Plan for the Best: Understanding Token Ordering in Masked Diffusionscited by 214
- 2019SATNet: Bridging deep learning and logical reasoning using a differentiable satisfiability solvercited by 173
- 2024Beyond Autoregression: Discrete Diffusion for Complex Reasoning and Planningcited by 135
- 2023Teaching Arithmetic to Small Transformerscited by 123
- 2024Physics of Language Models: Part 2.1, Grade-School Math and the Hidden Reasoning Processcited by 108
- 2023Physics of Language Models: Part 1, Learning Hierarchical Language Structurescited by 83
- 2017Recurrent Relational Networkscited by 72
- 2022A-NeSI: A Scalable Approximate Method for Probabilistic Neurosymbolic Inferencecited by 50
- 2024Physics of Language Models: Part 2.2, How to Learn From Mistakes on Grade-School Math Problemscited by 50
- 2024Causal Language Modeling Can Elicit Search and Reasoning Capabilities on Logic Puzzlescited by 38
- 2022NeuPSL: Neural Probabilistic Soft Logiccited by 34
- 2021Techniques for Symbol Grounding with SATNetcited by 24
- 2019Generalizing Complex Hypotheses on Product Distributions: Auctions, Prophet Inequalities, and Pandora's Problemcited by 22
- 2023Learning to Solve Constraint Satisfaction Problems with Recurrent Transformercited by 21
- 2025Spatial Reasoning with Denoising Modelscited by 16
- 2022Bandit Algorithms for Prophet Inequality and Pandora's Boxcited by 13
- 2017The Price of Information in Combinatorial Optimizationcited by 12
- 2020Pandora's Box Problem with Order Constraintscited by 12
- 2022Online Learning for Min Sum Set Cover and Pandora's Boxcited by 11
- 2019Pandora's Box with Correlations: Learning and Approximationcited by 10
- 2023Assessing SATNet's Ability to Solve the Symbol Grounding Problemcited by 10
- 2019Pandora's Problem with Nonobligatory Inspectioncited by 9
- 2019The Markovian Price of Informationcited by 8
- 2019Online Pandora's Boxes and Banditscited by 7
- 2023Weitzman's Rule for Pandora's Box with Correlationscited by 7
- 2022Pandora's Problem with Nonobligatory Inspection: Optimal Structure and a PTAScited by 6
- 2021Competitive Information Design for Pandora's Boxcited by 5
- 2022Contextual Pandora's Boxcited by 5
- 2022Pandora Box Problem with Nonobligatory Inspection: Hardness and Approximation Schemecited by 5
- 2021Approximating Pandora's Box with Correlationscited by 4
50 most cited of 59 All 59 (JSON)
Built on by
Citing papers per year: 2026: 3.
3 papers.
- 2026Self-Aware Markov Models for Discrete Reasoningcited by 1
- 2026G-RRM: Guiding Symbolic Solvers with Recurrent Reasoning Modelscited by 0
- 2026Knowledge transfer between simple discrete worldscited by 0
- 2026Knowledge transfer between simple discrete worlds10 Oct 2026
- 2026G-RRM: Guiding Symbolic Solvers with Recurrent Reasoning Models2 Jul 2026
- 2026Self-Aware Markov Models for Discrete Reasoning17 Mar 2026
Similar, not cited
Close in wording, no citation either way
- 2026Transformers Linearly Represent Highly Structured World Models
- 2025Liquid Reasoning Transformers: A Sudoku-Based Prototype for Chess-Scale Algorithmic Tasks
- 2026MaxSAT-Based Feedback for Guiding Vision-Language Models in Sudoku
- 2026DiBS: Diffusion-Informed Branch Selection
- 2026Not Too Hard, Not Too Easy: Learning from Intermediate States for LLM Structured Reasoning
- 2025Sudoku-Bench: Evaluating creative reasoning with Sudoku variants
- 2026AdaC-GRPO: Towards Mastering Long-Horizon Visual Sudoku Puzzles via Adaptive Curriculum Learning
- 2026Search, Fail, Recover: A Training Framework for Correction-Aware Reasoning