Fix negative evidence cascade suppressing same-name merges#32
Open
claude[bot] wants to merge 1 commit into
Open
Fix negative evidence cascade suppressing same-name merges#32claude[bot] wants to merge 1 commit into
claude[bot] wants to merge 1 commit into
Conversation
Two changes to the propagation inner loop prevent a self-reinforcing cascade where irrelevant cross-pairs (e.g. Park₁↔Chen₂ when both have same-name counterparts) suppress all same-name merges in a connected component: 1. Best-counterpart gating: a low-confidence neighbor pair only contributes negative evidence if neither neighbor has a better alternative (confidence > 0.5). 2. Merged-neighbor deduplication: after progressive merging, multiple relation-similar edges to the same merged entity count as one structural fact, preventing score inflation. Closes #30 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Root cause
The all-pairs negative evidence loop generated contributions from every low-confidence cross-pair, even when both neighbors had good matches elsewhere. For example, Park₁↔Chen₂ (confidence 0) generated negative evidence for Nextera₁↔Nextera₂ despite Park₁ matching Park₂ and Chen₂ matching Chen₁. Since
seed = 1.0zeroes out positive evidence (pos × (1 - seed) = 0), only negative evidence counted — Nextera dropped below 0.5 and cascaded to suppress Park₁↔Park₂ and Chen₁↔Chen₂.A secondary issue: after progressive merging, multiple relation-similar edges to the same merged neighbor (e.g. "is CEO of" and "is outgoing CEO of") were counted independently, inflating positive evidence and causing false merges between unrelated entities sharing a merged neighbor.
Changes
worldgraph/match.py— propagation inner loop:caandcbra == rb) contributions deduplicated by canonical ID — one structural fact per merged entitydocs/negative_evidence.md— documents best-counterpart gating and merged-neighbor dedupTests — 3 new tests encoding the cascade patterns from the issue:
test_predecessor_successor_at_same_company_no_match(test_propagation.py)test_shared_employee_bridge_no_company_merge(test_integration.py)test_regulator_and_regulated_entity_stay_separate(test_integration.py)Test plan
Closes #30
🤖 Generated with Claude Code