Skip to main content
QUICK REVIEW

[Paper Review] Controlled Text Generation with Natural Language Instructions

Wangchunshu Zhou, Yuchen Eleanor Jiang|arXiv (Cornell University)|Apr 27, 2023
Topic ModelingComputer Science10 citations
TL;DR

The paper introduces InstructCTG, a training-time framework that verbalizes generation constraints as natural language instructions and fine-tunes a pre-trained model, enabling flexible, decoding-free, instruction-based controlled text generation with strong few-shot generalization to unseen constraints.

ABSTRACT

Large language models generate fluent texts and can follow natural language instructions to solve a wide range of tasks without task-specific training. Nevertheless, it is notoriously difficult to control their generation to satisfy the various constraints required by different applications. In this work, we present InstructCTG, a controlled text generation framework that incorporates different constraints by conditioning on natural language descriptions and demonstrations of the constraints. In particular, we first extract the underlying constraints of natural texts through a combination of off-the-shelf NLP tools and simple heuristics. We then verbalize the constraints into natural language instructions to form weakly supervised training data. By prepending natural language descriptions of the constraints and a few demonstrations, we fine-tune a pre-trained language model to incorporate various types of constraints. Compared to existing search-based or score-based methods, InstructCTG is more flexible to different constraint types and has a much smaller impact on the generation quality and speed because it does not modify the decoding procedure. Additionally, InstructCTG allows the model to adapt to new constraints without re-training through the use of few-shot task generalization and in-context learning abilities of instruction-tuned language models.

Motivation & Objective

  • Motivate the need to control large language model outputs beyond decoding-time constraints.
  • Propose a training-time, instruction-tuning approach that uses natural-language verbalizations of constraints.
  • Synthesize a weakly supervised training corpus by annotating sentences with latent constraints and verbalizing them as instructions.
  • Demonstrate strong constraint satisfaction and fluency, plus generalization to unseen constraints and few-shot scenarios.

Proposed method

  • Synthesize a large weakly supervised training corpus by automatically imputing lexical, syntactic, semantic, style, and length constraints for natural sentences.
  • Verbalize each constraint as natural-language instructions and concatenate them with the target sentence to form training pairs.
  • Fine-tune a pre-trained instruction-tuned model (T0-11B) on the augmented corpus.
  • Incorporate multiple demonstrations of constraints via in-context learning to enable few-shot generalization of unseen constraints.
  • Extend the method to conditional text generation by composing task prompts with constraint verbalizations (e.g., paraphrase and question generation).
  • Enable constraint composition by conjoining verbalized constraints with “and.”
  • Maintain standard decoding procedures at inference time without modifying the decoder.
Figure 1 : A cartoon of the InstructCTG framework. InstructCTG is an instruction-tuned model for controlled text generation. In our experiments, we consider lexical , syntax , semantic , style , and length constraints.
Figure 1 : A cartoon of the InstructCTG framework. InstructCTG is an instruction-tuned model for controlled text generation. In our experiments, we consider lexical , syntax , semantic , style , and length constraints.

Experimental results

Research questions

  • RQ1Can natural-language verbalizations of constraints guide generation as effectively as decoding-time constraints?
  • RQ2How well does instruction-tuning with weakly supervised constraint data transfer to unseen constraints (zero-shot and few-shot)?
  • RQ3Does the approach generalize to conditional generation tasks and to concatenations of multiple constraints?
  • RQ4What is the impact of demonstrations and multiple templates on constraint satisfaction and fluency for seen and unseen constraints?

Key findings

  • InstructCTG achieves comparable or better constraint satisfaction than baselines across lexical, syntax, semantic, style, and length constraints.
  • The method yields higher fluency scores and faster generation than several constraint-based decoding methods.
  • InstructCTG demonstrates strong generalization to unseen constraints in few-shot settings with demonstrations.
  • The approach extends effectively to conditional generation tasks and supports composition of multiple constraints.
  • A few demonstrations (e.g., 5) provide a favorable trade-off between performance and efficiency.
Figure 2 : Results on the composition of multiple constraints. The aggregate performance number on the $y$ -axis is measured by the following procedure: First, for each constraint type, we calculate the percentage of succ and fluency that the model retains compared to the performance without constra
Figure 2 : Results on the composition of multiple constraints. The aggregate performance number on the $y$ -axis is measured by the following procedure: First, for each constraint type, we calculate the percentage of succ and fluency that the model retains compared to the performance without constra

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.