2025-10-23 · 专家 · 计算机视觉 · 机器学习 · 数据科学

When Do Transformers Learn Heuristics for Graph Connectivity?

这篇论文通过理论分析和实验验证,揭示了Transformer在图连通性问题上的学习行为,指出模型在数据分布超出其处理能力时倾向于学习启发式规则而非精确算法。

更新于 2025-10-23。作者:Qilin Ye、Deqing Fu、Robin Jia、Vatsal Sharan。

中文摘要

变压器通常无法学习具有可推广性的算法,反而依赖于脆弱的经验法则。以图连通性作为测试平台,我们从理论和实证两方面解释了这一现象。我们考虑了一种简化的变压器架构,即解耦变压器,并证明一个L层模型具有解决直径恰好为3^L的图的容量,实现了计算邻接矩阵幂的算法。我们分析了训练动态,并表明学习策略取决于大多数训练实例是否在这个模型容量内。在容量范围内的图(直径≤3^L)驱动学习正确的算法解决方案,而超出容量的图驱动学习基于节点度数的一个简单启发式算法。最后,我们通过实证表明,将训练数据限制在模型的容量内,会导致标准和解耦的变压器学习精确的算法,而不是基于度数的启发式算法。

英文摘要

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.

解读

一句话总结

这篇论文通过理论分析和实验验证,揭示了Transformer在图连通性问题上的学习行为,指出模型在数据分布超出其处理能力时倾向于学习启发式规则而非精确算法。

问题1:这篇论文想要解决什么具体问题?

问题2:论文的核心创新点是什么?

问题3:实验结果如何验证了方法的有效性?

问题4:这个研究的实际应用价值是什么?

来源

机器可读索引:llms.txt