A pipeline for the automatic construction of geometry problems along with step-by-step solutions.
Python
18
81 commits
updated Aug 27, 2025
A pipeline for the automatic construction of geometry problems along with step-by-step solutions.
Paper: Enhancing the Geometric Problem-Solving Ability of Multimodal LLMs via Symbolic-Neural Integration
Dataset: GeoExpand & GeoSynth

As the symbolic system relies on manually defined theorem rules, and symbolic annotations may be missing in the dataset, some types of geometry problems may remain unsolvable. We welcome issues and feedback to help us identify and address such limitations.
conda create -n geogen python=3.9
conda activate geogen
git clone https://github.com/ycpNotFound/GeoGen.git
cd GeoGen
pip install -r requirements.txt
GeoGen/
│
├── generator.py # Randomly sample premise and generate literals
├── allocator.py # Assign coordinates for literals
├── plotter.py # Draw with geometry diagram
├── solver.py # symbolic solver with our improved forward-search
├── target_finder.py # Conduct reasoning, find target and create question & answer
└── ...
We collect symbolic annotations for most of the diagrams from Geometry3K and PGPS9K, as listed in datasets_info. Note that symbolic reasoning can be conducted without relying on images. For Geometry3K, we utilize annotations from formalgeo7k, which provides detailed symbolic annotations for public datasets from FormalGeo. For PGPS9K, we use regularization tools and prompt LLMs to convert the source annotations into the required symbolic format. Since the annotations are constructed automatically, some omissions may occur. However, these do not affect the overall workflow.
You can download images and original annotations for Geometry3K from Inter-GPS.
You can download images and original annotations for PGPS9K from PGPS.
Run main_search_public.py with multiprocessing to expand more target and create question & answer from public dataset (geometry3K and PGPS9K).
python main_search_public.py \
--dataset_name geo3k \ # or pgps9k
--save_dir /path/to/your/dir \
--num_process 12 \
--seed 1234
Run main_search_synth.py with multiprocessing to synthesize geometry diagram and create question & answer for it, with one Q&A pair for each diagram.
python main_search_synth.py \
--save_dir /path/to/your/dir \
--num_process 12 \
--seed 1234 \
--use_default_sampling_num
# you can disable this param and modify the sampling num in python sript.
GeoGen is based on FormalGeo, released under the MIT License. We extend its symbolic reasoning engine to support automatic diagram generation and reasoning path synthesis.
We also draw inspiration from AlphaGeometry in designing our pipeline.
We gratefully acknowledge the use of ms-swift for model training.
81 commits
Python
100.0%
A pipeline for the automatic construction of geometry problems along with step-by-step solutions.
Python
18
81 commits
updated Aug 27, 2025
A pipeline for the automatic construction of geometry problems along with step-by-step solutions.
Paper: Enhancing the Geometric Problem-Solving Ability of Multimodal LLMs via Symbolic-Neural Integration
Dataset: GeoExpand & GeoSynth

As the symbolic system relies on manually defined theorem rules, and symbolic annotations may be missing in the dataset, some types of geometry problems may remain unsolvable. We welcome issues and feedback to help us identify and address such limitations.
conda create -n geogen python=3.9
conda activate geogen
git clone https://github.com/ycpNotFound/GeoGen.git
cd GeoGen
pip install -r requirements.txt
GeoGen/
│
├── generator.py # Randomly sample premise and generate literals
├── allocator.py # Assign coordinates for literals
├── plotter.py # Draw with geometry diagram
├── solver.py # symbolic solver with our improved forward-search
├── target_finder.py # Conduct reasoning, find target and create question & answer
└── ...
We collect symbolic annotations for most of the diagrams from Geometry3K and PGPS9K, as listed in datasets_info. Note that symbolic reasoning can be conducted without relying on images. For Geometry3K, we utilize annotations from formalgeo7k, which provides detailed symbolic annotations for public datasets from FormalGeo. For PGPS9K, we use regularization tools and prompt LLMs to convert the source annotations into the required symbolic format. Since the annotations are constructed automatically, some omissions may occur. However, these do not affect the overall workflow.
You can download images and original annotations for Geometry3K from Inter-GPS.
You can download images and original annotations for PGPS9K from PGPS.
Run main_search_public.py with multiprocessing to expand more target and create question & answer from public dataset (geometry3K and PGPS9K).
python main_search_public.py \
--dataset_name geo3k \ # or pgps9k
--save_dir /path/to/your/dir \
--num_process 12 \
--seed 1234
Run main_search_synth.py with multiprocessing to synthesize geometry diagram and create question & answer for it, with one Q&A pair for each diagram.
python main_search_synth.py \
--save_dir /path/to/your/dir \
--num_process 12 \
--seed 1234 \
--use_default_sampling_num
# you can disable this param and modify the sampling num in python sript.
GeoGen is based on FormalGeo, released under the MIT License. We extend its symbolic reasoning engine to support automatic diagram generation and reasoning path synthesis.
We also draw inspiration from AlphaGeometry in designing our pipeline.
We gratefully acknowledge the use of ms-swift for model training.
81 commits
Python
100.0%