Training-Free Long-Context Scaling of Large Language Models
The ability of Large Language Models (LLMs) to process and generate coherent
text is markedly weakened when the number of input tokens exceeds their
pretraining length. Given the expensive overhead of finetuning large-scale
models with longer sequences, we propose Dual Chunk Attention (DCA), which
enables Llama2 70B to support context windows of more than 100k tokens without
continual training. By decomposing the attention computation for long sequences
into chunk-based modules, DCA manages to effectively capture the relative
positional information of tokens within the same chunk (Intra-Chunk) and across
distinct chunks (Inter-Chunk), as well as integrates seamlessly with Flash
Attention. In addition to its impressive extrapolation capability, DCA achieves
performance on practical long-context tasks that is comparable to or even
better than that of finetuned models. When compared with proprietary models,
our training-free 70B model attains 94% of the performance of gpt-3.5-16k,
indicating it is a viable open-source alternative. All code and data used in
this work are released at https://github.com/HKUNLP/ChunkLlama.
65dea1e31403407a305b5e6d
Chenxin An
claimed_verified
2024-02-28T08:27:33.271Z
64acb321264bbbf171a2b040
/avatars/0ad344c0e9b1e3fda469932f91d117dc.svg
Chenxin An
user
Chancy
65dea1e31403407a305b5e6e
Fei Huang
admin_assigned
2024-02-28T12:52:57.853Z
635b8b6a37c6a2c12e2cce00
/avatars/229fb72180529141515d1df797b33709.svg
Fei Huang
user
hzhwcmhf
65dea1e31403407a305b5e6f
Jun Zhang
65dea1e31403407a305b5e70
Shansan Gong
claimed_verified
2024-10-24T07:16:32.608Z
628c83d186fc004b14e1ed48
/avatars/05ff943a9b89b5f67c5bc254bf45b8f5.svg
Shansan Gong
user
Sansa
65dea1e31403407a305b5e71
Xipeng Qiu
admin_assigned
2024-02-28T12:54:02.882Z
61457b8deff2c9fdb4de4988
https://cdn-avatars.huggingface.co/v1/production/uploads/1632381702899-61457b8deff2c9fdb4de4988.jpeg
Xipeng Qiu
user
xpqiu
65dea1e31403407a305b5e72
Chang Zhou
admin_assigned
2024-02-28T12:54:16.511Z
622892774323cef93a956a4a
/avatars/e57ef5c3b0c4289988ccd42f14e54336.svg
chang zhou
user
jiemizc
65dea1e31403407a305b5e73
Lingpeng Kong
Training-Free Long-Context Scaling of Large Language Models
The ability of Large Language Models (LLMs) to process and generate coherent
text is markedly weakened when the number of input tokens exceeds their
pretraining length. Given the expensive overhead of finetuning large-scale
models with longer sequences, we propose Dual Chunk Attention (DCA), which
enables Llama2 70B to support context windows of more than 100k tokens without
continual training. By decomposing the attention computation for long sequences
into chunk-based modules, DCA manages to effectively capture the relative
positional information of tokens within the same chunk (Intra-Chunk) and across
distinct chunks (Inter-Chunk), as well as integrates seamlessly with Flash
Attention. In addition to its impressive extrapolation capability, DCA achieves
performance on practical long-context tasks that is comparable to or even
better than that of finetuned models. When compared with proprietary models,
our training-free 70B model attains 94% of the performance of gpt-3.5-16k,
indicating it is a viable open-source alternative. All code and data used in
this work are released at https://github.com/HKUNLP/ChunkLlama.
Dual Chunk Attention (DCA) enhances Llama2 70B to handle over 100k tokens without fine-tuning by decomposing attention into chunk-based modules, achieving performance comparable to finetuned models.
Large Language Models (LLMs) input tokens pretraining length finetuning Dual Chunk Attention (DCA) context windows attention computation chunk-based modules relative positional information Flash Attention extrapolation capability practical long-context tasks training-free model gpt-3.5-16k open-source alternative