Abstract
Controlling the length of generated text is a critical requirement for practical summarization systems, yet existing models often sacrifice summary quality for length precision. We present LenAtten (Length Attention), a modular neural component designed to achieve high-precision character-count targets. By utilizing an attention mechanism over length embeddings at each decoding step, LenAtten allows models to dynamically adjust their output. Experimental results on the CNN/Daily Mail and Annotated English Gigaword datasets demonstrate that LenAtten improves length controllability by up to 732 times over previous state-of-the-art methods while simultaneously enhancing ROUGE scores.
Introduction
Fixed Length Summarization (FLS) is essential for applications with strict UI constraints, such as mobile news snippets or headline generation. Standard sequence-to-sequence (Seq2Seq) models typically struggle with these constraints, either failing to meet the target length or producing truncated, incoherent text. Previous research has generally faced a trade-off: models either prioritize summary quality (losing length control) or prioritize control (degrading linguistic quality).
The primary bottleneck identified is the method of injecting length information into the decoder. Traditional approaches often use static length embeddings that interfere with the recurrent unit's hidden state, forcing a conflict between language modeling and length adherence.
The LenAtten Unit
The core innovation of this work is the Length Attention (LenAtten) unit. Rather than a single static input, LenAtten employs a set of pre-defined length embeddings based on sinusoidal positional encodings.
Key components of the LenAtten mechanism include:
- Stepwise Remaining Length ($r_t$): The model tracks the remaining character budget at every generation step.
- Attention Mechanism: The decoder uses its current hidden state and $r_t$ to compute attention weights over the length embeddings, generating a dynamic "length context vector" ($c^l_t$).
- Integration: This context vector is concatenated with the hidden state before the final word prediction, allowing the model to "consult" its budget without corrupting its internal representation of the text's meaning.
LenAtten is modular and can be integrated into various architectures, including standard Seq2Seq, Attention-based models, and Pointer-Generator networks (e.g., PAULUS).
Experimental Setup
The proposed method was evaluated on two benchmark datasets:
- CNN/Daily Mail (CNN/DM): Characterized by multi-sentence summaries.
- Annotated English Gigaword (AEG): Focused on short, headline-style summaries.
Results and Discussion
LenAtten significantly outperforms prior methods in both precision and quality. On the CNN/DM dataset, it achieved a length variance ($Var$) of 0.0070, a 732x improvement over the previous state-of-the-art GOLC (Var = 5.13). Furthermore, ROUGE-L scores increased by 1 to 3 points across different base architectures, suggesting that length awareness acts as a beneficial inductive bias.
Qualitative Analysis: Lexical Compression
Qualitative analysis reveals that LenAtten-equipped models learn "lexical compression." When the remaining character budget is low, the model intelligently selects shorter synonyms or more concise phrasing to convey the same information.
Limitations
Despite its precision, the model operates at a word-level granularity while tracking character counts. This can lead to slight "over-length" issues if the model prioritizes completing a meaningful word over stopping abruptly mid-word. Additionally, the model occasionally generates extra tokens to fill a very small remaining gap.
Conclusion
LenAtten provides a robust solution for length-constrained summarization by decoupling length control from the primary decoding logic via an attention mechanism. This approach not only achieves unprecedented precision but also improves the overall quality of the generated summaries. Future work will explore the integration of LenAtten into large-scale pre-trained transformers.
Summary updated