textmath-ai/StackMathQAmathreasoningquestion-answeringstack-exchangefine-tuningpretrainingllmlatexenglishcc-by-4.0

StackMathQA Mathematics Question-Answer Corpus

Free

Open dataset

Sample structure: 100 / 100
3 download links issued
Seller: DataBazaar
Sign up to download

Already have an account? Log in

Agent? Connect your account →

Category
Text
Records
6,195,432 rows
Format
PARQUET
Update Frequency
Not documented
Collection Method
auto_imported_huggingface_federated
PII
No flagged field names; not a privacy audit
File Size
~5215.44 MB
Download links issued
3

Source, license and coverage

Supplier documentation. These claims are separate from the automated sample score. A listing edit date is not a data freshness date.

License
cc-by-4.0
Source / creator
math-ai/StackMathQA
Collection method
The authors sourced raw Q&A pairs from Stack Exchange's public data dumps across math-related sites, then filtered and curated for quality, deduplicated, and sharded into size-stratified configs (100k → 1.6M) plus a full 2M release. Math content retains its original LaTeX formatting. Per-question multiple answers are preserved as a list rather than collapsed.
Coverage start
Not documented
Coverage end
Not documented
Data last updated
Not documented
Update schedule
Not documented

Source documentation ↗

License terms ↗

Content is English-only and reflects the demographics and topic distribution of Stack Exchange users (skewed toward undergraduate/graduate pure math, with strong representation of algebra, calculus, and analysis; weaker on applied/numerical topics). Answer quality varies — high-vote answers are not separated from low-vote ones in all configs. LaTeX rendering assumes downstream MathJax/KaTeX support. The dataset is not deduplicated against common math benchmarks (MATH, GSM8K, MathQA), so benchmark contamination is a real risk for evaluation use. Source does not document a formal quality-filtering threshold; buyers should validate empirically.

Sample structure score: 100 / 100

This automated check describes the inspected sample, not factual accuracy, legal rights, representativeness, or the quality of the entire dataset. It is not a customer rating.

Assessed 10 sample records (JSON) on 2026-10-09. All records in the provided sample were checked.

CheckPointsEvidence
Populated cells50 / 5030 of 30 top-level cells contain a value. Null, absent and blank values count as missing; zero and false count as populated.
Consistent value types30 / 3030 of 30 populated cells match their column's most common observed type. Types are inferred, not checked against real-world truth.
Consistent record shape20 / 2010 of 10 records have the expected fields. CSV/TSV use the header width; JSON uses the union of observed keys.
Field-level findings and improvements

Check missing cells and mixed types below. Document intentional missing values or mixed types in your field descriptions. Do not fill legitimate unknowns with invented values just to increase this score.

FieldMissing cellsMost common typeOther populated types
Q0 / 10string0 / 10
A0 / 10string0 / 10
meta0 / 10object0 / 10
How the score is calculated, its limitations, and how to correct an assessment →

About this data

Mathematical questions and answers from Stack Exchange sites including Math, MathOverflow, and Stats. Suitable for math reasoning fine-tuning, pretraining, and retrieval-augmented generation tasks.

Retrieve with your agent or Python

Create an account and configure DATABAZAAR_API_KEY. This example retrieves free or already purchased data; it never makes a purchase. For a multi-file dataset, choose a file index from the manifest.

Download the Python example
python3 retrieve-dataset.py 9b99632f-dff5-4939-91be-c5c86ef6ce96 --output dataset.bin
Full supplier documentation
## Overview StackMathQA is a curated corpus of approximately 2 million mathematical questions and answers scraped and filtered from Stack Exchange sites (math.stackexchange.com, mathoverflow.net, stats.stackexchange.com, and related). The dataset is distributed in JSON format and offered in multiple size configs (stackmathqa1600k, 800k, 400k, 200k, 100k, and the full 2M). Content is English-language and includes LaTeX-formatted math. The dataset is intended for training and evaluating LLMs on mathematical reasoning. ## Schema - Q — string — the question text (often with LaTeX math) - A — list[string] — one or more answer texts from Stack Exchange responders - meta — object — source metadata including site, question/answer IDs, scores, tags - title — string — original question title - url — string — link back to the source Stack Exchange post (Exact field names depend on the config; the 2M full corpus is the union of per-site shards.) ## Sources - math-ai/StackMathQA on Hugging Face — https://huggingface.co/datasets/math-ai/StackMathQA — License: CC-BY-4.0 - Upstream: Stack Exchange data dump (Math, MathOverflow, Stats, etc.), itself CC-BY-SA ## Methodology The authors sourced raw Q&A pairs from Stack Exchange's public data dumps across math-related sites, then filtered and curated for quality, deduplicated, and sharded into size-stratified configs (100k → 1.6M) plus a full 2M release. Math content retains its original LaTeX formatting. Per-question multiple answers are preserved as a list rather than collapsed. ## Known gaps & limitations Content is English-only and reflects the demographics and topic distribution of Stack Exchange users (skewed toward undergraduate/graduate pure math, with strong representation of algebra, calculus, and analysis; weaker on applied/numerical topics). Answer quality varies — high-vote answers are not separated from low-vote ones in all configs. LaTeX rendering assumes downstream MathJax/KaTeX support. The dataset is not deduplicated against common math benchmarks (MATH, GSM8K, MathQA), so benchmark contamination is a real risk for evaluation use. Source does not document a formal quality-filtering threshold; buyers should validate empirically. ## Intended use & out-of-scope - IS for: fine-tuning and pretraining LLMs on mathematical reasoning, building math-focused RAG corpora, studying natural-language proofs and explanations. - NOT for: training models that will be evaluated on MATH/GSM8K/MathQA without first running decontamination; not a verified-correct answer source (Stack Exchange answers can be wrong or downvoted). _Federated dataset: 24 parquet shards, 5.09 GB total. Queries and downloads stream through the DataBazaar API._ _PII signals: cc_shape×10 (Luhn-valid: 0), us_phone×1 present in the sample. Common in public datasets (papers, logs) but worth knowing before joining with private data._ Original supplier listing: StackMathQA: 2M Math Q&A from Stack Exchange Curated collection of 2 million mathematical questions and answers sourced from Stack Exchange sites (Math, MathOverflow, Stats, etc.). Designed for math reasoning fine-tuning, pretraining, and RAG.

Schema

NameTypeDescription
QVARCHARMathematical question text from Stack Exchange, potentially containing LaTeX-formatted equations and multi-line content.
AVARCHAROne or more answer texts from Stack Exchange responders, each potentially containing LaTeX-formatted mathematical content.
metaSTRUCT("language" VARCHAR, url VARCHAR, "timestamp" TIMESTAMP, "source" VARCHAR, question_score VARCHAR, answer_count BIGINT, answer_id BIGINT)Metadata object containing source site, post URLs, timestamps, question/answer IDs, vote scores, and answer counts from Stack Exchange.

Sample Data

Preview a sample of the data before downloading.

Public sample only. Sign in to retrieve the full dataset, including free datasets.

For AI Agents

Via MCP Server
# 1. Add to your agent's MCP config (claude_desktop_config.json or similar):
{
  "mcpServers": {
    "databazaar": { "command": "npx", "args": ["databazaar-mcp"] }
  }
}

# 2. Your agent can then call:
search_datasets({ query: "StackMathQA Mathematics Questi" })
// Found: 9b99632f-dff5-4939-91be-c5c86ef6ce96
get_download_url({ dataset_id: "9b99632f-dff5-4939-91be-c5c86ef6ce96" })  // free — sign in with MCP OAuth first
Via REST API
# Free dataset — sign in or use your account API key:
curl https://api.databazaar.io/datasets/9b99632f-dff5-4939-91be-c5c86ef6ce96/download-url -H "Authorization: Bearer $DATABAZAAR_API_KEY"