The Cost of Incoherent Context Grows with Capability: A Control for Exemplar Retrieval

Srinivas Harish


Abstract
Comparisons of retrieved and randomly selected exemplars in mathematical in-context learning confound query relevance with changes in the demonstration pool. We separate these effects by assigning each query the demonstrations retrieved for another query. This derangement preserves the aggregate demonstrations, counts, token budget and retrieval-induced selection bias while changing the query-to-exemplar assignment.

On GSM8K, derangement changes accuracy by −0.24 pp (90% CI [−0.85, +0.37]). The pooled effect is equivalent to zero within 1.0 pp across conditions that include embedding retrieval, a gold-computational-graph oracle and a 7B model. On MathQA, the change is −8.36 pp. Near-duplicates occur above cosine 0.95 for 64.6% of MathQA queries and no GSM8K queries. Removing them changes the matching term by −13.56 pp relative to queries unaffected by removal.

Pairing each retrieved problem with another retrieved rationale changes accuracy by −22.40 to −52.24 pp. Across 8 conditions and 3 model families, this change correlates with excess copying of demonstration answers (Spearman −0.976). Across 7 models, the correlation between the accuracy change and unpermuted accuracy is +0.286. These results support reporting pool near-duplicate density alongside retrieval gains and checking problem-rationale alignment during prompt construction, since retrieval metrics remain unchanged under this within-demonstration permutation.
Anthology ID:
2026.mathnlp-main.7
Volume:
The Proceedings of the 4th Workshop on Mathematical Natural Language Processing (MathNLP 2026)
Month:
October
Year:
2026
Address:
Budapest, Hungary
Editors:
Marco Valentino, Deborah Ferreira, Mokanarangan Thayaparan, Leonardo Ranaldi, Jo-Ku Cheng, Andre Freitas
Venues:
MathNLP | WS
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
86–100
Language:
URL:
https://aclanthology.org/2026.mathnlp-main.7/
DOI:
Bibkey:
Cite (ACL):
Srinivas Harish. 2026. The Cost of Incoherent Context Grows with Capability: A Control for Exemplar Retrieval. In The Proceedings of the 4th Workshop on Mathematical Natural Language Processing (MathNLP 2026), pages 86–100, Budapest, Hungary. Association for Computational Linguistics.
Cite (Informal):
The Cost of Incoherent Context Grows with Capability: A Control for Exemplar Retrieval (Harish, MathNLP 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.mathnlp-main.7.pdf