---
license: mit
language:
- en
- zh
task_categories:
- text-generation
tags:
- geometry
- geometric-constraint-solving
- reasoning
- synthetic-data
- math
pretty_name: PyGeoX
size_categories:
- 10K
Internalizing Geometric Law: a programmable geometry language for precision-critical LLM generation
--- Datasets for training and evaluating language models on **geometric constraint solving (GCS)** — reading a natural-language description of a diagram and producing the point coordinates / circle radii that satisfy all stated constraints — plus a supervised set for generating PyGeoX scene code.
The agent reasons in code and outputs exact coordinates and radii; PyGeoX verifies each constraint independently via per-constraint residuals.
--- ## Subsets | Config | Rows | Task | |--------|------|------| | `gcs-sft` | 15,738 | SFT — solve geometry (NL → coordinates), merged master with per-variant reward labels | | `codegen-sft` | 46,977 | SFT — NL diagram description → PyGeoX code | | `gcs-rl` | 46,977 | RL — prompts for geometry constraint solving | | `bench` | 300 | Evaluation benchmark (self-contained) | | `wild` | 200 | Evaluation — real-world school-geometry questions | ```python from datasets import load_dataset ds = load_dataset("rafaelcabral96/PyGeoX", "gcs-rl") ``` ## Subset details ### `gcs-sft` — geometry-solving SFT (merged master) One deduplicated file keyed by (problem, completion). Each row's `splits` map records, per training variant (`sar`, `sar_sd`, `mse`, `mse_sd`, `sparse`, plus the `full` base), whether that variant includes it and with what reward/weight. Reconstruct any variant: ```python rows = [r for r in ds if r["splits"]["mse_sd"]["in"]] weights = [r["splits"]["mse_sd"].get("weight", 1.0) for r in rows] ``` ### `codegen-sft` — NL → PyGeoX code `messages` = (user: diagram description + "Please generate PyGeoX code…", assistant: ```python … ``` block), plus `problem_id`, `source_file`, `difficulty`. ### `gcs-rl` — RL prompts `messages` (system + user), `source_file` (→ reward ground truth), `difficulty` (`easy`/`medium`/`hard` for 1/2/3 primary objects). ### `bench` — evaluation benchmark (self-contained) Each record carries everything needed to score a model inline: `unique_id, nl_description, pygeox_code, Objs, Rels, Points, extra_rel, possible_solution`. Rebuild the scene directly from a record (no file needed) and score predicted coordinates: ```python from pygeox.synthetic.llm_client import create_scene_from_json scene = create_scene_from_json(domain=10, json_data=record, generate_objective_function=True) reward, details = scene.reward.reward_function(pred_points, pred_circles) ``` ### `wild` — real-world school geometry 200 questions from MathVerse, ZhongKaoGeo, and MathVista (`id, question, source, source_id`). Ground truth is executable PyGeoX `full_code`, shipped in `data/PyGeoX-Wild-Code.zip` (one `problem_