YaRN: Efficient Context Window Extension of Large Language Models

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Peng, Bowen, Quesnelle, Jeffrey, Fan, Honglu, Shippole, Enrico
Format: Preprint
Publié: 2023
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866917254716719104
author Peng, Bowen
Quesnelle, Jeffrey
Fan, Honglu
Shippole, Enrico
author_facet Peng, Bowen
Quesnelle, Jeffrey
Fan, Honglu
Shippole, Enrico
contents Rotary Position Embeddings (RoPE) have been shown to effectively encode positional information in transformer-based language models. However, these models fail to generalize past the sequence length they were trained on. We present YaRN (Yet another RoPE extensioN method), a compute-efficient method to extend the context window of such models, requiring 10x less tokens and 2.5x less training steps than previous methods. Using YaRN, we show that LLaMA models can effectively utilize and extrapolate to context lengths much longer than their original pre-training would allow, while also surpassing previous the state-of-the-art at context window extension. In addition, we demonstrate that YaRN exhibits the capability to extrapolate beyond the limited context of a fine-tuning dataset. Code is available at https://github.com/jquesnelle/yarn
format Preprint
id arxiv_https___arxiv_org_abs_2309_00071
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle YaRN: Efficient Context Window Extension of Large Language Models
Peng, Bowen
Quesnelle, Jeffrey
Fan, Honglu
Shippole, Enrico
Computation and Language
Artificial Intelligence
Machine Learning
Rotary Position Embeddings (RoPE) have been shown to effectively encode positional information in transformer-based language models. However, these models fail to generalize past the sequence length they were trained on. We present YaRN (Yet another RoPE extensioN method), a compute-efficient method to extend the context window of such models, requiring 10x less tokens and 2.5x less training steps than previous methods. Using YaRN, we show that LLaMA models can effectively utilize and extrapolate to context lengths much longer than their original pre-training would allow, while also surpassing previous the state-of-the-art at context window extension. In addition, we demonstrate that YaRN exhibits the capability to extrapolate beyond the limited context of a fine-tuning dataset. Code is available at https://github.com/jquesnelle/yarn
title YaRN: Efficient Context Window Extension of Large Language Models
topic Computation and Language
Artificial Intelligence
Machine Learning
url https://arxiv.org/abs/2309.00071