Abstract
Controlling the length of generated text is a critical requirement for practical summarization systems, yet existing methods often sacrifice linguistic quality for length precision. We introduce LenAtten, a novel "Length Attention" unit that dynamically incorporates remaining length constraints at every decoding step. By attending to length-based embeddings, LenAtten achieves length controllability up to 732 times better than previous state-of-the-art methods while simultaneously improving ROUGE scores by 1–3 points.
Introduction
Fixed Length Summarization (FLS) addresses the need for summaries tailored to specific constraints, such as mobile notifications or web previews. The primary challenge in FLS is the trade-off between Quality and Control. High-quality models often ignore length constraints, while length-constrained models frequently produce repetitive or nonsensical outputs. Traditional approaches, such as initializing decoders with length embeddings, often fail because the model "forgets" the constraint as the sequence grows.
The LenAtten Mechanism
The Length Attention (LenAtten) unit addresses the "forgetting" problem by making length a dynamic part of the generation process. Instead of a static initial condition, the model calculates the Stepwise Remaining Length ($r_t$) at every decoding step $t$, where $r_t = \text{Target} - \text{Current Length}$.
As shown in Figure 1, the unit uses $r_t$ to calculate attention scores across a set of pre-defined length embeddings (utilizing sinusoidal positional encoding). This produces a length context vector $c_t^l$, which is concatenated with the standard hidden states. This integration informs the model of the remaining "budget" before predicting the next token, allowing the LenAtten unit to act as a boundary guard while the core model focuses on linguistics.
Experimental Setup and Datasets
The researchers evaluated LenAtten on two benchmark datasets:
- Annotated English Gigaword (AEG): Focused on short, headline-style summaries.
- CNN/Daily Mail (CNN/DM): Comprising long-form news articles and multi-sentence summaries.
These datasets provided a diverse range of target lengths, testing the model's ability to generalize from short snippets to summaries exceeding 1,500 characters.
Key Results and Insights
LenAtten demonstrates that length constraints can serve as a helpful inductive bias rather than a hindrance. By narrowing the candidate word space to those fitting the remaining budget, the model often produces more concise and relevant summaries.
Quantitative Performance
On the CNN/DM dataset, LenAtten improved length variance—a measure of how closely the model hits the target—by a factor of 732 compared to previous controllable summarizers. Crucially, this precision did not come at the cost of quality; ROUGE scores increased by 1–3 points across tasks.
Qualitative Adaptability
Qualitative analysis reveals that the model learns sophisticated strategies like synonym substitution. For instance, if the remaining character budget is tight, the model might choose "tariffs" instead of "customs duty" to preserve meaning within the constraint.
As illustrated in Figure 6, the model successfully scales the information density of the summary based on the provided target length, ranging from a simple arrival notice at 30 characters to a detailed description of diplomatic talks at 70 characters.
Conclusion and Future Work
LenAtten effectively breaks the quality-control trade-off in text summarization. By using a standard Maximum Likelihood Estimation (MLE) objective, it avoids the computational overhead of Reinforcement Learning while providing superior precision. Future research will explore integrating LenAtten into large-scale Transformer architectures like GPT-4 and refining word selection to further minimize the "over-length" ratio caused by word-level generation boundaries.
Summary updated