Enriching a Model's Notion of Belief using a Persistent Memory

Nora Kassner, Oyvind Tafjord, Hinrich Schütze, Peter ClarkarXiv 2021

Abstract

Although pretrained language models (PTLMs) have been shown to contain significant amounts of world knowledge, they can still produce inconsistent answers to questions when probed, even after using specialized training techniques to reduce inconsistency. As a result, it can be hard to identify what the model actually "believes" about the world. Our goal is to reduce this problem, so systems are more globally consistent and accurate in their answers. Our approach is to add a memory component -- a BeliefBank -- that records a model's answers, and two mechanisms that use it to improve consistency among beliefs. First, a reasoning component -- a weighted SAT solver -- improves consistency by flipping answers that significantly clash with others. Second, a feedback component re-queries the model but using known beliefs as context. We show that, in a controlled experimental setting, these two mechanisms improve both accuracy and consistency. This is significant as it is a first step towards endowing models with an evolving memory, allowing them to construct a more coherent picture of the world.

Introduction

Pre-trained language models (PTLMs) like GPT-3 or T5 possess vast world knowledge but often exhibit logical inconsistencies. A model might correctly identify a "swallow" as a "bird" while simultaneously claiming it has "gills." This lack of a global world model stems from the local nature of next-token prediction. This paper introduces BeliefBank, a persistent memory layer and reasoning framework designed to improve the logical coherence and accuracy of PTLMs without requiring expensive retraining.

System Architecture and Methods

The proposed architecture augments a standard PTLM with three core components, as illustrated in Figure 1:

The BeliefBank system architecture, showing the flow from a query (Q) to a consistent answer (A) via a persistent memory and constraint solver.
  1. The BeliefBank: A persistent memory that stores the model's answers as triples: (sentence, truth value, confidence score).
  2. Constraint Reasoning: The system utilizes a set of logical constraints (e.g., "If X is a bird, then X has wings"). A weighted SAT solver (Z3) evaluates the BeliefBank to identify and "flip" beliefs that violate these rules, minimizing total constraint violations while respecting the model's original confidence scores.
  3. Feedback Loop: When a new question is posed, the system retrieves relevant prior beliefs from the BeliefBank and provides them as context. For example, prepending "Swallows are not fish" before asking "Does a swallow have gills?" helps the model maintain consistency with its existing knowledge.

Experimental Setup

The approach was evaluated using a controlled benchmark consisting of:

  • Constraints: 12,147 logical constraints (positive implications and mutual exclusivities) sourced from ConceptNet and WordNet.
  • Facts: 4,998 facts covering 27 entities (animals and plants), with truth values propagated through a constraint graph.

Key Results

The system was tested on the MAQAw model (a T5 derivative). As shown in the results table below, the integration of constraint solving and feedback significantly enhanced performance across all metrics.

Performance results showing Accuracy (F1) and Consistency (Con) across different data percentages and model configurations.
  • Accuracy: The raw model's F1 score of 73.25 improved to 91.90 with the constraint solver.
  • Consistency: Consistency rose from 74.68% to 99.83% with the solver, effectively eliminating logical contradictions within the provided constraint set.
  • Synergy: The combination of feedback and constraint solving achieved the highest overall F1 score of 93.40 at 100% data exposure.

Discussion and Limitations

The BeliefBank framework demonstrates that a reasoning layer can effectively prune "false positive" beliefs—logical outliers that the raw model might otherwise accept. However, several challenges remain for broader application:

  • Domain Constraints: The current study focuses on simple sentences and predefined constraints. Real-world knowledge is more linguistically complex and nuanced.
  • Constraint Discovery: Future systems must autonomously mine constraints from raw text rather than relying on structured databases.
  • Scalability: Managing a SAT solver over millions of facts in a massive BeliefBank requires significant computational optimization to remain performant.

Despite these hurdles, this work represents a vital step toward endowing models with an evolving, coherent memory of the world.

Summary updated

BibTeX
@misc{kassner2021enriching,
  author = {Nora Kassner and Oyvind Tafjord and Hinrich Schütze and Peter Clark},
  title = {{Enriching a Model's Notion of Belief using a Persistent Memory}},
  year = {2021},
  eprint = {2104.08401},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2104.08401},
}
Figure