ICML2022 《ProGCL:Rethinking Hard Negative Mining in Graph Contrastive Learning》 Reading Note
paper Introduction Contrastive Learning 受益于区分hard negatives (最相似的negative pairs), 但是其他领域的hard negative mining方法不适用于graph。 对于GCL来说大量embedding之后的hard negatives实际上是false negatives。如左图所示,对于CV上的SimCLR,它所学到的高相似度的negatives中,True negatives 和False negatives数量相当,那么从高相似度的negatives中采样到true negatives的概率更大。然而对于GCL方法GCA来说,是每个anchor节点将其他所有(inter/intra)节点作为negatives,使得在训练过程中与它同类的节点也变成anchor的negatives,这些negatives是false negatives。对于GCA,高相似度的negatives中false negatives的数量远多于true negatives,所以直接采样高相似度的negatives作为hard negatives来针对性的判别他们,会导致同类节点的embedding相互远离。这是传统的hard negatives mining方法在graph domain失效的原因。 为了解决这个问题, 本文提出利用Beta mixture model来估计对于一个anchor node,它的一个negatve是true negative的概率,结合相似度,来衡量该negative的hardness。即与anchor node相似度越高,且它是true negative的概率越大,那么该节点的hardness越高。 Methodology GCL 如上图所示,InfoNCE将跨图same node视为positives,其他节点对视为negatives,GCL的目标函数如下: $$ \begin{aligned} \ell\left(\boldsymbol{u}_{i},\boldsymbol{v}_{i}\right)= \log \frac{e^{\theta\left(\boldsymbol{u}_{i}, \boldsymbol{v}_{i}\right) / \tau}}{\underbrace{e^{\theta\left(\boldsymbol{u}_{i}, \boldsymbol{v}_{i}\right) / \tau}}_{\text{positive pair }}+\underbrace{\sum_{k\neq i}e^{\theta\left(\boldsymbol{u}_{i}, \boldsymbol{v}_{k}\right) / \tau}}_{\text{inter-view negative pairs}}+\underbrace{\sum_{k\neq i}e^{\theta\left(\boldsymbol{u}_{i}, \boldsymbol{u}_{k}\right) / \tau}}_{\text{intra-view negative pairs}}}, \end{aligned} $$ Overall objective定义在所有跨图same node pairs上: $$ \mathcal{J}=-\frac{1}{2 N} \sum_{i=1}^N\left[\ell\left(\boldsymbol{u}_{\boldsymbol{i}}, \boldsymbol{v}_{\boldsymbol{i}}\right)+\ell\left(\boldsymbol{v}_{\boldsymbol{i}}, \boldsymbol{u}_{\boldsymbol{i}}\right)\right] $$ 如果将GCA中的2层shared GNN替换为MLP,那么contrastive learning将不存在Message Passing,这样得到的true/false negative分布如(b)所示,可以看出Message Passing是GCL和CL之间产生区别关键因素。直观上,MP将anchor与相邻的negatives拉近,而相邻的negatives大多为False negatives(Homophily),所以GCL得到的高相似度negatives中false negatives要远多于True negatives。 ...