Skip to content

Resolve ambiguous namesake mentions from source clues before profile scores - #1192

Open
virtue039 wants to merge 4 commits into
deeplethe:devfrom
virtue039:fix/namesake-mention-resolution
Open

virtue039 wants to merge 4 commits into
deeplethe:devfrom
virtue039:fix/namesake-mention-resolution

Conversation

@virtue039

@virtue039 virtue039 commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Why

A profile-score gap is not identity evidence when multiple entities share a mention name. This partial resolution fix for #1136 checks passage evidence before profile tiers. The review also exposed unbounded growth: 20 ambiguous mentions of a name with two holders created 20 additional entities and 230 pending human reviews.

What changes

Select a uniquely corroborated exact-name candidate, including current name facts and already-typed namesakes for unbound mentions. Otherwise reuse the KB’s unresolved entity for that name (review option 1) and keep human review pairs idempotent. Pending human namesake_tie reviews identify the unresolved entity; its facts are excluded from identity corroboration. The name lock and transaction cover entity creation/reuse and review insertion, including case-varied concurrent mentions. Existing kept decisions are respected. Transferred reviews and active merge survivors do not identify unresolved entities; a regression covers both merge directions. Machine-kept human reviews retain an explicit unresolved-left marker; the lookup recognizes that marker and does not reopen those same human review pairs on recurring ambiguity. Human decisions and redirected/merged survivors remain excluded. A real-caller regression processes 20 further mentions after automatic keeps: still one unresolved entity, with zero pending human reviews. The singleton path, schema, prompts and adjudication are unchanged. #1193 tracks the separate adjudication-evidence proposal.

The code/test diff exceeds 500 added lines because this one bounded-growth change needs the sequential 20-mention, concurrent typed/unbound/case-varied, merged-survivor and automatically-kept review lifecycle regressions. Splitting off a lifecycle guard would leave a reproduced entity/review growth path. The adjudication evidence producer is kept separate in #1193.

How it was checked

macOS / Apple Silicon; Rust 1.99.0. Candidate 945425e, baseline e9057ac. Required DB/PDF guards enabled: workspace 1493 passed / 0 failed / 6 existing ignored; namesake suite 10 passed. fmt, workspace/all-targets clippy (-D warnings), frozen-lockfile web build and diff check passed. Every commit is signed off.

The maintainer’s 2-holder / 20-ambiguous-mention reproduction fails on the previous candidate d8e3cf8 (20 additional entities / 230 pending human reviews). The revised candidate adds one unresolved entity and two pending human reviews. A concurrent typed/unbound, case-varied test also creates one unresolved entity and two reviews; a later positive clue still selects the original holder even after the unresolved entity accumulates the same fact.

Fresh same-session official identity bench: two rounds, eight new KBs per side, each with 12 documents and 21 truth anchors. Both sides use Qwen Flash (qwen3.7-flash-2026-07-15, thinking disabled) and pinned local BAAI/BGE-M3 (5617a9f61b028005a4858fdac845db406aefb181; CPU float32, L2-normalized CLS, 1024 dimensions). The upstream corpus, ontology options and scorer are unchanged. All 16 KBs have all documents and associated jobs completed. Both sides were started fresh with Qwen after stopping the partial DeepSeek evaluation at the contributor’s request. The completed Qwen evaluation of 69c3978 is also archived separately: a later combined lifecycle regression exposed the machine-kept marker issue, so both sides were rerun fresh for this final revision. No earlier run is included or selected by its score.

Official bench, eight KBs each Baseline Revised candidate
Mean F1 0.5583 0.5321
Mean surviving entities 27.2500 26.8750
Mean pending human reviews 0.3750 1.1250
Mean false-merge anchor pairs 3.3750 3.0000
Mean false-split anchor pairs 6.5000 7.6250
Mean missing anchors 5.0000 4.2500

Both rounds are reported, without selecting the best run:

  • Round 1 mean F1: 0.5833 → 0.5600.
  • Round 2 mean F1: 0.5333 → 0.5042.

In this final run, mean F1 0.5583 → 0.5321 and pending human reviews 0.375 → 1.125. The repeated-mention growth is bounded by the regressions, but these measurements do not demonstrate an overall quality improvement or a lower review load.

Limits

These are descriptive repeated measurements, not a significance or end-to-end fix claim. The official scorer excludes missing/untyped anchors; F1 must be read together with anchor coverage, entity counts and pending human reviews.

Official Zhang Wei outcomes (merged / incomplete / complete separation): baseline {'merged': 7, 'incomplete': 0, 'separate': 1}, revised candidate {'merged': 7, 'incomplete': 0, 'separate': 1}. A supplemental quote/subject inspection, using names as a manual aid and ignoring type assignment, observes mixed finance/engineering facts in 7/8 baseline KBs and 7/8 revised KBs. This diagnostic is not the official score; absent or ambiguous matches remain unknown.

This guard covers exact-name multi-candidate resolution. Qualified-name recall, subsequent singleton attachment and positive-evidence adjudication remain separate concerns. A recorded merge alone does not establish incorrect adjudication; the source passages and document/merge ordering must also be inspected.

Observed chat calls: baseline 539, revised candidate 537; gateway transport errors 0. All benchmark jobs completed. Shared embedding-cache timings are not an isolated speed comparison.

All 16 fresh official-bench bases: F1, entities and pending human reviews
Run Order KB F1 Entities Pending human reviews False-merge pairs False-split pairs Missing
baseline-r1-b1 forward 01a12960-027e-7fe2-a45d-5ad4e2bb479e 0.6000 29 0 3 5 6
baseline-r1-b1 reverse 01a12962-c4a3-70a2-96b6-7d643cd727eb 0.5000 29 0 6 6 4
baseline-r1-b2 forward 01a12960-027c-71a1-b5ea-f667990c71d2 0.7780 25 0 0 4 6
baseline-r1-b2 reverse 01a12962-885d-7d23-9e01-732b5e6e160d 0.4550 27 1 3 9 4
baseline-r2-b1 forward 01a12966-0e5d-7ff3-b3dd-f5ecf90567aa 0.6000 27 1 3 5 7
baseline-r2-b1 reverse 01a12969-1af4-7520-9bf2-7b05fdd52def 0.5710 27 0 3 6 5
baseline-r2-b2 forward 01a12966-0d6d-7fb1-b585-a2e900238697 0.5000 27 0 6 6 4
baseline-r2-b2 reverse 01a12968-6317-7d81-ac26-5eec5388bfb7 0.4620 27 1 3 11 4
candidate-r1-b1 forward 01a12960-038a-7bb2-9d3b-5564b7bc9b35 0.6430 26 0 4 6 3
candidate-r1-b1 reverse 01a12962-c4a3-7021-94c2-02c211cc5764 0.5710 26 0 6 6 4
candidate-r1-b2 forward 01a12960-0385-7142-adf6-4c4437b19ced 0.5000 27 0 3 7 4
candidate-r1-b2 reverse 01a12962-a125-7022-b6d9-e09501c7e536 0.5260 29 3 0 9 5
candidate-r2-b1 forward 01a12966-0e60-7f10-88a3-0107c4ef5aa0 0.6360 27 0 2 6 4
candidate-r2-b1 reverse 01a12968-dd51-7e20-8791-9cb769af75a5 0.3810 28 3 3 10 5
candidate-r2-b2 forward 01a12966-0e5e-7501-9fae-ae1f9f0028bc 0.6000 25 0 3 5 6
candidate-r2-b2 reverse 01a12968-574b-7b63-ac71-d48038f62283 0.4000 27 3 3 12 3

Before review

  • Every commit is signed off.
  • fmt, workspace/all-targets clippy and workspace tests pass.
  • Store SQL was exercised with the database and required DB guard.

…candidate.

Signed-off-by: Virtue039 <virtue039@qq.com>

@WaylandYang WaylandYang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for this, and for measuring it exactly as #1136 asked: same session, eight bases a side, both rounds, and a straight account of the four bases that still mix.

Your diagnosis is right: a gap in profile scores is not identity evidence. One thing needs solving before it can land. When a name recurs, each mention that cannot be placed creates a new entity, which is then a namesake for the next one. In a small experiment (one name with two holders, then 20 more mentions with nothing in the passage to tell them apart) this branch created 20 entities and 230 pending human reviews; dev created none. On a real base two entities of one name are usually an unmerged duplicate (#1104), so this would grow with every document.

Either of these would bound it, and we would be glad to take whichever you prefer:

  1. A mention that cannot be placed joins the base's one unresolved entity of that name, as ambiguous_bare_cache already does within a document.
  2. The guard applies only once a review between the namesakes has been kept; until then the profile tiers stay.

Could you also report entities and pending human reviews per base beside F1? I will look again as soon as it is updated.

Thank you again for the careful work.

Signed-off-by: Virtue039 <virtue039@qq.com>
…ut reopening reviews

Signed-off-by: Virtue039 <virtue039@qq.com>
@virtue039

Copy link
Copy Markdown
Contributor Author

Implemented option 1 in 945425e: unplaceable mentions reuse one unresolved entity for that name across documents. The two-holder / 20-mention regression now adds one entity and two pending human reviews, rather than 20 / 230. Typed/unbound and case-varied concurrent mentions are covered.

Merged survivors and redirected reviews cannot become unresolved buckets. An automatic evidence-gated keep preserves the unresolved-left marker without reopening the same human pairs; the real-caller regression covers another 20 mentions with no additional entities and zero pending human reviews. Positive passage clues still select the original holder.

Both sides were rerun fresh with qwen3.7-flash-2026-07-15, thinking disabled and local BGE-M3: two rounds, eight KBs per side, all documents/jobs complete, no gateway errors. Mean F1 0.5583 → 0.5321; mean entities 27.250 → 26.875; mean pending human reviews 0.375 → 1.125. The updated PR body lists F1, entities and pending human reviews for every KB, with false merges/splits and missing anchors beside them. Earlier revisions' evaluations are excluded. Mean F1 declined and mean pending human reviews increased in this final run; bounding repeated-mention growth is not a demonstrated overall quality gain or a claim to reduce total review load.

Workspace 1493 passed / 0 failed / 6 existing ignored; focused namesake suite 10 passed; fmt, clippy, DB/PDF guards and frozen-lockfile web build passed. The separate adjudication follow-up is #1199; neither PR claims to solve the remaining singleton/qualified-name path or to demonstrate their joint real-model effect.

@WaylandYang

Copy link
Copy Markdown
Contributor

Thank you for the rework, and for reporting the numbers as they came out, including the ones that do not favour the change. The growth is bounded now, as you show.

We would like to hold this one for now. On your run F1 went from 0.558 to 0.532, false splits from 6.5 to 7.6 and pending human reviews from 0.4 to 1.1, and the resolver gains a lifecycle of unresolved entities that later changes to merging would have to carry. Our own retest on #1136 found the mixing varies more from day to day than between builds, so we do not yet have a measurement this can be judged by.

That measurement would be the most useful next step: a fixed set of namesake cases with scripted model replies, running in CI, that fails today in the two ways #1136 describes. Would you be willing to start there? A much smaller change could then be judged against it.

Thank you again for the care you put into this.

@virtue039

Copy link
Copy Markdown
Contributor Author

Agreed; this production PR remains held. The requested fixed measurement is submitted separately as #1202, directly from dev, without the unresolved-entity lifecycle.

Both resolution and adjudication reproduce a source-identity false_merge in each order (4/8 gold disagreements); the four controls pass. Strict mode fails on those four gold errors. CI reports them explicitly while enforcing a proposed known-failure ceiling; budget green is not an identity correctness claim. A deliberately broken true-merge control was rejected in both orders and restored before final validation. The PR includes the fixed cases, source oracle, local/CI commands and results so we can judge a smaller change after agreement on the measurement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants