Controlling Summarization Length Through EOS Token Weighting

Zeno Belligoli, Emmanouil Stergiadis, Eran Fainman, Ilya Gusev
6/5/2025
cs.CLcs.LG

No confident code implementation found for this paper.

Abstract

Controlling the length of generated text can be crucial in various text-generation tasks, including summarization. Existing methods often require complex model alterations, limiting compatibility with pre-trained models. We address these limitations by developing a simple approach for controlling the length of automatic text summaries by increasing the importance of correctly predicting the EOS token in the cross-entropy loss computation. The proposed methodology is agnostic to architecture and decoding algorithms and orthogonal to other inference-time techniques to control the generation length. We tested it with encoder-decoder and modern GPT-style LLMs, and show that this method can control generation length, often without affecting the quality of the summary.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{belligoli2025controlling,
  title  = {Controlling Summarization Length Through EOS Token Weighting},
  author = {Zeno Belligoli and Emmanouil Stergiadis and Eran Fainman and Ilya Gusev},
  year   = {2025},
  eprint = {2506.05017},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2506.05017v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2506.05017.svg)](https://codeofpaper.com/paper/2506.05017)

Discussion