Improving Rule-based Reasoning in LLMs using Neurosymbolic Representations

Varun Dhanraj, Chris Eliasmith
1/31/2025
cs.LGcs.AI

Official code: vdhanraj/Neurosymbolic-LLM (16 stars, GPL-3.0, last commit 2026-02-02).

Abstract

Large language models (LLMs) continue to face challenges in reliably solving reasoning tasks, particularly those that require precise rule following, as often found in mathematical reasoning. This paper introduces a novel neurosymbolic method that improves LLM reasoning by encoding hidden states into neurosymbolic vectors, enabling problem-solving within a neurosymbolic vector space. The results are decoded and merged with the original hidden state, significantly boosting the model's performance on numerical reasoning tasks. By offloading computation through neurosymbolic representations, this method enhances efficiency, reliability, and interpretability. Experimental results demonstrate an average of 88.6% lower cross-entropy loss and 15.4 times more problems correctly solved on a suite of mathematical reasoning tasks compared to chain-of-thought prompting and supervised fine-tuning (LoRA), without degrading performance on other tasks. We make our code available at: https://github.com/vdhanraj/Neurosymbolic-LLM.

View on arXivView PDF

Code Implementations(1)

GPL-3.0

Integrating neurosymbolic representations into LLMs for interpretability, steering, and running symbolic algorithms

164Python, Jupyter NotebookMar 24, 20258 months agoGPL-3.0

Similar Papers

Cite this paper

@article{dhanraj2025improving,
  title  = {Improving Rule-based Reasoning in LLMs using Neurosymbolic Representations},
  author = {Varun Dhanraj and Chris Eliasmith},
  year   = {2025},
  eprint = {2502.01657},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2502.01657v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2502.01657.svg)](https://codeofpaper.com/paper/2502.01657)

Discussion