SEQ-GPT: LLM-assisted Spatial Query via Example

Ivan Khai Ze Lim, Ningyi Liao, Yiming Yang, Gerald Wei Yong Yip, Siqiang LuoarXiv 2025 · OpenReview

Abstract

Contemporary spatial services such as online maps predominantly rely on user queries for location searches. However, the user experience is limited when performing complex tasks, such as searching for a group of locations simultaneously. In this study, we examine the extended scenario known as Spatial Exemplar Query (SEQ), where multiple relevant locations are jointly searched based on user-specified examples. We introduce SEQ-GPT, a spatial query system powered by Large Language Models (LLMs) towards more versatile SEQ search using natural language. The language capabilities of LLMs enable unique interactive operations in the SEQ process, including asking users to clarify query details and dynamically adjusting the search based on user feedback. We also propose a tailored LLM adaptation pipeline that aligns natural language with structured spatial data and queries through dialogue synthesis and multi-model cooperation. SEQ-GPT offers an end-to-end demonstration for broadening spatial search with realistic data and application scenarios.

Traditional map services excel at finding single points of interest (POIs). However, they struggle with multi-location tasks. For instance, a user looking for a hotel specifically located near both a gym and a pharmacy must typically perform three separate searches and manually cross-reference the results.

Comparison between conventional individual search queries and the natural language chat approach of SEQ-GPT.

This is the domain of Spatial Exemplar Query (SEQ). While SEQ algorithms exist, they often require rigid, structured inputs that are difficult for average users to provide. Furthermore, spatial language is frequently ambiguous or region-specific (e.g., a "subway" in New York vs. an "MRT" in Singapore). Conventional systems lack the "common sense" to resolve these ambiguities or the flexibility to let users refine their search through natural feedback.

Methodology: The SEQ-GPT System

SEQ-GPT bridges the gap between natural language and structured spatial databases through a specialized client-server architecture.

The SEQ-GPT system architecture, highlighting the interaction between Client, Server, and the Data Generation pipeline.

LLM Adaptation Pipeline

Rather than relying on a single massive model, the system utilizes a pair of specialized LLMs. A "Generator LLM" (GPT-4o) synthesizes training data, while smaller "Chat LLMs" (such as LLaMA-3-8B) are fine-tuned for specific subtasks like parsing locations or defining search areas.

Synthetic Data Generation (SynTOD)

To overcome the lack of large-scale "spatial chat" datasets, the researchers developed a state transition model. This model performs "constrained random walks" through 31 different conversational states—ranging from introducing the search to handling errors and clarifying distances—to generate 2,000 high-quality synthetic dialogue samples for fine-tuning.

The system uses a signal-based protocol where models output special tokens to indicate their current state. This allows the system to determine when to ask for clarification versus when to trigger the backend SEQ algorithm. Once extracted, the algorithm identifies candidate combinations of locations based on attribute similarity and relative spatial distances.

Key Insights and Results

  • State Machine Grounding: By framing conversations as traversals through a state transition graph, the authors ensure the LLM remains grounded, preventing the "hallucination" common in generic chatbots.
  • Contextual Flexibility: The LLM acts as a semantic translator, understanding that "a place to get coffee" and "Starbucks" satisfy the same requirement, and converting relative constraints like "within a 10-minute walk" into precise metric distances.
  • Hybrid Interaction: Users can switch seamlessly between "Map Mode" (traditional clicking) and "Chat Mode" (natural language).
  • Effective Fine-tuning: Fine-tuning smaller models like LLaMA-3-8B for just 3 epochs on synthetic data achieved high intent prediction accuracy and diverse conversational responses.

Limitations and Future Work

While synthetic data is diverse, real-world user behavior can be more unpredictable, suggesting a need for future human-in-the-loop testing. Additionally, using LLMs for every turn adds latency; optimizing these models for edge deployment or lower-cost inference is a priority. Finally, while proximity search works well locally, performing complex SEQ searches across continent-scale datasets remains a significant algorithmic challenge.

Summary updated

BibTeX
@misc{lim2025seq,
  author = {Ivan Khai Ze Lim and Ningyi Liao and Yiming Yang and Gerald Wei Yong Yip and Siqiang Luo},
  title = {{SEQ-GPT: LLM-assisted Spatial Query via Example}},
  year = {2025},
  eprint = {2508.10486},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2508.10486},
}
Figure