GeoLoom: High-quality Geometric Diagram Generation from Textual Input
Abstract
High-quality geometric diagram generation presents both a challenge and an opportunity: it demands strict spatial accuracy while offering well-defined constraints to guide generation. Inspired by recent advances in geometry problem solving that employ formal languages and symbolic solvers for enhanced correctness and interpretability, we propose GeoLoom, a novel framework for text-to-diagram generation in geometric domains. GeoLoom comprises two core components: an autoformalization module that translates natural language into a specifically designed generation-oriented formal language GeoLingua, and a coordinate solver that maps formal constraints to precise coordinates using the efficient Monte Carlo optimization. To support this framework, we introduce GeoNF, a dataset aligning natural language geometric descriptions with formal GeoLingua descriptions. We further propose a constraint-based evaluation metric that quantifies structural deviation, offering mathematically grounded supervision for iterative refinement. Empirical results demonstrate that GeoLoom significantly outperforms state-of-the-art baselines in structural fidelity, providing a principled foundation for interpretable and scalable diagram generation.
Lay Summary
High-quality geometric diagrams can make geometric problems more intuitive and clear. Although existing models are capable of generating realistic images, due to the high sparsity and strict topological constraints of geometric structures, general-purpose text-to-image models often struggle to produce geometrically correct diagrams. We propose GeoLoom, a novel text-to-diagram generation framework tailored for the geometry domain. GeoLoom consists of two core components: an autoformalization module that converts natural language descriptions into a specially designed generation-oriented formal language, GeoLingua, and a coordinate solver that maps formal constraints to precise geometric coordinates via an efficient Monte Carlo optimization method. To support this framework, we further construct the GeoNF dataset, which aligns natural language geometric descriptions with formal GeoLingua expressions. Additionally, we propose a constraint-based evaluation metric to quantify structural deviations in the generated results and provide mathematically grounded supervision signals for iterative optimization. Extensive experimental results demonstrate that GeoLoom significantly outperforms state-of-the-art methods in structural fidelity, offering a more systematic and reliable solution for interpretable and scalable geometric diagram generation. In educational scenarios, this approach holds promise for enabling AI tutoring systems to more effectively assist teachers and students in geometric teaching and learning tasks.