[論文レビュー] Augmenting Language Models with Long-Term Memory
LongMemは、凍結されたバックボーン LLM が長い過去の文脈をエンコードできる分離型メモリフレームワークを提案し、一方で軽量な SideNet がメモリ拡張を取得・融合して、長文脈モデリングとメモリ拡張インコンテキスト学習を可能にします。
Existing large language models (LLMs) can only afford fix-sized inputs due to the input length limit, preventing them from utilizing rich long-context information from past inputs. To address this, we propose a framework, Language Models Augmented with Long-Term Memory (LongMem), which enables LLMs to memorize long history. We design a novel decoupled network architecture with the original backbone LLM frozen as a memory encoder and an adaptive residual side-network as a memory retriever and reader. Such a decoupled memory design can easily cache and update long-term past contexts for memory retrieval without suffering from memory staleness. Enhanced with memory-augmented adaptation training, LongMem can thus memorize long past context and use long-term memory for language modeling. The proposed memory retrieval module can handle unlimited-length context in its memory bank to benefit various downstream tasks. Typically, LongMem can enlarge the long-form memory to 65k tokens and thus cache many-shot extra demonstration examples as long-form memory for in-context learning. Experiments show that our method outperforms strong long-context models on ChapterBreak, a challenging long-context modeling benchmark, and achieves remarkable improvements on memory-augmented in-context learning over LLMs. The results demonstrate that the proposed method is effective in helping language models to memorize and utilize long-form contents. Our code is open-sourced at https://aka.ms/LongMem.
研究の動機と目的
- 固定された入力制限を超える長文の過去文脈を、言語モデルが記憶し活用できるようにする。
- 適応時のメモリの陳腐化を避けるため、メモリエンコードとメモリ取得を分離する。
- 現在の入力処理へメモリ拡張を取得・融合する軽量な SideNet を開発する。
- 無限長のメモリを許容し、長文タスクと何千ものデモンストレーションをインコンテキストでサポートする。
- 長文脈言語モデリングのベンチマークとメモリ拡張インコンテキスト学習で改善を示す。
提案手法
- 凍結したバックボーン LLM をメモリエンコーダとして使用し、過去のアテンションキー値ペアを微分不可能なメモリバンクにキャッシュする。
- バックボーンを凍結した状態のまま、メモリ拡張適応で訓練されるメモリリトリーバー兼リーダーとして残差 SideNet を導入する。
- トークンをチャンクへとメモリ取得を実装し、上位 K のメモリチャンクを取得してメモリ拡張デコーダーレイヤを介して融合する。
- レイヤーごとの残差を介してバックボーン LLM の情報を SideNet に注入する、クロスネットワーク残差接続を適用する。
- 標準の左から右への言語モデリング目的でメモリ拡張トレーニングを実施し、メモリの取得と融合を学習できるようにする。
実験結果
リサーチクエスチョン
- RQ1分離型メモリアーキテクチャは、メモリの陳腐化なしに LLM が長期的な過去の文脈を活用できるだろうか?
- RQ2長文脈タスクのためのメモリ拡張を取得・融合する軽量な SideNet の有効性はどの程度か?
- RQ3無限のメモリが利用可能な場合、長文脈言語モデリングとインコンテキスト学習の利得は何か?
- RQ4メモリサイズとチャンク化粒度は取得品質と下流の性能にどのように影響するか?
主な発見
- LongMem は長文モデリングのベンチマークで強力な長文文脈ベースラインを上回り、PG-22 (-1.38 to -1.62) および ArXiv (-1.0) で大幅な perplexity の低減を達成。
- ChapterBreak (AO3) で、LongMem は最先端の 40.5% suffix-identification accuracy を達成し、x-former ベースラインやはるかに多くのパラメータを持つ GPT-3 を上回る。
- メモリ拡張インコンテキスト学習では、LongMem は MemTRM および非メモリベースラインより顕著な利得を示し、20-shot 設定で 5 NLU タスクの平均精度で約 +8.0 を達成。
- メモリデモンストレーション(例:200 個の追加デモンストレーション)を用いると、LongMem は SQuAD open-ended generation 指標を EM 26.77、F1 35.70 に改善。
- アブレーション形式の知見は、小さなチャンクサイズ(例:csz = 2)が ICL タスクの細粒度の取得に有利になり、メモリサイズの選択(msz)がデータセットの文脈長と一致して最良の perplexity 性能になることを示す。
より良い研究を、今すぐ始めましょう
論文設計から論文執筆まで、研究時間を劇的に削減しましょう。
クレジットカード登録不要
このレビューはAIが作成し、人間の編集者が確認しました。