ChatPaper.aiChatPaper

Transformerはいつグラフ接続性のヒューリスティクスを学習するのか?

When Do Transformers Learn Heuristics for Graph Connectivity?

October 22, 2025
著者: Qilin Ye, Deqing Fu, Robin Jia, Vatsal Sharan
cs.AI

要旨

Transformerは、一般化可能なアルゴリズムを学習するのではなく、脆弱なヒューリスティックに依存することが多い。本論文では、グラフの連結性をテストベッドとして、この現象を理論的かつ実証的に説明する。簡略化されたTransformerアーキテクチャであるdisentangled Transformerを考察し、L層のモデルが直径がちょうど3^Lまでのグラフを解く能力を持つことを証明する。これは、隣接行列のべき乗を計算するアルゴリズムと等価である。学習ダイナミクスを分析し、学習された戦略が、ほとんどの訓練インスタンスがこのモデルの能力範囲内にあるかどうかに依存することを示す。能力範囲内のグラフ(直径 ≤ 3^L)は、正しいアルゴリズム的解法の学習を促す一方で、能力範囲外のグラフは、ノード次数に基づく単純なヒューリスティックの学習を促す。最後に、訓練データをモデルの能力範囲内に制限することで、標準的なTransformerとdisentangled Transformerの両方が、次数ベースのヒューリスティックではなく、正確なアルゴリズムを学習することを実証的に示す。
English
Transformers often fail to learn generalizable algorithms, instead relying on brittle heuristics. Using graph connectivity as a testbed, we explain this phenomenon both theoretically and empirically. We consider a simplified Transformer architecture, the disentangled Transformer, and prove that an L-layer model has capacity to solve for graphs with diameters up to exactly 3^L, implementing an algorithm equivalent to computing powers of the adjacency matrix. We analyze the training-dynamics, and show that the learned strategy hinges on whether most training instances are within this model capacity. Within-capacity graphs (diameter leq 3^L) drive the learning of a correct algorithmic solution while beyond-capacity graphs drive the learning of a simple heuristic based on node degrees. Finally, we empirically demonstrate that restricting training data within a model's capacity leads to both standard and disentangled transformers learning the exact algorithm rather than the degree-based heuristic.
PDF11October 23, 2025