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

Xinyi Wang, Alfonso Amayuelas, Kexun Zhang, Liangming Pan, Wenhu Chen +1 more
2/5/2024
cs.LGcs.AIcs.CL

Official code: WANGXinyiLinda/LM_random_walk (21 stars, MIT, last commit 2024-02-29).

Abstract

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

View on arXivView PDF

Code Implementations(1)

MIT

Official code for paper Understanding the Reasoning Ability of Language Models From the Perspective of Reasoning Paths Aggregation

212Shell, PythonFeb 29, 20242 years agoMIT

Similar Papers

Cite this paper

@article{wang2024understanding,
  title  = {Understanding Reasoning Ability of Language Models From the Perspective of Reasoning Paths Aggregation},
  author = {Xinyi Wang and Alfonso Amayuelas and Kexun Zhang and Liangming Pan and Wenhu Chen and William Yang Wang},
  year   = {2024},
  eprint = {2402.03268},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2402.03268v3},
  journal = {ICML 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2402.03268.svg)](https://codeofpaper.com/paper/2402.03268)

Discussion