Summarization with Precise Length Control

Lesly Miculicich, Yujia Xie, Song Wang, Pengcheng HearXiv 2023

Abstract

Many applications of text generation such as summarization benefit from accurately controlling the text length. Existing approaches on length-controlled summarization either result in degraded performance or can only control the length approximately. In this work, we present a framework to generate summaries with precisely the specified number of tokens or sentences, while maintaining or even improving the text quality. In addition, we jointly train the models to predict the lengths, so our model can generate summaries with optimal length. We evaluate the proposed framework on the CNNDM dataset and show improved performance compared to existing methods.

Introduction

In AI-driven summarization, controlling output length is a persistent challenge. Whether fitting a news snippet onto a smartwatch or generating a three-sentence executive brief, most current models treat length as a suggestion rather than a rule. This often leads to summaries that are either truncated mid-sentence or excessively wordy.

Existing solutions typically fall into two categories: bucketing (grouping summaries into imprecise length ranges) or EOS manipulation (forcing the model to stop by boosting the "End of Sentence" token probability). The latter often results in "chopped off" sentences and poor flow. This research introduces techniques to bake length awareness directly into the model's architecture, allowing it to plan its "budget" of words or sentences from the first token.

Methodology

REPILOT: Token-Level Control

The REverse Position Induced Length-cOntrolled Text generation (REPILOT) method modifies how position embeddings are utilized. While standard models use position embeddings to denote sequential order (1, 2, 3...), REPILOT reverses this. If a 50-token summary is requested, the model starts at position 50 and counts down to zero.

Comparison of standard (left) and reverse (right) position embeddings used in REPILOT.

By counting down to zero, the model remains constantly aware of its remaining "budget." To prevent robotic endings, a small amount of random noise is added to the starting index during training, helping the model learn to finish sentences gracefully as it approaches the limit.

SentEnum: Sentence-Level Control

Controlling sentence counts is more complex due to linguistic ambiguity at boundaries. The researchers utilize SentEnum (Sentence Enumeration), a prefix-based approach that inserts special tokens (e.g., [SN]1, [SN]2) before each sentence. This acts as a template, signaling to the model exactly how many text blocks must be generated.

Joint Length Prediction

To handle cases where the optimal length is unknown, the model is jointly trained to predict the ideal length based on the source document. This replaces traditional "length penalty" hyperparameters during decoding, making the model more autonomous.

Evaluation and Results

The framework was evaluated on the CNN/Daily Mail (CNNDM) and ArXiv datasets.

Accuracy and Quality

SentEnum achieved 98.6% accuracy in hitting exact sentence counts on CNNDM, significantly outperforming the baseline Zcode++ (60.1%). As shown in the figure below, SentEnum maintains high accuracy even as the number of sentences per bucket increases, whereas other methods like Buckets and SentPrefix degrade rapidly.

Accuracy of sentence count control for different methods across varying summary lengths.

For token-level control, REPILOT achieved a ROUGE-1 score of 46.36, outperforming previous state-of-the-art models. Its mean absolute difference from the target was only 1.3 tokens, a substantial improvement over bucket-based methods.

Conclusion

The core insight of this work is that position embeddings can serve as an active control mechanism rather than just a passive feature. By turning generation into a "countdown," models can plan content to fit limits while preserving logical flow. Furthermore, training the model to predict length simultaneously improves ROUGE scores, suggesting that length awareness is integral to content understanding. Future work may extend these techniques to text simplification and translation.

Summary updated

BibTeX
@misc{miculicich2023summarization,
  author = {Lesly Miculicich and Yujia Xie and Song Wang and Pengcheng He},
  title = {{Summarization with Precise Length Control}},
  year = {2023},
  eprint = {2305.05171},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2305.05171},
}
Figure