Abstract
Lexically Constrained Generation (LCG) requires Large Language Models (LLMs) to incorporate specific keywords into their outputs. Despite their advanced capabilities, LLMs face a "complexity bottleneck" where success rates plummet as the number of constraints grows. This paper introduces Divide and Conquer Generation (DnC), an iterative strategy that decomposes the LCG task. By identifying missing keywords, generating focused snippets, and merging them into the primary text, DnC boosts success rates by over 90% on challenging benchmarks, enabling even smaller models to achieve near-perfect constraint satisfaction.
The Challenge of Lexical Constraints
In Natural Language Processing, LCG is critical for tasks like recipe generation, table-to-text summarization, and marketing content creation. However, even state-of-the-art models like GPT-4 struggle when the constraint list expands. The authors identify three primary drivers of this failure:
- Position Bias: Models exhibit architectural biases; GPT models favor keywords at the start of a prompt (primacy effect), while LLaMA models favor those at the end (recency effect).
- Parameter Insensitivity: Adjusting decoding parameters like temperature or top-p sampling has negligible impact on constraint fulfillment.
- The Tokenizer Trap: Sub-tokenization of compound words can lead models to satisfy only fragments of a constraint.
As shown in Figure 3, the "complexity bottleneck" is evident across all tested models, with success rates dropping sharply as the number of concepts increases from 3 to 15. This suggests that the failure is rooted in the model's planning rather than its sampling parameters.
Divide and Conquer Generation (DnC)
To overcome these limitations, the authors propose Divide and Conquer Generation (DnC). Unlike traditional constrained decoding which requires internal model access, DnC is a modular, black-box approach that works iteratively.
The DnC workflow consists of four main stages:
- Generate: The LLM produces an initial response based on all constraints.
- Evaluate: An automated system identifies which keywords are missing from the output.
- Conquer: The model is prompted to generate specific sentences or snippets that incorporate only the missed constraints.
- Merge: A generator model integrates the new snippets with the original output to ensure a cohesive and fluent final text.
This cycle repeats until all constraints are satisfied or a predefined iteration limit is reached.
Experimental Evaluation
The researchers tested DnC on benchmarks including CommonGen and custom "Challenging Constraints" sets, alongside real-world tasks like recipe generation and profile writing.
The results were transformative. On recipe generation tasks with 15 ingredients, LLaMA-2-7b’s success rate improved from a dismal 5% to 98%. GPT-3.5 reached a 100% success rate across all real-world applications within five iterations. Crucially, human and automated evaluations confirmed that the merging process preserved text quality, maintaining high levels of fluency and coherence comparable to vanilla generations.
Conclusion
Divide and Conquer Generation provides a robust framework for steering LLMs toward strict constraint satisfaction without the need for expensive fine-tuning or complex decoding modifications. While it introduces additional inference latency due to its iterative nature, the dramatic gains in reliability make it a powerful tool for production-grade NLP applications where precision is paramount.
Summary updated