Understanding the RoPE Extensions of Long-Context LLMs: An Attention Perspective
Fuente:
arXiv
Saved in:
| Main Authors: | , , , , , , , |
|---|---|
| Format: | Preprint |
| Published: |
2024
|
| Subjects: | |
| Online Access: | |
| Tags: |
Add Tag
No Tags, Be the first to tag this record!
|
| _version_ | 1866912152626921472 |
|---|---|
| author | Zhong, Meizhi Zhang, Chen Lei, Yikun Liu, Xikai Gao, Yan Hu, Yao Chen, Kehai Zhang, Min |
| author_facet | Zhong, Meizhi Zhang, Chen Lei, Yikun Liu, Xikai Gao, Yan Hu, Yao Chen, Kehai Zhang, Min |
| contents | Enabling LLMs to handle lengthy context is currently a research hotspot. Most LLMs are built upon rotary position embedding (RoPE), a popular position encoding method. Therefore, a prominent path is to extrapolate the RoPE trained on comparably short texts to far longer texts. A heavy bunch of efforts have been dedicated to boosting the extrapolation via extending the formulations of the RoPE, however, few of them have attempted to showcase their inner workings comprehensively. In this paper, we are driven to offer a straightforward yet in-depth understanding of RoPE extensions from an attention perspective and on two benchmarking tasks. A broad array of experiments reveals several valuable findings: 1) Maintaining attention patterns to those at the pretrained length improves extrapolation; 2) Large attention uncertainty leads to retrieval errors; 3) Using longer continual pretraining lengths for RoPE extensions could reduce attention uncertainty and significantly enhance extrapolation. |
| format | Preprint |
| id |
arxiv_https___arxiv_org_abs_2406_13282 |
| institution | arXiv |
| publishDate | 2024 |
| record_format | arxiv |
| spellingShingle | Understanding the RoPE Extensions of Long-Context LLMs: An Attention Perspective Zhong, Meizhi Zhang, Chen Lei, Yikun Liu, Xikai Gao, Yan Hu, Yao Chen, Kehai Zhang, Min Computation and Language Enabling LLMs to handle lengthy context is currently a research hotspot. Most LLMs are built upon rotary position embedding (RoPE), a popular position encoding method. Therefore, a prominent path is to extrapolate the RoPE trained on comparably short texts to far longer texts. A heavy bunch of efforts have been dedicated to boosting the extrapolation via extending the formulations of the RoPE, however, few of them have attempted to showcase their inner workings comprehensively. In this paper, we are driven to offer a straightforward yet in-depth understanding of RoPE extensions from an attention perspective and on two benchmarking tasks. A broad array of experiments reveals several valuable findings: 1) Maintaining attention patterns to those at the pretrained length improves extrapolation; 2) Large attention uncertainty leads to retrieval errors; 3) Using longer continual pretraining lengths for RoPE extensions could reduce attention uncertainty and significantly enhance extrapolation. |
| title | Understanding the RoPE Extensions of Long-Context LLMs: An Attention Perspective |
| topic | Computation and Language |
| url | https://arxiv.org/abs/2406.13282 |