PositionID: LLMs can Control Lengths, Copy and Paste with Explicit Positional Awareness

Zekun Wang, Feiyu Duan, Yibo Zhang, Wangchunshu Zhou, Ke Xu +2 more
10/9/2024
cs.CLcs.AI

No confident code implementation found for this paper.

Abstract

Large Language Models (LLMs) demonstrate impressive capabilities across various domains, including role-playing, creative writing, mathematical reasoning, and coding. Despite these advancements, LLMs still encounter challenges with length control, frequently failing to adhere to specific length constraints due to their token-level operations and insufficient training on data with strict length limitations. We identify this issue as stemming from a lack of positional awareness and propose novel approaches--PositionID Prompting and PositionID Fine-Tuning--to address it. These methods enhance the model's ability to continuously monitor and manage text length during generation. Additionally, we introduce PositionID CP Prompting to enable LLMs to perform copy and paste operations accurately. Furthermore, we develop two benchmarks for evaluating length control and copy-paste abilities. Our experiments demonstrate that our methods significantly improve the model's adherence to length constraints and copy-paste accuracy without compromising response quality.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{wang2024positionid,
  title  = {PositionID: LLMs can Control Lengths, Copy and Paste with Explicit Positional Awareness},
  author = {Zekun Wang and Feiyu Duan and Yibo Zhang and Wangchunshu Zhou and Ke Xu and Wenhao Huang and Jie Fu},
  year   = {2024},
  eprint = {2410.07035},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2410.07035v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2410.07035.svg)](https://codeofpaper.com/paper/2410.07035)

Discussion