Datasets:
Tasks:
Multiple Choice
Modalities:
Text
Formats:
csv
Languages:
Arabic
Size:
10K - 100K
ArXiv:
License:
Upload folder using huggingface_hub
Browse filesFiles changed (3)
- README.mdAdded+104
- apply_filter.pyAdded+55
- ids.csvAdded
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104---license: cc-by-4.0size_categories:- 10K<n<100Klanguage:- artask_categories:- multiple-choicepretty_name: AraSTEM (verified)configs:- config_name: default data_files: - split: test path: ids.csv---
# AraSTEM (verified)
A filtered version of **AraSTEM**, a native Arabic multiple-choice benchmark of STEM questions from school and college sources, with samples flagged by a multi-judge audit removed. The verified set has one config per level and subject (14 configs, `<level>_<subject>`).
> **What "verified" means.** Samples were removed when all three LLM judges flagged a significant defect. This is not a human review, and only samples that baseline models answered incorrectly were audited, so some defects may remain in the kept data.
**This repository does not contain the AraSTEM questions.** The source repository is public but states no license, so we publish the filter instead: which source rows to keep, plus a script that applies it to the source.
## How to use
```bashpip install pandas pyarrow huggingface_hubpython apply_filter.py arastem_verified```
[`apply_filter.py`](apply_filter.py) downloads the source file from GitHub at the commit below, checks every row against the fingerprints in `ids.csv`, splits it by `level` and `subject`, and writes the 10,494-row verified set as one parquet file per config (`arastem_verified/<level>_<subject>.parquet`, e.g. `primary_math.parquet`). It stops with an error if the source has changed.
Or filter it yourself:
```pythonimport json, urllib.requestimport pandas as pd
ids = pd.read_csv("hf://datasets/IFM/AraSTEM_verified/ids.csv")url = "https://raw.githubusercontent.com/AI-DSCHubAUB/AraSTEM-Dataset/d8f8fdd4e420df45737df1105a60a34b9b4aecd2/AraSTEMv5.json"source = pd.DataFrame(json.load(urllib.request.urlopen(url)))kept = ids["status"].eq("kept").to_numpy()verified = source[kept].reset_index(drop=True) # 10,494 rowsconfig = ids.loc[kept, "config"].reset_index(drop=True)primary_math = verified[config.eq("primary_math")].reset_index(drop=True) # 2,774 rows```
## Files- `ids.csv`: one row per source row (10,824 rows): - `row`: the 0-based row index in the source file. - `config`: `<level>_<subject>` from the source `level` and `subject` (spaces replaced by `_`, e.g. `college_information_technology`). - `status`: `kept` (10,494) or `removed` (330). - `fingerprint`: the first 16 hex characters of a SHA-256 over the row's `question`, `option_0`–`option_4`, `correct_option`, `level`, `subject` and `resource` (as text, joined by `\x1f`), used to detect changes in the source.- `apply_filter.py`: rebuilds the verified set from the source.
## Source- Original dataset: GitHub [`AI-DSCHubAUB/AraSTEM-Dataset`](https://github.com/AI-DSCHubAUB/AraSTEM-Dataset), commit `d8f8fdd4e420df45737df1105a60a34b9b4aecd2`, file `AraSTEMv5.json` (10,824 questions). Splitting that file by `level` and `subject` reproduces the evaluation files exactly; each config is one such split after filtering.- Columns of the rebuilt set, as in the source: `question`, `option_0`–`option_4` (unused options are empty strings), `correct_option` (the 0-based index of the correct option, an integer), `level`, `subject` and `resource` (source reference).
## Audit and filtering
Samples were screened with the multi-judge audit described in [`IFM/discarded_samples`](https://huggingface.co/datasets/IFM/discarded_samples) (config `AraSTEM`). Three language-model judges (GPT-5.6 Sol, Gemini 3.8 Flash, Claude Opus 5) assessed candidate samples that strong baselines answered incorrectly. A sample is excluded only when **all three** judges report a *significant* issue (a problem with the question, the options or the gold label that prevents reliable answering or scoring). Each discarded record's `doc_id` is the 0-based position of the sample within its `<level>_<subject>` split of the source file; `ids.csv` gives the matching source row (`row`) for each excluded sample. All other rows are kept unchanged and in their original order.
| Config | Original rows | Excluded | Kept ||---|---:|---:|---:|| `college_biology` | 588 | 21 | 567 || `college_chemistry` | 326 | 34 | 292 || `college_dentistry` | 632 | 29 | 603 || `college_information_technology` | 369 | 38 | 331 || `college_medicine` | 721 | 31 | 690 || `college_pharmacy` | 423 | 15 | 408 || `college_physics` | 137 | 4 | 133 || `primary_math` | 2,822 | 48 | 2,774 || `primary_science` | 3,868 | 66 | 3,802 || `secondary_biology` | 322 | 9 | 313 || `secondary_chemistry` | 237 | 9 | 228 || `secondary_math` | 84 | 3 | 81 || `secondary_physics` | 180 | 7 | 173 || `secondary_science` | 115 | 16 | 99 || **Total** | **10,824** | **330** | **10,494** |
## LicenseThe source repository states no license, so its content remains all rights reserved by its authors, and this repository redistributes none of its text. The files here (`ids.csv`, `apply_filter.py` and this card) are released under CC BY 4.0. The verified set you build from the source remains subject to the source's terms.
## CitationPlease cite the original authors:
```bibtex@article{mustapha2024arastem, title = {AraSTEM: A Native Arabic Multiple Choice Question Benchmark for Evaluating LLMs Knowledge In STEM Subjects}, author = {Mustapha, Ahmad and Al-Khansa, Hadi and Al-Mubasher, Hadi and Mourad, Aya and Hamoud, Ranam and El-Husseini, Hasan and Al-Sakkaf, Marwah and Awad, Mariette}, journal = {arXiv preprint arXiv:2501.00559}, year = {2024}, url = {https://arxiv.org/abs/2501.00559}}
@misc{jais3_2026, title = {Jais 3: Introducing Arabic-centric Agentic AI}, author = {{IFM Team}}, year = {2026}, url = {https://ifm.ai/blog/jais3/},}```12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455"""Rebuild the verified AraSTEM configs from the public source file on GitHub.
Usage: python apply_filter.py [output_dir]
Writes one parquet file per config, <output_dir>/<level>_<subject>.parquet."""import hashlibimport jsonimport osimport sysimport urllib.request
import pandas as pdfrom huggingface_hub import hf_hub_download
SOURCE = "AI-DSCHubAUB/AraSTEM-Dataset"SOURCE_REVISION = "d8f8fdd4e420df45737df1105a60a34b9b4aecd2"SOURCE_URL = f"https://raw.githubusercontent.com/{SOURCE}/{SOURCE_REVISION}/AraSTEMv5.json"THIS_REPO = "IFM/AraSTEM_verified"COLUMNS = ["question", "option_0", "option_1", "option_2", "option_3", "option_4", "correct_option", "level", "subject", "resource"]EXPECTED_KEPT = { "college_biology": 567, "college_chemistry": 292, "college_dentistry": 603, "college_information_technology": 331, "college_medicine": 690, "college_pharmacy": 408, "college_physics": 133, "primary_math": 2774, "primary_science": 3802, "secondary_biology": 313, "secondary_chemistry": 228, "secondary_math": 81, "secondary_physics": 173, "secondary_science": 99,}
def fingerprint(row): return hashlib.sha256("\x1f".join(str(row[c]) for c in COLUMNS).encode()).hexdigest()[:16]
ids = pd.read_csv(hf_hub_download(THIS_REPO, "ids.csv", repo_type="dataset"))with urllib.request.urlopen(SOURCE_URL) as f: source = pd.DataFrame(json.load(f), columns=COLUMNS)assert len(source) == len(ids), f"expected {len(ids)} source rows, got {len(source)}"mismatch = [i for i, row in source.iterrows() if fingerprint(row) != ids.at[i, "fingerprint"]]assert not mismatch, f"source rows differ from the audited version: {mismatch[:10]}"
config = (source["level"] + "_" + source["subject"]).str.replace(" ", "_")assert config.equals(ids["config"]), "config labels differ from ids.csv"kept = ids["status"].eq("kept").to_numpy()
out = sys.argv[1] if len(sys.argv) > 1 else "arastem_verified"os.makedirs(out, exist_ok=True)for name, expected in EXPECTED_KEPT.items(): verified = source[kept & config.eq(name).to_numpy()].reset_index(drop=True) assert len(verified) == expected, f"{name}: expected {expected} rows, got {len(verified)}" verified.to_parquet(os.path.join(out, f"{name}.parquet"))total = sum(EXPECTED_KEPT.values())assert total == int(kept.sum()) == 10494print(f"Wrote {total} rows in {len(EXPECTED_KEPT)} configs to {out}/")README.mdAdded+104
apply_filter.pyAdded+55
ids.csvAdded