arXiv:2601.18858cs.LGcs.AI2026-01被引 2

用结构度量预测并提升Transformer的组合泛化能力

Representational Homomorphism Predicts and Improves Compositional Generalization In Transformer Language Model

  • 提出同态误差(HE)衡量语义表示与语法规则的一致性
  • HE与分布外准确率相关性达0.73,可预测模型失败
  • 正则化降低HE能显著提升组合泛化性能,适合研究语言模型机制者

组合泛化——即理解熟悉成分的新组合——仍是神经网络的持久挑战。行为评估虽能揭示模型何时失败,却难以说明其在表示层面失败的原因。本文引入同态误差(HE),一种结构化度量,用于评估语言语法规则与模型隐状态组合规则之间的不一致性。将这种不一致性建模为语言表达代数与模型隐状态空间之间近似同态的偏离。通过实验验证:i)HE能否预测组合泛化性能;ii)训练中正则化低HE是否可提升性能。为避免数据污染,我们使用改进版SCAN数据集,从零开始训练小型解码器型Transformer。在受控实验中,HE在噪声注入下对分布外(OOD)组合泛化具有0.73的$R^2$相关性。消融分析显示,模型深度对HE或OOD准确率影响甚微,训练数据覆盖率存在阈值效应,随机插入噪声标记会增加HE。干预实验表明,HE正则化训练显著降低HE(p=1.1×10⁻⁴),并使OOD准确率显著提升(p=0.023)。结果表明,HE兼具诊断价值与可操作性,可用于改善组合泛化。

原文摘要 · Abstract (English)

Compositional generalization-the ability to interpret novel combinations of familiar components-remains a persistent challenge for neural networks. Behavioral evaluations reveal \emph{when} models fail but offer limited insight into \emph{why} failures arise at the representational level. We introduce \textit{Homomorphism Error} (HE), a structural metric that measures the inconsistency between a set of established rules for which words combine to form new meaning (linguistic syntax) and model's learned rules for which hidden states combine to form new states (semantic syntax). We formulate this inconsistency as deviations from approximate homomorphisms between the linguistic expression algebra and a model's hidden-state space. We designed experiments to test if i) HE predicts compositional generalization performance, and ii) will regularizing for low HE during training improve such performance. To avoid the effect of data spoilage, we train small decoder-only Transformers from scratch using an adapted version of established dataset, SCAN, for testing compositional generalization. Across controlled experiments, HE predicts out-of-distribution (OOD) compositional generalization under noise injection, achieving $R^2=0.73$ correlation between HE and OOD accuracy. Ablations show that model depth has minimal effect on either HE or OOD accuracy, training data coverage exhibits threshold effects, and randomly inserted noise tokens increase HE. Intervention experiment shows that HE-regularized training significantly reduces HE ($p=1.1\times10^{-4}$) and yields a statistically significant improvement in OOD accuracy ($p=0.023$). Together, these results indicate the potential of HE to be both a diagnostic and an actionable training signal for improving compositional generalization.

组合泛化语言模型同态误差Transformer

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。