Downloads · 30 days
11
2% of all-time downloads
Yukang/Llama-2-7b-longlora-16k
Llama-2-7b-longlora-16k is a text generation model from Yukang. Use it when you need the model to write or continue text. It is set up for transformers.
<font size=6<div align='center' <a href=http://arxiv.org/abs/2309.12307Paper</a | <a href="https://huggingface.co/Yukang"Models</a | <a href="https://github.com/dvlab-research/LongLoRA"Code</a </div</font
Downloads · 30 days
11
2% of all-time downloads
All-time downloads
655
Public
Repo size
1.1 GB
Likes
2
Public
Click a slice to open those files.
.bin1.1 GB · 100%
From the Hugging Face model README
<font size=6><div align='center' > <a href=http://arxiv.org/abs/2309.12307>**Paper**</a> | <a href="https://huggingface.co/Yukang">Models</a> | <a href="https://github.com/dvlab-research/LongLoRA">Code</a> </div></font>
LongLoRA: Efficient Fine-tuning of Long-Context Large Language Models [Paper] <br /> Yukang Chen, Shengju Qian, Haotian Tang, Xin Lai, Zhijian Liu, Song Han, Jiaya Jia<br />
We present LongLoRA, an efficient fine-tuning approach that extends the context sizes of pre-trained large language models (LLMs), with limited computation cost. Typically, training LLMs with long context sizes is computationally expensive, requiring extensive training hours and GPU resources. In this paper, we speed up the context extension of LLMs in two aspects. On the one hand, although dense global attention is needed during inference, fine-tuning the model can be effectively and efficiently done by sparse local attention. The proposed shift short attention effectively enables context extension, leading to non-trivial computation saving with similar performance to fine-tuning with vanilla attention. On the other hand, we find that LoRA for context extension works well under the premise of trainable embedding and normalization. LongLoRA demonstrates strong empirical results on various tasks on LLaMA2 models from 7B/13B to 70B. LongLoRA adopts LLaMA2 7B from 4k context to 100k, or LLaMA2 70B to 32k on a single 8x A100 machine. LongLoRA extends models' context while retaining their original architectures, and is compatible with most existing techniques, like FlashAttention-2. In addition, to make LongLoRA practical, we collect a dataset, LongQA, for supervised fine-tuning. It contains more than 3k long context question-answer pairs. For more details, please refer to the paper.
LongLoRA speed up the context extension of pre-trained large language models in both attention-level and weight-level.
| Model | Size | Context | Train | Link |
|---|---|---|---|---|
| Llama-2-13b-chat-longlora-32k-sft | 13B | 32768 | LoRA+ | link |
| Llama-2-70b-chat-longlora-32k-sft | 70B | 32768 | LoRA+ | link |
| Model | Size | Context | Train | Link |
|---|---|---|---|---|
| Llama-2-7b-longlora-8k-ft | 7B | 8192 | Full FT | link |
| Llama-2-7b-longlora-16k-ft | 7B | 16384 | Full FT | link |
| Llama-2-7b-longlora-32k-ft | 7B | 32768 | Full FT | link |
| Llama-2-7b-longlora-100k-ft | 7B | 100000 | Full FT | link |
| Llama-2-13b-longlora-8k-ft | 13B | 8192 | Full FT | link |
| Llama-2-13b-longlora-16k-ft | 13B | 16384 | Full FT | link |
| Llama-2-13b-longlora-32k-ft | 13B | 32768 | Full FT | link |
| Model | Size | Context | Train | Link |
|---|---|---|---|---|
| Llama-2-7b-longlora-8k | 7B | 8192 | LoRA+ | link |
| Llama-2-7b-longlora-16k | 7B | 16384 | LoRA+ | link |
| Llama-2-7b-longlora-32k | 7B | 32768 | LoRA+ | link |
| Llama-2-13b-longlora-8k | 13B | 8192 | LoRA+ | link |
| Llama-2-13b-longlora-16k | 13B | 16384 | LoRA+ | link |
| Llama-2-13b-longlora-32k | 13B | 32768 | LoRA+ | link |
| Llama-2-13b-longlora-64k | 13B | 65536 | LoRA+ | link |
| Llama-2-70b-longlora-32k | 70B | 32768 | LoRA+ | link |
| Llama-2-70b-chat-longlora-32k | 70B | 32768 | LoRA+ | link |
If you find this project useful in your research, please consider citing:
@article{longlora,
title={LongLoRA: Efficient Fine-tuning of Long-Context Large Language Models},
author={Yukang Chen and Shengju Qian and Haotian Tang and Xin Lai and Zhijian Liu and Song Han and Jiaya Jia},
journal={arXiv:2309.12307},
year={2023}
}