From the course: Using Spatial Data in AI Workflows

How language models work with spatial data and real-world application

From the course: Using Spatial Data in AI Workflows

How language models work with spatial data and real-world application

If you ask a large language model what is the capital of France, it will confidently say Paris. But if you ask what is five kilometers due north of Notre Dame Cathedral, the LLM will likely struggle, either giving you a generic answer, or worse, hallucinating something that doesn't exist. Why? Because large language models are language models. they do not have a map or a spatial engine built in. To an LLM, Notre-Dame Cathedral isn't a specific coordinate at a specific latitude and longitude. It's a cluster of tokens or words frequently associated with Paris, France, or landmarks. In short, it understands semantic proximity, not geographic proximity. This is a critical distinction. It means LLMs excel at explanation and context, but can be extremely misleading when it comes to spatial tasks like measurement, summarization, and analysis. First, let's take a look at where they excel, extraction and formatting. If you provide an LLM several different messy emails from customers, it can extract and standardize the address, zip codes, and city names from those emails. First, let's take a look at where they excel, extraction and formatting. Here, I will create some fake customer emails in Gemini. Let's copy and paste this data back to Claude to extract the addresses. Now, let's ask Claude to find the nearest warehouse location to each address. LLMs cannot reliably calculate a distance, area, or statistical analysis. analysis. If you were to ask a model to take that customer data and find the nearest service center to each customer, it would struggle to perform that analysis. This brings us to the core philosophy of this course. We do not use LLMs alone to ask questions about the physical world. We use them to access the tools that can answer those questions. In simpler terms, the LLM interprets the question and asks it to a spatial engine to read the mapped data. Understanding this limitation is the first step to building robust agents. Don't trust the model to do the analysis, trust it to drive the tools that can. In the next video, you will see text explaining strategies for doing this and how to do so with ethical and responsible LLM use in mind.

Contents