Lune

NeurIPS2023Top-tier venue

A Pseudo-Semantic Loss for Autoregressive Models with Logical Constraints

Kareem Ahmed, Kai-Wei Chang, Guy Van den Broeck

Abstract

Neuro-symbolic AI bridges the gap between purely symbolic and neural approaches to learning. This often requires maximizing the likelihood of a symbolic constraint w.r.t the neural network's output distribution. Such output distributions are typically assumed to be fully-factorized. This limits the applicability of neuro-symbolic learning to the more expressive autoregressive distributions, e.g., transformers. Under such distributions, computing the likelihood of even simple constraints is #P-hard. Instead of attempting to enforce the constraint on the entire output distribution, we propose to do so on a random, local approximation thereof. More precisely, we optimize the likelihood of the constraint under a pseudolikelihood-based approximation centered around a model sample. Our approximation is factorized, allowing the reuse of solutions to sub-problems, a main tenet for efficiently computing neuro-symbolic losses. Moreover, it is a local, high-fidelity approximation of the likelihood, exhibiting low entropy and KL-divergence around the model sample. We evaluate our approach on Sudoku and shortest-path prediction cast as autoregressive generation, and observe that we greatly improve upon the base model's ability to predict logically-consistent outputs. We also evaluate on the task of detoxifying large language models. Using a simple constraint disallowing a list of toxic words, we are able to steer the model's outputs away from toxic generations, achieving SoTA detoxification compared to previous approaches.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

8 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Adaptable Logical Control for Large Language Models cites RealToxicityPrompts: Evaluating Neural Toxic Degeneration in Language Models
  • Logically Consistent Language Models via Neuro-Symbolic Integration cites Differentiation of Blackbox Combinatorial Solvers
  • Logically Consistent Language Models via Neuro-Symbolic Integration cites Semantic Probabilistic Layers for Neuro-Symbolic Learning
  • Logically Consistent Language Models via Neuro-Symbolic Integration cites Coherent Hierarchical Multi-Label Classification Networks
  • Logically Consistent Language Models via Neuro-Symbolic Integration cites On the Independence Assumption in Neurosymbolic Learning
  • Semantic Probabilistic Layers for Neuro-Symbolic Learning cites Differentiation of Blackbox Combinatorial Solvers
  • Semantic Probabilistic Layers for Neuro-Symbolic Learning cites Coherent Hierarchical Multi-Label Classification Networks
  • Semantic Probabilistic Layers for Neuro-Symbolic Learning cites Einsum Networks: Fast and Scalable Learning of Tractable Probabilistic Circuits
  • On the Independence Assumption in Neurosymbolic Learning cites Semantic Probabilistic Layers for Neuro-Symbolic Learning
  • Neurosymbolic Diffusion Models cites Differentiation of Blackbox Combinatorial Solvers
  • Neurosymbolic Diffusion Models cites Adaptable Logical Control for Large Language Models
  • Neurosymbolic Diffusion Models cites Logically Consistent Language Models via Neuro-Symbolic Integration
  • Neurosymbolic Diffusion Models cites Semantic Probabilistic Layers for Neuro-Symbolic Learning
  • Neurosymbolic Diffusion Models cites On the Independence Assumption in Neurosymbolic Learning
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers8

  1. Adaptable Logical Control for Large Language ModelsHonghua Zhang, Po-Nien Kung, Masahiro Yoshida, Guy Van den Broeck et al.NeurIPS 2024 · 42 citations
  2. On the Independence Assumption in Neurosymbolic LearningEmile van Krieken, Pasquale Minervini, Edoardo M. Ponti, Antonio VergariICML 2024 · 18 citations
  3. Neurosymbolic Diffusion ModelsEmile van Krieken, Pasquale Minervini, Edoardo Maria Ponti, Antonio VergariNeurIPS 2025 · 12 citations
  4. Compositional Neural Network Verification via Assume-Guarantee ReasoningHai Duong, David Shriver, ThanhVu Nguyen, Matthew DwyerNeurIPS 2025 · 10 citations
  5. Logically Consistent Language Models via Neuro-Symbolic IntegrationDiego Calanzone, Stefano Teso, Antonio VergariICLR 2025 · 2 citations

Builds on10

  1. RealToxicityPrompts: Evaluating Neural Toxic Degeneration in Language ModelsSamuel Gehman, Suchin Gururangan, Maarten Sap, Yejin Choi et al.EMNLP Findings 2020 · 692 citations
  2. Differentiation of Blackbox Combinatorial SolversMarin Vlastelica Pogancic, Anselm Paulus, Vít Musil, Georg Martius et al.ICLR 2020 · 341 citations
  3. Einsum Networks: Fast and Scalable Learning of Tractable Probabilistic CircuitsRobert Peharz, Steven Lang, Antonio Vergari, Karl Stelzner et al.ICML 2020 · 155 citations
  4. Coherent Hierarchical Multi-Label Classification NetworksEleonora Giunchiglia, Thomas LukasiewiczNeurIPS 2020 · 142 citations
  5. Semantic Probabilistic Layers for Neuro-Symbolic LearningKareem Ahmed, Stefano Teso, Kai-Wei Chang, Guy Van den Broeck et al.NeurIPS 2022 · 133 citations

Related papers

  1. Controllable Generation via Locally Constrained ResamplingKareem Ahmed, Kai-Wei Chang, Guy Van den BroeckICLR 2025
  2. Constraints-Guided Diffusion Reasoner for Neuro-Symbolic LearningXuan Zhang, Zhijian Zhou, Weidi Xu, Yanting Miao et al.AAAI 2026
  3. MIL-Decoding: Detoxifying Language Models at Token-Level via Multiple Instance LearningXu Zhang, Xiaojun WanACL 2023 · 3 citations
  4. Contrastive Perplexity for Controlled Generation: An Application in Detoxifying Large Language ModelsTassilo Klein, Moin NabiACL 2025
  5. CMD: a framework for Context-aware Model self-DetoxificationZecheng Tang, Keyan Zhou, Juntao Li, Yuyang Ding et al.EMNLP 2024 · 1 citation
Dusk over the sea between two cliffs drawn in fine vertical lines