Skip to main content
QUICK REVIEW

[Paper Review] NeuroLogic Decoding: (Un)supervised Neural Text Generation with Predicate Logic Constraints

Ximing Lu, Peter West|arXiv (Cornell University)|Oct 24, 2020
Topic ModelingComputer Science29 references11 citations
TL;DR

NeuroLogic Decoding is a novel inference-time algorithm that enables neural language models to generate fluent text while strictly satisfying complex lexical constraints expressed in predicate logic, without modifying model weights or training. It achieves state-of-the-art performance across four diverse text generation tasks—commonsense reasoning, recipe generation, dialogue response generation, and gender bias reduction in translation—often outperforming supervised models with conventional decoding, even when using smaller, unsupervised models.

ABSTRACT

Conditional text generation often requires lexical constraints, i.e., which words should or shouldn't be included in the output text. While the dominant recipe for conditional text generation has been large-scale pretrained language models that are finetuned on the task-specific training data, such models do not learn to follow the underlying constraints reliably, even when supervised with large amounts of task-specific examples. We propose NeuroLogic Decoding, a simple yet effective algorithm that enables neural language models -- supervised or not -- to generate fluent text while satisfying complex lexical constraints. Our approach is powerful yet efficient. It handles any set of lexical constraints that is expressible under predicate logic, while its asymptotic runtime is equivalent to conventional beam search. Empirical results on four benchmarks show that NeuroLogic Decoding outperforms previous approaches, including algorithms that handle a subset of our constraints. Moreover, we find that unsupervised models with NeuroLogic Decoding often outperform supervised models with conventional decoding, even when the latter is based on considerably larger networks. Our results suggest the limit of large-scale neural networks for fine-grained controllable generation and the promise of inference-time algorithms.

Motivation & Objective

  • To address the persistent failure of fine-tuned large language models to reliably satisfy lexical constraints in text generation.
  • To develop a general, efficient, and plug-and-play decoding method that enforces complex logical constraints at inference time.
  • To demonstrate that inference-time control can surpass the performance of large-scale fine-tuning, especially in zero-shot or low-data settings.
  • To reduce reliance on dataset-specific patterns and improve robustness in constrained generation tasks such as recipe generation and gender bias mitigation.

Proposed method

  • The method formulates constraints as a predicate logic formula in Conjunctive Normal Form (CNF), expressing both inclusion (positive) and exclusion (negative) requirements for specific words or phrases.
  • It converts hard logical constraints into a differentiable soft penalty term within the beam search decoding objective, enabling efficient optimization under constraints.
  • The algorithm maintains constraint states throughout the decoding process to enable computation reuse and avoid redundant checks, preserving beam search’s asymptotic runtime complexity.
  • It supports arbitrary combinations of positive and negative constraints using logical connectives, allowing for complex requirements such as synonym or inflectional equivalence (e.g., 'beef' or 'steak' both satisfy a 'meat' requirement).
  • The approach is model-agnostic and requires no model fine-tuning or architectural changes, making it applicable to both supervised and unsupervised pre-trained language models.

Experimental results

Research questions

  • RQ1Can a decoding-only method outperform fine-tuned models in constrained text generation, especially when the latter are significantly larger?
  • RQ2To what extent can unsupervised models with NeuroLogic Decoding match or exceed the performance of supervised models using standard decoding?
  • RQ3Does enforcing logical constraints at inference time reduce reliance on dataset-specific patterns and improve generalization?
  • RQ4Can NeuroLogic Decoding effectively reduce gender bias in machine translation by enforcing correct gender inflection in output sequences?

Key findings

  • NeuroLogic Decoding achieved new SOTA results on all four evaluated benchmarks, including in zero-shot settings where it outperformed supervised baselines.
  • In recipe generation, the method significantly improved constraint satisfaction compared to standard beam search, even with large fine-tuned GPT-2 models.
  • For gender bias reduction in translation, NeuroLogic Decoding increased accuracy from 53.0% to 89.9% on English-French and from 60.5% to 95.0% on English-German when using ground-truth gender markers.
  • The method reduced the performance gap ΔS between stereotypical and non-stereotypical gender roles by up to 8.9 percentage points in French translation, indicating reduced model bias.
  • Unsupervised models with NeuroLogic Decoding outperformed larger, fine-tuned models using standard decoding, suggesting that inference-time control can surpass the limits of scale in fine-tuning.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.