GeoSDF: Plane Geometry Diagram Synthesis via Signed Distance Field

Chengrui Zhang, Maizhen Ning, Zihao Zhou, Jie Sun, Kaizhu Huang, Qiu-Feng Wang · DOI

TL;DR

This paper introduces GeoSDF, a novel framework for automatically generating accurate and visually plausible plane geometry diagrams using Signed Distance Fields (SDFs). By representing geometric elements and constraints within SDFs and optimizing them, GeoSDF can synthesize complex diagrams, even for challenging International Mathematical Olympiad (IMO) problems, and achieve high accuracy in solving geometry problems.

What Problem Does This Paper Address?

Creating precise geometric diagrams for mathematical problems has traditionally been a manual and labor-intensive process, requiring complex calculations. While recent AI models like Stable Diffusion and GPT can generate diagrams, they often lack the necessary accuracy and mathematical rigor, leading to geometrically inconsistent or incorrect figures. This gap hinders applications in education, AI-driven mathematical reasoning, and problem-solving. The paper aims to bridge this gap by providing a method for generating both accurate and visually appealing geometric diagrams automatically.

Methods

GeoSDF employs a four-step pipeline:

  1. Parsing Natural Language into Symbolic Language: A fine-tuned LLM converts natural language problem descriptions into a structured symbolic representation consisting of geometric "Elements" (points, lines, circles) and "Constraints" (relationships like incidence, metric, spatial, and topological).
  2. Representation by SDF: Each geometric element is represented as a Signed Distance Field (SDF), a continuous and differentiable function encoding its shape and position. Constraints are expressed as differentiable functions over these SDFs.
  3. Optimizing SDF Field: A global loss function is formulated by combining the SDF-based constraint losses and a "crowd regularization" term to prevent element overlap. This differentiable loss is minimized using gradient-based optimization to achieve a configuration that satisfies all constraints.
  4. Boundary Extraction and Visualization: The optimized SDFs are rendered to produce the final geometric diagrams.

A key innovation is the use of SDFs, which allows for a differentiable representation of geometric elements and constraints, enabling optimization via standard gradient descent. The "crowd regularization" term is also crucial for preventing degenerate configurations.

Datasets

  • FormalGeo7k: Used as the primary source dataset for training and evaluating GeoSDF. This dataset consists of 6,981 Plane Geometry Problems (PGPs) that were collected and re-annotated from existing benchmarks like GeoQA and Geometry3K. The authors augmented this dataset by synthesizing 32 diverse diagrams per problem, resulting in a total of 224k samples.
  • IMO Problems: A selection of problems from the International Mathematical Olympiad (IMO) (1959-2022) were used for evaluating GeoSDF's ability to handle complex and challenging diagrams. These problems were manually annotated with constraints.
  • GeoQA: Used for evaluating the performance of GeoSDF in solving geometry problems.

Key Insights and Ideas

  • SDFs as a Unified Representation: Representing geometric elements and their relationships as SDFs provides a continuous, differentiable, and unified framework for optimization, which is more robust than traditional rule-based or purely model-based approaches.
  • Self-Verification in SDF: The SDF representation allows for "self-verification" of the synthesized diagrams, ensuring mathematical accuracy and visual plausibility directly within the optimized field.
  • Bridging Text and Geometry: The pipeline effectively translates natural language descriptions into precise geometric constructions, a critical step for AI systems that need to understand and generate visual representations of mathematical concepts.
  • Quantifiability for Problem Solving: The ability to extract precise measurements (angles, lengths) from the synthesized SDFs opens up a novel "solve-by-construction" paradigm for solving geometry problems, achieving state-of-the-art accuracy.

Key Results

  • Diagram Synthesis Accuracy: GeoSDF achieved 88.67% accuracy in human evaluation for synthesizing IMO-level geometry diagrams, indicating they are geometrically equivalent to the ground truth.
  • Geometry Problem Solving Accuracy: GeoSDF achieved a remarkable 95.9% accuracy on the GeoQA dataset in the "choice" setting (selecting the correct answer from options) and 78.5% in the end-to-end setting (including LLM parsing), significantly surpassing existing SOTA solvers.
  • Efficiency: The optimization process is efficient, converging in about 20 seconds for complex IMO problems, and can be performed in batches.
  • Robustness: The crowd regularization term improved diagram synthesis success rate by 3.7% on the FormalGeo7k dataset.

Limitations and Future Work

  • Limitations:
    • Implicit Information: The LLM parser struggles with inferring implicit geometric information not explicitly stated in the problem description.
  • Ambiguity and Errors: Ambiguous phrasing in natural language can lead to incorrect symbolic translations, and the system cannot correct semantic mistakes made by the user.
  • Non-Value-Based Problems: The synthesis process can fail for problems that are not strictly value-based, such as those with undefined variables.
  • Optimization Failures: The optimizer can sometimes converge to local minima or saddle points, leading to high final loss or geometric degeneracies.
  • Future Work:
    • Extend GeoSDF to handle more types of geometry diagrams, including solid geometry and analytic geometry.
  • Further improve the natural language parsing to better handle implicit information and ambiguity.
  • Explore more advanced optimization techniques to mitigate failure modes.

Summary updated

BibTeX
@misc{zhang2025geosdf,
  author = {Chengrui Zhang and Maizhen Ning and Zihao Zhou and Jie Sun and Kaizhu Huang and Qiu-Feng Wang},
  title = {{GeoSDF: Plane Geometry Diagram Synthesis via Signed Distance Field}},
  year = {2025},
  eprint = {2506.13492},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.13492},
}
Figure