mlsanityData to 7 Oct 2026

Hansel: Output Length Controlling Framework for Large Language Models

arXiv 2412.14033 ↗First posted 18 Dec 2024cs.CL cs.LGcited by 2

Not on the map. Why?

Abstract (arXiv)

Despite the great success of large language models (LLMs), efficiently controlling the length of the output sequence still remains a challenge. In this paper, we propose Hansel, an efficient framework for length control in LLMs without affecting its generation ability. Hansel utilizes periodically outputted hidden special tokens to keep track of the remaining target length of the output sequence. Together with techniques to avoid abrupt termination of the output, this seemingly simple method proved to be efficient and versatile, while not harming the coherency and fluency of the generated text. The framework can be applied to any pre-trained LLMs during the finetuning stage of the model, regardless of its original positional encoding method. We demonstrate this by finetuning four different LLMs with Hansel and show that the mean absolute error of the output sequence decreases significantly in every model and dataset compared to the prompt-based length control finetuning. Moreover, the framework showed a substantially improved ability to extrapolate to target lengths unseen during finetuning, such as long dialog responses or extremely short summaries. This indicates that the model learns the general means of length control, rather than learning to match output lengths to those seen during training.

Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Builds on 31 of its 41 references that are in the map. First posted on arXiv 18 Dec 2024.

Builds on

31 of 41 references.

References · 31

  1. 2017Attention Is All You Needcited by 59,932
  2. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  3. 2024The Llama 3 Herd of Modelscited by 14,192
  4. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
  5. 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 7,916
  6. 2019BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehensioncited by 5,874
  7. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
  8. 2022Large Language Models are Zero-Shot Reasonerscited by 4,323
  9. 2020Dense Passage Retrieval for Open-Domain Question Answeringcited by 3,779
  10. 2022OPT: Open Pre-trained Transformer Language Modelscited by 3,464
  11. 2014Sequence to Sequence Learning with Neural Networkscited by 2,974
  12. 2023G-Eval: NLG Evaluation using GPT-4 with Better Human Alignmentcited by 2,205
19 more
  1. 2022BLOOM: A 176B-Parameter Open-Access Multilingual Language Modelcited by 1,968
  2. 2018Don't Give Me the Details, Just the Summary! Topic-Aware Convolutional Neural Networks for Extreme Summarizationcited by 1,308
  3. 2018Self-Attention with Relative Position Representationscited by 1,112
  4. 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,085
  5. 2015Teaching Machines to Read and Comprehendcited by 1,039
  6. 2024SimPO: Simple Preference Optimization with a Reference-Free Rewardcited by 951
  7. 2023AlpacaFarm: A Simulation Framework for Methods that Learn from Human Feedbackcited by 738
  8. 2017DailyDialog: A Manually Labelled Multi-turn Dialogue Datasetcited by 649
  9. 2023Textbooks Are All You Need II: phi-1.5 technical reportcited by 559
  10. 2022News Summarization and Evaluation in the Era of GPT-3cited by 324
  11. 2023A Long Way to Go: Investigating Length Correlations in RLHFcited by 285
  12. 2019Massively Multilingual Neural Machine Translation in the Wild: Findings and Challengescited by 253
  13. 2020MultiWOZ 2.2 : A Dialogue Dataset with Additional Annotation Corrections and State Tracking Baselinescited by 201
  14. 2020CTRLsum: Towards Generic Controllable Text Summarizationcited by 98
  15. 2016Controlling Output Length in Neural Encoder-Decoderscited by 75
  16. 2019Positional Encoding to Control Output Sequence Lengthcited by 56
  17. 2024Eliminating Biased Length Reliance of Direct Preference Optimization via Down-Sampled KL Divergencecited by 29
  18. 2021LenAtten: An Effective Length Controlling Unit For Text Summarizationcited by 14
  19. 2022Latent Prompt Tuning for Text Summarizationcited by 6

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2025: 1; 2026: 1.

2 papers.