Papers › Understanding Reasoning Ability of Language Models From the Perspective of Reasoning...

Understanding Reasoning Ability of Language Models From the Perspective of Reasoning Paths Aggregation

5 Feb 2024arXiv:2402.03268archive 2025-07-28

Xinyi Wang, Alfonso Amayuelas, Kexun Zhang, Liangming Pan, Wenhu Chen, William Yang Wang

Pre-trained language models (LMs) are able to perform complex reasoning without explicit fine-tuning. To understand how pre-training with a next-token prediction objective contributes to the emergence of such reasoning capability, we propose that we can view an LM as deriving new conclusions by aggregating indirect reasoning paths seen at pre-training time. We found this perspective effective in two important cases of reasoning: logic reasoning with knowledge graphs (KGs) and chain-of-thought (CoT) reasoning. More specifically, we formalize the reasoning paths as random walk paths on the knowledge/reasoning graphs. Analyses of learned LM distributions suggest that a weighted sum of relevant random walk path probabilities is a reasonable way to explain how LMs reason. Experiments and analysis on multiple KG and CoT datasets reveal the effect of training on random walk paths and suggest that augmenting unlabeled random walk reasoning paths can improve real-world multi-step reasoning performance. code: https://github.com/WANGXinyiLinda/LM_random_walk

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="2402.03268")

Code

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

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

wangxinyilinda/lm_random_walk officialmentioned in papermentioned on GitHubpytorchMIT report

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

10 samples harvested; 6 ran; 0 honoured the contract we drafted; 4 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.

6ran
4unverified

Licence: 0 of the 10 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 wangxinyilinda/lm_random_walk. “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.

KL wangxinyilinda/lm_random_walk/kg_reasoning/analysis.py official repository ran fingerprinted MIT (permissive) · bd677ad1a63e9ad4 · report
aggragate wangxinyilinda/lm_random_walk/kg_reasoning/analysis.py official repository ran MIT (permissive) · 0b845d4db5d929b1 · report
eval_with_timeout wangxinyilinda/lm_random_walk/cot_reasoning/calculator.py official repository ran fingerprinted MIT (permissive) · 25d344d4b993934e · report
make_random_walk_data_module wangxinyilinda/lm_random_walk/cot_reasoning/load_data/random_walk_dataset.py official repository ran MIT (permissive) · 7965884ea488bbf9 · report
model_name_mapping wangxinyilinda/lm_random_walk/cot_reasoning/model/utils.py official repository ran fingerprinted MIT (permissive) · 47f22a2c40d83dba · report
parse_outputs wangxinyilinda/lm_random_walk/kg_reasoning/analysis.py official repository ran MIT (permissive) · 9c493833053fbfe2 · report
make_sparse_mask wangxinyilinda/lm_random_walk/cot_reasoning/model/generation_utils.py official repository unverified MIT (permissive) · d6fb9c5bed407a12 · report
safe_str wangxinyilinda/lm_random_walk/cot_reasoning/model/my_trainer.py official repository unverified MIT (permissive) · f7c8ecc9fe3dc748 · report
sample wangxinyilinda/lm_random_walk/cot_reasoning/calculator.py official repository unverified MIT (permissive) · 9fffb425547e2bb7 · report
use_calculator wangxinyilinda/lm_random_walk/cot_reasoning/calculator.py official repository unverified MIT (permissive) · aa8243de687a96f5 · report

Tasks

Knowledge GraphsMath

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

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