Not All Gap Correction Helps: A Geometric View of External Information in LLM Inference

Dingzirui Wang, Xuanliang Zhang, Keyan Xu, Qingfu Zhu, Wanxiang Che, Yang DengNeurIPS 2026

TL;DR

When we feed external context to an LLM—whether via RAG, few-shot examples, or memory—we usually assume that filling the model’s knowledge gap as strongly as possible is always good. By treating LLM inference as vector geometry, this paper proves that too much correction in the right direction actually overshoots the target and degrades performance. By balancing both the direction and magnitude of this "push," we can select better context and reliably boost reasoning accuracy.

What Problem Does This Paper Address?

To help Large Language Models (LLMs) solve tough queries, we routinely stuff helpful context into their prompts—using Retrieval-Augmented Generation (RAG), In-Context Learning (ICL), or historical memory (Mem). Recent intuition suggests that good external context shouldn't just mimic the query; it should actively compensate for what the model lacks ("gap-corrective" information).

While researchers know that noisy or overly long context hurts performance, there has been a quiet, underlying assumption: the stronger the gap correction, the better.

The authors challenge this. Think of an LLM's baseline mistake as a vector in space. Adding external information applies a "push" (a correction vector) to nudge the prediction toward the ground truth. If the push points the wrong way, it’s under-corrective. But what if the push points in the exact right direction, yet shoves way too hard? You overshoot the truth entirely. The paper formalizes this overlooked over-corrective regime and asks: mathematically, what makes external information "just right"?

Figure 1: An illustration of different types of information, where green denotes properly corrective information, and red denotes under-corrective or over-corrective information. In the lower-right corner of each part, the blue vector represents the baseline error vector, while the green and red vectors represent the information-induced correction vectors. The cyan and purple vectors denote the corresponding composed vectors, respectively. The composed vector for properly corrective information is shorter than the baseline error vector, showing lower error. In contrast, the composed vectors for under-corrective or over-corrective information are longer than the baseline error vector.

Methods

The authors pair a clean theoretical framework with a lightweight, practical selection strategy:

  • Geometric Analysis of Transformers (Novel Theory): Using a simplified (and later generalized multi-layer) Transformer architecture, they define reasoning error as the vector difference between the model's output and the ground truth ($e(x)$). Introducing external context $t$ induces an information-corrective vector $g(t, x)$. Using calculus on the attention and MLP layers, they prove that the strength of this push is upper-bounded by two factors: relevance (how much attention the query pays to the context, $\alpha_{x \leftarrow t}$) and complementarity (how different the context is from the query in the attention value space, $\|v_t - v_x\|$).
  • The "Goldilocks" Condition: Basic vector geometry reveals that context reduces error if and only if $\frac{\|g(t,x)\|}{2\|e(x)\|} < \rho(t,x)$, where $\rho(t,x)$ is the cosine alignment between the correction vector and the negative baseline error.
  • Two-Stage Information Selection (Practical Algorithm): At inference time, you don't know the ground truth, so you can't compute $\rho(t,x)$ directly. After coarsely retrieving 32 candidates using standard methods, the authors use a trained ELECTRA-Large model to predict the alignment $\rho(t, x)$ from the query, candidate context, and baseline LLM answer. First, they filter out misaligned or over-corrective candidates. Second, among the safe candidates, they pick the one with the largest corrective strength proxy ($\alpha_{x \leftarrow t}\|v_t - v_x\|$), extracted directly from the LLM's internal states.

Datasets

The authors evaluate four 8B-parameter models (Llama-3.1, DeepSeek-R1-Distill-Llama, Qwen3, and Ministral) across seven existing benchmarks—introducing no new datasets, but filtering specifically for "hard" queries that models fail on without external help:

  • Math: MATH, CHAMP
  • Reasoning: TheoremQA, MMLU-Redux, GPQA
  • Question Answering: NaturalQuestions, FinQA

Key Insights and Ideas

  • Over-correction is a real trap: Plotting accuracy against relative corrective strength reveals an inverted-U curve. Performance climbs as context helps, peaks around a normalized corrective effect of 0.8, and drops off when the model over-attends to the context at the expense of the user's actual query.
Figure 2: The performance change under different relative corrective effect when using contextual information. Since performance of each data is a boolean value, we plot it against the first vari- able by grouping samples into quantile-based bins, computing the empirical accuracy and Wilson confidence interval within each bin, and overlay- ing a rolling-average curve to visualize the trend.
  • Theory matches empirical geometry: Plotting real LLM inferences on a polar chart confirms the math—virtually every instance where context reduced reasoning error falls neatly inside the predicted geometric boundary.
  • Why context usually fails (and why gains are modest): When external context makes things worse, roughly 88%–90% of failures are due to under-correction (pointing the wrong way), while ~10%–12% are due to over-correction. Furthermore, even when context helps, its strength ratio mostly hovers between 0.1 and 0.5—meaning most good retrievals are actually quite weak and fail to fully cancel out the model's baseline error.

Key Results

Tested across ICL, RAG, and Memory setups using top-1 selected context on Llama-3.1-8B and Qwen3-8B, the two-stage selection method consistently outperforms standard retrievers (like BM25 and DPR) and specialized baselines (like InstructRAG and ReMem):

  • Achieves an average relative error reduction of 5.9% across all settings.
  • RAG highlights: Boosts Qwen3-8B accuracy on NaturalQuestions from 73.8% (BM25) and 75.6% (ReFeedL) to 78.9%, and Llama-3.1-8B on TheoremQA from 37.6% (BM25) to 42.5%.
  • ICL & Mem highlights: Pushes Qwen3-8B on MATH to 90.2% in ICL (vs. 88.4% for GenICL) and 69.9% on MMLU-Redux in Memory settings.

Limitations and Future Work

While the main text does not feature a dedicated limitations section, the authors note several boundaries in their setup:

  • Architectural simplifications: The core proofs encode queries, context, and outputs as single semantic vectors and omit certain Transformer components (like layer normalization), though they note in the appendices that multi-token and full-architecture extensions preserve their conclusions.
  • Proxy overhead and scope: Because ground truth is hidden at test time, directional alignment relies on training an external ELECTRA predictor. Additionally, the practical selection experiments focus on top-1 context selection with 8B models—Designed as a proof-of-concept to validate their geometric theory rather than a heavy-duty, state-of-the-art retrieval pipeline.

Summary updated

Abstract

Providing external information beyond the query is a common way to improve large language model (LLM) inference, as seen in in-context learning (ICL), retrieval-augmented generation (RAG), and memory-based methods (Mem). Existing work increasingly suggests that useful external information should compensate for the gap between LLMs and user queries, implicitly assuming that stronger gap-correction can lead to better performance. In this paper, we challenge this assumption and show that more gap-corrective external information can instead harm performance. We analyze this phenomenon in Transformers through the lens of reasoning error, defined as the difference between the predicted answer vector and the ground-truth answer vector. Our analysis reveals that external information can be not only under-corrective but also over-corrective, where excessively strong correction increases reasoning error. We further show that the induced correction vector is jointly determined by attention and the complementarity between the external information and the query, and derive conditions under which information is properly corrective in both direction and magnitude. Experiments on four mainstream LLMs and seven reasoning benchmarks across ICL, RAG, and Mem validate our theory and support a theory-guided information selection method.
BibTeX
@inproceedings{wang2026not,
  author = {Dingzirui Wang and Xuanliang Zhang and Keyan Xu and Qingfu Zhu and Wanxiang Che and Yang Deng},
  title = {{Not All Gap Correction Helps: A Geometric View of External Information in LLM Inference}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=LkdvmbQDdL},
}
Figure