arXiv:2505.02027cs.LGcs.AI2025-05中稿 · ed被引 6

通过分阶段优化图提示,提升模型在新图上的零样本适应能力。

GraphPrompter: Multi-stage Adaptive Prompt Optimization for Graph In-Context Learning

  • 分三阶段优化提示:生成、选择、增强,减少噪声干扰。
  • 在多类测试场景下,性能超越现有方法8%以上。
  • 适合需要快速适配新图数据的科研与工业场景。

图上下文学习能使预训练图模型在不更新参数的情况下适应新且多样的下游图任务,其关键在于基于选定提示样本对下游图进行条件建模。现有方法随机选取子图或边作为提示,导致提示噪声大,模型性能下降。此外,当测试图类别数远超训练时,上下文学习能力显著削弱。为此,我们提出多阶段自适应提示优化方法 GraphPrompter,系统优化提示生成、选择与使用全过程。首先,提示生成器引入重建层,突出重要边并抑制无关噪声;其次,提示选择器采用k近邻算法与预训练选择层,动态筛选合适样本,降低无关提示影响;最后,提示增强器结合缓存替换策略,提升模型在新数据集上的泛化能力。大量实验表明,GraphPrompter显著增强图模型的上下文学习能力,在所有设置下平均优于现有最优基线8%以上。代码已开源。

原文摘要 · Abstract (English)

Graph In-Context Learning, with the ability to adapt pre-trained graph models to novel and diverse downstream graphs without updating any parameters, has gained much attention in the community. The key to graph in-context learning is to perform downstream graphs conditioned on chosen prompt examples. Existing methods randomly select subgraphs or edges as prompts, leading to noisy graph prompts and inferior model performance. Additionally, due to the gap between pre-training and testing graphs, when the number of classes in the testing graphs is much greater than that in the training, the in-context learning ability will also significantly deteriorate. To tackle the aforementioned challenges, we develop a multi-stage adaptive prompt optimization method GraphPrompter, which optimizes the entire process of generating, selecting, and using graph prompts for better in-context learning capabilities. Firstly, Prompt Generator introduces a reconstruction layer to highlight the most informative edges and reduce irrelevant noise for graph prompt construction. Furthermore, in the selection stage, Prompt Selector employs the $k$-nearest neighbors algorithm and pre-trained selection layers to dynamically choose appropriate samples and minimize the influence of irrelevant prompts. Finally, we leverage a Prompt Augmenter with a cache replacement strategy to enhance the generalization capability of the pre-trained model on new datasets. Extensive experiments show that GraphPrompter effectively enhances the in-context learning ability of graph models. On average across all the settings, our approach surpasses the state-of-the-art baselines by over 8%. Our code is released at https://github.com/karin0018/GraphPrompter.

图神经网络提示学习自适应优化

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