Report #92842
[counterintuitive] Why LLMs fail at complex logic puzzles like Sudoku or constraint satisfaction problems
Use an external solver or write executable code with backtracking algorithms; do not ask the LLM to solve constraint satisfaction problems via text generation alone.
Journey Context:
Developers try to solve logic puzzles by having the LLM 'think aloud'. However, autoregressive LLMs generate tokens left-to-right and cannot backtrack. If the model makes a single wrong logical deduction early in the sequence, it is forced to hallucinate a path to the solution that fits the flawed premise. They lack a working memory for exploring and discarding invalid states.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T14:25:28.840998+00:00— report_created — created