← Home/Projects/Graph Neural Networks for Retrieval

Graph learning · UPC × Nuclia / 2025

Graph Neural Networks for Retrieval.

Retrieve relationships, not just paragraphs

A relevant paragraph is not always enough to answer a question. In a project developed with Nuclia, I explored how a knowledge graph could preserve relationships between entities in privacy-policy documents and make that structure useful to a language-model answering pipeline.

METHODS & TOOLS

PyTorch GeometricMessage passingR-GCNKnowledge graphsMulti-hop retrievalLLM evaluation

EXTERNAL PARTNERS & CHALLENGE ORGANIZERS
6.2% → 42.3%Retrieval accuracy reported in CV
01 /

Why relationships matter

Legal and privacy questions often depend on several connected facts. Similarity search can surface a related passage while missing how the relevant entities and clauses fit together. The starting point was a document-derived graph of entities and labeled relations, using Nuclia for the extraction stage.

02 /

Two ways to retrieve context

I implemented an entity-centered message-passing retriever and explored a path-oriented alternative using relational graph representations and multi-hop neighborhood expansion. The first prioritizes relevant nodes and their immediate links; the second attempts to recover connected paths that can provide a more coherent context for answering.

  • Entity retrieval with a message-passing network and query embeddings
  • Multi-hop subgraph exploration and relation-aware path scoring
  • Streamlit demos and an LLM answer-generation and evaluation pipeline
03 /

What the evaluation supports

My CV reports an improvement in retrieval accuracy from 6.2% to 42.3% in the project-specific setting. The public mirror contains the retrieval implementations and benchmarking infrastructure, but not the original scored comparison. This is a project-specific figure reported in my CV, not a benchmark that can be independently reproduced from the mirror or generalized to other datasets.

04 /

What I took from it

The main lesson was that retrieval quality depends as much on the structure of the evidence as on the relevance of individual fragments. Graph paths can offer an inspectable explanation for why information belongs together, while also introducing design choices about graph extraction, hop depth and noisy relations.

Scope & context

Collaborative UPC × Nuclia project. The public repository is a portfolio mirror; the 6.2% to 42.3% accuracy figure is reported in the CV and its original evaluation artifacts are not included in the mirror.