CLSep 27, 2024

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

arXiv:2409.18943v224 citationsh-index: 9Has Code
Originality Incremental advance
AI Analysis

This addresses a practical limitation in human-AI interaction where users need length-controlled responses, though it appears incremental as it builds on existing instruction-following capabilities.

The paper tackles the problem of large language models struggling to generate responses of specified lengths by proposing Ruler, a model-agnostic method using Meta Length Tokens, which achieved average gains of 27.97 on Precise Match and 29.57 on Flexible Match metrics.

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.

Code Implementations1 repo
Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes