Investigating Symbolic Capabilities of Large Language Models

Neisarg Dave, Daniel Kifer, C. Lee Giles, Ankur Arjun Mali

Abstract

While Large Language Models (LLMs) demonstrate remarkable proficiency in natural language processing, their ability to perform pure symbolic reasoning remains a subject of intense debate. This paper investigates whether LLMs truly learn algorithmic rules or if they rely on the memorization of "knowledge tuples." By evaluating a range of enterprise and open-source models across tasks of varying computational complexity—mapped to the Chomsky Hierarchy—we demonstrate that LLM performance collapses as symbolic complexity increases. Our findings suggest that current architectures are fundamentally limited in their ability to generalize algorithmic logic beyond their training data.

Introduction

In recent years, LLMs have been increasingly marketed as general-purpose "reasoning engines." However, most benchmarks used to support this claim focus on language-heavy word problems where linguistic context can provide shortcuts to a solution. To isolate the core reasoning capabilities of these models, this study focuses on symbolic manipulation: the rule-based processing required for mathematics and formal logic.

To provide a rigorous framework for this investigation, we utilize the Chomsky Hierarchy, which categorizes languages based on the computational power required to process them. Tasks range from those solvable by simple Finite State Automata to those requiring the complexity of Turing Machines. By testing LLMs on tasks mapped to this hierarchy, we aim to determine if these models are simulating the necessary mental machinery for logic or simply performing sophisticated pattern matching on previously seen data.

Methodology

Models Evaluated

The study evaluated eight prominent LLMs, categorized into two groups:

  • Enterprise Models: GPT-4, GPT-3.5, Gemini Pro, and Claude 3 Haiku.
  • Open-Source Models: Llama 2 (13B) and three math-specialized variants (Llemma 7B, Deepseek 7B, and MetaMath 7B).

Evaluation Framework

Five tasks were designed to test varying levels of computational requirements:

  1. Sum of Sequence: Adding a list of numbers (Context-Free / Pushdown Automata).
  2. Modulo-10 Arithmetic: Solving complex expressions containing brackets (Context-Free).
  3. Decimal Arithmetic: Testing numerical precision and floating-point handling.
  4. Multiplication: Multi-digit multiplication (Context-Sensitive / Linearly Bounded Automata).
  5. Symbolic Counting: Counting character frequency within a string.

To allow models to navigate these solutions autonomously without external assistance (such as Python interpreters), the researchers employed Zero-shot Chain of Thought (CoT) prompting, using the instruction "Let’s think step by step."

Data and Scaling

Custom datasets were generated to control for difficulty, scaling tasks by input length (e.g., adding 5 numbers versus 500) or precision (1 to 6 decimal places). Each difficulty level consisted of 100 samples. Additionally, a subset of 300 samples per sequence length was used to fine-tune GPT-3.5 to test if specialized training could overcome generalization gaps.

The "Knowledge Tuple" Hypothesis

A central contribution of this research is the Knowledge Tuple Hypothesis. The authors argue that LLMs do not learn the underlying "automaton" (the algorithm) for a task. Instead, they store information as "tuples"—fixed input-output pairs. For example, a model may correctly identify that $12 \times 12 = 144$ because that specific pair appears frequently in its training corpus. However, it lacks the internal algorithmic logic to solve $12345 \times 67890$, a pair it has likely never encountered.

This hypothesis is supported by the Parameter Efficiency Gap. Theoretically, a very small state machine can solve addition for any arbitrary length of numbers. In contrast, LLM performance correlates heavily with parameter count. This suggests that LLMs require massive memory to store millions of individual tuples rather than a single, efficient algorithm.

Key Results and Analysis

The Complexity Wall

Performance across all models did not degrade gracefully; instead, it typically hit a "wall." Once the number of symbols or the complexity of the operation exceeded a specific threshold, accuracy plummeted to near zero. This suggests a hard limit on the models' ability to maintain state or apply rules over long sequences.

Model Comparisons

  • Enterprise vs. Open Source: Enterprise models significantly outperformed open-source counterparts. This is likely a result of higher parameter counts and superior data curation, which allows for a larger library of stored knowledge tuples.
  • Multiplication Failure: Multiplication proved to be the most significant challenge. Even GPT-4’s accuracy reached near 0% as the number of digits in the operands increased.
  • Gemini’s Resilience: Gemini Pro demonstrated notable endurance in the "Sum of Sequence" task, maintaining accuracy for longer sequences than GPT-4, though it eventually succumbed to the same degradation at higher complexities.
  • Math Pre-training: While models like Deepseek and MetaMath outperformed the base Llama 2 model, they still failed to sustain performance as symbolic complexity scaled, indicating that math-specific pre-training expands the tuple library but does not necessarily instill algorithmic reasoning.

Generalization and Fine-tuning

Fine-tuning GPT-3.5 on specific sequence lengths improved its performance on those specific lengths but failed to generalize to longer sequences. This reinforces the conclusion that the model was simply learning more specific patterns (new tuples) rather than the underlying logic of the task.

Conclusion and Future Directions

The current Transformer architecture appears fundamentally limited in its capacity for intrinsic symbolic reasoning. While LLMs are powerful tools for language-based tasks, their reliance on memorized patterns makes them unreliable for complex, rule-based symbolic manipulation.

Future research should explore architectural adjustments that move beyond the standard Transformer, perhaps by integrating external memory structures (such as stacks or tapes) or developing neuro-symbolic hybrids. Such advancements are necessary if we are to move LLMs beyond sophisticated memorization and toward true algorithmic execution.

Summary updated

BibTeX
@inproceedings{dave2024investigating,
  author = {Neisarg Dave and Daniel Kifer and C. Lee Giles and Ankur Arjun Mali},
  title = {{Investigating Symbolic Capabilities of Large Language Models}},
  booktitle = {LNSAI @ IJCAI},
  year = {2024},
}
Figure