paper-with-me

홈 › Papers

HMT: Hierarchical Memory Transformer for Long Context Language Processing

2024-05-09 · Zifan He, Zongyue Qin, Neha Prakriya, Yizhou Sun, Jason Cong

Transformer-based large language models (LLM) have been widely used in language processing applications. However, most of them restrict the context window that permits the model to attend to every token in the inputs. Previous works in recurrent models can memorize past tokens to enable unlimited context and maintain effectiveness. However, they have "flat" memory architectures, which have limitations in selecting and filtering information. Since humans are good at learning and self-adjustment, we speculate that imitating brain memory hierarchy is beneficial for model memorization. We propose the Hierarchical Memory Transformer (HMT), a novel framework that enables and improves models' long-context processing ability by imitating human memorization behavior. Leveraging memory-augmented segment-level recurrence, we organize the memory hierarchy by preserving tokens from early input token segments, passing memory embeddings along the sequence, and recalling relevant information from history. Evaluating general language modeling (Wikitext-103, PG-19) and question-answering tasks (PubMedQA), we show that HMT steadily improves the long-context processing ability of context-constrained and long-context models. With an additional 0.5% - 2% of parameters, HMT can easily plug in and augment future LLMs to handle long context effectively. Our code is open-sourced on Github: https://github.com/OswaldHe/HMT-pytorch.

📄 PDF Abstract BibTeX arXiv:2405.06067

Code (1)

OswaldHe/HMT-pytorch 공식 구현 pytorch

Tasks

Language ModelingLanguage ModellingMemorizationQuestion Answering

Methods 이 논문이 사용한 방법론

Attention 설명 없음
Linear Layer A Linear Layer is a projection $\mathbf{XW + b}$.
Multi-Head Attention 설명 없음
Position-Wise Feed-Forward Layer 설명 없음
Dropout Dropout is a regularization technique for neural networks that drops a unit (along with connections) at training time with a specified probability $p$ (a common value is…
Label Smoothing Label Smoothing is a regularization technique that introduces noise for the labels. This accounts for the fact that datasets may have mistakes in them, so maximizing the…
Residual Connection 설명 없음
Softmax The Softmax output function transforms a previous layer's output into a vector of probabilities. It is commonly used for multiclass classification. Given an input vector $x$…

Similar Papers 제목 키워드 기반

PHOTON: Hierarchical Autoregressive Modeling for Lightspeed and Memory-Efficient Language Generation

2025-12-22 · Yuma Ichikawa, Naoya Takagi, Takumi Nakagawa, Yuzi Kanazawa 외 arxiv

Transformers operate as horizontal token-by-token scanners; at each generation step, attending to an ever-growing sequence of token-level states. This access pattern increases prefill latency and makes long-context decod…

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

2024-04-16 · Woomin Song, Seunghyuk Oh, Sangwoo Mo, Jaehyung Kim 외

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 proce…

Long-Context UnderstandingToken Reduction

History-Aware Hierarchical Transformer for Multi-session Open-domain Dialogue System

2023-02-02 · Tong Zhang, Yong liu, Boyang Li, Zhiwei Zeng 외

With the evolution of pre-trained language models, current open-domain dialogue systems have achieved great progress in conducting one-session conversations. In contrast, Multi-Session Conversation (MSC), which consists …

Pretraining with hierarchical memories: separating long-tail and common knowledge

2025-09-29 · Hadi Pouransari, David Grangier, C Thomas, Michael Kirchhof 외 arxiv

The impressive performance gains of modern language models currently rely on scaling parameters: larger models store more world knowledge and reason better. Yet compressing all world knowledge into parameters is unnecess…

An Exploration of Hierarchical Attention Transformers for Efficient Long Document Classification

2022-10-11 · Ilias Chalkidis, Xiang Dai, Manos Fergadiotis, Prodromos Malakasiotis 외

Non-hierarchical sparse attention Transformer-based models, such as Longformer and Big Bird, are popular approaches to working with long documents. There are clear benefits to these approaches compared to the original Tr…

Document ClassificationGPU