Extract, Denoise, and Enforce: Evaluating and Predicting Lexical Constraints for Conditional Text Generation

Yuning Mao, Wenchang Ma, Deren Lei, Xiang Ren

Abstract

Standard sequence-to-sequence (seq2seq) models often fail to preserve critical input concepts, leading to factual inconsistencies in generated text. We introduce EDE (Extract, Denoise, and Enforce), a framework that automatically identifies key entities from source text and dynamically enforces them as lexical constraints during decoding. By incorporating a novel Denoised Dynamic Beam Allocation (DDBA) mechanism, EDE filters out noisy or disfluent constraints on the fly. Our evaluation across multiple tasks—including question generation, dialog, and summarization—demonstrates that EDE significantly improves both generation quality and concept preservation compared to vanilla pre-trained language models.

Introduction

In conditional text generation tasks such as abstractive summarization and knowledge-grounded dialog, maintaining factual consistency is paramount. Key concepts—such as named entities, dates, and technical terms—must be accurately carried over from the source to the target. However, modern pre-trained language models (PLMs) like BART or T5 treat all tokens with equal priority, often failing to attend to critical information.

While Lexically Constrained Generation (LCGen) can force the inclusion of specific words, it typically relies on "gold" constraints provided by humans. In fully automated pipelines, keyword extraction is often noisy. Forcing a model to use an incorrectly extracted or irrelevant keyword results in disfluent and nonsensical output. EDE addresses this by bridging the gap between automated extraction and high-quality, fluent generation.

Methodology

The EDE framework operates during inference and does not require retraining the underlying PLM. It consists of three main stages:

  1. Extract: A state-of-the-art keyphrase extraction model (BERT-KPE) identifies important concepts from the source text.
  2. Denoise: To handle imperfect extraction, we introduce Denoised Dynamic Beam Allocation (DDBA). Unlike standard DBA, which strictly enforces all constraints, DDBA evaluates the generation probability of a constraint at each step. If a constraint significantly reduces fluency (lowers probability), it is dynamically discarded.
  3. Enforce: The remaining high-confidence constraints are enforced during beam search, ensuring their presence in the final output.
The EDE framework: Extracting keyphrases, denoising via DDBA, and enforcing constraints during decoding.

Experimental Setup

We evaluated EDE across four diverse text-to-text tasks using five standard datasets:

  • Question Generation: SQuAD 1.1
  • Knowledge-Grounded Dialog: Wizard of Wikipedia (WoW)
  • Headline Generation: English Gigaword
  • Abstractive Summarization: CNN/Daily Mail (extractive-leaning) and XSum (abstractive-leaning)

Preliminary analysis revealed that existing datasets are surprisingly "hallucinated." For instance, in XSum and Gigaword, nearly 50% of concepts in the target outputs are absent from the source text. Furthermore, standard unconstrained seq2seq models only preserve approximately half of the important concepts even when they are present in the source.

Results and Discussion

EDE (DDBA) consistently outperforms vanilla BART and standard hard-constraint DBA across all evaluated tasks. On the SQuAD question generation task, EDE achieved state-of-the-art results, significantly boosting BLEU-4 and ROUGE-L scores.

Performance comparison on SQuAD Question Generation. EDE with DDBA consistently outperforms vanilla BART and standard DBA.

Beyond automated metrics, human evaluation confirmed that DDBA maintains high fluency (3.88/4.0 on SQuAD) compared to non-denoised DBA (3.52/4.0). This proves that dynamic filtering effectively prevents the awkward phrasing often caused by rigid lexical constraints. EDE also significantly boosted the F1 score of preserved concepts (e.g., +3.6 F1 on SQuAD), confirming its ability to maintain factual grounding.

Conclusion and Future Work

EDE provides a robust method for improving factual consistency in automated text generation by intelligently filtering noisy constraints. While highly effective, the framework currently relies on exact string matching, which may miss paraphrased concepts. Future research will focus on semantic-level constraint enforcement and more sophisticated extraction techniques to further bridge the gap between source knowledge and generated content.

Summary updated

BibTeX
@inproceedings{mao2021extract,
  author = {Yuning Mao and Wenchang Ma and Deren Lei and Xiang Ren},
  title = {{Extract, Denoise, and Enforce: Evaluating and Predicting Lexical Constraints for Conditional Text Generation}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2021},
  doi = {10.18653/v1/2021.emnlp-main.413},
}
Figure