arXiv:2412.11299cs.LGstat.ML2024-12AAAI被引 4

直接匹配比任务损失匹配更可靠地衡量神经网络表征相似性

How not to Stitch Representations to Measure Similarity: Task Loss Matching versus Direct Matching

  • 用直接匹配最小化拼接后表征的差异,避免分布外表示问题
  • 任务损失匹配会错误判断远层间相似性,甚至自比还高
  • 适合评估模型内部表征相似性,尤其在结构对比时

衡量深度神经网络内部表征的相似性是一个重要且具有挑战性的问题。模型拼接被提出作为一种可能方法:将两个半网络通过将前半部分输出映射到后半部分输入的方式连接起来。若拼接后的网络在特定任务上表现良好,则认为其表征功能相似。通常采用任务损失匹配法,即在冻结两个半网络的前提下,训练一个仿射拼接层以优化任务损失。然而我们指出,任务损失匹配可能严重误导相似性判断。例如,它可能错误显示相距甚远的层之间高度相似(而这些层的功能属性本应不同),或使架构对应层之间的相似性低于非对应层。更令人意外的是,在同一网络内比较层时,任务损失匹配常显示某层比自身更相似。我们认为其根本原因在于任务损失匹配倾向于生成分布外表征以提升任务性能。我们证明,直接匹配(即最小化拼接后表征距离)不存在这些问题。通过与任务损失匹配、CCA和CKA等经典相似性指标对比,我们得出结论:直接匹配在结构与功能需求之间取得了良好平衡。

原文摘要 · Abstract (English)

Measuring the similarity of the internal representations of deep neural networks is an important and challenging problem. Model stitching has been proposed as a possible approach, where two half-networks are connected by mapping the output of the first half-network to the input of the second one. The representations are considered functionally similar if the resulting stitched network achieves good task-specific performance. The mapping is normally created by training an affine stitching layer on the task at hand while freezing the two half-networks, a method called task loss matching. Here, we argue that task loss matching may be very misleading as a similarity index. For example, it can indicate very high similarity between very distant layers, whose representations are known to have different functional properties. Moreover, it can indicate very distant layers to be more similar than architecturally corresponding layers. Even more surprisingly, when comparing layers within the same network, task loss matching often indicates that some layers are more similar to a layer than itself. We argue that the main reason behind these problems is that task loss matching tends to create out-of-distribution representations to improve task-specific performance. We demonstrate that direct matching (when the mapping minimizes the distance between the stitched representations) does not suffer from these problems. We compare task loss matching, direct matching, and well-known similarity indices such as CCA and CKA. We conclude that direct matching strikes a good balance between the structural and functional requirements for a good similarity index.

表征相似性神经网络深度学习

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