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.
University of Illinois at Urbana-Champaign(伊利诺伊大学厄巴纳-香槟分校);Amazon.com Inc.(亚马逊公司);USC Information Sciences Institute(南加州大学信息科学研究所);Argonne National Laboratory(阿贡国家实验室);The Hebrew University of Jerusalem(耶路撒冷希伯来大学);University of Chicago(芝加哥大学)
The Markovian Thinker: Architecture-Agnostic Linear Scaling of Reasoning
Mila;Microsoft Research(微软研究院);McGill University(麦吉尔大学);ServiceNow Research(ServiceNow研究院);Canada CIFAR AI Chair(加拿大CIFAR人工智能主席);Chandar Research Lab(Chandar研究实验室);Polytechnique Montréal(蒙特利尔理工学院);Université de Montréal(蒙特利尔大学)
Prompt-SAW: Leveraging Relation-Aware Graphs for Textual Prompt Compression
Provable Responsible AI and Data Analytics (PRADA) Lab(可证明的负责任人工智能与数据分析(PRADA)实验室);King Abdullah University of Science and Technology(阿卜杜拉国王科技大学);South China University of Technology(华南理工大学);University of Macau(澳门大学);Nankai University(南开大学);University of Copenhagen(哥本哈根大学);Stony Brook University(纽约州立大学石溪分校);SDAIA-KAUST AI(沙特数据与人工智能总局-阿卜杜拉国王科技大学人工智能机构);Ant Group(蚂蚁集团)