LongQLoRA: Efficient and Effective Method to Extend Context Length of Large Language Models

Jianxin Yang
11/8/2023
cs.CLcs.AI

Official code: yangjianxin1/LongQLoRA (168 stars, last commit 2023-11-12).

Abstract

We present LongQLoRA, an efficient and effective method to extend context length of large language models with less training resources. LongQLoRA combines the advantages of Position Interpolation, QLoRA and Shift Short Attention of LongLoRA. With a single 32GB V100 GPU, LongQLoRA can extend the context length of LLaMA2 7B and 13B from 4096 to 8192 and even to 12k within 1000 finetuning steps. LongQLoRA achieves competitive perplexity performance on PG19 and Proof-pile datasets, our model outperforms LongLoRA and is very close to MPT-7B-8K within the evaluation context length of 8192. We collect and build 39k long instruction data to extend context length of Vicuna-13B from 4096 to 8192 and achieve good performance both in long and short context generation task. We also do some ablation experiments to study the effect of LoRA rank, finetuning steps and attention patterns in inference.The model weights, training data and code are avaliable at https://github.com/yangjianxin1/LongQLoRA.

View on arXivView PDF

Code Implementations(1)

LongQLoRA: Extent Context Length of LLMs Efficiently

16815PythonOct 22, 20232 years ago
llmlong-contextlongloraloraqlora

Similar Papers

Cite this paper

@article{yang2023longqlora,
  title  = {LongQLoRA: Efficient and Effective Method to Extend Context Length of Large Language Models},
  author = {Jianxin Yang},
  year   = {2023},
  eprint = {2311.04879},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2311.04879v2}
}

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/2311.04879.svg)](https://codeofpaper.com/paper/2311.04879)

Discussion