Hierarchical Context Merging: Better Long Context Understanding for Pre-trained LLMs

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Song, Woomin, Oh, Seunghyuk, Mo, Sangwoo, Kim, Jaehyung, Yun, Sukmin, Ha, Jung-Woo, Shin, Jinwoo
Natura: Preprint
Pubblicazione: 2024
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866914756688871424
author Song, Woomin
Oh, Seunghyuk
Mo, Sangwoo
Kim, Jaehyung
Yun, Sukmin
Ha, Jung-Woo
Shin, Jinwoo
author_facet Song, Woomin
Oh, Seunghyuk
Mo, Sangwoo
Kim, Jaehyung
Yun, Sukmin
Ha, Jung-Woo
Shin, Jinwoo
contents Large language models (LLMs) have shown remarkable performance in various natural language processing tasks. However, a primary constraint they face is the context limit, i.e., the maximum number of tokens they can process. Previous works have explored architectural changes and modifications in positional encoding to relax the constraint, but they often require expensive training or do not address the computational demands of self-attention. In this paper, we present Hierarchical cOntext MERging (HOMER), a new training-free scheme designed to overcome the limitations. HOMER uses a divide-and-conquer algorithm, dividing long inputs into manageable chunks. Each chunk is then processed collectively, employing a hierarchical strategy that merges adjacent chunks at progressive transformer layers. A token reduction technique precedes each merging, ensuring memory usage efficiency. We also propose an optimized computational order reducing the memory requirement to logarithmically scale with respect to input length, making it especially favorable for environments with tight memory restrictions. Our experiments demonstrate the proposed method's superior performance and memory efficiency, enabling the broader use of LLMs in contexts requiring extended context. Code is available at https://github.com/alinlab/HOMER.
format Preprint
id arxiv_https___arxiv_org_abs_2404_10308
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Hierarchical Context Merging: Better Long Context Understanding for Pre-trained LLMs
Song, Woomin
Oh, Seunghyuk
Mo, Sangwoo
Kim, Jaehyung
Yun, Sukmin
Ha, Jung-Woo
Shin, Jinwoo
Machine Learning
Artificial Intelligence
Large language models (LLMs) have shown remarkable performance in various natural language processing tasks. However, a primary constraint they face is the context limit, i.e., the maximum number of tokens they can process. Previous works have explored architectural changes and modifications in positional encoding to relax the constraint, but they often require expensive training or do not address the computational demands of self-attention. In this paper, we present Hierarchical cOntext MERging (HOMER), a new training-free scheme designed to overcome the limitations. HOMER uses a divide-and-conquer algorithm, dividing long inputs into manageable chunks. Each chunk is then processed collectively, employing a hierarchical strategy that merges adjacent chunks at progressive transformer layers. A token reduction technique precedes each merging, ensuring memory usage efficiency. We also propose an optimized computational order reducing the memory requirement to logarithmically scale with respect to input length, making it especially favorable for environments with tight memory restrictions. Our experiments demonstrate the proposed method's superior performance and memory efficiency, enabling the broader use of LLMs in contexts requiring extended context. Code is available at https://github.com/alinlab/HOMER.
title Hierarchical Context Merging: Better Long Context Understanding for Pre-trained LLMs
topic Machine Learning
Artificial Intelligence
url https://arxiv.org/abs/2404.10308