Reproduce “Ruler: A Model-Agnostic Method to Control Generated Length for Large Language Models” on OpenResearch
Turn your favorite coding agents into research agents that review literature, develop hypotheses, and run experiments.
Universal app for Apple silicon and Intel. Requires macOS 11 or later.
About this paper
Jiaming Li, Lei Zhang, Yunshui Li, Ziqiang Liu, yuelin bai, Run Luo, Longze Chen, Min Yang
The RULER method enables large language models to precisely control the length of their generated responses by fine-tuning them with dedicated Meta Length Tokens. This approach consistently improved the ability of various LLMs to meet specified word counts, showing average gains of 27.97 in Precise Match and 29.57 in Flexible Match across different length ranges, all while largely preserving the models' general performance.
Key insights
- Explicit meta tokens (Meta Length Tokens or MLTs) provide a more robust and precise mechanism for controlling LLM output length than natural language prompts alone.
- Target length generation can be significantly improved across diverse LLM architectures through model-agnostic fine-tuning without substantially compromising the models' general performance on other tasks.
- Formally defining the Target Length Generation (TLG) task and developing precise (PM) and flexible (FM) evaluation metrics enables systematic assessment of LLM length control capabilities.
Summary by alphaXiv.
Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.