Logically Consistent Language Models via Neuro-Symbolic Integration

Diego Calanzone, Stefano Teso, Antonio Vergari
9/9/2024
cs.CLcs.AIcs.LG

No official code found. Best implementation: ddidacus/loco-llm (11 stars, last commit 2025-03-11).

Abstract

Large language models (LLMs) are a promising venue for natural language understanding and generation. However, current LLMs are far from reliable: they are prone to generating non-factual information and, more crucially, to contradicting themselves when prompted to reason about relations between entities of the world. These problems are currently addressed with large scale fine-tuning or by delegating reasoning to external tools. In this work, we strive for a middle ground and introduce a loss based on neuro-symbolic reasoning that teaches an LLM to be logically consistent with an external set of facts and rules and improves self-consistency even when the LLM is fine-tuned on a limited set of facts. Our approach also allows to easily combine multiple logical constraints at once in a principled way, delivering LLMs that are more consistent w.r.t. all constraints and improve over several baselines w.r.t. a given constraint. Moreover, our method allows LLMs to extrapolate to unseen but semantically similar factual knowledge, represented in unseen datasets, more systematically.

View on arXivView PDF

Code Implementations(1)

ddidacus/loco-llmCommunity55%

Official repository for "Logically Consistent Language Models via Neuro-Symbolic Integration", accepted at ICLR 2025.

112Shell, PythonFeb 28, 20251 years ago

Similar Papers

Cite this paper

@article{calanzone2024logically,
  title  = {Logically Consistent Language Models via Neuro-Symbolic Integration},
  author = {Diego Calanzone and Stefano Teso and Antonio Vergari},
  year   = {2024},
  eprint = {2409.13724},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2409.13724v1},
  journal = {ICLR 2024 2024}
}

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/2409.13724.svg)](https://codeofpaper.com/paper/2409.13724)

Discussion