新着研究 / LLM
語句の記憶を部品ごとに読み出す言語モデル、FactorEngram
FactorEngram
FactorEngramの原論文から掲載した図です。細部はクリックして拡大できます。
原論文の図の説明を読む
Figure 1: Overview of FactorEngram. Left: memory modules are residually inserted before the attention module at selected Transformer layers. Right: n-gram lookups retrieve coefficients that are concatenated and modulated by context-dependent basis-level gates. The shared dictionary participates in both gating and memory reconstruction. The reconstructed memory is projected, refined by a short causal convolution, and added to the backbone hidden state.
概要
- 共有辞書の部品を語句ごとの係数で組み合わせ、文脈に応じて部品単位で読み出す。
- 340MモデルではWikiTextのパープレキシティがEngramの22.29から21.29に改善した。
- 1Bモデルでは長文検索のNIAH-3正答率がEngramの16.6%から44.2%になったが、下流課題の平均正答率はわずかに低かった。
補足:編集した模式図で仕組みを確認する
VISUAL EXPLAINER
図でつかむ、FactorEngramの仕組み
- 01単語と語句
- 02係数を検索
- 03文脈で部品を調整
- 04記憶を再構成
原論文の説明をもとにした模式図です。処理の細部は省略しています。
研究の背景
FactorEngramは、言語モデルが繰り返し出会う語句を、計算だけで毎回組み立て直さず、学習した記憶から読み出す方法を扱う。nグラムとは、連続するn個の単語などの並びを指す。
従来の記憶では、同じ語句が文脈で違う意味を持っても、取り出した表現全体をまとめて強めるか弱めるかしかできない。限られた記憶領域を、意味の近い語句の間でどう共有するかも課題だった。
手法
入力文の各位置で、単語、2語、3語の並びに対応する係数を表から取り出す。係数は、共有辞書にある基底ベクトル、つまり記憶を組み立てる部品の重みである。学習時には、多数の部品を一度に使いすぎないよう係数に制約をかける。
現在の文脈を表すモデル内部の状態と各基底を照合し、係数を個別に調整して記憶ベクトルを作る。例えば同じ「the bank」でも、河岸の文と金融機関の文で部品の重みを変える狙いだ。得たベクトルは近くの位置の情報も加味してTransformerの内部状態に足し、次の語の予測に使う。
新規性
FactorEngramは、語句ごとに完成した記憶ベクトルを置く代わりに、共有辞書の基底ベクトルを組み合わせる係数を保存する。語句間で記憶の部品を再利用できる設計だ。
文脈による調整にも同じ辞書を使い、基底ごとに係数を制御する。共有する対象と読み出し方を一体で設計した点が、著者らの主張する進歩である。
従来手法との違い
比較対象のEngramは、2語・3語の並びから記憶ベクトルを取り出し、文脈に応じた一つの係数で全体を調整する。FactorEngramは単語も対象に加え、記憶を共有辞書と係数に分けて、部品単位で調整する。
著者らの340Mモデルでは、EngramのNIAH-2、NIAH-3正答率37.6%、15.0%に対し、FactorEngramは79.1%、58.3%だった。ただし、改善には単語検索など複数の変更が含まれるため、各要素の寄与は除去実験で読む必要がある。
実験結果
著者らはFineWeb-Eduの300億語相当で340M、1200億語相当で1Bの基盤モデルを学習し、最大文脈長8192で比較した。WikiTextとLAMBADAの評価には、低いほどよいパープレキシティという予測の難しさの指標を用いた。
340MではWikiTextがTransformerの23.19、Engramの22.29に対し21.29、下流課題の平均正答率は48.10%、49.06%に対し49.82%だった。1BではNIAH-3がEngramの16.6%に対し44.2%。著者らは、基底単位の調整を一括調整に替えると340MのNIAH-3が9.4%に下がるとも報告した。
応用の可能性
編集上の応用案 · 論文が実証した用途とは区別しています。
編集上の応用案:社内手順書から、似た表現が異なる意味で使われる箇所を検索して回答する支援モデルを試す。入力は質問と関連する手順書の文章、出力は該当箇所を踏まえた短い回答とする。
例えば「承認を通す」が購買手続きと開発手続きの双方に現れる場合、前後の文脈で必要な語句の成分を選べるかを見る。論文はこの業務を評価していないため、効果は実データで別途確かめる。
応用先の候補からNauhに相談できます。
導入時の検証
導入時の検証案 · 対象データでの再評価が必要です。
導入時の検証案:まず対象文書から、同じ語句が異なる意味で現れる質問と、長い文章から情報を拾う質問を集める。既存のTransformer、可能ならEngram型の記憶方式、FactorEngramを同じ条件で比較する。
正答率だけでなく、文脈を取り違えた回答の割合、長文中の必要情報を見つける割合、応答時間、記憶領域の使用量を測る。学習量と基盤モデルの規模をそろえ、単語検索と基底単位の調整を一つずつ外して寄与を確認する。
限界と課題
著者らが示した実験は、340Mと1BのTransformer、および指定された言語・検索課題が中心である。1BではWikiTextの指標はTransformerと同値で、下流課題の平均正答率はEngramをわずかに下回った。全指標で優位とは読めない。
編集上の確認点は、導入先の文章での品質に加え、検索表、共有辞書、追加計算がメモリー使用量や応答時間に与える影響である。語句の意味が基底にきれいに分かれているかも、この結果だけでは断定できない。
出典
元のタイトル・要旨を確認する(英語)
FactorEngram: Factorized N-gram Memory with Basis-Level Gating for Language Models
Lookup-based memory has been a promising way to scale the parameters of large language models (LLMs). It retrieves learned representations of local token patterns, such as n-grams, instead of reconstructing them through successive layers of computation. However, existing designs such as Engram treat each retrieved embedding as a monolithic unit. Each embedding is stored in its own hashed slot and modulated by a single scalar gate. As a result, polysemous patterns cannot selectively read out the components of their memory that are relevant to the context. Moreover, parameters are shared only through hash collisions, which are largely unrelated to semantics. We propose FactorEngram, a factorized n-gram memory with basis-level contextual gating. FactorEngram retrieves sparsity-regularized coefficients over a dictionary of basis vectors shared across patterns, so related patterns can reuse common components. The same dictionary is also used for gating. The backbone hidden state is scored against each basis vector to gate the corresponding coefficient before reconstruction, which lets the context modulate each memory component individually. FactorEngram also covers both individual tokens and multi-token n-grams, and we systematically study where the memory branch should be inserted. On 340M- and 1B-parameter Transformer backbones, FactorEngram improves language modeling and downstream task performance. Ablation studies confirm the contribution of each component and identify insertion before the attention sublayer in the middle layers as an effective configuration.
論文本体の取得範囲に基づく解説。AIが作成した未校閲の記事です。性能の数値は著者の評価条件に依存します。応用例と検証計画は編集上の提案です。解説更新:2026-09-29




