TempPerturb-Eval: On the Joint Effects of Internal Temperature and External Perturbations in RAG Robustness

Yongxin Zhou, Philippe Mulhem, Didier Schwab

TL;DR

Production RAG systems often face imperfect, noisy retrieval, but how does this external noise interact with an LLM's internal generation settings? This paper introduces TempPerturb-Eval, a framework demonstrating that higher generation temperatures drastically amplify an LLM's vulnerability to text perturbations, revealing distinct, model-specific thresholds for robust deployment.

What Problem Does This Paper Address?

Retrieval-Augmented Generation (RAG) is highly effective because it grounds Large Language Models (LLMs) with external knowledge. However, in real-world deployments, retrieval is rarely perfect—it frequently introduces noise in the form of irrelevant text, missing facts, or corrupted entities. At the same time, developers adjust generation hyperparameters like temperature to balance creativity and determinism.

Traditionally, researchers evaluate retrieval quality and generation parameters in isolation. This paper addresses a critical gap: the unstudied interaction between external text perturbations and internal model temperature. Failing to account for how these two forces compound can lead to misleading robustness assessments and unexpected system failures in production.

Methods

The authors propose the RAG Perturbation-Temperature Analysis Framework to systematically evaluate how LLMs handle noisy contexts across different temperature settings.

Figure 1: RAG Perturbation-Temperature Analysis Framework. The methodology stresses system ro- bustness along two axes: external context perturbations (replacement, removal, NER substitution) and internal LLM temperature variation. The evaluation measures correctness and output variability across these conditions to establish a benchmark and derive practical guidelines.

The methodology involves:

  1. Temperature Scaling: Varying the LLM sampling temperature from 0.0 to 2.0 in increments of 0.2.
  2. Context Perturbations: Applying three distinct types of text modifications to the supporting documents to simulate retrieval errors:
  3. Sentence Replacement: Replacing the latter portion of supporting sentences with irrelevant sentences from the same document title (simulating correct entity retrieval with incorrect evidence).
  4. Sentence Removal: Deleting the latter half of supporting sentences (simulating incomplete evidence).
  5. NER Replacement: Masking named entities with [MASK] tokens to disrupt entity recognition and relationship inference.
  6. Multiple Evaluation Runs: Executing each query three times per condition to separate the model's internal stochasticity (due to temperature) from the impact of the external perturbations.

Outputs are evaluated using semantic similarity metrics, primarily BERTScore, against reference answers that are expanded into complete sentences using a standardized template.

Datasets

The framework is evaluated using the training set of the fullwiki version of HotpotQA, a popular benchmark for multi-hop question answering that requires complex reasoning across multiple documents. The authors randomly selected 600 samples, evenly balanced across different fact counts (2, 3, and 4 facts) and reasoning types ("bridge" vs. "comparison" questions).

Key Insights and Ideas

  • Temperature is a Degradation Amplifier: Temperature does not just introduce randomness; it actively amplifies a model's vulnerability to noisy context. While models tolerate perturbations reasonably well at low temperatures, their performance drops sharply as temperature increases.
  • Model-Specific Fragility Landscapes: Different LLM architectures show completely unique sensitivity profiles. GPT models maintain high stability until they hit a sharp performance cliff at $T = 1.4$. Llama models begin degrading much earlier ($T = 0.6$) but experience a more gradual decline.
  • The Extreme Temperature Flip: At lower temperatures ($T < 1.4$), proprietary GPT models achieve the highest BERTScores. However, at extreme temperatures ($T = 2.0$), this hierarchy completely reverses: deepseek-reasoner maintains stable performance, while GPT models degrade below the open-source Llama models.
  • DeepSeek’s Chain-of-Thought Resilience: Uniquely, deepseek-reasoner remains nearly invariant to temperature changes. The authors attribute this to its test-time Chain-of-Thought (CoT) architecture, which enforces logical coherence and insulates the final answer from sampling noise.

Key Results

The quantitative effects of temperature and perturbations across different models are highlighted in the paper's trend analysis:

BERTScore trends across temperature variations
  • GPT-4o Vulnerability: For gpt-4o, NER Replacement caused minimal issues, but Sentence Replacement and Sentence Removal triggered severe performance drops and model refusal behaviors (e.g., "The retrieved document does not provide...") at temperatures above 1.4.
  • Output Variability: Using the Coefficient of Variation (CV), the authors found that temperature exerts a much stronger influence on output variability than the specific type of perturbation applied.
  • Practical Deployment Guidelines: To maintain acceptable correctness under noisy retrieval conditions, the authors recommend strict temperature ceilings:
  • DeepSeek-reasoner: Ideal for applications requiring consistent performance across any temperature.
  • GPT Models: Keep temperature ceilings at $T \le 1.4$ to avoid sharp performance cliffs.
  • LLaMA Models: Use conservative temperature limits of $T \le 0.6$.

Limitations and Future Work

  • Task Generalizability: The findings are currently restricted to multi-hop factoid QA (HotpotQA). How temperature and perturbations interact in other common RAG tasks, such as long-form summarization or open-ended dialogue, remains to be validated.
  • Other Hyperparameters: The study held other decoding parameters (like top-p or frequency penalties) constant, though they likely also interact with context noise.
  • Controlled vs. End-to-End Noise: The authors isolated generator sensitivity by perturbing "gold" contexts. A crucial next step is integrating actual, messy vector retrieval systems to observe how real-world retrieval inaccuracies compound with generation stochasticity in end-to-end pipelines.

Summary updated

Abstract

The evaluation of Retrieval-Augmented Generation (RAG) systems typically examines retrieval quality and generation parameters like temperature in isolation, overlooking their interaction. This work presents a systematic investigation of how text perturbations (simulating noisy retrieval) interact with temperature settings across multiple LLM runs. We propose a comprehensive RAG Perturbation-Temperature Analysis Framework that subjects retrieved documents to three distinct perturbation types across varying temperature settings. Through extensive experiments on HotpotQA with both open-source and proprietary LLMs, we demonstrate that performance degradation follows distinct patterns: high-temperature settings consistently amplify vulnerability to perturbations, while certain perturbation types exhibit non-linear sensitivity across the temperature range. Our work yields three key contributions: (1) a diagnostic benchmark for assessing RAG robustness, (2) an analytical framework for quantifying perturbation-temperature interactions, and (3) practical guidelines for model selection and parameter tuning under noisy retrieval conditions.
BibTeX
@inproceedings{zhou2026tempperturb,
  author = {Yongxin Zhou and Philippe Mulhem and Didier Schwab},
  title = {{TempPerturb-Eval: On the Joint Effects of Internal Temperature and External Perturbations in RAG Robustness}},
  booktitle = {LREC},
  year = {2026},
  doi = {10.63317/3v28zfbo6agu},
}
Figure