論文解説
Evaluating Compositional Generalization in Transformers: The Role of Composition Equivalence and Module Coverage
Transformerの構成的汎化の評価:構成の同値性とモジュールカバレッジの役割
- 課題 Transformerの構成的汎化の性能のばらつきを、ベンチマーク設計の要因である構成の同値性とモジュールカバレッジで説明します。
- 手法 構成の同値性の共有割合と位置ごとのモジュール分布のずれを制御して訓練・テスト分割を作り、直接モデルと段階的モデルを比べます。
- 結果 直接モデルの精度は、共有される構成の同値の割合に応じて急に高くなります。位置ごとのモジュールカバレッジのずれが大きいほど、両モデル系列の精度は下がります。LiveCodeBenchの事例でも、同値の漏えいによってLlama3-8Bの全体精度が上がりました。
構成的汎化の評価の問題
Transformerの逐次的な構成的汎化(task-based compositional generalization)は、訓練で見ていないモジュール順序をテストで処理する能力です。既存研究は、無作為に作った少数の訓練・テスト分割で評価してきました。その結果、直接モデル(最終出力のみで学習)の性能は設定ごとに大きく変わり、一貫しませんでした。本論文は、このばらつきをモデル構造ではなく、ベンチマーク設計の二つの要因、構成の同値性(composition equivalence)とモジュールカバレッジ(module coverage)で説明しようとしています。構成の同値性とは、異なるモジュール順序が同じエンドツーエンドの関数に帰着する性質です。
モジュールカバレッジは、テストが訓練とは異なる位置や文脈でモジュールをどの程度頻繁に出現させるかを示します。
構成の同値性とモジュールカバレッジの定義
構成の同値性は、二つの逐次的構成FとF′が、入力の部分空間Sのすべてのx∈Sについて F(x)=F′(x) を満たすとき、同値であると定義されます。この定義により、同値類[F]_Sは同じ入力と出力の対応を共有する構成の集合になります。テストの構成のうち、訓練の構成と少なくとも一つの同値類を共有する割合をδ_equivと定義します。1−δ_equivは、訓練中に見ていないエンドツーエンドの振る舞いを示すテスト構成の割合として読みます。モジュールカバレッジは、位置ごとの分布と対ごとの隣接分布のKL発散で測ります。位置ごとの発散は、テストの分布が訓練の分布からどれだけ外れるかを、位置全体にわたって平均した値です。

Figure 1 : (a) A sequential composition task combines “atomic” functions (e.g., sort, mode, filter). Task-basedcompositional generalization is the ability to generalize to unseen sequences after training on a subset. (b)Composition equivalence:Different sequences are composition equivalent if they reduce to the same end-to-end function. For example, one equivalence class consisting of the first four sequences reduces to returning the most frequently occurring vowel in a set of strings; direct models succeed on the test sequence (mode◦filter◦sort ) from this class but fail on the remaining two test sequences from a different composition equivalence class. (c)Module coverage:Examples of coverage failures includeposition-wise(e.g., function 2 never appearing in the first position, shown with dashed lines) andpair-wise(e.g., missing pair (2,1) in the training set, shown with solid lines).
出典 · CC BY 4.0 · Purva Pruthi, Andrew Yuan, Alexander D'Amour, David Jensen · Evaluating Compositional Generalization in Transformers: The Role of Composition Equivalence and Module Coverage · 論文の図を引用 · 元のPDFの2ページ目から図の部分を抽出しています。統制された訓練・テスト分割の構成
Uniformデータセットは、6つのランダムな全単射(bijection)関数で構成されます。構成の同値性を基本的に取り除いた統制設定です。Diverseデータセットは、sort、concatenate、filter、shift、union、modeの6つの関数で構成されます。filterやmodeのように多対一の写像があるため、構成の同値性が多く現れます。同値類は、構成のペアの出力一致スコアが閾値0.01以上のとき辺を張ったグラフの連結成分として学習されます。その後、共有割合を調整するため、各テスト同値類の構成のおよそ半分を、訓練同値類の構成と入れ替えます。モジュールカバレッジは、偏りの強さαで、訓練とテストの位置ごとのサンプリング確率を互いに逆方向に偏らせて調整します。
モデルと評価の設定
直接モデルと段階的モデルを、それぞれ絶対位置埋め込みと相対位置埋め込みで学習します。実装はnanoGPT構造(3層、6ヘッド)です。この小さな構造は、多くの分割を効率よく評価するために選ばれました。より大きな構造(12層、12ヘッド)でも、似た傾向が報告されています。評価では、テストサンプル10k個に対して完全一致による採点で未知の入力の精度を測り、5つのランダムシードの平均を取ります。within-k設定は、同じ長さkの訓練とテストを分割します。cross-k設定は、異なるkで評価しつつ、恒等モジュールで長さを揃えます。

Figure 3 :Cross- k evaluation:For the diverse benchmark (a–b), direct models perform well near training k as equivalences persist across nearbyk values. Direct models fail on the uniform benchmark (c–d) regardless of identity tokens, since identity-based equivalences in the uniform benchmark are k-specific. Step-by-step models are more robust but still exhibit significant variability.
出典 · CC BY 4.0 · Purva Pruthi, Andrew Yuan, Alexander D'Amour, David Jensen · Evaluating Compositional Generalization in Transformers: The Role of Composition Equivalence and Module Coverage · 論文の図を引用 · 元のPDFの7ページ目から図の部分を抽出しています。
Figure 9 :Generalization performance of bigger transformer architecture: We observe that the performance of the bigger architecture shows similar performance trends as seen for the smaller architecture (N_heads = 6, N_layers = 3) in Figures 2(b) and (d).
出典 · CC BY 4.0 · Purva Pruthi, Andrew Yuan, Alexander D'Amour, David Jensen · Evaluating Compositional Generalization in Transformers: The Role of Composition Equivalence and Module Coverage · 論文の図を引用 · 元のPDFの18ページ目から図の部分を抽出しています。構成の同値の共有と直接モデルの精度
Diverseベンチマークのk=6設定では、テスト系列の共有構成同値の割合が0%から約80%まで高まるにつれて、直接モデルの精度が急に上がると報告されています。完全共有でも精度は100%に届きません。一部の同値は入力に応じて近似的であり、一部の同値類は構成が4~6個しかないため、訓練の部分集合では完全な汎化が保証されないからです。著者らは、この結果を、共有された同値類は直接モデルの汎化に必要だが十分ではない根拠として解釈しています。閾値を0.01から0.95まで変えた感度分析では、閾値が高いと実際の共有が過小評価され、0%共有条件の精度が押し上げられる傾向が報告されています。

Figure 4 :Isolating the effect of composition equivalence in the diverse benchmark ( k= 6 ):(a) Generalization performance increases with the degree of shared composition equivalence classes between train and test. (b) The direct model generalizes primarily to test sequences that share equivalence classes and fails on classes exhibiting novel end-to-end behavior.
出典 · CC BY 4.0 · Purva Pruthi, Andrew Yuan, Alexander D'Amour, David Jensen · Evaluating Compositional Generalization in Transformers: The Role of Composition Equivalence and Module Coverage · 論文の図を引用 · 元のPDFの8ページ目から図の部分を抽出しています。
Table 1 :Sensitivity of direct-model accuracy to the equivalence threshold:We report accuracy on train/test splits with 0% and 100% shared composition equivalences, where equivalence classes are learned at different thresholds. At low thresholds, weak equivalences are captured, so the 0% shared split contains no equivalences of any strength and generalization is poor. At high thresholds, some equivalences go undetected and remain in the 0% shared split, which inflates generalization performance.
出典 · CC BY 4.0 · Purva Pruthi, Andrew Yuan, Alexander D'Amour, David Jensen · Evaluating Compositional Generalization in Transformers: The Role of Composition Equivalence and Module Coverage · 論文の図を引用 · 元のPDFの8ページ目から図の部分を抽出しています。
Figure 8 :Diverse benchmark, N_heads = 6, N_layers = 3, Direct (Relative): We observe non-trivial compositional generalization, as the models perform well on training and validation compositions, the test performance also increases. We observe better generalization for K= 6 than for K= 2 due to more training diversity and shared equivalences.
出典 · CC BY 4.0 · Purva Pruthi, Andrew Yuan, Alexander D'Amour, David Jensen · Evaluating Compositional Generalization in Transformers: The Role of Composition Equivalence and Module Coverage · 論文の図を引用 · 元のPDFの17ページ目から図の部分を抽出しています。
Figure 10 :Equivalence class necessity and training requirements:(a) Generalization performance to unseen sequences is strongly correlated with the degree of shared composition equivalence classes between train and test. (b) Models need to see at least 4–5 composition equivalences (per class) in training to generalize to the corresponding test equivalences.
出典 · CC BY 4.0 · Purva Pruthi, Andrew Yuan, Alexander D'Amour, David Jensen · Evaluating Compositional Generalization in Transformers: The Role of Composition Equivalence and Module Coverage · 論文の図を引用 · 元のPDFの19ページ目から図の部分を抽出しています。
Figure 12 :Size distribution of learned equivalence classes(K= 6)
出典 · CC BY 4.0 · Purva Pruthi, Andrew Yuan, Alexander D'Amour, David Jensen · Evaluating Compositional Generalization in Transformers: The Role of Composition Equivalence and Module Coverage · 論文の図を引用 · 元のPDFの21ページ目から図の部分を抽出しています。位置ごとのモジュールカバレッジのずれの影響
位置ごとのKL発散αが大きくなるほど、直接モデルと段階的モデルの汎化精度は単調に下がります。Diverseベンチマークでは、構成の同値がある場合、この低下がすべてのモデルでより速く進みます。著者らは、これを、同値が生む近道学習がカバレッジの失敗と重なった結果として解釈しています。絶対位置埋め込みを使った段階的モデルは、相対位置埋め込みより位置ごとのずれに敏感だと報告されています。対ごとのずれでも、Diverseベンチマークで感度が大きくなります。Uniformベンチマークは、極端なサポート集合の違反を除けば、概ね頑健です。

Figure 5 :Effect of position-wise distribution shift:As the position-wise KL divergence in- creases, the compositional generalization perfor- mance of both direct and step-by-step models de- creases.
出典 · CC BY 4.0 · Purva Pruthi, Andrew Yuan, Alexander D'Amour, David Jensen · Evaluating Compositional Generalization in Transformers: The Role of Composition Equivalence and Module Coverage · 論文の図を引用 · 元のPDFの9ページ目から図の部分を抽出しています。
Figure 19 :Effect of pairwise-wise distribution shift:(a) As the pairwise-wise KL divergence increases, the compositional generalization performance of both direct and step-by-step models decreases in the diverse benchmark. (b) For the uniform benchmark, the effect of divergence is primarily observed at the extreme right end for support violations.
出典 · CC BY 4.0 · Purva Pruthi, Andrew Yuan, Alexander D'Amour, David Jensen · Evaluating Compositional Generalization in Transformers: The Role of Composition Equivalence and Module Coverage · 論文の図を引用 · 元のPDFの25ページ目から図の部分を抽出しています。
Figure 20 :Combined effect of position-wise shift and reduced diversity:Shows (1- accuracyKL) to demonstrate accuracy degradation as in Figure 5, revealing combined effects of coverage shift and reduced compositional diversity due to biased sampling. Here, accuracyKL is the performance with biased sampling.
出典 · CC BY 4.0 · Purva Pruthi, Andrew Yuan, Alexander D'Amour, David Jensen · Evaluating Compositional Generalization in Transformers: The Role of Composition Equivalence and Module Coverage · 論文の図を引用 · 元のPDFの26ページ目から図の部分を抽出しています。統制実験と除去による対照
Uniformベンチマークで恒等モジュールなしにwithin-kで評価すると、直接モデルの精度は、k∈{2,…,6}のすべての範囲でちょうど0に落ちます。この設定には、構造的に構成の同値がないためです。一方、恒等モジュールを入れると、正確な恒等に基づく同値が生まれ、精度が高くなります。Diverseベンチマークでは、恒等モジュールがなくても、sortやmodeなどの関数の性質から生じた同値が直接モデルの性能を生み出します。これらの結果は、構成の同値の存在が直接モデルの性能の主な条件であることを示しています。ただし、恒等モジュールそのものが汎化を保証するわけではありません。

Figure 2 :Within- k evaluation:Direct models fail completely (0% accuracy) on uniform bijections without identity tokens (Figure (d)), while step-by-step models maintain near-perfect performance across all conditions. We observe that including identity tokens or diverse function types seems crucial for the generalization performance of direct models.
出典 · CC BY 4.0 · Purva Pruthi, Andrew Yuan, Alexander D'Amour, David Jensen · Evaluating Compositional Generalization in Transformers: The Role of Composition Equivalence and Module Coverage · 論文の図を引用 · 元のPDFの7ページ目から図の部分を抽出しています。
Figure 7 :Uniform benchmark (without identity), N_heads = 6, N_layers = 3, Direct (Relative): We observe that the models learn to predict the outputs of training compositions for both K=2 and for K=6, while the test accuracy on unseen compositions remains 0% throughout. We report two metrics: (1)sharp accuracy, where a prediction scores 1.0 only if the entire output sequence is correct and 0.0 otherwise; and (2)mean token accuracy, average accuracy of predictions in the output sequence, with both metrics averaged across compositions from each split. For reference, 100 epochs correspond to roughly 20k iterations (batch size 512, 100k training samples, 195 iterations per epoch).
出典 · CC BY 4.0 · Purva Pruthi, Andrew Yuan, Alexander D'Amour, David Jensen · Evaluating Compositional Generalization in Transformers: The Role of Composition Equivalence and Module Coverage · 論文の図を引用 · 元のPDFの17ページ目から図の部分を抽出しています。Llama3-8Bの事例研究
LiveCodeBenchのコード出力予測タスクで、Llama3-8BをLoRAでファインチューニングした事例研究では、同じ関数名で定義された同値類を訓練に漏えいさせた割合hを0、0.5、1.0と変えています。訓練サンプル数は条件間で一定に保たれています。その結果、同値を漏えいさせると全体の精度は大きく上がります。一方、漏えいしなかったheld-out関数の精度は、ごくわずかしか上がりません。著者らは、この結果を、実際のコードのタスクでも構成の同値が構成的汎化の性能に影響するという根拠として示しています。ただし、この事例は特定のチェックポイントと特定のデータ構成に限った結果です。漏えいなしでも一部の関数が改善した点は、明示されていない同値の影響によるものと解釈されます。

Figure 6 : (a)Code output prediction performance of Llama3-8b on LiveCodeBench benchmark: We show the accuracy of the base model (No LoRA) and three LoRA fine-tuned models on splits with varying ratios of shared equivalence classes (defined by the same function names) (held out h=0, 0.5, 1.0). As splits share composition equivalences, accuracy improves substantially. (b)Performance grouped by equivalence classes:We observe that performance onmostfunctions only improves when equivalences are leaked into the fine-tuning set.
出典 · CC BY 4.0 · Purva Pruthi, Andrew Yuan, Alexander D'Amour, David Jensen · Evaluating Compositional Generalization in Transformers: The Role of Composition Equivalence and Module Coverage · 論文の図を引用 · 元のPDFの10ページ目から図の部分を抽出しています。範囲と限界
著者らは、研究結果は主に逐次的な構成タスクから得られたものであり、階層的またはグラフベースの複雑な構成に一般化されるかどうかは未解決の問いだと述べています。LiveCodeBenchでは、実装ごとに異なるライブラリを使うため構造が大きく違い、実データではモジュールカバレッジ・長さ・順序を統制できません。したがって、著者らは、構成の同値が観測された性能向上の唯一の仕組みであるとは主張していません。二つの要因を正確に分けるには、統制された合成設定や、明示的に統制された実データが必要だと提案しています。
論文情報
- 著者
- Purva Pruthi, Andrew Yuan, Alexander D'Amour, David Jensen
- 学会・ジャーナル
- arXiv · プレプリント
- 公開日
- 2026年11月10日
- 登録日
- 2026年11月11日
- 更新日
- 2026年11月10日
- バージョン
- v1
- arXiv
- 2611.13498
- カテゴリ
- cs.LG · cs.CL
- ライセンス
- CC BY 4.0
- 掲載内容
- 論文情報・解説・論文の図
この解説は、Refivuの韓国語解説をAIで翻訳したものです。不正確な翻訳や誤りが含まれる可能性があります。論文と図の利用条件は各出典に従います。
アブストラクト
Compositional generalization is an important form of out-of-distribution generalization, defined as the ability to train on some combinations of modules (e.g., functions such as sort, filter) and then generalize to unseen combinations. Despite substantial empirical work evaluating compositional generalization in transformers, findings have been inconsistent because evaluations were often conducted on a limited set of train-test splits, defined in an ad hoc manner. Through a systematic evaluation, we identify two key aspects of the train-test distribution that strongly affect performance: composition equivalence and module coverage. We show that the apparent performance of direct models (trained only on final outputs) results primarily from exploiting composition equivalences, meaning different sequences of modules that reduce to identical end-to-end functions. When benchmarks eliminate these equivalences, performance drops significantly, showing their inability to generalize to compositions of known modules that produce novel end-to-end functions. We further demonstrate that performance degrades monotonically as module coverage shifts increase (when modules appear in different contexts between train and test), affecting both direct and step-by-step models (trained on intermediate and final outputs). These findings have concrete implications for benchmark design: benchmarks that include compositional equivalences can lead to significant overestimation of the generalization abilities of direct models, and benchmarks that include both module coverage violations and compositional equivalences can exacerbate shortcut learning. As a case study, we demonstrate the role of compositional equivalence on the generalization performance of the pre-trained model Llama3-8B on the code-output prediction task in the coding benchmark LiveCodeBench.
この論文を引用
Purva Pruthi, Andrew Yuan, Alexander D'Amour, David Jensen (2026). Evaluating Compositional Generalization in Transformers: The Role of Composition Equivalence and Module Coverage. arXiv:2611.13498v1. https://arxiv.org/abs/2611.13498v1
BibTeX
@misc{pruthi2026evaluating,
title = {{Evaluating Compositional Generalization in Transformers: The Role of Composition Equivalence and Module Coverage}},
author = {Purva Pruthi and Andrew Yuan and Alexander D'Amour and David Jensen},
year = {2026},
eprint = {2611.13498},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2611.13498v1}
}