Geo-LLaVA: A Large Multi-Modal Model for Solving Geometry Math Problems with Meta In-Context Learning

Shihao Xu, Yiyang Luo, Wei ShiarXiv 2024 · DOI

Abstract

Geometry problem-solving represents a significant challenge for Large Multi-Modal Models (LMMs), requiring both precise visual perception and rigorous logical deduction. While general-purpose models like GPT-4V excel in many domains, they often struggle with the spatial reasoning required for geometry, particularly in 3D (solid) geometry. This paper introduces Geo-LLaVA, a 13-billion parameter model specifically optimized for geometric reasoning. By implementing a novel "meta-training" approach combined with a retrieval-augmented in-context learning pipeline, Geo-LLaVA achieves state-of-the-art performance on both plane and solid geometry benchmarks, significantly outperforming general-purpose LMMs.

Introduction: The Challenge of Geometric Reasoning

Solving geometry problems is a "grand challenge" for AI because it requires a perfect marriage of visual perception—understanding complex diagrams—and logical deduction—applying mathematical theorems. While Large Multi-Modal Models (LMMs) have excelled at general image captioning, they often stumble on geometry. They tend to provide vague descriptions of diagrams or fail to maintain the spatial logic required for multi-step proofs.

Furthermore, most existing research and datasets focus almost exclusively on plane geometry (2D). Solid geometry (3D), which involves reasoning about volumes, spatial relationships, and hidden lines in 3D shapes, has been largely neglected. This gap in 3D reasoning is a primary focus of the Geo-LLaVA project.

Comparison of Geo-LLaVA, LLaVA-1.5, and GPT-4V on a geometry problem, demonstrating Geo-LLaVA's superior reasoning.

Methodology: Meta-Training and In-Context Learning

Geo-LLaVA is built on the LLaVA-1.5-13B architecture. Its core innovation lies in a three-step pipeline designed to mimic how humans solve math problems—by referencing similar "worked examples."

  1. Retrieval Network: A dual-tower network (using BERT for text and ViT-L-14 for images) is trained with a contrastive loss (InfoNCE). This network identifies the most mathematically and visually similar problems from a database to serve as context.
  2. Meta-Training: Unlike standard fine-tuning, Geo-LLaVA undergoes "meta-training." During the Supervised Fine-Tuning (SFT) phase, the model is fed a prompt that includes a retrieved similar problem and its solution, followed by the target problem. This teaches the model how to learn from examples on the fly.
  3. In-Context Learning (ICL) at Inference: When solving a new problem, the model retrieves a similar case from the training set and uses it as a reference. To bypass the single-image input constraint of the base LLaVA model, the researchers vertically merge the retrieved image and the query image into a single file.
The three-step pipeline of Geo-LLaVA: Retrieval Model Training, Data Augmentation/Fine-tuning, and Inference Stage.

Datasets and Experimental Setup

The researchers curated several key datasets to train and evaluate the model:

  • GeoMath (New): A collection of ~10,000 solid geometry problems sourced from Chinese high school education websites and translated into English. It includes detailed reasoning steps and covers selection, cloze, and proving questions.
  • GeoQA+ & PSDK9K: Established benchmarks for plane geometry used to ensure broad competence.
  • UniGeo: Utilized specifically for geometry proving tasks.
  • Data Augmentation: GPT-3.5 was used to paraphrase questions and generate diverse image captions, expanding the training variety six-fold.

Key Results and Insights

Geo-LLaVA achieved State-of-the-Art (SOTA) results on the targeted benchmarks:

  • Plane Geometry (GeoQA+): Achieved 65.25% accuracy, outperforming GPT-4V (50.50%).
  • Solid Geometry (GeoMath): Achieved 42.36% accuracy. While lower than the plane geometry score, it represents a massive leap over baseline LLaVA (22.28%) and GPT-4V (20.00%).

The "Meta-ICL" approach proved highly effective. Ablation studies showed that the meta-training step provided a ~2% boost, and using In-Context Learning during inference added another ~1% improvement. The paper highlights that 3D reasoning remains significantly harder for current models than 2D, but specialized training helps models "see" mathematical primitives—like tangent lines or right angles—more accurately than general-purpose models.

Limitations and Future Directions

Despite its success, Geo-LLaVA has limitations. The vertical stacking of images is a workaround for single-image architectures that may limit resolution. Additionally, while 10,000 samples is a significant step for solid geometry, it remains small compared to general-purpose datasets. Future work will focus on improving the formal mathematical rigor of proofs and exploring more sophisticated multi-image architectures to handle complex visual contexts more naturally.

Summary updated

BibTeX
@misc{xu2024geo,
  author = {Shihao Xu and Yiyang Luo and Wei Shi},
  title = {{Geo-LLaVA: A Large Multi-Modal Model for Solving Geometry Math Problems with Meta In-Context Learning}},
  year = {2024},
  eprint = {2412.10455},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.10455},
}
Figure