NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Evaluating Large Language Models on Controlled Generation Tasks

Jiao Sun, Yufei Tian, Wangchunshu Zhou, Nan Xu, Qian Hu, Rahul Gupta, John Frederick Wieting, Nanyun Peng, Xuezhe Ma

Introduction

Large Language Models (LLMs) have demonstrated remarkable capabilities in generating coherent, creative, and contextually relevant text. However, while these models excel at capturing the "vibe" or sentiment of a prompt, they often struggle with precise, rule-based constraints. This paper investigates the gap between semantic fluency and structural controllability, introducing a new benchmark to evaluate how well models follow "hard" versus "soft" constraints.

The Problem: Controllability in LLMs

In practical applications, LLMs are often required to adhere to strict formatting or structural rules—such as specific word counts for summaries, syllable counts for poetry, or precise syntactic structures for linguistic analysis. While general-purpose benchmarks like MMLU measure knowledge and reasoning, they do not systematically test a model's ability to follow fine-grained generation constraints. This research addresses a critical question: Are massive, general-purpose LLMs truly superior to smaller, specialized models when it comes to rule-based text generation?

Methodology

The researchers conducted a systematic analysis across five distinct tasks and ten benchmarks, focusing on the following experimental pillars:

  1. Numerical Planning Benchmark (NPB): A novel test designed to evaluate numerical constraints at four levels: word, syllable, sentence, and paragraph. A typical task might require a model to complete a sentence starting with a specific phrase, using an exact number of additional words, and ending with a specific target word.
  2. In-Context Learning (ICL) Analysis: The study compared zero-shot performance against few-shot prompting to determine if providing examples helps or hinders the model’s ability to adhere to strict rules.
  3. Model Comparison: The evaluation included high-capacity models like ChatGPT (GPT-3.5 and GPT-4) and Alpaca-7b, alongside smaller, task-specific models such as finetuned GPT-2 and BART-based architectures (specifically the AESOP model for paraphrasing).

Datasets

The study utilized a diverse array of datasets to cover the spectrum of controlled generation:

  • Numerical Planning: Derived from Romance Books and Reddit Short Stories.
  • Content Control: Amazon Reviews (sentiment), CommonGen (keywords), and M2D2 (topics).
  • Story Generation: ROCStories and Writing Prompts.
  • Rationale Generation: CoS-E and ECQA (evaluating the quality of explanations).
  • Paraphrase Generation: ParaNMT and QQPPos.

Key Insights

The "Hard" Constraint Wall

LLMs exhibit a significant performance drop-off as constraints become more granular. While they are highly effective at "soft" constraints—such as maintaining a specific sentiment or topic—they frequently fail at "hard" constraints, such as exact word counts. The study suggests that as the granularity of the requirement increases, the reliability of the LLM decreases.

The ICL Backfire

One of the most surprising findings was that few-shot examples can actually deteriorate performance on numerical tasks. LLMs often prioritize mimicking the style or length of the provided examples rather than following the explicit numerical instruction in the prompt. This suggests a conflict between the model's pattern-matching tendencies and its instruction-following capabilities.

Tokenization as a Structural Barrier

The authors hypothesize that sub-word tokenization is a fundamental hurdle. Because models process text in tokens (where a single word may be split into multiple units), they lack a direct, intuitive mechanism to "count" words or syllables during the autoregressive generation process.

Key Results

  • Counting Accuracy: In word-count tasks, a finetuned GPT-2 model achieved a success rate of 0.64, significantly outperforming ChatGPT, which managed only 0.41. As the required word count ($N$) increased beyond five, ChatGPT’s performance plummeted.
  • Syntactic Precision: The specialized AESOP model (based on BART) outperformed ChatGPT in mimicking specific syntactic structures, demonstrating that for structural accuracy, specialized architectures can still outperform general-purpose giants.
  • Semantic Success: ChatGPT remained the leader in sentiment and topic control, reaching up to 90.3% accuracy with few-shot prompting. It also produced qualitatively superior, more coherent stories compared to older models using standard decoding strategies.

Conclusion and Future Work

The study concludes that while LLMs are excellent at high-level reasoning and semantic control, they are currently unreliable for tasks requiring strict structural or numerical adherence. The authors acknowledge that prompt engineering remains a significant hurdle and that automatic metrics may not fully capture the nuances of creative generation.

Future research directions include the use of Chain-of-Thought (CoT) prompting—allowing models to "plan" or count in a scratchpad before generating the final output—and the exploration of Non-Autoregressive Architectures that allow models to verify constraints by looking back at the generated text during the inference process.

Summary updated

BibTeX
@inproceedings{sun2023evaluating,
  author = {Jiao Sun and Yufei Tian and Wangchunshu Zhou and Nan Xu and Qian Hu and Rahul Gupta and John Frederick Wieting and Nanyun Peng and Xuezhe Ma},
  title = {{Evaluating Large Language Models on Controlled Generation Tasks}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  doi = {10.18653/v1/2023.emnlp-main.190},
}
Figure