DECIDER: A Dual-System Rule-Controllable Decoding Framework for Language Generation

Chen Xu, Tian Lan, Yu Ji, Changlong Yu, Wei Wang, Jun Gao, Qunxi Dong, Kun Qian, Piji Li, Wei Bi, Bin Hu

TL;DR

DECIDER is a neuro-symbolic decoding framework that equips Large Language Models (LLMs) with a First-Order Logic (FOL) reasoner to follow high-level rules during text generation. By mimicking human dual-process cognition—balancing intuitive fluency with logical constraints—it produces text that satisfies complex requirements while remaining significantly more natural and less "greedy" than traditional constrained decoding methods.

What Problem Does This Paper Address?

Standard LLMs are excellent at generating fluent text but struggle to adhere to specific constraints (like including certain keywords or maintaining a specific persona) without specialized fine-tuning. Existing "constrained decoding" methods attempt to fix this at inference time by greedily forcing target words into the output.

However, this often results in "logical egocentrism" or awkward phrasing. For example, a model forced to use the word "bike" might redundantly say "wheeled bike" just to satisfy the constraint as quickly as possible. These models lack a high-level plan and fail to use "bridging concepts"—related words that humans naturally use to transition toward a goal. The authors aim to bridge this gap by integrating explicit logical reasoning into the decoding process.

Methods

Inspired by cognitive dual-process theory, DECIDER splits the generation task into two systems:

  1. System 1 (The Intuitive PLM): A standard pre-trained language model (like GPT-2 or Llama) that provides a probability distribution for the next token based on linguistic fluency.
  2. System 2 (The Logical Reasoner): A symbolic component that evaluates First-Order Logic (FOL) rules. It uses a Rule Parser to turn human-designed rules into a parse tree and a Rule Prover to check the entire vocabulary against these rules in parallel using matrix operations.
The dual-system architecture of DECIDER, showing how the PLM and Logical Reasoner interact via a Decision Function.

The two systems are unified by a Decision Function that shifts the PLM’s probability distribution toward words that satisfy the logical rules. Crucially, DECIDER doesn't just perturb the final output; it also modifies the model's internal attention distributions over previous words and target keywords, steering the model's "focus" toward logically relevant concepts.

Datasets

The authors evaluated DECIDER on two distinct types of constrained generation:

  • CommonGen: A lexical constraint task where the model must generate a commonsense sentence using a provided set of concept keywords (e.g., {enjoy, classroom, students}).
  • PersonaChat: A semantic constraint task for dialogue, where the model must generate responses consistent with a specific persona (e.g., "I have pets"). The authors also tested on a "Revised" version of this dataset to ensure the model wasn't just memorizing keyword overlaps.

Key Insights and Ideas

  • Bridging Concepts: Unlike greedy decoders that only reward target words, DECIDER’s rules can reward related concepts found in a knowledge graph (ConceptNet). For a "classroom" target, the logic might encourage the word "learning," creating a more natural narrative flow.
  • Parallel Logic Proving: To avoid the massive computational overhead of checking every word in a 50,000-word vocabulary against logical rules, the authors implemented the FOL prover using Pytorch sparsity matrices, allowing for efficient, parallelized inference.
  • Mitigating Egocentrism: In dialogue, constrained models often obsessively repeat their own persona traits. DECIDER uses rules to find "common ground" between the user's input and the model's persona, leading to more interactive and less self-centered conversation.
Fig. 1: In the CommonGen (left) and PersonaChat (right) tasks, DECIDER can employs and follows the rules in Table I to mitigate the greedy focus on targets, producing logic-controllable text that not only completes task requirements but also better aligns with natural human expression scenarios.

Key Results

DECIDER consistently outperformed state-of-the-art constrained decoding baselines (like NeuroLogic and COLD) across multiple metrics:

  • Fluency and Logic: On CommonGen, DECIDER achieved a BLEU score of 27.03 (vs. NeuroLogic's 24.53) and a ROUGE score of 43.14 (vs. 41.84), while maintaining a high concept coverage of 97.1%.
  • Human Preference: In human evaluations, DECIDER was rated significantly higher for "Informativeness" and "Naturalness," as it builds more vivid scenarios rather than just checking off keyword boxes.
  • Model Agnostic: The framework proved effective when applied to various base models, including GPT-2, Llama 2-13B, and Llama 3.1-8B.

Limitations and Future Work

The authors identify a few areas for improvement:

  • Granularity: The current version of DECIDER operates on single words ($x$). Future iterations could extend this to phrase-level or sentence-level predicates to handle more complex linguistic structures.
  • Knowledge Dependency: The system relies heavily on the quality and breadth of the external knowledge graph (ConceptNet). Integrating more specialized or dynamic knowledge bases could further enhance its reasoning capabilities.
  • Rule Engineering: While FOL rules are powerful, they currently require human design. Automating the discovery of these rules from data remains an open challenge.

For those interested in the implementation details of the logical proving process, the authors provide a recursive algorithm for traversing the rule parse tree:

The recursive proving algorithm used by System 2 to evaluate truth values across the vocabulary.

Summary updated

BibTeX
@article{xu2025decider,
  author = {Chen Xu and Tian Lan and Yu Ji and Changlong Yu and Wei Wang and Jun Gao and Qunxi Dong and Kun Qian and Piji Li and Wei Bi and Bin Hu},
  title = {{DECIDER: A Dual-System Rule-Controllable Decoding Framework for Language Generation}},
  journal = {IEEE Transactions on Knowledge and Data Engineering},
  year = {2025},
  url = {https://openreview.net/forum?id=5M5CJUJjR6},
}
Figure