GeoGramBench: Benchmarking the Geometric Program Reasoning in Modern LLMs

Shixian Luo, Zhu zezhou, Yu Yuan, Yuncheng Yang, Lianlei Shan, Yong Wu

Geometric spatial reasoning forms the foundation of many applications in artificial intelligence. Yet, the ability of Large Language Models (LLMs) to operate over geometric spatial information expressed in procedural code remains underexplored. GeoGramBench is a new benchmark designed to evaluate how well LLMs perform Program-to-Geometry reasoning—the ability to translate procedural drawing code (like Asymptote) into internal spatial representations to solve math problems.

The study reveals a significant "spatial gap": while top models excel at basic geometric recognition, they consistently fail when required to integrate complex, global spatial relationships.

The "Program-to-Geometry" Gap

While LLMs have made massive strides in mathematical word problems, their ability to reason about geometry through the lens of procedural code remains a frontier. Most existing geometry benchmarks focus on visual perception (looking at an image) or pure text. However, in fields like engineering, CAD, and robotics, geometry is often expressed symbolically through code.

Example of a Program-to-Geometry task

The authors identify a critical gap in current evaluations and point out a major flaw in existing datasets: answer leakage. In many current math benchmarks, the procedural code used to generate a diagram often contains the answer explicitly (e.g., a coordinate that is exactly the length the question asks for). This allows models to "cheat" by simply parsing the code rather than actually reasoning about the geometry.

Formalizing the Task with GeoGramBench

To address these issues, the researchers formalized the Program-to-Geometry task and developed GeoGramBench, a dataset of 500 curated, high-quality problems filtered from over 905,000 candidates. Their approach stands out through three key innovations:

  1. Geometric Taxonomy: Instead of categorizing problems by traditional mathematical difficulty (e.g., "high school" vs. "olympiad"), they organized them by geometric complexity:
  2. Primitive Recognition: Identifying basic shapes (points, lines).
  3. Local Relation Composition: Integrating relationships between a few elements.
  4. Global Abstract Integration: Reasoning about 3D objects, recursion, or complex transformations like folding and rotation.
  5. Rigorous Decontamination: To prevent cheating, the team manually rescaled coordinates and masked parameters in the code so that the answer could not be extracted via simple inspection.
  6. Multi-Model Evaluation: They benchmarked 19 frontier models, including proprietary giants and leading open-source models.

Key Insights: Where Models Stumble

Evaluating these models revealed several fascinating behavioral quirks and limitations:

  • The "Algebraic Bias": Models have a pronounced preference for algebraic methods. They often try to brute-force coordinate calculations rather than using geometric heuristics (like adding an auxiliary line), even when the geometric approach is much simpler.
  • Spatial Disorientation: Models struggle immensely with spatial orientation instructions, such as distinguishing between clockwise (CW) and counter-clockwise (CCW) directions in code.
  • CoT has a Ceiling: While Chain-of-Thought (CoT) reasoning helps with logic, it doesn't fix a "broken map." If the model's internal spatial representation of the code is wrong, "thinking longer" just leads to more elaborate but incorrect symbolic reasoning.
  • Independence of Syntax: Interestingly, the choice of programming language (Asymptote vs. Matplotlib) had almost no impact on performance. The bottleneck is the spatial logic, not the code syntax.

Performance Results and the "Abstract Wall"

The evaluation highlighted both the progress and the severe limitations of current frontier models. GPT-5 emerged as the current leader with an overall accuracy of 75.01%, while open-source models like Qwen3-235B-Thinking performed remarkably well at 74.00%.

Performance drops across frontier models

However, two major negative trends defined the results:

  1. The "Abstract" Wall: Every single model tested performed below 50% on the "Global Abstract Integration" level. This confirms that complex spatial synthesis is a major unresolved challenge for LLMs.
  2. Significant Performance Drops: Models showed a severe drop in accuracy (up to 23.5% or more in some cases) when moving from standard text-only problems to those requiring code-to-geometry translation, highlighting the difficulty of grounding procedural code into spatial reality.

Future Directions

GeoGramBench successfully exposes key limitations in program-driven spatial reasoning. While the current benchmark focuses primarily on 2D and "synthetic" 3D (2D projections of 3D objects), the authors plan to extend this work to real-world, continuous 3D environments relevant to robotics. Future work will also focus on developing automated diagnostic tools to better understand why a model's internal spatial map fails, paving the way for new architectural designs that can robustly ground symbolic code into spatial representations.

Summary updated

BibTeX
@inproceedings{luo2026geogrambench,
  author = {Shixian Luo and Zhu zezhou and Yu Yuan and Yuncheng Yang and Lianlei Shan and Yong Wu},
  title = {{GeoGramBench: Benchmarking the Geometric Program Reasoning in Modern LLMs}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=MrJoBgN1VO},
}
Figure