paper-with-me

Papers

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

2024-09-27 · Jiaming Li, Lei Zhang, Yunshui Li, Ziqiang Liu, Yuelin Bai, Run Luo, Longze Chen, Min Yang

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.

📄 PDF Abstract BibTeX arXiv:2409.18943

Code (1)

geaming2002/ruler 공식 구현

Tasks

Instruction Following

Similar Papers 제목 키워드 기반

RULER: What's the Real Context Size of Your Long-Context Language Models?

2024-04-09 · Cheng-Ping Hsieh, Simeng Sun, Samuel Kriman, Shantanu Acharya 외

The needle-in-a-haystack (NIAH) test, which examines the ability to retrieve a piece of information (the "needle") from long distractor texts (the "haystack"), has been widely adopted to evaluate long-context language mo…

Long-Context Understanding

Positional Failures in Long-Context LLMs: A Blind Spot in Reasoning Benchmarks

2026-05-22 · Chuyifei Zhang, Hongyu Cui, Xiaowen Huang, Jitao Sang arxiv

Position-controlled evaluation is standard for retrieval tasks such as Needle-in-a-Haystack and RULER, but mainstream reasoning benchmarks do not control positional placement of target tasks in long contexts. We audit 11…

LongGenBench: Benchmarking Long-Form Generation in Long Context LLMs

2024-09-03 · Yuhao Wu, Ming Shan Hee, Zhiqing Hu, Roy Ka-Wei Lee

Current benchmarks like Needle-in-a-Haystack (NIAH), Ruler, and Needlebench focus on models' ability to understand long-context input sequences but fail to capture a critical dimension: the generation of high-quality lon…

16kBenchmarkingFormInstruction Following+1

RuleR: Improving LLM Controllability by Rule-based Data Recycling

2024-06-22 · Ming Li, Han Chen, Chenguang Wang, Dang Nguyen 외

Despite the remarkable advancement of Large language models (LLMs), they still lack delicate controllability under sophisticated constraints, which is critical to enhancing their response quality and the user experience.…

Data AugmentationInstruction Following

Shuffle the Context: RoPE-Perturbed Self-Distillation for Long-Context Adaptation

2026-04-15 · Zichong Li, Chen Liang, Liliang Ren, Tuo Zhao 외 arxiv

Large language models (LLMs) increasingly operate in settings that require reliable long-context understanding, such as retrieval-augmented generation and multi-document reasoning. A common strategy is to fine-tune pretr…

Long-Context Understanding