Are Large Language Models Good Statisticians?

Yizhang Zhu, Shiyin Du, Boyan Li, Yuyu Luo, Nan Tang

Abstract

While Large Language Models (LLMs) have demonstrated remarkable proficiency in mathematics and symbolic logic, their capacity for "statistical literacy"—the ability to select appropriate analytical methods based on specific data characteristics—remains largely unexamined. This paper introduces StatQA, a comprehensive benchmark comprising over 11,000 tasks designed to evaluate LLMs on their ability to assess data prerequisites and select valid statistical tests. Our findings reveal that even state-of-the-art models like GPT-4o struggle with prerequisite assessment, frequently committing "applicability errors." However, the study also identifies a unique complementarity between human and AI performance, suggesting new pathways for collaborative data science.

Introduction

Statistical analysis is a foundational pillar of scientific inquiry, yet its execution requires more than mere computational accuracy. A qualified statistician must evaluate a dataset's nuances—such as distribution normality, sample size, and variable types—before choosing a hypothesis test. Applying a parametric test like a t-test to non-normal data, or a Pearson correlation to non-linear relationships, results in scientifically invalid conclusions.

Despite the proliferation of LLM benchmarks in STEM fields, most focus on calculation or symbolic reasoning. The "literacy" required to navigate the prerequisites of statistical methods is often overlooked. This research addresses this gap by asking: Can LLMs competently select relevant data, recognize prerequisites, and discern appropriate usage scenarios for statistical methods?

The StatQA Benchmark

To rigorously evaluate these capabilities, the authors developed StatQA, a benchmark of 11,623 examples derived from 78 real-world tables across domains such as medicine, economics, and education.

The benchmark was constructed using a "reverse synthesis" pipeline to ensure ground-truth accuracy:

  1. Target Selection: Specific statistical methods and data columns were selected from real-world datasets.
  2. Prerequisite Verification: Automated scripts verified whether the data met the rigorous requirements for the chosen methods (e.g., Shapiro-Wilk tests for normality).
  3. Question Synthesis: Hand-crafted templates were used to generate questions, which were then refined by GPT-3.5-Turbo to ensure natural and diverse linguistic phrasing.

The resulting dataset covers five core categories: Correlation Analysis, Contingency Table Tests, Distribution Compliance, Variance Tests, and Descriptive Statistics.

Experimental Methodology

The researchers evaluated a range of models, including LLaMA-2, LLaMA-3, GPT-3.5, GPT-4, and GPT-4o. Several prompting and training strategies were employed:

  • Few-shot & Chain-of-Thought (CoT): Standard reasoning prompts to encourage step-by-step logic.
  • Domain Knowledge (DK): Providing models with explicit rules regarding the applicability of specific tests.
  • Fine-tuning: Utilizing Low-Rank Adaptation (LoRA) to specialize models on the StatQA task set.

Results and Analysis

The Applicability Blind Spot

The most prevalent failure mode for LLMs was the "Applicability Error." Models frequently identified the correct category of test (e.g., recognizing a correlation task) but failed to check if the data met the prerequisites for a specific test (e.g., choosing Pearson instead of Spearman for non-normal data).

Human-AI Complementarity

A striking finding of the study is the divergence between human and AI error patterns. In a comparison using a subset called mini-StatQA, human participants (statistics graduate students) achieved an accuracy of 53.45%. While lower than the top-performing models, humans excelled at prerequisite checks—the very area where LLMs failed. Conversely, humans were prone to "Task Confusion," occasionally misidentifying the fundamental goal of a question, a mistake LLMs rarely made. This suggests that human-AI "tag teams" could significantly outperform either alone.

Performance Benchmarks

  • GPT-4o: Achieved a peak performance of 64.83% when augmented with explicit domain knowledge.
  • Fine-tuned LLaMA-3 8B: Reached the highest overall score of 77.13%. This indicates that statistical literacy is a specialized skill where domain-specific fine-tuning can outperform general-purpose prompting of much larger models.
  • Scaling Effects: Larger models (e.g., Qwen2-72B) showed significant improvements over smaller versions, suggesting that general reasoning capacity is a necessary, though not sufficient, foundation for statistical literacy.

Discussion and Limitations

The study highlights that "thinking step-by-step" (CoT) is not a universal solution; for smaller models, CoT actually led to a slight performance degradation, likely due to the hallucination of statistical logic.

Currently, StatQA focuses on hypothesis testing and descriptive statistics. Future research is needed to expand this benchmark into more complex domains such as regression analysis and causal inference. Furthermore, the transition from binary (correct/incorrect) evaluation to more granular, step-by-step scoring could provide deeper insights into the internal reasoning of these models. The authors propose that multi-agent frameworks, where different LLM "experts" collaborate to assess data and select methods, may be the next step in achieving true statistical competence in AI.

Summary updated

BibTeX
@inproceedings{zhu2024are,
  author = {Yizhang Zhu and Shiyin Du and Boyan Li and Yuyu Luo and Nan Tang},
  title = {{Are Large Language Models Good Statisticians?}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
}
Figure