Symbolic Working Memory Enhances Language Models for Complex Rule Application

Siyuan Wang, Zhongyu Wei, Yejin Choi, Xiang Ren

Abstract

While Large Language Models (LLMs) demonstrate impressive capabilities in single-step logic, their performance often degrades significantly during complex, multi-step reasoning tasks. This paper introduces WM-Neurosymbolic, a framework that augments LLMs with an external symbolic working memory. By offloading the "search and match" process (rule grounding) to a symbolic system and utilizing the LLM primarily for rule implementation, the framework achieves substantial performance gains on difficult logic benchmarks, including the Law School Admission Test (LSAT). Our findings suggest that the primary bottleneck in LLM reasoning is not logical inference itself, but rather the bookkeeping required to track facts and rules across multiple steps.

Introduction

Modern LLMs frequently encounter a "reasoning cliff": as the number of steps required to solve a problem increases, the probability of a successful outcome drops precipitously. This failure is often attributed to the model's inability to maintain a consistent state of knowledge or to correctly identify which rules apply to which facts in a crowded context. To address this, we propose a neurosymbolic approach that separates the task of rule grounding from the task of rule application.

The Problem: Rule Grounding and Bookkeeping

The authors identify rule grounding as a specific bottleneck in auto-regressive models. In a complex problem, an LLM must navigate a collection of facts and a list of rules to determine the correct next step. Because LLMs process text sequentially, they are susceptible to distractions, such as irrelevant facts or rules presented out of order. This often leads to "broken links" in the chain of thought, where a single hallucination or missed connection invalidates the entire reasoning process. Essentially, LLMs are proficient at logic but struggle with the administrative "bookkeeping" required for long-form reasoning.

The WM-Neurosymbolic Framework

The proposed framework addresses these limitations by providing the LLM with an external Symbolic Working Memory. The system operates through a structured, iterative loop:

  1. Memory Schema: The system maintains a unified vocabulary of predicates (e.g., father_of) and objects (e.g., Alice). This standardization prevents the model from being confused by linguistic variations of the same concept.
  2. Symbolic Formulation: Facts and rules are stored in both natural language and symbolic formats (such as Prolog-style logic). This dual representation allows for both human-readable interaction and deterministic processing.
  3. The Iterative Loop:
    • Symbolic Rule Grounding: Instead of relying on the LLM to find the next applicable rule, the system uses deterministic code to match variables and predicates. This offloads the "needle-in-a-haystack" search from the model.
  4. LLM-based Rule Implementation: Once a specific rule and its supporting facts are identified, the LLM is tasked with deriving the new conclusion. This leverages the LLM's strength in single-step inference.
  5. Write-Back: The resulting conclusion is converted back into symbols and updated in the working memory, ensuring the state remains current for the next iteration.

Experimental Evaluation

The researchers evaluated the WM-Neurosymbolic framework across four diverse reasoning benchmarks:

  • CLUTRR: Kinship reasoning tasks requiring the derivation of relationships (e.g., determining a grandfather based on a series of parent-child links).
  • ProofWriter: Logical implications involving "open-world" reasoning scenarios.
  • AR-LSAT: Analytical reasoning tasks from the Law School Admission Test, which involve complex constraint-satisfaction puzzles.
  • Boxes: A state-tracking task where items are moved between containers, testing the model's ability to maintain an accurate "current state" over time.

Key Results and Insights

The framework demonstrated significant improvements over standard Chain-of-Thought (CoT) prompting, particularly on high-complexity tasks:

  • LSAT Performance: On the AR-LSAT benchmark using GPT-4, the standard "Scratchpad" method achieved only 41.25% accuracy. The WM-Neurosymbolic framework increased this to 70.00%.
  • State Tracking: In the Boxes task, the framework achieved a perfect 100% accuracy with GPT-4, compared to 91.85% for standard CoT.
  • Robustness to Noise: Unlike standard LLMs, which see performance drops when rules are shuffled or irrelevant "distractor" rules are added, the WM-Neurosymbolic framework remained almost entirely unaffected.
  • Model Agnosticism: The benefits extended to smaller models; for example, Llama-3-8B saw its CLUTRR performance jump from 52.77% to 63.40%.

Discussion

The core insight of this work is the distinction between inference and grounding. By using a symbolic system to handle the bookkeeping, the LLM is freed to focus on linguistic rule application. Furthermore, because the working memory acts as a non-ordered database, the system is immune to the "lost in the middle" and recency bias issues that plague standard long-context prompting.

Limitations

Despite its success, the framework has limitations. It is sensitive to the initial parsing of facts into symbols; if the LLM fails to correctly translate the starting premises into the symbolic schema, the subsequent reasoning chain will be flawed. Additionally, the iterative nature of the framework requires multiple LLM calls, which increases computational cost and latency compared to single-shot prompting.

Conclusion

WM-Neurosymbolic provides a robust path forward for enhancing the reasoning capabilities of LLMs. By integrating the precision of symbolic logic with the linguistic flexibility of neural models, we can overcome the inherent bookkeeping limitations of auto-regressive architectures, paving the way for more reliable automated reasoning in complex domains.

Summary updated

BibTeX
@inproceedings{wang2024symbolic,
  author = {Siyuan Wang and Zhongyu Wei and Yejin Choi and Xiang Ren},
  title = {{Symbolic Working Memory Enhances Language Models for Complex Rule Application}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.emnlp-main.974},
}
Figure