Simulator-Grounded Large Language Models for Industrial Causal Reasoning: Tool-Use, Structured Injection, and Plant-Portable Retrieval for Wastewater Treatment Decision Support

causal reasoningcounterfactual inferencelarge language modelsparameter injectionretrieval-augmented generationsimulator groundingtool-usewastewater treatment

Abstract


Wastewater operators need answers grounded in how their plant's variables interact and how fast effects propagate—not in generic pretraining text—when asking causal questions such as "why is N2O rising?" or "what happens if I cut aeration by 20%?". We compare three concrete ways to ground a frozen Qwen2.5-32B-Instruct model in an architecturally interpretable wastewater simulator (CCSS-IX): a live simulator oracle (Method 1), structured parameter injection (Method 2), and a Decoupled Recall-Reasoning (DRR) retriever (Method 3). On a 198-question causal benchmark, the three achieve 99.5%, 79%, and 75.8% accuracy, respectively, forming a deployment ladder above the strongest retrieval-augmented baseline at 48%. The DRR retriever has 110M parameters and trains per plant in ~17 seconds; after cross-plant transfer to a biologically distinct plant, it still reaches 88%, while Method 2's static table cannot transfer. On a 60-question counterfactual benchmark, only Method 3 handles queries about what happens after an intervention: +16.3 percentage points over Method 2, with a paired 95% confidence interval of [+7.1, +26.4] pp, and 100% accuracy on the timescale and operating-regime categories. On the AI2 Reasoning Challenge (ARC) with an OpenBookQA fact corpus, the same selective-retrieval mechanism reaches 79% versus unconstrained Llama-3.1-8B at 76% and full-injection at 74%, a +3 pp out-of-domain replication that argues against a result specific to wastewater treatment. We provide the first single-simulator comparison of live tool-use, static parameter injection, and learned numerical-parameter retrieval for industrial causal question answering.


1. Introduction


Large language models (LLMs) have shown remarkable capabilities in natural language understanding and generation, but their application to industrial decision support systems—particularly those requiring causal reasoning—remains challenging. In domains such as wastewater treatment, operators frequently ask questions that demand precise, context-aware answers based on the plant's dynamic behavior, not just generic knowledge from pretraining corpora. For instance, a question like "why is N2O rising?" requires understanding the specific relationships between process variables in the plant, while "what happens if I cut aeration by 20%?" necessitates counterfactual reasoning about interventions and their temporal effects.


2. Background and Motivation


As of 2026, the integration of LLMs into industrial settings has accelerated, but the gap between general-purpose language models and domain-specific causal reasoning remains a critical bottleneck. Generic retrieval-augmented generation (RAG) approaches often fail because they retrieve text passages that lack the numerical precision and dynamic interaction information needed for accurate causal answers. This paper addresses this gap by systematically comparing three distinct grounding strategies that anchor an LLM to a simulator's structured knowledge.


3. Methodology


We evaluate three methods for grounding a frozen Qwen2.5-32B-Instruct model in the CCSS-IX wastewater treatment simulator:


  • Method 1: Live Simulator Oracle—The model directly queries the simulator in real time to obtain accurate causal and temporal information.
  • Method 2: Structured Parameter Injection—Static plant-specific parameters are injected into the model's prompt, providing facts but no dynamic interaction data.
  • Method 3: Decoupled Recall-Reasoning (DRR) Retriever—A lightweight 110M-parameter retriever that learns to select relevant numerical parameters and supports cross-plant portability.

4. Results


4.1 Causal Reasoning Benchmark


On a 198-question benchmark testing causal queries, the methods achieve the following accuracy:

  • Method 1: 99.5%
  • Method 2: 79%
  • Method 3: 75.8%
  • Baseline (strongest RAG): 48%

This forms a clear „deployment ladder," where operators can choose the method that best fits their computational and functional requirements.


4.2 Counterfactual Reasoning


On a 60-question counterfactual benchmark focusing on post-intervention scenarios, only Method 3 (DRR) successfully handles these queries, outperforming Method 2 by +16.3 percentage points (paired 95% CI [+7.1, +26.4] pp) and achieving 100% accuracy on timescale and operating-regime categories.


4.3 Out-of-Domain Generalization


To test whether the results are domain-specific, the same selective-retrieval mechanism was applied to the AI2 Reasoning Challenge (ARC) with an OpenBookQA fact corpus. It reached 79%, outperforming unconstrained Llama-3.1-8B (76%) and full-injection (74%), yielding a +3 pp improvement out-of-domain, suggesting general applicability.


5. Discussion


Our results provide the first single-simulator comparison of three major grounding approaches—live tool-use, static parameter injection, and learned retrieval—for industrial causal question answering. The DRR retriever stands out for its portability and counterfactual capability, making it a practical choice for real-world deployment where plants differ biologically and operators require what-if analysis.


6. Conclusion


We demonstrate that simulator-grounded LLMs can effectively support causal and counterfactual reasoning in industrial settings. The DRR retriever offers a compelling balance of accuracy, efficiency, and transferability, paving the way for broader adoption of such systems in wastewater treatment and beyond. Future work will explore scaling to more complex simulators and integrating user feedback loops for continuous improvement.


Comments: 20 pages, 2 figures, 8 tables. Preprint submitted to Elsevier.


Subjects: Computation and Language (cs.CL); Artificial Intelligence (cs.AI)


ACM Classes: I.2.7; I.2.6; H.3.3; J.2


Cite as: arXiv:2608.05151 [cs.CL]

via ArXiv CL+LG

Related