Resonance RoPE: Improving Context Length Generalization of Large Language Models

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Wang, Suyuchen, Kobyzev, Ivan, Lu, Peng, Rezagholizadeh, Mehdi, Liu, Bang
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866912013920239616
author Wang, Suyuchen
Kobyzev, Ivan
Lu, Peng
Rezagholizadeh, Mehdi
Liu, Bang
author_facet Wang, Suyuchen
Kobyzev, Ivan
Lu, Peng
Rezagholizadeh, Mehdi
Liu, Bang
contents This paper addresses the challenge of train-short-test-long (TSTL) scenarios in Large Language Models (LLMs) equipped with Rotary Position Embedding (RoPE), where models pre-trained on shorter sequences face difficulty with out-of-distribution (OOD) token positions in longer sequences. We introduce Resonance RoPE, a novel approach designed to narrow the generalization gap in TSTL scenarios by refining the interpolation of RoPE features for OOD positions, significantly improving the model performance without additional online computational costs. Furthermore, we present PosGen, a new synthetic benchmark specifically designed for fine-grained behavior analysis in TSTL scenarios, aiming to isolate the constantly increasing difficulty of token generation on long contexts from the challenges of recognizing new token positions. Our experiments on synthetic tasks show that after applying Resonance RoPE, Transformers recognize OOD position better and more robustly. Our extensive LLM experiments also show superior performance after applying Resonance RoPE to the current state-of-the-art RoPE scaling method, YaRN, on both upstream language modeling tasks and a variety of downstream long-text applications.
format Preprint
id arxiv_https___arxiv_org_abs_2403_00071
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Resonance RoPE: Improving Context Length Generalization of Large Language Models
Wang, Suyuchen
Kobyzev, Ivan
Lu, Peng
Rezagholizadeh, Mehdi
Liu, Bang
Computation and Language
Artificial Intelligence
This paper addresses the challenge of train-short-test-long (TSTL) scenarios in Large Language Models (LLMs) equipped with Rotary Position Embedding (RoPE), where models pre-trained on shorter sequences face difficulty with out-of-distribution (OOD) token positions in longer sequences. We introduce Resonance RoPE, a novel approach designed to narrow the generalization gap in TSTL scenarios by refining the interpolation of RoPE features for OOD positions, significantly improving the model performance without additional online computational costs. Furthermore, we present PosGen, a new synthetic benchmark specifically designed for fine-grained behavior analysis in TSTL scenarios, aiming to isolate the constantly increasing difficulty of token generation on long contexts from the challenges of recognizing new token positions. Our experiments on synthetic tasks show that after applying Resonance RoPE, Transformers recognize OOD position better and more robustly. Our extensive LLM experiments also show superior performance after applying Resonance RoPE to the current state-of-the-art RoPE scaling method, YaRN, on both upstream language modeling tasks and a variety of downstream long-text applications.
title Resonance RoPE: Improving Context Length Generalization of Large Language Models
topic Computation and Language
Artificial Intelligence
url https://arxiv.org/abs/2403.00071