Symbolic Working Memory Enhances Language Models for Complex Rule Application

Siyuan Wang, Zhongyu Wei, Yejin Choi, Xiang Ren
8/24/2024
cs.CL

Official code: SiyuanWangw/RuleApplication (11 stars, last commit 2024-08-27).

Abstract

Large Language Models (LLMs) have shown remarkable reasoning performance but struggle with multi-step deductive reasoning involving a series of rule application steps, especially when rules are presented non-sequentially. Our preliminary analysis shows that while LLMs excel in single-step rule application, their performance drops significantly in multi-step scenarios due to the challenge in rule grounding. It requires anchoring the applicable rule and supporting facts at each step, amidst multiple input rules, facts, and inferred facts. To address this, we propose augmenting LLMs with external working memory and introduce a neurosymbolic framework for rule application. The memory stores facts and rules in both natural language and symbolic forms, enabling precise tracking. Utilizing this memory, our framework iteratively performs symbolic rule grounding and LLM-based rule implementation. The former matches predicates and variables of symbolic rules and facts to ground applicable rules at each step. Experiments indicate our framework's effectiveness in rule application and its robustness across various steps and settings~\footnote{Code and data are available at \url{https://github.com/SiyuanWangw/RuleApplication}.}.

View on arXivView PDF

Code Implementations(1)

111Shell, PythonJun 24, 20242 years ago

Similar Papers

Cite this paper

@article{wang2024symbolic,
  title  = {Symbolic Working Memory Enhances Language Models for Complex Rule Application},
  author = {Siyuan Wang and Zhongyu Wei and Yejin Choi and Xiang Ren},
  year   = {2024},
  eprint = {2408.13654},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2408.13654v1}
}

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

Discussion