SymbolicAI: A framework for logic-based approaches combining generative models and solvers

Marius-Constantin Dinu, Claudiu Leoveanu-Condrei, Markus Holzleitner, Werner Zellinger, Sepp Hochreiter

Introduction

Modern artificial intelligence faces a fundamental dichotomy between the "fuzzy" generative capabilities of Large Language Models (LLMs) and the "rigid" precision of symbolic logic. While LLMs excel at natural language understanding and creative generation, they are prone to logical hallucinations and struggle with structured tool interaction. Conversely, classical symbolic AI provides formal guarantees but lacks the flexibility to handle unstructured data.

The authors characterize this challenge through the "Neuro-Symbolic (NeSy) Spectrum," which spans from pure differentiable programming (neural networks) to classical software engineering.

The Neuro-Symbolic AI Spectrum illustrates the gap between traditional software engineering and modern machine learning.

SymbolicAI is introduced as a modular framework designed to bridge this gap. It treats LLMs as semantic parsers capable of orchestrating external solvers and executing formal code, thereby enabling explainable, multi-step computational workflows.

Methods: Bridging Language and Logic

SymbolicAI is implemented as a Python library that operationalizes language as the "connective tissue" for complex logic. The framework relies on several core architectural pillars:

  • Symbols and Expressions: Data is encapsulated in a Symbol class, while Expression objects define interaction logic.
  • LLMs as Semantic Parsers: The framework utilizes LLMs to translate natural language instructions into structured calls for specialized solvers, such as WolframAlpha for mathematics or Z3 for formal logic.
  • Polymorphic Operations: Standard Python operators are overloaded to perform semantic tasks. For instance, adding two Symbol objects might trigger a semantic merge or a database query join depending on the context.
  • Computational Graphs: By chaining operations, the system constructs a graph where each node represents a discrete state in a reasoning process.
The SymbolicAI pipeline: An expression is converted into a Domain Specific Language (DSL) prompt, processed by the Neuro-Symbolic Engine with verification, and resolved into a symbol.

The VERTEX Score

To evaluate these complex workflows, the authors propose the Vector Embedding for Relational Trajectory Evaluation through Cross-similarity (VERTEX) score. Unlike traditional metrics like BLEU, which focus on surface-level word overlap, VERTEX uses vector embeddings to compare the "distributional path" of a model’s reasoning trajectory against a gold-standard reference, providing a more robust measure of logical correctness.

Benchmark and Evaluation

The framework was tested against a new benchmark covering five key capabilities: associative prediction, multi-modal binding (e.g., OCR or web scraping), program synthesis, logical components (puzzles), and hierarchical computational graphs (complex orchestration).

Key Results

  • Model Performance: GPT-4 Turbo led the field with a total VERTEX score of 0.68, showing superior orchestration skills.
  • The Open-Source Gap: While models like LLaMA 3 70B are competent in basic tasks, a significant performance gap remains in complex multi-step reasoning compared to proprietary models.
  • The Logic Hurdle: Logic remains a difficult domain; even GPT-4 scored only 0.48 in the "Logic" category, often attempting to bypass rigorous formal steps.
  • Efficiency of Smaller Models: Mistral 7B and Zephyr 7B demonstrated impressive performance in functional logic, occasionally rivaling much larger architectures.

Discussion and Future Work

The authors hypothesize that language serves as a central processing module that coordinates cognitive functions like memory and reasoning. SymbolicAI mimics this by using LLMs as "orchestrators" for specialized sub-modules.

However, limitations remain. The framework is constrained by LLM context windows and the quality of the embedding models used for VERTEX scoring. Future directions include moving toward non-sequential planning, where autonomous agents can dynamically generate and modify their own execution plans.

Summary updated

BibTeX
@inproceedings{dinu2024symbolicai,
  author = {Marius-Constantin Dinu and Claudiu Leoveanu-Condrei and Markus Holzleitner and Werner Zellinger and Sepp Hochreiter},
  title = {{SymbolicAI: A framework for logic-based approaches combining generative models and solvers}},
  booktitle = {CoLLAs},
  year = {2024},
  url = {https://openreview.net/forum?id=WQnpdzzKEc},
}
Figure