A Neural-Symbolic Approach to Natural Language Understanding

Zhixuan Liu, Zihao Wang, Yuan Lin, Hang Li

Abstract

Deep neural networks, empowered by pre-trained language models, have achieved remarkable results in natural language understanding (NLU) tasks. However, their performances can drastically deteriorate when logical reasoning is needed. This is because NLU in principle depends on not only analogical reasoning, which deep neural networks are good at, but also logical reasoning. According to the dual-process theory, analogical reasoning and logical reasoning are respectively carried out by System 1 and System 2 in the human brain. Inspired by the theory, we present a novel framework for NLU called Neural-Symbolic Processor (NSP), which performs analogical reasoning based on neural processing and logical reasoning based on both neural and symbolic processing. As a case study, we conduct experiments on two NLU tasks, question answering (QA) and natural language inference (NLI), when numerical reasoning (a type of logical reasoning) is necessary. The experimental results show that our method significantly outperforms state-of-the-art methods in both tasks.

Introduction

While Large Language Models (LLMs) like BERT and RoBERTa excel at "analogical reasoning"—the ability to identify patterns and extract information from text—they frequently struggle with tasks requiring explicit logic or arithmetic. For instance, in a reading comprehension task, a model might correctly identify two numerical values in a passage but fail to calculate the difference between them. This limitation stems from a fundamental architectural mismatch: current NLU models attempt to solve logical problems using pattern-matching mechanisms.

Drawing from the dual-process theory of human cognition, we distinguish between two systems: System 1 (Intuition), which is fast and pattern-based, and System 2 (Logic), which is slow and rule-governed. We propose the Neural-Symbolic Processor (NSP), a hybrid architecture designed to integrate these two modes of thought, allowing each to handle the reasoning types for which they are best suited.

The Neural-Symbolic Processor (NSP) Framework

The NSP framework consists of four primary components that work in tandem to process natural language through both neural and symbolic lenses:

  1. The Encoder: Utilizing a standard Transformer architecture (such as RoBERTa or BART), the encoder transforms input text into high-dimensional embeddings.
  2. Analogical Reasoning Path (System 1): This path consists of neural "Predictors" that perform traditional NLU tasks, such as span extraction (locating an answer within the text) or classification.
  3. Logical Reasoning Path (System 2): To handle complex logic, a neural decoder translates the text embeddings into a symbolic Program (e.g., diff(N1, N2)). A symbolic Executor then runs this program to produce a deterministic result.
  4. Mixture-of-Experts (MoE) Gating: A gating network analyzes the input text to decide which path—the neural predictor or the symbolic executor—is most likely to yield the correct answer.

The model is trained in a two-phase process. First, the neural components are trained to predict answers and generate programs simultaneously. Second, the gating network is trained to identify the linguistic cues that signal whether a question requires simple extraction or complex calculation.

Experimental Setup

We evaluated the NSP framework on two primary datasets requiring numerical reasoning:

  • DROP (Discrete Reasoning Over Paragraphs): A question-answering dataset where we utilized a subset of approximately 32,000 instances. We manually annotated these instances with symbolic programs to facilitate System 2 training.
  • AWPNLI: A Natural Language Inference dataset focused on numerical reasoning. All 722 instances were annotated with symbolic programs.

These program annotations have been released to the research community to support further development in neural-symbolic NLU.

Results and Discussion

NSP demonstrated significant performance improvements over state-of-the-art baselines, including QDGAT and NA-RoBERTa.

  • DROP Performance: NSP achieved an 84.01 F1 score, outperforming the best neural baseline by 2.4 points.
  • Numerical Dominance: In categories requiring multiplication, division, or averaging—areas where pure neural models typically fail—NSP improved F1 scores by 56.42%.
  • AWPNLI Accuracy: NSP reached 92.24% accuracy, a substantial increase over the 49.85% achieved by standard RoBERTa/BART models and the 71.5% achieved by rule-based systems.

Ablation studies confirmed a clear division of labor: neural predictors are superior for extracting names or dates (span-type answers), while the symbolic path is essential for calculations. The gating network proved highly effective at identifying when to switch between these modes based on the raw text input.

Conclusion and Future Work

The Neural-Symbolic Processor successfully bridges the gap between neural intuition and symbolic logic. However, challenges remain regarding the annotation bottleneck, as the system currently relies on human-annotated programs. Furthermore, the current Domain-Specific Language (DSL) is limited in its ability to handle highly nested multi-step reasoning or complex conditional logic. Future research will focus on expanding the DSL and developing methods for generating symbolic programs with less human supervision.

Summary updated

BibTeX
@inproceedings{liu2022neural,
  author = {Zhixuan Liu and Zihao Wang and Yuan Lin and Hang Li},
  title = {{A Neural-Symbolic Approach to Natural Language Understanding}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2022},
  url = {https://openreview.net/forum?id=FEZys68BAB},
}
Figure