Abstract
While Large Language Models (LLMs) excel in natural language processing, their ability to perform rigorous causal reasoning on tabular data remains limited. This paper introduces the Causal Agent, a framework designed to bridge the gap between sequential text processing and structural causal logic. By orchestrating specialized Python tools through a ReAct-based planning module and maintaining an instantiated memory of causal graphs, the Causal Agent transforms LLMs from "causal parrots" into effective orchestrators of causal discovery and effect estimation. Experimental results show that the framework achieves over 80% accuracy on complex causal tasks and surpasses previous state-of-the-art models on real-world benchmarks by 6%.
Introduction
The "Ladder of Causality" requires understanding not just correlations, but the underlying mechanisms of why events occur. Despite their prowess, LLMs face two primary hurdles in this domain: a structural mismatch between tabular data (CSVs) and sequential text, and the complexity of causal theory, which often leads to hallucinations when models attempt direct reasoning. Current approaches typically focus on basic data manipulation rather than deep causal logic involving confounders or colliders.
The Causal Agent Framework
The Causal Agent framework addresses these challenges through three integrated modules:
- Tool Module: The agent does not perform statistical calculations directly. Instead, it generates Python code to invoke specialized libraries such as
causal-learnfor discovery andEconMLfor effect estimation. This ensures that tabular data is processed with mathematical precision. - Memory Module: To prevent the loss of detail common in long text prompts, the agent maintains a dictionary of instantiated Python objects representing causal graphs. This structured memory allows for precise manipulation across multiple reasoning steps.
- Plan Module: Utilizing the ReAct (Reason + Act) framework, the agent iteratively "thinks" about the problem, executes tool calls, observes outputs, and refines its strategy until a final answer is reached.
The reasoning process is structured across four hierarchical levels: Variable (correlation), Edge (direct/indirect causes), Causal Graph (full structure), and Causal Effect (intervention quantification).
Evaluation and Benchmarks
The framework was evaluated using two primary datasets:
- CausalTQA: A new benchmark comprising ~1.4K questions across the four levels of causal reasoning, using synthetic data with known ground truths paired with natural language narratives.
- QRData: A real-world dataset used to validate the agent's generalization capabilities in practical scenarios.
Results
The Causal Agent demonstrated superior performance across all reasoning levels:
- Variable Level: >95% accuracy in independence testing.
- Edge Level: >89% accuracy in identifying complex structures like colliders and confounders.
- Causal Effect: 98% accuracy in estimating Average Treatment Effects (ATE).
- Real-world Performance: On the QRData benchmark, the Causal Agent (powered by GLM-4-Plus) achieved a score of 57.3, representing a 6% improvement over the previous state-of-the-art and significantly outperforming base GPT-4 (42.8).
Discussion and Conclusion
The primary innovation of the Causal Agent lies in shifting the LLM's role from a calculator to an orchestrator. By using causal graphs as intermediate representations in memory, the system avoids the "telephone game" effect of text-only reasoning. However, limitations remain, particularly regarding minor syntax errors in parameter passing and the increased logical complexity of multi-agent coordination. Future work will focus on refining tool-calling accuracy and calibrating output biases to further enhance the reliability of automated causal reasoning.
Summary updated