TL;DR
This study reveals that the "temperature" parameter in LLMs like GPT-4o significantly impacts diagnostic accuracy in emergency medicine scenarios. Lower temperatures lead to more accurate and consistent diagnoses, while higher temperatures increase variability and reduce accuracy, highlighting the need for careful parameter tuning and transparent reporting in clinical AI applications.
What Problem Does This Paper Address?
Large Language Models (LLMs) are increasingly being explored for clinical decision support, particularly in high-stakes fields like emergency medicine. However, LLMs are inherently non-deterministic; their outputs can vary even with identical inputs due to parameters like "temperature." This parameter controls the randomness of the model's output sampling, influencing whether it favors more predictable, common responses or explores a wider, potentially less accurate, range of possibilities. This variability poses a challenge for clinical applications where reliability and reproducibility are paramount. The paper addresses the critical question of how this temperature setting affects the diagnostic accuracy and consistency of an LLM when presented with realistic emergency medicine cases, and how this might impact its utility in clinical settings.
Methods
The researchers conducted a simulation-based study using GPT-4o. They selected four challenging emergency medicine cases from a medical curriculum, designed to be difficult and potentially ambiguous. Each case was fed into GPT-4o 250 times across five different temperature settings (0.0, 0.25, 0.50, 0.75, and 1.0). Crucially, this was done both with and without the inclusion of physical examination findings, resulting in a total of 10,000 outputs. To ensure a focused evaluation, each output was constrained to provide exactly three differential diagnoses, with one designated as the leading diagnosis. This structure aimed to prevent inflated accuracy from long, unranked lists. Diagnostic accuracy was assessed by comparing the LLM's outputs against pre-determined "gold standard" diagnoses. Mixed-effects models were used to analyze the relationship between temperature and accuracy, and a sensitivity analysis specifically examined the impact of excluding physical examination data. Diagnostic divergence, a measure of how much the LLM's suggested diagnoses varied across repeated runs for the same case and temperature, was also analyzed.
Datasets
The study utilized four challenging emergency medicine cases adapted from the "Foundations of Emergency Medicine" (FoEM) curriculum. These cases were chosen to be representative of complex scenarios encountered in emergency medicine and were designed to have a single, unambiguous gold-standard diagnosis. The cases were: myxedema coma, ascending cholangitis, carbon monoxide poisoning, and cryptococcal meningitis. These cases were specifically selected to minimize the likelihood of them being directly present in GPT-4o's training data, thus providing a more robust evaluation of its reasoning capabilities.
Key Insights and Ideas
- Temperature is not just a knob for creativity; it's a dial for accuracy and reliability. The study strongly suggests that for clinical applications demanding high reliability, lower temperature settings are crucial.
- Higher temperatures can lead to "diagnostic divergence," meaning the LLM generates a wider array of diagnoses across repeated attempts for the same case. This inconsistency can be problematic in a clinical setting where a stable, predictable output is desired.
- Not all cases are equally sensitive to temperature. Some cases, like carbon monoxide poisoning with highly specific symptoms, remain accurate regardless of temperature. Others, like ascending cholangitis, are highly sensitive, with accuracy dropping significantly as temperature increases. This suggests that case complexity and the presence of pathognomonic signs play a role.
- Physical examination findings are critical for certain diagnoses. The study highlights that for some conditions (e.g., ascending cholangitis, myxedema coma), the absence of physical exam data significantly degrades diagnostic accuracy, underscoring the importance of comprehensive input for LLMs.
Key Results
- At a temperature of 0.0, GPT-4o achieved 100% leading diagnosis accuracy across all four cases when physical examination data was provided.
- As temperature increased to 1.0, overall leading diagnosis accuracy dropped to 89.4%.
- Diagnostic divergence increased dramatically: the average number of unique diagnoses generated across iterations rose from 4.5 at temperature 0.0 to 26.25 at temperature 1.0 (a 483% increase).
- Ascending cholangitis was the most temperature-sensitive case, with leading diagnosis accuracy falling from 100% to 70.4% as temperature increased.
- Carbon monoxide poisoning maintained 100% accuracy across all temperature settings.
- Excluding physical examination data significantly reduced overall accuracy, particularly for ascending cholangitis and myxedema coma.
Limitations and Future Work
The authors acknowledge several limitations:
- Limited Case Variety: The study used only four simulated cases, which cannot fully replicate the ambiguity and complexity of real-world patient presentations.
- Discrete Gold Standards: The scoring relied on discrete gold-standard diagnoses rather than probabilistic reasoning, which might not capture nuanced diagnostic processes.
- Single LLM: Only GPT-4o was tested; generalizability to other models or future versions is unknown.
- No Random Seed Control: OpenAI models did not allow for specification of the random seed, which could confound stochasticity at temperatures greater than 0.0.
- Focus on Reasoning: The study did not specifically test the impact of temperature on LLMs designed for reasoning models.
Future work could involve expanding the case diversity, testing a wider range of LLMs, and exploring the impact of temperature on LLMs specifically designed for probabilistic reasoning. The authors also emphasize the critical need for transparent reporting of temperature settings and other decoding parameters in all LLM clinical research to ensure reproducibility and build trust.
Summary updated