arXiv cs.LG

Semantic Needles in Document Haystacks: Sensitivity Testing of LLM-as-a-Judge Similarity Scoring

· 1小时前
AI 摘要

arXiv:2604.18835v2 Announce Type: replace-cross Abstract: We propose a scalable, multifactorial experimental framework that systematically probes LLM sensitivity to subtle semantic changes in pairwise document comparison. We analogize this as a needle-in-a-haystack problem: a single semantically altered sentence (the needle) is embedded within surrounding context (the hay), and we vary the perturbation type (negation, conjunction swap, named entity replacement), context type (original vs. topically unrelated), needle position, and document length across all combinations, testing seven LLMs on tens of thousands of document pairs. Our analysis reveals several striking findings. First, LLMs can exhibit a within-document positional bias distinct from previously studied candidate-order effects: some models penalize semantic differences more harshly when they occur earlier in a document. Second, when the altered sentence is surrounded by topically unrelated context, it raises similarity scores in almost all settings. This is consistent with a contradiction account, in which topically related context allows the alteration to conflict with the surrounding sentences. Third, all models exhibit the same hierarchy in how harshly they score different perturbation types, with negation penalized the most, but express this hierarchy on significantly different scales. Finally, varying the prompt's conception of semantic similarity across several alternatives changes the magnitude but not the direction of these effects. Together, these results demonstrate how LLM semantic similarity scores are sensitive to the aforementioned parameters in ways that go beyond the semantic change itself; our framework offers a practical toolkit for auditing and comparing scoring behavior across current and future models.

查看原文(arXiv cs.LG)