Graph Context for Embedding Collision Resolution
Can graph topology fix embedding collisions during entity resolution?
Motivation
During entity resolution for the Knowledge Graph project, two entities named “API Gateway” appeared in different documents referring to completely different systems. Their embedding cosine similarity was 0.97 — they would trivially merge under any threshold-based resolver.
Hypothesis
If two entities have the same name but different meanings, they should have structurally different graph neighborhoods. A combined embedding — text + neighborhood context — should separate them.
Approach
- Extract initial entities and create a provisional graph with high-recall, low-precision merging
- Compute neighborhood embeddings: encode the entity’s 1-hop subgraph (entity types, relationship labels, connected entity names)
- Concatenate text embedding + neighborhood embedding
- Re-run clustering on the combined representation
Observations
- Text-only embedding: 12 incorrect merges out of 340 entity pairs
- Combined embedding: 3 incorrect merges
- The remaining 3 failures were entities with identical names AND identical neighborhoods (true duplicates in source documents)
Result
Confirmed. Graph topology provides meaningful disambiguation signal. The approach is practical — neighborhood encoding adds ~40ms per entity at graph sizes under 10,000 nodes.
What failed
Initial attempt used 2-hop neighborhoods. The additional context added noise rather than signal for entities in dense subgraphs. 1-hop was better.
Conclusion
Graph-aware entity resolution significantly outperforms text-only embedding at the cost of requiring an initial graph to exist. This creates a bootstrapping problem — partially addressed by iterative refinement.