mlsanityData to 7 Oct 2026

Ruler: A Model-Agnostic Method to Control Generated Length for Large Language Models

arXiv 2409.18943 ↗First posted 27 Sep 2024cs.CLcited by 1

Not on the map. Why?

Abstract (arXiv)

The instruction-following ability of large language models enables humans to interact with AI agents in a natural way. However, when required to generate responses of a specific length, large language models often struggle to meet users' needs due to their inherent difficulty in accurately perceiving numerical constraints. To explore the ability of large language models to control the length of generated responses, we propose the Target Length Generation Task (TLG) and design two metrics, Precise Match (PM) and Flexible Match (FM) to evaluate the model's performance in adhering to specified response lengths. Furthermore, we introduce a novel, model-agnostic approach called Ruler, which employs Meta Length Tokens (MLTs) to enhance the instruction-following ability of large language models under length-constrained instructions. Specifically, Ruler equips LLMs with the ability to generate responses of a specified length based on length constraints within the instructions. Moreover, Ruler can automatically generate appropriate MLT when length constraints are not explicitly provided, demonstrating excellent versatility and generalization. Comprehensive experiments show the effectiveness of Ruler across different LLMs on Target Length Generation Task, e.g., at All Level 27.97 average gain on PM, 29.57 average gain on FM. In addition, we conduct extensive ablation experiments to further substantiate the efficacy and generalization of Ruler. Our code and data is available at https://github.com/Geaming2002/Ruler.

Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Builds on 26 of its 37 references that are in the map. First posted on arXiv 27 Sep 2024.

Builds on

26 of 37 references.

References · 26

  1. 2017Attention Is All You Needcited by 59,932
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  3. 2020Language Models are Few-Shot Learnerscited by 32,199
  4. 2023GPT-4 Technical Reportcited by 18,132
  5. 2022Training language models to follow instructions with human feedbackcited by 15,712
  6. 2021Training Verifiers to Solve Math Word Problemscited by 9,743
  7. 2020Measuring Massive Multitask Language Understandingcited by 7,768
  8. 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,767
  9. 2018Think you have Solved Question Answering? Try ARC, the AI2 Reasoning Challengecited by 4,710
  10. 2019HellaSwag: Can a Machine Really Finish Your Sentence?cited by 4,018
  11. 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,747
  12. 2021TruthfulQA: Measuring How Models Mimic Human Falsehoodscited by 2,919
14 more
  1. 2023Jailbroken: How Does LLM Safety Training Fail?cited by 1,565
  2. 2021Calibrate Before Use: Improving Few-Shot Performance of Language Modelscited by 1,371
  3. 2020RealToxicityPrompts: Evaluating Neural Toxic Degeneration in Language Modelscited by 1,235
  4. 2023WizardLM: Empowering large pre-trained language models to follow complex instructionscited by 1,116
  5. 2023LIMA: Less Is More for Alignmentcited by 1,080
  6. 2022A Survey on In-context Learningcited by 717
  7. 2019ELI5: Long Form Question Answeringcited by 567
  8. 2023Learning to Compress Prompts with Gist Tokenscited by 379
  9. 2023What Makes Good Data for Alignment? A Comprehensive Study of Automatic Data Selection in Instruction Tuningcited by 354
  10. 2021Alignment of Language Agentscited by 167
  11. 2021Meta-learning via Language Model In-context Tuningcited by 163
  12. 2024Long Context Compression with Activation Beaconcited by 101
  13. 2023LongForm: Effective Instruction Tuning with Reverse Instructionscited by 47
  14. 2023TCRA-LLM: Token Compression Retrieval Augmented Large Language Model for Inference Cost Reductioncited by 34

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 1.

1 paper.