DistRAG: Towards Distance-Based Spatial Reasoning in LLMs

Nicole R Schneider, Nandini Ramachandran, Kent O'Sullivan, Hanan Samet
6/3/2025
cs.CLcs.IR

No confident code implementation found for this paper.

Abstract

Many real world tasks where Large Language Models (LLMs) can be used require spatial reasoning, like Point of Interest (POI) recommendation and itinerary planning. However, on their own LLMs lack reliable spatial reasoning capabilities, especially about distances.

Show full abstract

To address this problem, we develop a novel approach, DistRAG, that enables an LLM to retrieve relevant spatial information not explicitly learned during training. Our method encodes the geodesic distances between cities and towns in a graph and retrieves a context subgraph relevant to the question. Using this technique, our method enables an LLM to answer distance-based reasoning questions that it otherwise cannot answer. Given the vast array of possible places an LLM could be asked about, DistRAG offers a flexible first step towards providing a rudimentary `world model' to complement the linguistic knowledge held in LLMs.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{schneider2025distrag,
  title  = {DistRAG: Towards Distance-Based Spatial Reasoning in LLMs},
  author = {Nicole R Schneider and Nandini Ramachandran and Kent O'Sullivan and Hanan Samet},
  year   = {2025},
  eprint = {2506.03424},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2506.03424v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2506.03424.svg)](https://codeofpaper.com/paper/2506.03424)

Discussion