NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Evaluating LLMs' Mathematical and Coding Competency through Ontology-guided Interventions

Pengfei Hong, Navonil Majumder, Deepanway Ghosal, Somak Aditya, Rada Mihalcea, Soujanya Poria

Introduction

The rapid advancement of Large Language Models (LLMs) has led to record-breaking performances on standard benchmarks like GSM8K for mathematics and HumanEval for coding. However, these high scores raise a fundamental question: are these models truly reasoning through problems, or are they merely sophisticated pattern matchers? The risk of "data contamination"—where models memorize publicly available benchmark solutions during training—threatens the validity of these evaluations. This research moves beyond simple accuracy scores toward a systematic, ontology-guided stress test to probe the "reasoning depth" of current AI systems.

Methodology: An Ontology of Perturbations

To investigate the robustness of LLM competency, the authors developed a comprehensive four-level ontology consisting of 44 distinct perturbation types. These interventions are designed to test whether a model's problem-solving ability is invariant to changes in context, constraints, or format.

The ontology is structured as follows:

  1. Level I (Aspect): Categorizes perturbations into Structural (altering logic or reasoning paths) and Representational (altering encoding or format while maintaining logic).
  2. Level II (Target): Further divides these into Logic Alteration, Concept Analysis, and Format Constraints.
  3. Levels III & IV (Dimension & Category): Define specific tweaks such as "Backward Reasoning," "Identify Hidden Error," or "Change Reasoning Style."
Examples of ontology-guided perturbations for the GSM8K (math) and HumanEval (coding) benchmarks.

The researchers employed a semi-automatic pipeline to generate their datasets. Starting with five "seed" questions each from GSM8K and HumanEval, they used GPT-4 to create variants across the 44 categories. A rigorous human-in-the-loop validation process, involving PhD students, ensured that all perturbed questions remained logically coherent, solvable, and accurately reflected the intended perturbation.

New Benchmarks: GSMore and HumanEval-Core

The result of this process is two new robustness evaluation datasets:

  • GSMore: A mathematics-oriented dataset consisting of 216 perturbed examples derived from GSM8K.
  • HumanEval-Core: A coding-oriented dataset consisting of 219 perturbed examples derived from HumanEval.

These datasets allow for a direct comparison between a model's performance on original "seed" samples and its performance on logically consistent variations, revealing the gap between "reciting" a solution and "reasoning" through one.

Experimental Results: The Robustness Gap

The study revealed a significant "robustness gap" across all tested models. Even top-tier models like GPT-4o and OpenAI’s o1-preview experienced dramatic performance declines when faced with perturbations.

Performance metrics for various LLMs across structural and representational perturbation categories in both MATH and CODE domains.

Key Findings

  • Dramatic Performance Drops: Across the board, models saw accuracy decreases of 30 to 40 points on the perturbed datasets compared to their performance on original benchmarks. While humans maintained near-perfect accuracy (97.7%) across perturbations, models plummeted to an average of 41.2%.
  • Concept Analysis as the Achilles' Heel: Models performed significantly worse on "Concept Analysis" (e.g., "Is there a way to solve this without calculating X?") than on "Logic Alteration." This indicates that models struggle to discuss the process of math or coding abstractly, even if they can perform the calculation.
  • The Cost of Fine-Tuning: Interestingly, models fine-tuned on specific tasks (like MetaMath or CodeLlama) often performed better on logic/format changes but worse on concept analysis. This suggests that narrow fine-tuning might restrict broader reasoning capacities, essentially training the model to be a better "reciter" rather than a better "thinker."
  • o1-preview Resilience: OpenAI’s o1-preview showed the highest resilience to these tests, but even it saw a 9-12% performance drop, proving that robust reasoning remains an unsolved frontier.

Discussion and Future Directions

The disparity between human and model performance is stark. The fact that errors are often systematic suggests that LLMs lack the "structured reasoning abilities" that allow humans to generalize principles across different contexts. Techniques like "Program of Thought" (PoT) helped handle symbolic manipulation better, but "Self-Consistency" (majority voting) showed only minor improvements, indicating that the failures are not random but rooted in a lack of fundamental understanding.

The authors suggest that this ontology-guided framework should be used for data augmentation—training models on these types of perturbations to help them move past pattern matching and toward true algorithmic reasoning. Future work will aim to scale this approach to a larger pool of seed questions to provide even more robust statistics on LLM competency.

Reference: Hong, P., et al. (2025). Evaluating LLMs’ Mathematical and Coding Competency through Ontology-guided Interventions. Findings of ACL 2025.

Summary updated

BibTeX
@inproceedings{hong2025evaluating,
  author = {Pengfei Hong and Navonil Majumder and Deepanway Ghosal and Somak Aditya and Rada Mihalcea and Soujanya Poria},
  title = {{Evaluating LLMs' Mathematical and Coding Competency through Ontology-guided Interventions}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure