mlsanityData to 7 Oct 2026

NCO: A Versatile Plug-in for Handling Negative Constraints in Decoding

arXiv 2605.10065 ↗First posted 11 May 2026cs.CL cs.AIcited by 0

Not on the map. Why?

Abstract (arXiv)

Controlling Large Language Models (LLMs) to prevent the generation of undesirable content, such as profanity and personally identifiable information (PII), has become increasingly critical. While earlier approaches relied on post-processing or resampling, recent research has shifted towards constrained decoding methods that control outputs during generation to mitigate high computational costs and quality degradation. However, preventing multiple forbidden hard constraints or regex constraints from appearing anywhere in the output is computationally challenging. A straightforward solution is to convert these constraints into a single automaton that tracks all forbidden patterns during decoding, but this often becomes impractically large. Standard regex engines also do not readily support the operations needed to build such a constraint, such as complement and intersection. In order to address these limitations, we propose NCO, a decoding strategy that performs online pattern matching over finite hard constraints and regex constraints, reducing computational overhead without inducing state explosion. NCO is fully compatible with standard inference strategies, including various sampling methods and beam search, while also supporting soft masking for probabilistic suppression. We empirically demonstrate its effectiveness across practical tasks, including PII and profanity suppression. Our implementation is available at https://github.com/hyundong98/NCO-Decoding .

Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 22 of its 32 references that are in the map. First posted on arXiv 11 May 2026.

Builds on

22 of 32 references.

References · 22

  1. 2024The Llama 3 Herd of Modelscited by 14,192
  2. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
  3. 2024Qwen2.5 Technical Reportcited by 4,713
  4. 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,346
  5. 2023Pythia: A Suite for Analyzing Large Language Models Across Training and Scalingcited by 1,734
  6. 2020RealToxicityPrompts: Evaluating Neural Toxic Degeneration in Language Modelscited by 1,235
  7. 2024Phi-4 Technical Reportcited by 675
  8. 2023The Falcon Series of Open Language Modelscited by 526
  9. 2021PICARD: Parsing Incrementally for Constrained Auto-Regressive Decoding from Language Modelscited by 402
  10. 2023Efficient Guided Generation for Large Language Modelscited by 192
  11. 2023Grammar-Constrained Decoding for Structured NLP Tasks without Finetuningcited by 186
  12. 2022Synchromesh: Reliable code generation from pre-trained language modelscited by 156
10 more
  1. 2021NeuroLogic A*esque Decoding: Constrained Text Generation with Lookahead Heuristicscited by 153
  2. 2020NeuroLogic Decoding: (Un)supervised Neural Text Generation with Predicate Logic Constraintscited by 146
  3. 2024Guiding LLMs The Right Way: Fast, Non-Invasive Constrained Generationcited by 99
  4. 2024XGrammar: Flexible and Efficient Structured Generation Engine for Large Language Modelscited by 73
  5. 2024Automata-based constraints for language model decodingcited by 49
  6. 2025Flexible and Efficient Grammar-Constrained Decodingcited by 42
  7. 2025GUARD: Generation-time LLM Unlearning via Adaptive Restriction and Detectioncited by 17
  8. 2021Abstract Reasoning via Logic-guided Generationcited by 7
  9. 2024Tokenization as Finite-State Transductioncited by 5
  10. 2025RegexPSPACE: A Benchmark for Evaluating LLM Reasoning on PSPACE-complete Regex Problemscited by 1

Built on by

Not cited yet.