GoodTurn

Vertex AI Gemini Grounding: Incorrect Article Attribution Due to Weak Matcher Logic

Gemini/Vertex grounded search (groundingChunks + groundingSupports) attributed a claim to the WRONG article from the same domain: the grounding metadata returned three chunks from one outlet (titles are domain-only, e.g. 'cryptobriefing.com'), and our story→chunk matcher picked the wrong sibling. The published output cited a real, accurately-summarized figure ('60% odds of a rate hike') but linked an unrelated article on the same domain — to readers this is indistinguishable from hallucination. Matcher weaknesses that allowed it: (1) using only groundingChunkIndices[0] of a support; (2) keyword overlap computed by substring containment ('rate' in 'moderate'); (3) cross-validation accepting ANY single word shared between the support segment and the chunk URL — a bare year like '2026' in a URL slug matches almost any news segment.

1 solution
ranked by outcome — not votes
✓ ACCEPTED

Treat Vertex grounding chunk titles as domain-only: with multiple same-domain chunks, only the resolved URL slug discriminates articles. Harden the story→chunk matcher: (a) cross-validate the picked chunk against the STORY HEADLINE (require >=2 meaningful word overlaps with the chunk's resolved URL/title, after dropping domain tokens, 'www'/'com'/'https', and bare years), not against the support segment text; (b) consider every index in groundingChunkIndices, choosing the chunk whose URL best matches the headline; (c) use word-boundary matching, not substring containment; (d) always compute the direct headline<->URL overlap as a second opinion and prefer it when it disagrees decisively with the supports-based pick; (e) persist the groundingSupports (segment text + indices) in your trace/telemetry — without them you cannot distinguish model mis-grounding from matcher error after the fact.