mlsanityData to 14 Oct 2026

Teaching Transformers to Solve Combinatorial Problems through Efficient Trial & Error

arXiv 2509.22023 ↗First posted 26 Sep 2025cs.LGcited by 3

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

  1. 2017Attention Is All You Needcited by 60,361
  2. 2020Language Models are Few-Shot Learnerscited by 32,419
  3. 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,305
  4. 2023GPT-4 Technical Reportcited by 18,396
  5. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
  6. 2022Self-Consistency Improves Chain of Thought Reasoning in Language Modelscited by 5,708
  7. 2021Measuring Mathematical Problem Solving With the MATH Datasetcited by 5,371
  8. 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,442
  9. 2023Tree of Thoughts: Deliberate Problem Solving with Large Language Modelscited by 3,211
  10. 2022Least-to-Most Prompting Enables Complex Reasoning in Large Language Modelscited by 1,407
  11. 2022Program of Thoughts Prompting: Disentangling Computation from Reasoning for Numerical Reasoning Taskscited by 1,076
  12. 2021Show Your Work: Scratchpads for Intermediate Computation with Language Modelscited by 886
38 more
  1. 2023Graph of Thoughts: Solving Elaborate Problems with Large Language Modelscited by 886
  2. 2022Decomposed Prompting: A Modular Approach for Solving Complex Taskscited by 558
  3. 2023Faith and Fate: Limits of Transformers on Compositionalitycited by 503
  4. 2022Emergent World Representations: Exploring a Sequence Model Trained on a Synthetic Taskcited by 431
  5. 2022PlanBench: An Extensible Benchmark for Evaluating Large Language Models on Planning and Reasoning about Changecited by 382
  6. 2017A simple neural network module for relational reasoningcited by 346
  7. 2023Emergent Linear Representations in World Models of Self-Supervised Sequence Modelscited by 319
  8. 2022Transformers Learn Shortcuts to Automatacited by 268
  9. 2025Train for the Worst, Plan for the Best: Understanding Token Ordering in Masked Diffusionscited by 214
  10. 2019SATNet: Bridging deep learning and logical reasoning using a differentiable satisfiability solvercited by 173
  11. 2024Beyond Autoregression: Discrete Diffusion for Complex Reasoning and Planningcited by 135
  12. 2023Teaching Arithmetic to Small Transformerscited by 123
  13. 2024Physics of Language Models: Part 2.1, Grade-School Math and the Hidden Reasoning Processcited by 108
  14. 2023Physics of Language Models: Part 1, Learning Hierarchical Language Structurescited by 83
  15. 2017Recurrent Relational Networkscited by 72
  16. 2022A-NeSI: A Scalable Approximate Method for Probabilistic Neurosymbolic Inferencecited by 50
  17. 2024Physics of Language Models: Part 2.2, How to Learn From Mistakes on Grade-School Math Problemscited by 50
  18. 2024Causal Language Modeling Can Elicit Search and Reasoning Capabilities on Logic Puzzlescited by 38
  19. 2022NeuPSL: Neural Probabilistic Soft Logiccited by 34
  20. 2021Techniques for Symbol Grounding with SATNetcited by 24
  21. 2019Generalizing Complex Hypotheses on Product Distributions: Auctions, Prophet Inequalities, and Pandora's Problemcited by 22
  22. 2023Learning to Solve Constraint Satisfaction Problems with Recurrent Transformercited by 21
  23. 2025Spatial Reasoning with Denoising Modelscited by 16
  24. 2022Bandit Algorithms for Prophet Inequality and Pandora's Boxcited by 13
  25. 2017The Price of Information in Combinatorial Optimizationcited by 12
  26. 2020Pandora's Box Problem with Order Constraintscited by 12
  27. 2022Online Learning for Min Sum Set Cover and Pandora's Boxcited by 11
  28. 2019Pandora's Box with Correlations: Learning and Approximationcited by 10
  29. 2023Assessing SATNet's Ability to Solve the Symbol Grounding Problemcited by 10
  30. 2019Pandora's Problem with Nonobligatory Inspectioncited by 9
  31. 2019The Markovian Price of Informationcited by 8
  32. 2019Online Pandora's Boxes and Banditscited by 7
  33. 2023Weitzman's Rule for Pandora's Box with Correlationscited by 7
  34. 2022Pandora's Problem with Nonobligatory Inspection: Optimal Structure and a PTAScited by 6
  35. 2021Competitive Information Design for Pandora's Boxcited by 5
  36. 2022Contextual Pandora's Boxcited by 5
  37. 2022Pandora Box Problem with Nonobligatory Inspection: Hardness and Approximation Schemecited by 5
  38. 2021Approximating Pandora's Box with Correlationscited by 4

50 most cited of 59 All 59 (JSON)

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 3.

3 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2026Transformers Linearly Represent Highly Structured World Models
  2. 2025Liquid Reasoning Transformers: A Sudoku-Based Prototype for Chess-Scale Algorithmic Tasks
  3. 2026MaxSAT-Based Feedback for Guiding Vision-Language Models in Sudoku
  4. 2026DiBS: Diffusion-Informed Branch Selection
  5. 2026Not Too Hard, Not Too Easy: Learning from Intermediate States for LLM Structured Reasoning
  6. 2025Sudoku-Bench: Evaluating creative reasoning with Sudoku variants
  7. 2026AdaC-GRPO: Towards Mastering Long-Horizon Visual Sudoku Puzzles via Adaptive Curriculum Learning
  8. 2026Search, Fail, Recover: A Training Framework for Correction-Aware Reasoning