Abstract
Large Language Models (LLMs) are widely used across various scenarios due to their exceptional reasoning capabilities and natural language understanding. While LLMs demonstrate strong performance in tasks involving mathematics and coding, their effectiveness diminishes significantly when applied to chemistry-related problems. Chemistry problems typically involve long and complex reasoning steps, which contain specific terminology, including specialized symbol systems and complex nomenclature conventions. These characteristics often cause general LLMs to experience hallucinations during the reasoning process due to their lack of specific knowledge. However, existing methods are struggling to effectively leverage chemical expertise and formulas. Moreover, current uncertainty estimation methods, designed to mitigate potential reasoning errors, are unable to precisely identify specific steps or key knowledge. In this work, we propose a novel framework called ChemAU, which incorporates our adaptive uncertainty estimation method that applies different uncertainty values based on the position of reasoning steps within the whole reasoning chain. Leveraging this method, ChemAU identifies gaps in chemistry knowledge and precisely supplements chemical expertise with the specialized domain model, thereby correcting and updating the previously flawed reasoning chain. Our experiments with three popular LLMs across three chemistry datasets demonstrate that ChemAU significantly enhances both reasoning accuracy and uncertainty estimation.
Introduction: The "Domino Effect" in Chemical Reasoning
Chemistry is a high-stakes reasoning domain where precision is paramount. A single error in a molecular formula—such as misidentifying "Yellow Prussiate of Potash" as $K_3[Fe(CN)_6]$ instead of $K_4[Fe(CN)_6]$—triggers a "domino effect." This initial hallucination invalidates every subsequent calculation, from molar mass to final yield. General LLMs frequently stumble into these "hallucination traps" due to a lack of specialized chemical vocabulary and nomenclature.
A critical discovery in this research is the Logit Inflation Trap. In general text, uncertainty typically remains stable. However, in chemistry, as an LLM generates a long chain of reasoning, it tends to "convince itself" it is correct. The internal probability scores (logits) for specialized chemical terms often show an upward trend as the reasoning progresses, even when the model is hallucinating. This phenomenon masks errors from traditional uncertainty detection methods.
The ChemAU Framework
To address these challenges, we propose ChemAU (Chemical Adaptive Uncertainty), a framework that integrates general LLM intelligence with specialized chemical expertise through a three-phase process.
1. Adaptive Uncertainty Estimation
Standard methods treat all reasoning steps equally. ChemAU introduces a position-aware penalty to prioritize foundational steps. Uncertainty ($U_i$) is calculated as: $$U_i = \max(-\log p) + \alpha(L_R - i)$$ By applying a stricter threshold to earlier steps ($i$), ChemAU recognizes that early errors are more catastrophic than late ones.
2. Knowledge Extraction and Supplementation
When a step is flagged as uncertain, ChemAU extracts the specific "atomic" chemistry knowledge required (e.g., a chemical formula). It then queries a smaller, specialized domain model—a fine-tuned Qwen2.5-1.5B—to provide the correct expertise.
3. Iterative Correction
The corrected domain knowledge is fed back into the general LLM. The model then regenerates the remaining reasoning chain from the point of correction, ensuring the "domino effect" is halted and reversed.
Experimental Results
ChemAU was evaluated on chemistry-specific subsets of expert-level benchmarks: GPQA, MMLU-Pro, and SuperGPQA.
- Significant Accuracy Gains: On MMLU-Pro, LLaMA-3-8B’s accuracy improved from 27.44% to 53.56% using the ChemAU framework.
- Parameter Efficiency: Smaller models (7B-8B) using ChemAU frequently outperformed much larger 14B parameter models, demonstrating that structured reasoning can compensate for raw parameter count.
- Reliable Uncertainty Detection: The adaptive method outperformed standard $Max(-\log p)$ metrics by up to 9.68%, proving more effective at catching scientific hallucinations.
Discussion and Limitations
While ChemAU significantly enhances chemical reasoning, it currently operates as a "white-box" method. It requires access to the model's internal logit values, which are typically unavailable for proprietary "black-box" models like GPT-4 or Claude. Future research will explore "black-box" adaptations of adaptive uncertainty that rely on semantic consistency or self-reflection rather than raw probability scores.
Summary updated