TY - JOUR
T1 - Formulating and Unveiling In-context Learning over Graph Tasks
AU - Zhang, Chunhui
AU - Ding, Lizhong
AU - Li, Pengqi
AU - Fu, Jiarun
AU - Yang, Peng
AU - Ren, Yanyu
AU - Gu, Tianlong
AU - Chang, Liang
AU - Yuan, Ye
AU - Wang, Guoren
N1 - Publisher Copyright:
© 2026 Elsevier B.V.
PY - 2027/1
Y1 - 2027/1
N2 - In-context learning (ICL) enables large language models (LLMs) to adapt to new tasks by conditioning on demonstrations, without updating model parameters. While recent studies have examined the ICL capabilities of LLMs over graph tasks, the mechanism by which demonstrations influence model behavior remains difficult to formalize and poorly understood. In this paper, we present thorough formulations, innovative mechanisms, and comprehensive benchmarks for investigating ICL over graph tasks. We introduce the first unified formulation that explicitly models demonstration number, graph structure, and task category over graph tasks, enabling independent variation of these factors and systematic analysis of their effects. We unveil how demonstrations in graph tasks activate the ICL capabilities of LLMs, showing that LLMs adjust their predictions by weighting and aggregating the representations of the query and demonstrations. We introduce two new benchmarks designed to enable rigorous evaluation under controlled structural and task variations, comprising a total of 17,155 graph questions across graphs of varying sizes and multiple task categories. Using these benchmarks, our experiments explore how demonstrations activate the ICL capabilities of LLMs over graph tasks from the perspectives of demonstration number, graph structure, and task category, and provide empirical support for the proposed formulations and mechanisms. The benchmarks and code are available at: https://github.com/zhangchunhui2024/Graph-ICL .
AB - In-context learning (ICL) enables large language models (LLMs) to adapt to new tasks by conditioning on demonstrations, without updating model parameters. While recent studies have examined the ICL capabilities of LLMs over graph tasks, the mechanism by which demonstrations influence model behavior remains difficult to formalize and poorly understood. In this paper, we present thorough formulations, innovative mechanisms, and comprehensive benchmarks for investigating ICL over graph tasks. We introduce the first unified formulation that explicitly models demonstration number, graph structure, and task category over graph tasks, enabling independent variation of these factors and systematic analysis of their effects. We unveil how demonstrations in graph tasks activate the ICL capabilities of LLMs, showing that LLMs adjust their predictions by weighting and aggregating the representations of the query and demonstrations. We introduce two new benchmarks designed to enable rigorous evaluation under controlled structural and task variations, comprising a total of 17,155 graph questions across graphs of varying sizes and multiple task categories. Using these benchmarks, our experiments explore how demonstrations activate the ICL capabilities of LLMs over graph tasks from the perspectives of demonstration number, graph structure, and task category, and provide empirical support for the proposed formulations and mechanisms. The benchmarks and code are available at: https://github.com/zhangchunhui2024/Graph-ICL .
KW - Graph tasks
KW - In-context learning
KW - Large language models
UR - https://www.scopus.com/pages/publications/105043809171
U2 - 10.1016/j.inffus.2026.104581
DO - 10.1016/j.inffus.2026.104581
M3 - Article
AN - SCOPUS:105043809171
SN - 1566-2535
VL - 137
JO - Information Fusion
JF - Information Fusion
M1 - 104581
ER -