Improved Logical Reasoning of Language Models via Differentiable Symbolic Programming

Hanlin Zhang, Jiani Huang, Ziyang Li, Mayur Naik, Eric Xing
5/5/2023
cs.AIcs.CLcs.LG

No official code found. Best implementation: moqingyan/dsr-lm (13 stars, last commit 2023-07-08).

Abstract

Pre-trained large language models (LMs) struggle to perform logical reasoning reliably despite advances in scale and compositionality. In this work, we tackle this challenge through the lens of symbolic programming. We propose DSR-LM, a Differentiable Symbolic Reasoning framework where pre-trained LMs govern the perception of factual knowledge, and a symbolic module performs deductive reasoning. In contrast to works that rely on hand-crafted logic rules, our differentiable symbolic reasoning framework efficiently learns weighted rules and applies semantic loss to further improve LMs. DSR-LM is scalable, interpretable, and allows easy integration of prior knowledge, thereby supporting extensive symbolic programming to robustly derive a logical conclusion. The results of our experiments suggest that DSR-LM improves the logical reasoning abilities of pre-trained language models, resulting in a significant increase in accuracy of over 20% on deductive reasoning benchmarks. Furthermore, DSR-LM outperforms a variety of competitive baselines when faced with systematic changes in sequence length.

View on arXivView PDF

Code Implementations(1)

moqingyan/dsr-lmCommunity100%
133PythonMay 11, 20233 years ago

Cite this paper

@article{zhang2023improved,
  title  = {Improved Logical Reasoning of Language Models via Differentiable Symbolic Programming},
  author = {Hanlin Zhang and Jiani Huang and Ziyang Li and Mayur Naik and Eric Xing},
  year   = {2023},
  eprint = {2305.03742},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2305.03742v1}
}

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/2305.03742.svg)](https://codeofpaper.com/paper/2305.03742)

Discussion