Evaluates a model's ability to translate complex mathematical word problems into executable Python code that computes a specific numerical answer. It probes semantic grounding of natural language, arithmetic reasoning, and straight-line code generation. Use when the user wants to benchmark on MathQA-Python, or asks about evaluating this task. Reports accuracy.
Scanned 9/11/2026
Install to Claude Code
npx -y skills add qhjqhj00/research-skills-pool --skill mathqa-python-eval --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Mathqa Python Eval?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/qhjqhj00-mathqa-python-eval)More formats (shields.io, HTML) on the badges page.
---
name: mathqa-python-eval
description: Evaluates a model's ability to translate complex mathematical word problems into executable Python code that computes a specific numerical answer. It probes semantic grounding of natural language, arithmetic reasoning, and straight-line code generation. Use when the user wants to benchmark on MathQA-Python, or asks about evaluating this task. Reports accuracy.
metadata:
skill_kind: dataset_eval
source_arxiv: 2108.07732
bibtex_key: austin2021programsynthesis
confidence: high
---
# mathqa-python-eval
> Program Synthesis with Large Language Models — Austin et al. (2021) (arXiv:2108.07732, 2021)
## What this evaluates
Evaluates a model's ability to translate complex mathematical word problems into executable Python code that computes a specific numerical answer. It probes semantic grounding of natural language, arithmetic reasoning, and straight-line code generation.
## Datasets
- **MathQA-Python** — total 23914; splits: train (19209), val (2822), test (1883); repo https://github.com/google/trax/blob/master/trax/examples/MathQA_Python_generation_notebook.ipynb
## Metrics
- `accuracy` **(primary)** — range: [0, 1]
- Percentage of test problems for which the generated Python code executes and evaluates to the declared numerical ground-truth answer.
## Input / output format
**Input**: Mathematical word problem, optionally preceded by few-shot examples.
**Output**: Python code (or DSL code) that computes the ground truth numerical answer.
## Scoring recipe
```python
correct = 0
for problem in test_set:
code = model.generate(problem.prompt)
if execute_and_check(code, problem.numerical_answer):
correct += 1
return correct / len(test_set)
```
## Common pitfalls
- Dataset was filtered to 55% of original size to keep only problems where code evaluates to the declared numerical answer.
- Contains mostly straight-line code but complex natural language descriptions, unlike MBPP's control flow heavy tasks.
- Model must return code that computes the exact numerical answer, not just a string.
## Evidence (verbatim from paper)
> To evaluate whether pre-training on source code is useful for this task, we translate this dataset into a Python program synthesis dataset by translating the ground-truth programs from the domain-specific language given in the paper to Python code. ... We execute the sampled code to check for semantic correctness. This method of checking correctness forced us to filter the MathQA dataset to keep only those problems for which the code evaluates to the declared numerical answer, resulting in us removing 45% of problems. After this filtration we are left with 23914 problems, of which we use 19209 for training, 2822 for validation and 1883 for testing.
## Citation
```bibtex
@misc{austin2021programsynthesis,
title={Program Synthesis with Large Language Models},
author={Austin et al. (2021)},
year={2021},
note={arXiv:2108.07732}
}
```
- arXiv: 2108.07732
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!