Skip to main content
QUICK REVIEW

[Paper Review] Evaluating the Effectiveness of Large Language Models in Representing Textual Descriptions of Geometry and Spatial Relations

Yuhan Ji, Song Gao|arXiv (Cornell University)|Jul 5, 2023
Geographic Information Systems StudiesSocial Sciences7 citations
TL;DR

This study evaluates large language models (LLMs) like GPT-2 and BERT in encoding geometric and spatial relations from Well-Known Text (WKT) representations. While LLMs achieve 100% accuracy in classifying geometry types and up to 73% accuracy in predicting spatial predicates when combined with geometry type, they struggle with numeric estimation (e.g., area, centroid, distance) and spatial reasoning, indicating limitations in preserving quantitative spatial information due to tokenization and embedding averaging.

ABSTRACT

This research focuses on assessing the ability of large language models (LLMs) in representing geometries and their spatial relations. We utilize LLMs including GPT-2 and BERT to encode the well-known text (WKT) format of geometries and then feed their embeddings into classifiers and regressors to evaluate the effectiveness of the LLMs-generated embeddings for geometric attributes. The experiments demonstrate that while the LLMs-generated embeddings can preserve geometry types and capture some spatial relations (up to 73% accuracy), challenges remain in estimating numeric values and retrieving spatially related objects. This research highlights the need for improvement in terms of capturing the nuances and complexities of the underlying geospatial data and integrating domain knowledge to support various GeoAI applications using foundation models.

Motivation & Objective

  • To assess the effectiveness of LLMs in representing geometric and spatial relational information from textual WKT descriptions.
  • To investigate whether LLM-generated embeddings can preserve geometric attributes such as type, area, centroid, and spatial predicates.
  • To evaluate the capability of LLMs in capturing numeric spatial values and supporting downstream spatial reasoning tasks.
  • To identify limitations in current LLMs for GeoAI applications, particularly in handling quantitative spatial data and integrating domain-specific geospatial knowledge.

Proposed method

  • Extract geometric and spatial relation attributes (e.g., type, area, centroid, predicates, distance) from WKT-formatted geometries using GIS tools.
  • Use pre-trained LLMs (GPT-2 and BERT) to encode WKT strings into dense vector embeddings via their transformer-based architectures.
  • Feed the LLM-generated embeddings into multi-layer perceptrons (MLPs) with ReLU activation and dropout for regularization to perform downstream tasks.
  • Train classifiers and regressors on the embeddings to evaluate performance on tasks including geometry type classification, area and centroid prediction, spatial predicate recognition, distance estimation, and location retrieval.
  • Apply logarithmic transformation to target values for area and distance tasks and min-max normalization for centroid tasks to stabilize training, reporting results on original scales.
  • Use Mean Squared Error (MSE) loss on both transformed and original scales, with final performance reported on original target values.
Figure 1 : The evaluation workflow of this research
Figure 1 : The evaluation workflow of this research

Experimental results

Research questions

  • RQ1Can LLMs effectively encode geometric types from WKT-formatted textual descriptions?
  • RQ2To what extent can LLM-generated embeddings estimate numeric geometric attributes such as area and centroid?
  • RQ3How well can LLMs capture and predict spatial relations (e.g., disjoint, within, overlaps) between geometries?
  • RQ4Does incorporating geometry type improve the prediction accuracy of spatial predicates?
  • RQ5Can LLM embeddings support spatial reasoning tasks such as location prediction or distance estimation?

Key findings

  • LLMs achieved 100% accuracy in classifying geometry types (Point, LineString, Polygon) on both validation and test sets, indicating strong encoding of categorical geometric information.
  • For area computation, the Mean Absolute Percentage Error (MAPE) was 10,850% on all geometries and 41.9% on polygons alone, showing severe inaccuracy in numeric estimation.
  • Centroid derivation using LLM embeddings yielded a Root Mean Square Error (RMSE) of 0.029, but predicted centroids often fell outside the study area, indicating spatial mislocalization.
  • Spatial predicate prediction reached 72.3% accuracy when geometry type was included as input, compared to 68.7% without, demonstrating improved performance with contextual geometric knowledge.
  • Distance estimation for disjoint geometries had an RMSE of 0.075 with BERT, indicating poor numeric precision despite task restriction.
  • Location prediction achieved only 3% Precision@5, showing that LLM embeddings are insufficient for retrieving spatially related objects using average pooling alone.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.