TL;DR
Standard visual diffusion models can solve complex geometric problems directly in pixel space. By treating geometric reasoning as an image generation task, this approach provides high-quality approximate solutions to notoriously hard problems—such as the Inscribed Square, Steiner Tree, and Maximum Area Polygon problems—without requiring specialized architectures or custom symbolic encodings.
What Problem Does This Paper Address?
Classical geometric and combinatorial problems, like finding the shortest network connecting a set of points (the Steiner Tree Problem) or forming the largest possible non-self-intersecting polygon from a cloud of vertices, are notoriously difficult. Many are NP-hard, meaning exact algorithmic solutions scale exponentially and become intractable as the problem size grows.
When researchers apply deep learning to these challenges, they typically rely on highly specialized architectures (like Graph Neural Networks) and complex parametric representations tailored to each specific problem. This paper tackles a fascinating question: Can we bypass these custom formulations entirely and solve abstract geometric problems using standard, off-the-shelf visual diffusion models operating purely on pixels?
Methods
Instead of feeding coordinates or graph structures into a network, the authors represent each geometric problem instance as a simple $128 \times 128$ image.
The core architecture is a standard U-Net backbone with self-attention layers, identical to those used in popular text-to-image models like Stable Diffusion. The problem image (e.g., a curve or a set of points) serves as a conditioning signal, which is concatenated as an extra channel alongside the noisy input at each step of the diffusion process. The model is trained to progressively denoise random Gaussian noise into a clean image representing the solution.
Because the output is an image, a lightweight post-processing step ("decoding") is used to convert the pixels back into precise geometric objects:
- Inscribed Squares: A coarse grid search optimizes a small rigid transformation (rotation and translation) to "snap" the generated square's corners precisely onto the target curve.
- Steiner Trees & Polygons: Classic computer vision techniques (thresholding and blob detection) identify node locations, and straight-line pixel alignment checks determine where edges exist to reconstruct the final mathematical graph or polygon.
Datasets
Since no standard image-space benchmarks exist for these mathematical puzzles, the authors procedurally generated synthetic datasets for three distinct case studies:
- Inscribed Square Problem: Smooth Jordan curves paired with one to five valid inscribed squares.
- Steiner Tree Problem: Random point sets containing between 10 and 20 terminals, with ground-truth optimal solutions computed using the exact algorithmic solver
GeoSteiner. - Maximum Area Polygon Problem (MAXAP): Point sets containing 7 to 12 vertices, with optimal maximum-area polygons found via an exhaustive depth-first search (DFS).
Key Insights and Ideas
- Recasting Reasoning as Generation: The paper demonstrates a surprising bridge between generative modeling and mathematical problem-solving. The diffusion process naturally handles the multi-modal nature of geometric problems—if a curve contains multiple valid inscribed squares, the model uncovers different solutions simply by changing the initial random noise seed.
- Coarse-to-Fine Progression: Visualizing the intermediate denoising steps reveals that the global, low-frequency structure of the solution emerges very early in the sampling process. The remaining steps are used purely to refine the fine-grained pixel precision. This mirrors how humans intuitively sketch a coarse mental solution before filling in the exact details.
Key Results
- Steiner Tree Problem: For point sets matching the training size (10–20 points), the model achieved a 99.6% valid tree rate and an average total length ratio of 1.0008 relative to the exact optimal solution—meaning it found near-perfect solutions. It also demonstrated strong zero-shot generalization, successfully solving larger sets of 21–30 points with a 98.6% validity rate.
- Maximum Area Polygon (MAXAP): The model achieved a 95.3% validity rate for 7–12 points and recovered 98.8% of the optimal polygon area, significantly outperforming standard regression baselines.
Limitations and Future Work
The most prominent limitation is the reliance on a discrete pixel grid ($128 \times 128$), which inherently introduces quantization errors and limits sub-pixel precision. Furthermore, as the complexity of the problem scales up (e.g., Steiner tree instances with 41–50 points), the rate of valid solutions drops significantly (down to 33.4%), occasionally introducing topological errors like invalid loops.
For future work, the authors suggest exploring whether this visual paradigm can be extended to 3D geometric problems using volumetric or video-based diffusion models.
Summary updated