Current large language models (LLMs) are far from reliable: they are prone to generate non-factual information and, more crucially, to contradict themselves when prompted to reason about relations between real entities of the world. These problems are currently addressed with large scale fine-tuning or by delegating consistent reasoning to external tools. In this work, we strive for a middle ground and leverage a training objective based on a principled neuro-symbolic loss that teaches a LLM to be consistent with external knowledge in the form of a set of facts and rules. Fine-tuning with such a loss on a limited set of facts enables our LLMs to be more logically consistent than previous baselines for a given constraint. 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 the selected rules. Moreover, our method allows LLMs to extrapolate to unseen but semantically similar factual knowledge, represented in unseen datasets, more systematically.

Logically Consistent Language Models via Neuro-Symbolic Integration / Calanzone, Diego; Teso, Stefano; Vergari, Antonio. - (2025). ( ICLR 2025 Singapore 24-28 April 2025).

Logically Consistent Language Models via Neuro-Symbolic Integration

Teso, Stefano;Vergari, Antonio
2025-01-01

Abstract

Current large language models (LLMs) are far from reliable: they are prone to generate non-factual information and, more crucially, to contradict themselves when prompted to reason about relations between real entities of the world. These problems are currently addressed with large scale fine-tuning or by delegating consistent reasoning to external tools. In this work, we strive for a middle ground and leverage a training objective based on a principled neuro-symbolic loss that teaches a LLM to be consistent with external knowledge in the form of a set of facts and rules. Fine-tuning with such a loss on a limited set of facts enables our LLMs to be more logically consistent than previous baselines for a given constraint. 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 the selected rules. Moreover, our method allows LLMs to extrapolate to unseen but semantically similar factual knowledge, represented in unseen datasets, more systematically.
2025
Proceedings of ICLR 2025
Online
Curran Associates, Inc.
Calanzone, Diego; Teso, Stefano; Vergari, Antonio
Logically Consistent Language Models via Neuro-Symbolic Integration / Calanzone, Diego; Teso, Stefano; Vergari, Antonio. - (2025). ( ICLR 2025 Singapore 24-28 April 2025).
File in questo prodotto:
File Dimensione Formato  
reno54_semantic_large_language_models (1).pdf

accesso aperto

Descrizione: manuscript
Tipologia: Versione editoriale (Publisher’s layout)
Licenza: Creative commons
Dimensione 401.2 kB
Formato Adobe PDF
401.2 kB Adobe PDF Visualizza/Apri

I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/11572/453012
Citazioni
  • ???jsp.display-item.citation.pmc??? ND
  • Scopus ND
  • ???jsp.display-item.citation.isi??? ND
  • OpenAlex ND
social impact