In this paper, we introduce EgoFine, a new approach for fine-tuning Large Language Models (LLMs) based on ego networks extracted from Knowledge Graphs (KGs). EgoFine first identifies the most informative nodes in the KG using degree centrality. It then extracts their ego networks and generates structured training data through random paths within them, thus enabling LLMs to learn domain-specific knowledge. It further constructs negative samples to explicitly model the absence of relationships between entities. We present an experimental campaign involving three KGs (PrimeKG, WN18RR, and YAGO3) and four LLMs (Minerva-350M, Llama3.2-1B, Qwen2-1.5B, and Ministral-3B). This campaign demonstrates that EgoFine outperforms traditional embedding-based methods (e.g., AutoSF, BoxE, NodePiece, PairRE, and TransE), two state-of-the-art approaches integrating KGs and LLMs (e.g., GNN-RAG and KG-Adapter), as well as a baseline approach operating on the same principle as EgoFine but without exploiting the contribution of ego networks. Compared with this last approach, EgoFine improves Hit@1 values by up to 47.37%, Mean Reciprocal Rank (MRR) values by up to 46.87%, F1-Score values by up to 36.59%, and Accuracy values by up to 30.91%. The paper also presents an ablation study devoted to evaluating several design choices underlying EgoFine, as well as an analysis of the EgoFine’s behavior when applied to dynamic or noisy KGs. This way of proceeding makes EgoFine particularly beneficial for a variety of real-world applications, including understanding complex biological mechanisms, reasoning about the relationships between legislative sources and court cases, interpreting and explaining complex industrial maintenance and production processes, and understanding the connections between attacks, exploits, and countermeasures in the context of cybersecurity.
An Ego Network-Based Approach to Fine-Tune Large Language Models Using Knowledge Graphs / Amelio, A., Buratti, C., Marchetti, M., Traini, D., Ursino, D., Virgili, L.. - In: INFORMATION SCIENCES. - ISSN 0020-0255. - 755:(2026). [Epub ahead of print] [10.1016/j.ins.2026.123818]
An Ego Network-Based Approach to Fine-Tune Large Language Models Using Knowledge Graphs
C. Buratti
Secondo
;M. Marchetti
;D. Traini
;D. Ursino
Penultimo
;L. Virgili
Ultimo
2026-01-01
Abstract
In this paper, we introduce EgoFine, a new approach for fine-tuning Large Language Models (LLMs) based on ego networks extracted from Knowledge Graphs (KGs). EgoFine first identifies the most informative nodes in the KG using degree centrality. It then extracts their ego networks and generates structured training data through random paths within them, thus enabling LLMs to learn domain-specific knowledge. It further constructs negative samples to explicitly model the absence of relationships between entities. We present an experimental campaign involving three KGs (PrimeKG, WN18RR, and YAGO3) and four LLMs (Minerva-350M, Llama3.2-1B, Qwen2-1.5B, and Ministral-3B). This campaign demonstrates that EgoFine outperforms traditional embedding-based methods (e.g., AutoSF, BoxE, NodePiece, PairRE, and TransE), two state-of-the-art approaches integrating KGs and LLMs (e.g., GNN-RAG and KG-Adapter), as well as a baseline approach operating on the same principle as EgoFine but without exploiting the contribution of ego networks. Compared with this last approach, EgoFine improves Hit@1 values by up to 47.37%, Mean Reciprocal Rank (MRR) values by up to 46.87%, F1-Score values by up to 36.59%, and Accuracy values by up to 30.91%. The paper also presents an ablation study devoted to evaluating several design choices underlying EgoFine, as well as an analysis of the EgoFine’s behavior when applied to dynamic or noisy KGs. This way of proceeding makes EgoFine particularly beneficial for a variety of real-world applications, including understanding complex biological mechanisms, reasoning about the relationships between legislative sources and court cases, interpreting and explaining complex industrial maintenance and production processes, and understanding the connections between attacks, exploits, and countermeasures in the context of cybersecurity.| File | Dimensione | Formato | |
|---|---|---|---|
|
An Ego Network-Based Approach to Fine-Tune Large Language Models Using Knowledge Graphs.pdf
accesso aperto
Tipologia:
Versione editoriale (versione pubblicata con il layout dell'editore)
Licenza d'uso:
Creative commons
Dimensione
2.79 MB
Formato
Adobe PDF
|
2.79 MB | Adobe PDF | Visualizza/Apri |
I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.


