Papers › Causal Language Modeling Can Elicit Search and Reasoning Capabilities on Logic Puzzles

Causal Language Modeling Can Elicit Search and Reasoning Capabilities on Logic Puzzles

16 Sep 2024arXiv:2409.10502archive 2025-07-28

Kulin Shah, Nishanth Dikkala, Xin Wang, Rina Panigrahy

Causal language modeling using the Transformer architecture has yielded remarkable capabilities in Large Language Models (LLMs) over the last few years. However, the extent to which fundamental search and reasoning capabilities emerged within LLMs remains a topic of ongoing debate. In this work, we study if causal language modeling can learn a complex task such as solving Sudoku puzzles. To solve a Sudoku, the model is first required to search over all empty cells of the puzzle to decide on a cell to fill and then apply an appropriate strategy to fill the decided cell. Sometimes, the application of a strategy only results in thinning down the possible values in a cell rather than concluding the exact value of the cell. In such cases, multiple strategies are applied one after the other to fill a single cell. We observe that Transformer models trained on this synthetic task can indeed learn to solve Sudokus (our model solves 94.21% of the puzzles fully correctly) when trained on a logical sequence of steps taken by a solver. We find that training Transformers with the logical sequence of steps is necessary and without such training, they fail to learn Sudoku. We also extend our analysis to Zebra puzzles (known as Einstein puzzles) and show that the model solves 92.04 % of the puzzles fully correctly. In addition, we study the internal representations of the trained Transformer and find that through linear probing, we can decode information about the set of possible values in any given cell from them, pointing to the presence of a strong reasoning engine implicit in the Transformer weights.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2409.10502")

Code

Syntology Ran 5 of 11 code samples harvested from 1 repository linked to this paper; 6 have no recorded run. Of those that ran: 5 ran with no contract checked.

By repository: official repository: 11 samples from 1 repository, 5 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

11 samples harvested; 5 ran; 0 honoured the contract we drafted; 6 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

5ran
6unverified

Licence: 0 of the 11 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from kulinshah98/llm-reasoning-logic-puzzles. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

create_dataset kulinshah98/llm-reasoning-logic-puzzles/zebra-code/train/data.py official repository ran Apache-2.0 (permissive) · 5bf07d2ee6a39c55 · report
get_pred_logits kulinshah98/llm-reasoning-logic-puzzles/zebra-code/train/evaluater.py official repository ran Apache-2.0 (permissive) · 983da1fb4db946b2 · report
log_hyperparams_tb kulinshah98/llm-reasoning-logic-puzzles/sudoku-code/train/train_and_evaluate.py official repository ran Apache-2.0 (permissive) · c22983473f7ce496 · report
train_one_step kulinshah98/llm-reasoning-logic-puzzles/zebra-code/train/trainer.py official repository ran Apache-2.0 (permissive) · 594c91edb211f85b · report
valid_solution kulinshah98/llm-reasoning-logic-puzzles/sudoku-code/train/evaluater.py official repository ran fingerprinted Apache-2.0 (permissive) · 4b832a8d608fda5a · report
create_dataset kulinshah98/llm-reasoning-logic-puzzles/sudoku-code/train/data.py official repository unverified Apache-2.0 (permissive) · e87fe7038ae1f4de · report
create_iter kulinshah98/llm-reasoning-logic-puzzles/sudoku-code/train/data.py official repository unverified Apache-2.0 (permissive) · 2eec2cf59b50fbda · report
create_iter kulinshah98/llm-reasoning-logic-puzzles/zebra-code/train/data.py official repository unverified Apache-2.0 (permissive) · fb8dcfc1a0e1a5ea · report
get_beam_search_candidates kulinshah98/llm-reasoning-logic-puzzles/zebra-code/train/evaluater.py official repository unverified Apache-2.0 (permissive) · a2f2069bde94109f · report
get_eval_metrics kulinshah98/llm-reasoning-logic-puzzles/sudoku-code/train/evaluater.py official repository unverified Apache-2.0 (permissive) · 0e85806b890a5909 · report
prepare_tf_data kulinshah98/llm-reasoning-logic-puzzles/sudoku-code/train/data.py official repository unverified Apache-2.0 (permissive) · 9fd07dc9fd853492 · report

Tasks

Language ModelingLanguage ModellingLogical Sequence

1 archive task tag without a task page not shown.

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Absolute Position EncodingsAdamAttentionBPEDense ConnectionsDropoutLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSETSoftmaxTransformer

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections