ハイブリッドモデルはどのトークンをより正確に予測するか?
Allen AI は、Hybrid モデルが意味のあるトークン(名詞や動詞)の予測に優れ、単純な反復トークンの処理には Transformer が有利であることを示す詳細な分析結果を発表した。
キーポイント
ハイブリッドモデルの得意分野
名詞、動詞、形容詞といった意味を担うトークンや、代名詞の参照先を特定する文脈理解において、Transformer を上回る性能を示す。
Transformer の強み領域
入力テキストから単語やフレーズをそのまま繰り返す(verbatim)ような単純な反復タスクにおいては、ハイブリッドモデルの優位性が消え、Transformer が有利であることが判明した。
厳密な比較実験の実施
Olmo 3(Transformer)と Olmo Hybrid をデータ、トークナイザー、トレーニングレシピを可能な限り同一に保ち、アーキテクチャの違いのみによる予測の差異を詳細に分析した。
アーキテクチャ特性の解明
Transformer は広範囲の過去の情報を正確に呼び出すのに優れるが、時間的に変化する情報の表現には課題があり、ハイブリッドは再帰層により時系列情報の処理を強化している。
影響分析・編集コメントを表示
影響分析
この分析は、LLM アーキテクチャの選択を単なるベンチマークスコアの比較から、タスクごとの特性に基づいた戦略的な判断へと導く重要な示唆を与えます。特に、大規模な入力処理における計算コストと精度のトレードオフを理解する上で、Transformer と Hybrid の適材適所を明確に定義した点は、今後のモデル設計や実装において極めて重要です。
編集コメント
ベンチマークの平均値に頼らず、アーキテクチャごとの「得意不得意」をトークンレベルで解明した点は非常に示唆に富んでいます。実務では、文脈推論が必要なタスクには Hybrid を、単純なテキスト抽出には Transformer を使い分ける戦略が有効となる可能性があります。
モデルはどのような種類のトークンをよく予測し、またどの種類を予測できないのでしょうか?この問いは特にハイブリッドモデルにおいて興味深く、標準的なトランスフォーマーに挑戦し始めた言語モデルアーキテクチャであり、私たちは Olmo Hybrid とともに調査を進めています。ハイブリッドモデルは標準ベンチマークではトランスフォーマーと同等かそれ以上の性能を発揮しますが、主要な数値だけでは、ハイブリッドモデルがトランスフォーマーに対して持つ具体的な優位性についてはあまり明らかになりません。
これらのトークンレベルの振る舞いについて光を当てるため、私たちは最近、最も強力な 7B トランスフォーマーである Olmo 3 とハイブリッドモデルである Olmo Hybrid を直接比較する実験を行いました。具体的には、LLM(大規模言語モデル)への入力として現れる情報の単位である異なる種類のトークンにわたって、モデルの予測における違いを微細な粒度で比較します。Olmo 3 と Olmo Hybrid は、アーキテクチャ以外の部分では可能な限り同じになるように設計されており、データ、トークナイザー、トレーニングレシピが密接にマッチングしているため、両者の予測の違いは主にアーキテクチャそのものによるものです。これらの違いをトークンレベルで観察することで、ハイブリッドモデルがトランスフォーマーに対して持つ具体的な強みについて洞察を得ることができます。
Our results show that the hybrid's advantage is real across many tokens—but not all. Olmo Hybrid is strongest on tokens that carry meaning, such as nouns, verbs, and adjectives, and on tokens that can only be predicted by following what's going on—like which person a pronoun refers to. But the hybrid's advantage almost disappears on tokens that simply repeat something already in the input – a word or phrase reproduced verbatim from earlier – where the answer is sitting right there to be looked up. That’s where the transformer's strength lies.
Attention versus recurrence—and measuring the difference
A language model is built from a stack of repeated layers, each one refining its representation of every token using the tokens around it. A transformer uses attention in every layer—the model can draw directly on every earlier token at once, weighing how relevant each is to the current prediction. That makes attention good at recalling a specific earlier token exactly even when that token appeared far back in the input. The catch is that every token is compared against all the earlier ones, so attention's cost climbs steeply as the input grows. Additionally, while attention is strong at recalling and aggregating information, it also struggles to represent information that evolves sequentially over time.
ハイブリッドモデルは、いくつかの注意層(attention layers)を保持しつつ、残りを再帰的層(recurrent layers)に置き換えます。注意層とは異なり、再帰的層は左から右へとトークンを読み込み、固定サイズのメモリを保持します。新しいトークンが入力されるたびにそれをメモリに折りたたむことで、入力長がどれだけ長くても各トークンの処理コストは一定のまま保たれます。このメモリは圧縮されており、情報損失を伴うため、再帰的層は注意層のように正確な過去のトークンを参照することはできません。しかし、モデルがトークンを読み進めるにつれて変化する事柄の継続的な記録には非常に適しており、注意層に対する補完的な強みを提供します。
注意層と再帰的層それぞれの強みと弱みを明確に分離するために、Olmo 3 と Olmo Hybrid にテキストの断片(記事、ウィキペディアのエントリ、書籍、科学論文)および Python、HTML、LaTeX などの構造化テキストを入力し、各モデルが与えられたサンプル内で先行するトークンから次のトークンをどれだけ正確に予測できるかを評価しました。両モデルは同じ先行トークンを見ており、あり得るすべての次のトークンに対して確率を割り当てています。実際に次に現れたトークンに対して各モデルが付けた確率を記録しました。その後、2 つのモデル間の損失差(loss gap)、つまり両モデルの損失値の差を計算することで、トークン単位で 2 つのモデルの違いを要約します。正のギャップはハイブリッドモデルが実際の次のトークンをよりよく予測したことを意味し、負のギャップはトランスフォーマーモデルの方が優れていたことを示します。
損失ギャップがどこに集中する可能性があるかを見つけるために、私たちはいくつかの分析を行いました。まず、各トークンをカテゴリに分類し、これらのカテゴリ内での損失ギャップを平均化しました。生の平均値は、カテゴリの希少性やテキストサンプル内のトークンの繰り返し頻度などの他の要因によって歪められる可能性があるため、他の要因を一定に保ちながらカテゴリ自体の影響を推定する回帰分析を用いて各パターンを再確認しました。
実際のテキストが示すもの
Olmo Hybrid は、ほとんどの種類のトークンにおいて Olmo 3 よりも低い損失を示しますが、その差は種類によって同じではありません。
散文においては、意味を持つ名詞、動詞、形容詞などの内容語(content words)と、「the」「of」「is」などの機能語(function words)との間に明確な隔たりが見られます。ハイブリッドモデルは、トランスフォーマーよりも内容語をよりよく予測し、その損失ギャップは約 0.04 です。一方、機能語におけるギャップは約 0.02 と小さくなります。特に副詞や形容詞といった内容語のカテゴリでは、ハイブリッドモデルの優位性が顕著ですが、「there」のような存在を表す機能語のカテゴリでも、ハイブリッドモデルに大きな利点が見られます。要するに、ハイブリッドモデルの優位性は、文が何について述べているかを伝える単語において最も大きく、構文からほぼ推測できる文法用語においては最小となります。
対照的に、ハイブリッドモデルの優位性がトランスフォーマーに対して消失する特定の文脈をいくつか発見しました。その一つは、括弧の閉じ方であり、開き方は含まれません。このパターンは、言語、コード、マークアップにおけるあらゆる括弧タイプにわたって頑健です。なぜでしょうか?アテンション機構が括弧の対応関係を表現するのに十分であることは知られており、これはアテンションのみで括弧の閉じ方の予測も可能であることを示唆しています。
ハイブリッドモデルの優位性がほぼ消失するもう一つの場所は、次のトークンがすでにテキスト内に存在するものを単に繰り返す場合です。これらのケースは、繰り返し n-gram(シーケンスを完了させるトークンが、同じテキスト内で以前にそのまま現れている連続したテキストの塊)を検出することで特定できます。繰り返される連続部分が長いほど、ハイブリッドモデルのリードは小さくなり、最終的にはゼロに近づきます。
最後に、これらの知見に触発され、特定の種類のトークンに対するフィルタリングされた損失を評価指標として用いることで、事前学習実験における異なるアーキテクチャをより適切に比較できるか探索しました。私たちは以前の Olmo Hybrid 研究で用いたパラメータ数 10 億のモデル 3 つ、すなわちトランスフォーマー、ハイブリッド型、そして注意機構を全く持たない純粋なリカレントモデルを使用しました。意味を持つ繰り返しでないトークンにおいては、ハイブリッド型と純粋なリカレントモデルがトランスフォーマーを上回り、その中でハイブリッド型が最も優れた性能を示しました。一方、繰り返されるトークンにおいては、コピー元を参照するための注意機構を持たない純粋なリカレントモデルは、ハイブリッド型およびトランスフォーマーの両方に後れをとりました。したがって、これらのフィルタリングされたトークン損失は、トレーニング初期段階において、アーキテクチャ間の微細な差異(例えば、コピー能力や内容語における違いなど)を、それでは見ることができない形で明らかにします。
ここまでの結論
この研究から得られる教訓は二つあります。第一に、モデル全体の平均誤差である単一の全体損失(loss)では、トランスフォーマーとハイブリッドアーキテクチャを比較するにはあまりにも粗すぎます。特定のモデル能力を検証するトークンにのみ損失スコアリングを適用することで、重要な違いが浮き彫りになります。第二に、特にハイブリッドモデルにおいては、オープンクラス(open-class)のトークンにおいて特定のアプローチによる優位性の証拠が見つかりました。これはおそらく RNN レイヤーの状態追跡能力に関連していると考えられます。次のステップとして、これらの知見を現在進行中のハイブリッドモデリング研究に反映させていきます。各コンポーネントがどのトークンで得意とするかを一つずつ理解することから、最適なハイブリッドアーキテクチャが生まれると私たちは信じています。そして、このような研究が AI コミュニティ全体の理解の深化に寄与することを願っています。
完全なレポートをお読みいただき、Olmo 3、Olmo Hybrid、および関連するオープンアーティファクトをぜひ探索してください。
Ai2 の最新ニュースに関する月次アップデートを受け取るには購読してください。
原文を表示
Which kinds of tokens does a model predict well—and which does it not? That question is especially intriguing in the case of hybrids, a language model architecture that’s begun to challenge the standard transformer and that we’ve been investigating with Olmo Hybrid. Hybrids can match or beat transformers on standard benchmarks, but the headline numbers don’t reveal much about what specific advantages hybrid models have over transformers.
In an attempt to shed light on these token-level behaviors, we recently conducted experiments comparing our own strongest 7B transformer, Olmo 3, and hybrid model, Olmo Hybrid, head-to-head. Specifically, we compare the differences in model predictions in a fine-grained way across different types of tokens (units of information that appear as input to an LLM). Because Olmo 3 and Olmo Hybrid were built to be as alike as possible outside their architectures – closely matched in data, tokenizer, and training recipe – any difference in their predictions mostly reflects the architecture itself, and viewing these differences at the token level allows us to glean insights about the specific strengths of hybrid models over transformers.
Our results show that the hybrid's advantage is real across many tokens—but not all. Olmo Hybrid is strongest on tokens that carry meaning, such as nouns, verbs, and adjectives, and on tokens that can only be predicted by following what's going on—like which person a pronoun refers to. But the hybrid's advantage almost disappears on tokens that simply repeat something already in the input – a word or phrase reproduced verbatim from earlier – where the answer is sitting right there to be looked up. That’s where the transformer's strength lies.
Attention versus recurrence—and measuring the difference
A language model is built from a stack of repeated layers, each one refining its representation of every token using the tokens around it. A transformer uses attention in every layer—the model can draw directly on every earlier token at once, weighing how relevant each is to the current prediction. That makes attention good at recalling a specific earlier token exactly even when that token appeared far back in the input. The catch is that every token is compared against all the earlier ones, so attention's cost climbs steeply as the input grows. Additionally, while attention is strong at recalling and aggregating information, it also struggles to represent information that evolves sequentially over time.
A hybrid model keeps a few attention layers but swaps the rest for recurrent layers. Unlike an attention layer, a recurrent layer reads tokens left to right and carries a fixed-size memory, folding each new token into memory as it goes so the cost of processing each token stays flat however long the input gets. That memory is compressed and lossy, so a recurrent layer can't reach back for an exact earlier token the way attention can—but it’s well suited to keeping a running account of anything that changes as the model reads tokens, providing a complementary strength to attention.
To isolate the areas of strength and weakness for attention and recurrent layers, we fed Olmo 3 and Olmo Hybrid passages of text – articles, Wikipedia entries, books, and scientific papers, as well as structured text like Python, HTML, and LaTeX – and scored each model on how well it predicted each token from the tokens before it in a given sample. Both models saw the same earlier tokens and assigned a probability to every possible next token; we recorded the probability each gave to the token that actually followed. We then summarize the difference between the two models token by token by computing the loss gap, i.e., the difference in loss between the two models. A positive gap means the hybrid predicted the real next token better; a negative gap means the transformer did.
To find where the loss gaps might concentrate, we ran several analyses. First, we sorted each token into a category and averaged the loss gap within these categories. Because a raw average can be skewed by other factors, such as a category's rarity or how often tokens repeat in a sample of text, we re-checked each pattern with a regression that estimates the category's own effect while holding other factors constant.
What real text shows
We find that Olmo Hybrid has lower loss than Olmo 3 on most kinds of tokens—though not by the same amount on each.
In prose, the clearest divide is between content words – meaning-bearing nouns, verbs, and adjectives – and function words like "the," "of," and "is." The hybrid predicts content words better than the transformer with a loss gap around 0.04, whereas the gap is closer to 0.02 on function words. In particular on content-word categories like adverbs and adjectives, the advantage of hybrid models is particularly pronounced, though some function-word categories like existentials (“there”) also show a large advantage for hybrid models. In short, the hybrid's edge is biggest on the words that say what a sentence is about and smallest on the grammatical words any model can nearly guess from syntax.
In contrast, we find some specific contexts where the advantage of hybrid models over transformers disappears. The first of these is closing, but not opening, braces, a pattern which is robust across brackets in language, code, and markup. Why? It’s known that attention suffices for representing bracket matching, which suggests attention alone suffices for closing brace prediction.
The second place where the hybrid's advantage all but disappears is when the next token simply repeats something already in the passage. We spot these cases by looking for repeated n-grams—runs of text where the token that completes a sequence has appeared, verbatim, earlier in the same passage. The longer the repeated run, the smaller the hybrid's lead until it approaches zero.
Finally, inspired by these findings, we explore using filtered losses on specific types of tokens as an evaluation to better compare different architectures in pretraining experiments. We use three 1B-parameter models from our earlier Olmo Hybrid work: a transformer, a hybrid, and a pure recurrent model with no attention at all. On meaning-bearing tokens that aren't repeats, the hybrid and pure recurrent model overtake the transformer with the hybrid performing the best. On repeated tokens, the pure recurrent model – with no attention to reach back for the copy – falls behind both the hybrid and the transformer. Thus, these filtered token losses reveal different fine-grained differences between architectures (e.g., copying abilities or differences on content words) early in training in a way that would not otherwise be visible.
Where this leaves us
Two lessons follow from this work. First, a single overall loss – the model's average error across all tokens – is too blunt to compare transformer and hybrid architectures. Scoring the loss on just the tokens that test a specific model ability surfaces key differences. Second, specifically for hybrid models, we found evidence of particular advantages on open-class tokens, which perhaps is related to the state tracking capabilities of RNN layers. As a next step, we're taking these findings into our ongoing hybrid modeling work. We believe the best hybrid architectures will come from understanding, token by token, what each component of a model does well – and we hope studies like this help that understanding grow across the whole AI community.
We encourage you to read our full report and explore Olmo 3, Olmo Hybrid, and their associated open artifacts.
Subscribe to receive monthly updates about the latest Ai2 news.
関連記事
再帰型トランスフォーマー:より深い実効深度と効率的なデコーディング
研究者らが、標準的なトランスフォーマーの「時間的浅さ」を克服する新アーキテクチャ「再帰型トランスフォーマー」を発表した。層ごとの再帰性により、各層が内部メモリを継続的に更新し、大規模な層スタックなしで複雑な反復推論を実現する。
OlmPool:小さなアーキテクチャの選択が長文コンテキスト拡張を阻害する仕組み
研究者らは26モデルからなる制御されたスイート「OlmPool」を作成し、学習データや拡張レシピを一定に保った場合でも、アーキテクチャ上の微小な選択が積み重なることで長文コンテキストの拡張が困難になることを示した。
AI エンジニア向け技術ガイド:エージェントの記憶には 7 つのタイプがある
MarkTechPost は、デフォルトで状態を持たない大規模言語モデルを、継続的な学習と行動が可能なシステムに変えるための「エージェント記憶」の重要性を解説し、その実装に必要な 7 つの記憶タイプを技術的に紹介している。
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み