Elamur Research

Are Large Language Models Geospatially Knowledgeable?

Paper · 2023 · Prabin Bhandari, Antonios Anastasopoulos and Dieter Pfoser

Summary

A system that writes fluently about a city may still put it in the wrong place. The authors ask how much geographic information survives training on text and how readily it can be recovered. They study large language models through separate tests of factual recall, sensitivity to spatial language, and usefulness in a geographic inference task. Each test asks for something different. The first requests coordinates, the second elicits place names, and the third uses answers about distances to locate a city on a map.

For the coordinate test, the authors use a worldwide list of 3,527 cities and compare OPT, LLaMA, and the instruction-tuned Alpaca. The strongest comparison reported for LLaMA-13B is an 85% reduction in coordinate prediction error relative to Word2Vec, the best earlier baseline, when the prompt contains no worked examples. OPT and LLaMA perform quite differently at the same parameter count. Wording also matters. Showing three examples makes coordinate answers more frequent, while prompts without examples yield smaller errors on the coordinates returned. A system can therefore answer more often while becoming less dependable when it does answer.

The spatial language experiment uses 93 cities in the contiguous United States. Given a prompt ending in near or close to, LLaMA-13B tends to name cities physically closer to the starting point than it does after the control conjunction and. Prompts ending in far from tend to produce more distant places. Adding a state name can change which city the system takes as its starting point, as the authors show with Albany. In a comparison with word frequencies from a web corpus, ordinary city popularity and city-pair co-occurrence are more strongly associated with generation under and than under the proximity expressions. The authors interpret this as evidence that the wording draws on spatial information.

For the last test, the authors ask for distances in kilometers and supply those estimates to multidimensional scaling, a procedure that arranges points so their separations reflect the input distances. They align the resulting layout using cities with known coordinates and estimate the position of a city whose coordinates are withheld. Estimated and actual distances have a Pearson correlation of 0.92, and the estimates support better placement than random inputs or the frequency with which nearby cities are named. Actual distances still give the smallest mean placement error. The experiment shows that answers about distances carry enough geographic structure to help construct a map when combined with known locations and a geometric procedure. It leaves open how far that performance extends beyond the cities, prompts, and English-language settings tested.

Deep dive: Are Large Language Models Geospatially Knowledgeable?

City coordinates, nearby place names and estimated distances reveal how much geographic information language models can supply. · about 32 minutes to read

The problem and its context

What can be recovered from text?

A place name can carry several kinds of information. A reader might recognize the name, know where the city is, and have a rough sense of how far it lies from another city. These abilities can come apart. Naming the country that contains a city requires less numerical detail than giving its latitude and longitude. Knowing that nearby cities are frequently discussed together is also a different kind of evidence from knowing which cities are close enough to fill a sentence about proximity. The paper turns those differences into tests that can be checked against geography.

The question arises from earlier studies of language systems as stores of factual information. The paper places its investigation alongside work on commonsense, relational, and linguistic knowledge. The shared idea is that training changes the parameters in ways that can preserve associations a researcher later recovers with a suitable query. This is the sense in which a pretrained system might function as a limited knowledge base.

Geography offers several ways to check such an association. A numeric answer can be compared with a reference point. A generated city name can be resolved to a place and its distance from another city measured. A collection of approximate separations can be examined for whether it supports a coherent arrangement. In each case, the raw response is text, while the evidence sought concerns locations or relationships in physical space. A response that fits the grammar of the prompt has only cleared the first part of the task.

The authors describe their targets as knowledge, awareness, and reasoning. Knowledge covers facts such as where a city is and how far apart places are. Awareness concerns whether the language produced under a spatial description behaves in a way that reflects geography. Reasoning concerns the use of spatial information to reach a further conclusion. In this paper, that further conclusion is an estimated location from information about other cities. This is a concrete instance of knowledge representation and reasoning.

These distinctions matter because a coordinate pair and a description of proximity impose different demands. There is a reference location against which to score a coordinate estimate. An expression such as near has no single distance that applies in every context. Its effect can instead be examined over many completions by asking whether the associated places tend to be closer under that wording. For a layout, the question changes again. A group of answers can each sound individually plausible while failing to fit together well enough to place a city. The last experiment tests their collective value.

How earlier studies approached geography

Some of the work reviewed by the authors examined whether geographic structure could be recovered from word embeddings. An embedding represents a word as a vector, an ordered collection of numerical values. A study can compare relationships among vectors with relationships among the geographic concepts their words denote. In this tradition, the question is whether there is a structural correspondence between the representation and the world. A vector arrangement provides evidence about associations in the representation even when the system has never been asked to produce a geographic answer as text.

The authors focus on the behavior of a complete generative system. Its continuation depends on the surrounding words, so the same starting city can be put into different linguistic settings. An unfinished statement about coordinates, an unfinished phrase about nearby places, and a request for a distance each turn the city name into a different query. Researchers can then assess whether a change in wording changes the kind of evidence the system supplies. This approach belongs to the study of language models and pretraining.

An earlier study by Derungs and Purves had already used autocomplete to investigate nearness. They supplied a starting location followed by near and studied the places suggested by a system built from Microsoft’s counts of word sequences. Those suggestions supported maps of nearness at different geographic scales. Bhandari and colleagues carry forward the idea of using an unfinished expression to probe spatial expectations. The earlier setup relied on a language model built around the frequencies of short word sequences, or n-grams.

The paper also discusses work by Liétard and colleagues on geographic coordinates and neighboring countries. Those tasks had already made geographic knowledge a subject of direct evaluation. The authors describe the prior setup as involving smaller systems and some training. Their own study broadens the questions to include what spatial expressions do to generated place names and how generated information fares as input to a location estimate. The coordinate task also provides a point of comparison with the earlier work.

A methodological question runs through this history. A system might name two nearby cities together because that pairing was common in training text. Maps of language use can reveal a geographic pattern even when the mechanism behind it is textual association. To examine that explanation, the authors need more than a collection of appealing examples. They need a control that invites a place name without requesting proximity, as well as a way to compare generation with the prominence of individual cities and city pairs in a corpus. These choices make the awareness test a study of what changes with the wording as well as a study of which places appear.

Why use a continuation?

The systems in the study generate text autoregressively. Given the text so far, they assign probabilities to possible next tokens, the units into which text is divided. Once a continuation token is selected, it becomes part of the context for the following selection. This process allows the researchers to put a geographic question into the form of an unfinished sentence. They can then inspect whether the completed text supplies a number or a place name. The architecture behind the tested systems belongs to the Transformer and attention family.

A continuation format also allows the requested behavior to be demonstrated in the input. If an unfinished statement follows several completed ones, the earlier sentences can establish a pattern of answers. The paper traces this use of examples to Language Models are Few-Shot Learners. The experimenter can change which examples are present or leave them out and use the same pretrained parameters. That gives the authors a way to study access to geographic information without fitting a new geographic predictor for each task.

The practical motivation is to understand what kinds of geographic help can be expected from ordinary text generation. A rough relationship between two places might be enough for a broad description of their relative location. An application that needs coordinates at city scale demands a stricter test. The paper accordingly evaluates open-ended answers against geographic references and explores what happens when a separate calculation uses those answers. It frames decision support as a possible use of the information, with the experiments establishing how far the specific outputs go.

The method, step by step

The three paths from a prompt to a measurement

The study starts with the kind of information a prompt is intended to elicit and chooses an evaluation that fits it. For a coordinate answer, the researchers read a latitude and a longitude out of the continuation and compare the point with a known location. For a spatial expression, they identify the place named in the continuation and measure how far it is from the city in the prompt. For the layout task, they accumulate information about city pairs and use it to establish where a target city falls relative to others. The first two paths evaluate individual answers or groups of answers directly. The last requires another computational stage.

From city prompts to geographic evaluation

The steps in order.

From city prompts to geographic evaluationStep 1: Select cities with known locations1. Select cities with known locationsStep 2: Prompt for coordinates, places, or distances2. Prompt for coordinates, places, or distancesStep 3: Extract city names and numeric answers3. Extract city names and numeric answersStep 4: Score coordinates and measure generated places’ distances4. Score coordinates and measure generated places’ distancesStep 5: Arrange cities using pairwise dissimilarities5. Arrange cities using pairwise dissimilaritiesStep 6: Align the layout using cities with known coordinates6. Align the layout using cities with known coordinatesStep 7: Compare inferred city positions with their reference locations7. Compare inferred city positions with their reference locations

The coordinate experiment uses the 6.7B and 13B variants of OPT, the 7B and 13B variants of LLaMA, and Alpaca based on LLaMA 7B. Alpaca has undergone instruction fine-tuning using Self-Instruct, so its input is framed as a request to fulfill. The prompting experiments themselves use already trained parameters. The geographic examples placed in a prompt guide the current response and leave those parameters fixed.

The authors choose open systems so their behavior and training background can be examined more readily. They run generation using Hugging Face Transformers on an NVIDIA A100 with 80GB of memory, and estimate that the experiments took around 200 hours of GPU time. Stanza handles post-processing of the text in the spatial expression experiment, and the geometric procedure uses Scikit-learn. The authors release the experiment code as spatial-llm.

Eliciting latitude and longitude

The coordinate task begins with the MaxMind world cities database. The authors select cities with populations greater than 100k, giving them 3,527 places with reference coordinates. Latitude and longitude specify a place through its north–south and east–west positions. In this task they are the answer the system has to produce. The researchers can turn a usable answer into a point and measure the distance between it and the reference point for that particular city.

For the basic continuation, the researchers insert the name of the target city in an unfinished declarative sentence. One form refers to its geo-coordinates. Another explicitly names latitude and longitude. Both ask for the same information. The use of the two forms lets the authors compare access through a compact geographic label and through the names of the requested values. For Alpaca, the input instead has an instruction, the city name in a designated input field, and a place for the response. The authors can vary the coordinate terminology in the instruction as well.

In the zero-shot setting, the system receives the request without a solved case. In the 3-shot setting, three worked statements precede it. The cities in the examples are drawn at random from the city list. The paper illustrates this construction with completed statements about Peoria, Oldham, and Plzen, followed by an unfinished one about Kathmandu. The examples make the expected output visible: give the latitude and longitude as a pair of numbers associated with the target. This is the use of examples at inference time known as few-shot learning.

An example can teach the answer pattern even when it says little about the target location. Peoria’s coordinates, for example, demonstrate the shape of the response to the Kathmandu query. They do not in themselves establish where Kathmandu lies. The study can therefore ask whether demonstrations encourage the system to use a more readily scorable form and whether any such change improves its geographic estimates. These are distinct outcomes whenever a system is free to continue with prose.

The variants use beam search with five beams for this experiment. Beam search maintains several candidate continuations as generation proceeds, extending likely candidates and retaining a limited set for the next step. It gives the system some opportunity to pursue a probable complete answer even when another token was locally attractive earlier. The output remains unconstrained text. A plausible statement about a city can therefore come out of the search without supplying the requested numbers.

The authors distinguish usable output from the accuracy of a location once one can be scored. A continuation that puts Lobito in Angola illustrates the distinction. It conveys a geographic fact in response to a question about a city, yet it gives the experiment no coordinate pair to evaluate. A response with recognizable coordinates allows an error distance to be measured even when the point is far from the city. The prediction rate captures the availability of answers, while the mean distance error captures their geographic accuracy.

Eliciting places from spatial expressions

The experiment on spatial wording changes what the continuation must supply. It starts with a city, such as Albany, and finishes the input with wording that invites another place name. The authors use near, close to, and far from. They compare those completions with an input that joins the starting city to whatever follows using and. This conjunction gives the system room to name another place while leaving the intended separation unspecified. It is thus a control for the general tendency to mention certain cities together.

This stage uses a curated list of 93 cities from the contiguous United States. The researchers balance city size with geographic coverage across most of the contiguous states. They compare zero-shot and three-shot prompts and also compare prompts with and without the starting city’s state. For the latter comparison, the geographical referent can be made explicit while the spatial expression remains the same. An unqualified city name lets the system supply its own interpretation of which place is meant.

The authors select LLaMA-13B for this task based on the coordinate experiment. The awareness setup uses ten different prompts per city and draws fifty samples for each prompt. The paper describes building prompts by randomly choosing a city and pairing it with the nearest city in the curated list. Such examples set a geographic context for interpreting the repeated sampling. Each continuation can then be examined for the place it names, and the collection reveals how concentrated or dispersed the generated destinations are.

The strategy uses top-k sampling and sets k to 100 and temperature to zero.9. The symbol k is the number of highly probable next tokens kept available at each step. Sampling can pick different tokens from that pool in different runs. Temperature controls how sharply the generation probabilities favor the most likely alternatives. As the temperature rises, selection becomes more varied. The authors use sampling here to study a distribution of destinations under each prompt, whereas the coordinate task uses beam search to obtain an answer to a particular request.

Stanza post-processes the continuations so the generated places can be analyzed. A place name from a response is linked to a physical location for comparison with the starting city. The authors can then plot distances over generations and map where the outputs cluster. Reading these results requires keeping track of the unit being observed. A generated place is an answer to a prompt. The distance used to score that answer comes from the locations of the two places. The system supplies a name, and the evaluation determines how far away it is.

Comparing completions with corpus statistics

City names vary in how frequently they appear in text. Some pairs are also mentioned together more often than others. Both facts can affect what a continuation system produces, even if the prompt makes no claim about spatial proximity. The authors examine these possibilities with counts from CC100, which they treat as an approximation for relevant web material in LLaMA’s training. They justify the comparison through its use of Common Crawl material and the relationship between Common Crawl and the LLaMA training data.

The researchers count individual city mentions and count how frequently pairs occur together within a sentence in that corpus. They also count generations for the cities in their experiment under each wording. These measurements give them several comparisons. A pair may often co-occur in the corpus. The starting city may be common on its own. The generated city may be a frequent response because its name is generally prominent. The actual separation of the pair supplies another quantity to compare with those counts.

They use Spearman rank correlation to examine the associations. It compares the ordering of observations under the two variables of interest. For instance, if shorter distances generally accompany larger completion counts, the rank association between distance and generation frequency is negative. The exercise asks whether the relationship between physical distance and generation changes with the prompt and whether the frequency relationships change as well. The measured associations are about observed counts and distances. They leave the model’s internal use of particular training passages open.

Building a layout from pairwise evidence

The final experiment returns to the same list of 93 cities. This time the authors turn each city in turn into a target whose reference coordinates are held aside during placement. The remaining cities supply locations that can anchor the calculation. A dissimilarity measure is assigned to city pairs, including pairs involving the target. In a layout based on distances, greater dissimilarity means greater separation. The aim is to see how well each choice of pairwise evidence supports the recovery of a city’s known location.

The most direct generated evidence comes from a zero-shot continuation about distance. The names of both cities appear with their states, and the prompt specifies kilometers. The paper illustrates the form using Albany, New York, and Dallas, Texas. It again uses LLaMA-13B and beam search, this time described as using 5 beams. The answer contributes an estimate of the separation of the pair. City coordinates are not requested in this step.

The authors also take generation counts from the spatial expression task. Under near or close to, a high count suggests that the generated city is treated as similar to the starting city in the sense relevant here, namely that the two are close. The analysis also uses corpus co-occurrence counts as a baseline similarity measure. Both kinds of count have to be converted to dissimilarities before they can be treated as inputs that grow with separation. The paper describes taking reciprocals.

dᵢⱼ = (sᵢⱼ)⁻¹

Here i and j identify the cities in a pair. The symbol sᵢⱼ is the pair’s similarity value, such as its sentence-level co-occurrence count or the generation frequency under a proximity expression. The symbol dᵢⱼ is the resulting dissimilarity for the pair. The exponent ⁻¹ means taking the reciprocal of the individual value. Larger positive counts give smaller dissimilarities. Frequency under far from already has the intended direction for dissimilarity, since being repeatedly named as far away can itself be treated as evidence of separation. The reciprocal description applies to positive counts. The paper identifies sparse counts as a difficulty and leaves the handling of zero counts unspecified in its account of the procedure.

Multidimensional scaling, or MDS, then uses the dissimilarities to assign points in a 2-dimensional space. The geometric idea is to make the distances among points represent the supplied separations as closely as the fitting procedure allows. The target appears as a point in this space along with the cities whose coordinates are known. A configuration produced from pairwise distances alone has no fixed position on a geographic map. Moving or turning the entire arrangement can preserve its internal separations. To read out latitude and longitude, the researchers need a link between the fitted positions and the coordinate system of the reference cities.

The authors estimate that link by fitting a transformation between the points from MDS and the known geographic coordinates. They use a least-squares procedure, which seeks transformation parameters that keep squared discrepancies small for the paired points used in the fit. The known cities determine the transformation. Applying it to the target’s position yields an estimated geographic coordinate, which can be compared with the coordinate that was held aside. The alignment step is the same kind of operation whether the dissimilarities came from true distances, verbal estimates, or frequencies.

The operation can be run with anchors from across the contiguous United States or restricted to Census Bureau divisions. In the regional version, the target and its anchors belong to the same division. The countrywide setting asks the procedure to fit a layout over a broader domain, whereas the regional setting measures what can be recovered within a more local group of cities. The actual-distance benchmark goes through the geometric fitting and alignment as well, so it provides a reference for the errors associated with the placement procedure itself.

Experiments and results

Coordinate answers depend on the system and the query

The coordinate evaluation covers the 3,527 selected MaxMind cities worldwide. It compares mean geographic error on predicted coordinates and the rate at which the generation yields a coordinate answer. The baseline results are drawn from Liétard and colleagues rather than described as fresh runs. The earlier study included BERT, GPT-2, and Word2Vec. In that comparison, Word2Vec had the best reported result. BERT also performed better than GPT-2 despite the latter’s larger size. The earlier ranking helps explain why the authors ask about system family as well as parameter count.

The strongest quantified coordinate comparison in the results discussion is for LLaMA-13B with no in-context examples. Its reported coordinate prediction error is 85% lower than the best baseline, Word2Vec. This figure concerns the error measure for city coordinates, expressed by the study as mean distance in kilometers. The 85% is a relative error reduction. The discussion gives no absolute kilometer values for that pair of results. The size comparison below shows which foundation variants support the within-family and matched-parameter comparisons.

Parameter counts of foundation systems tested on MaxMind city coordinates

The strongest reported coordinate setting shares its parameter count with another tested foundation system.

Parameter counts of foundation systems tested on MaxMind city coordinatesOPT 6.7B: 6.7OPT 6.7B6.7LLaMA 7B: 7LLaMA 7B7OPT 13B: 13OPT 13B13LLaMA 13B, strongest reported zero-shot setting (this paper): 13LLaMA 13B, strongest reported zero-shotsetting (this paper)13
The numbers
System or settingbillion parameters
OPT 6.7B6.7
LLaMA 7B7
OPT 13B13
LLaMA 13B, strongest reported zero-shot setting (this paper)13

Larger variants generally perform better within the comparisons the authors describe. The results for OPT and LLaMA at 13B nevertheless differ markedly. That comparison holds parameter count fixed and leaves the families’ other differences in place. It shows that the count alone cannot explain the ordering. The authors identify architecture, design decisions, and pretraining material as possible contributors. The experiment compares the systems as they exist and supplies no separate estimate of how much each contributor matters. The trend across sizes is discussed in relation to scaling laws.

For LLaMA, prompting with geo-coordinates produces better reported predictions than naming latitude and longitude individually. The finding is specific to the compared formulations. It matters because a reader would normally treat these requests as asking for the same information, and the scoring reference does stay the same. The change is in how the request is presented to the generation system. A score from one formulation therefore captures the response to that formulation alongside the geographic information the system can supply.

The 3-shot setting improves the rate of obtaining an answer and brings it into a range the authors describe as comparable with Alpaca. Coordinate error is worse than in the zero-shot setting. The measures tell a more informative story together than either would alone. A prompt can make generations easier to parse by inducing a pair of numbers more often, yet the additional numbers can be inaccurate. The authors suggest that examples and instruction-following may induce answers for harder cities where a zero-shot continuation would have supplied no coordinates. The reported aggregate comparison does not establish which newly answered cities account for the change.

There is a local ambiguity in the account of prediction rate. The results discussion describes the column using language about generating another city, while the protocol and its example of a failure concern whether coordinates were produced. In context, the distinction the authors rely on is between getting a usable coordinate response and measuring its error. The findings about prediction rate are best read as claims about answer coverage in that task, without inferring an exact extraction rule from the description.

Spatial expressions change where the answers land

The awareness experiment evaluates actual distances from the starting city to the places named by LLaMA-13B. The authors compare the distributions across prompt wordings and across the presence or absence of a state name. The reported ordering is that complements after near and close to tend to be geographically closer to the starting city. Completions under far from tend to be farther away. The control with and produces a more dispersed set of locations in the mapped examples. The magnitude of the separations is presented visually and described in terms of relative patterns.

The comparison is meaningful because the system supplies another place, and geography supplies the measurement. A city may be a natural textual continuation for reasons having to do with popularity, shared regional identity, or other textual associations. When proximity wording changes the physical distribution of the outputs, the measured effect is richer than a demonstration that the system can produce a plausible place name. It shows that aspects of the distance relationship are reflected in the locations of the continuations.

The paper illustrates the effect with heatmaps for places including Albany, Fort Worth, Havre, and Fresno. In the examples with state names, prompts for a nearby place generally produce a hotspot around the starting city. Prompts for a distant place shift the hotspots away from it. The control maps have no comparably clear concentration in those examples. These maps help a reader see where completions occur, while the distance distributions organize the comparison by the separations they imply.

Albany also illustrates the effect of specifying a state. With New York included, the generated places concentrate near Albany, New York. When the state is omitted, responses cluster around Albany, New York, and Albany, California. The broadening can thus arise from ambiguity about the point of origin. A place near the California city is a geographically sensible completion under one interpretation of Albany and an apparent error under the other. The state comparison shows why an analysis of spatial wording must account for word sense disambiguation in the form of resolving a shared place name.

Distances support a geographic reconstruction

The layout experiment measures the mean distance in kilometers between the reconstructed location of a held-out city and its reference location. It reports this metric for two geographic settings. The first uses the rest of the contiguous-US city list as the known locations. The second divides cities among nine Census Bureau divisions and restricts the target and known locations to the same division. These are distinct scopes for reconstruction, and the regional runs generally have smaller mean errors.

The actual-distance benchmark asks how well the procedure can perform when its pairwise input is geographic distance itself. The random comparison averages the error from ten random predictions for test locations. The discussion subsequently describes this comparison in terms of random distances. The role of the comparison is to give a reference for poor placement when there is no useful geographic information to guide it. Corpus co-occurrence provides a separate baseline because it captures how frequently city names appear together in text.

The errors based on city-pair co-occurrence and on continuations under and resemble the random comparison. Frequencies under far from also yield poor placements. The counts for near and close to give smaller errors than corpus co-occurrence or and. The authors attribute their remaining weakness partly to sparsity. Even when frequent outputs tend to be nearby, the generation counts can provide uneven evidence about the set of city pairs needed to fit a layout.

Directly requested distances produce the strongest reconstruction among the inputs derived from language generation. Their mean location errors are described as closer to the actual-distance benchmark and substantially below the random comparison. The paper also reports a Pearson correlation coefficient of 0.92 between the actual and generated pairwise distances. Pearson correlation measures linear association. The reported value indicates that estimated distances tend to rise with actual ones. The comparison is over distances between cities, while the mean error evaluation concerns the locations estimated after fitting and aligning the layout. The quantities capture different properties of the estimates.

The maps show why the aggregate evaluation and the individual cases both matter. For Albany, New York, and Havre, Montana, the reconstructions from actual and generated distances are both near their reference locations in the displayed examples. The reconstruction for Dallas, Texas, fits the reference more closely when the procedure uses actual distances. Indianapolis, Indiana, goes the other way in the displayed case. Since both reconstructions pass through the same kind of layout and alignment procedure, a locally better result from noisy distances can coexist with better average performance from true distances.

The result is evidence for using approximate answers collectively. If the supplied separations contain enough geographic structure, known points can anchor them and the target can fall in a broadly plausible position. The authors suggest relative orientation as a potentially useful application of such a configuration. The evaluation measures point errors, and the maps illustrate particular placements. A separate measure of how often the procedure gets relative orientation right is absent from the result.

What the ablations show

The paper offers controlled comparisons of prompting, geographic scope, and the source of pairwise data. It does not present a component-removal ablation of a trained geographic system. The distinction bears on what the comparisons can explain. Changing one part of a query or substituting a different matrix of dissimilarities exposes which information the experiment depends on. It cannot assign the observed behavior to a particular internal representation.

Wording, examples, and the rate of answering

The two coordinate phrasings are an intervention at the point where the geographic information is requested. The desired answer and scoring reference stay fixed. LLaMA’s better performance with the wording geo-coordinates shows that the choice of words affects recoverability. A system can have more useful geographic information available through one request than another. The comparison leaves open whether the effect comes from familiar wording in text, better anticipation of the desired format, the particular way the continuation is decoded, or some combination of these factors.

Adding worked examples changes the output behavior along a different axis. In the reported comparison, coverage rises while the coordinate estimates become less accurate on average. If a prompt encourages responses to difficult cases, the error may partly reflect the changed population of answered cities. It may also reflect changed answers on cases that would have received coordinates either way. An aggregate answer rate and an aggregate distance error permit both explanations. Per-city comparisons under both prompt conditions would be needed to quantify their contributions. The results establish the tradeoff at the level reported by the paper.

Alpaca offers another comparison involving the willingness to supply an answer. Its instruction tuning is part of how the pretrained system was prepared, and it receives an instruction-form input in the experiment. Its answer behavior therefore reflects a different combination of training and presentation. The comparison with in-context examples is informative about how the tested settings behave. A comparison that changed only instruction tuning while holding prompt form and all other conditions fixed would be needed to estimate its separate effect.

Spatial wording versus familiarity with names

The use of and gives the proximity comparisons their clearest control. All of the prompts start from a named city and can elicit another place. The conjunction leaves distance unconstrained, while near and close to invite a spatial relationship. In the corpus analysis, generation frequency falls with actual distance more clearly for the proximity expressions than for and. That ordering supports the interpretation that spatial wording makes physical closeness more predictive of what gets generated.

The corpus comparisons add a second layer of evidence. Pairs that commonly co-occur tend to be generated more frequently under the conjunction and under both proximity expressions. The paper describes the association as somewhat stronger for and. It also finds an association between the general corpus frequency of a generated city and how often it is produced, with that relationship more pronounced for the control. A city name can be common and also be geographically suitable. The shift in these associations across prompt conditions suggests that ordinary familiarity plays a different role when the phrase explicitly calls for proximity.

The number of times the starting city appears in the corpus has little association with the generation counts in the comparison. The count of the generated city is more closely related to generation, consistent with some destinations being more familiar outputs. This distinction prevents a broad claim about city frequency from hiding which side of the pair the observation concerns. The tested corpus statistic for the source city can be weak at the same time as destination popularity contributes to the control completions.

The authors relate the overlap between proximity and textual co-occurrence to Tobler’s observation that nearby things tend to be more closely related. In a collection of text, relations between nearby cities can themselves furnish occasions to mention the cities together. That makes co-occurrence and geography intertwined sources of evidence. The ranking comparisons help establish which variable aligns more strongly with generation under particular wording. They cannot assign a causal share of the response to geography independently of every pattern in training.

The far from condition illustrates a different kind of ambiguity. The distance plots indicate generally farther completions than for the close-proximity wording, but the authors find no notable rank correlation that makes its generation counts a dependable guide to pairwise distance. Many cities can satisfy the phrase at a given scale. A city farther away need not be a more frequent completion than all other acceptable distant places. The weak reconstruction from these counts is consistent with the phrase expressing a broad category of locations instead of a graded estimate of how far each pair lies apart.

The state-name comparison tests a source of variation that is independent of the literal proximity term. Specifying New York narrows the intended Albany, and the associated cluster shifts accordingly. This establishes that the starting location named by a prompt matters to the evaluation beyond the surface string of the city’s name. It also illustrates why state names are included in the distance-prediction prompts. The additional wording helps determine which pair of cities a numeric answer is supposed to describe.

What the reconstruction needs from its inputs

The reconstruction tests use the same general geometry with different sources of pairwise information. This keeps the placement task recognizable across conditions. True distances show what the procedure does with accurate input. Estimated distances test whether generated numbers preserve enough structure. Reciprocals of counts test whether patterns of naming cities are an adequate substitute for direct distance information. The stronger performance of estimated distances shows that eliciting a quantity is more useful for this particular calculation than inferring that quantity from the tested frequency measures.

The comparison between near and and also connects the awareness and reasoning experiments. The proximity condition provides frequencies more informative about separation than generic co-mention does, and this difference survives the change from inspecting individual completions to fitting a configuration. Still, a condition can work in the awareness experiment and supply too little evidence for accurate reconstruction. Generating a few highly plausible neighbors supports an inference about local awareness. A layout needs enough trustworthy information across many city pairs to arrange the set.

The difference between regional and countrywide reconstruction shows that the same source of information can yield different errors at different spatial scales. The authors attribute the improvement in divisions to using cities closer to one another. The restriction also changes which anchors are available and the scale over which mean error is measured. The comparison therefore supports a statement about the tested settings. It does not isolate geographic extent as the only source of the difference.

The actual-distance setting is particularly important when interpreting the mapped examples. Even with true pairwise distances, fitting positions in a plane and aligning those positions to coordinates leaves some location error. The error with generated distances thus reflects a combination of the quality of those distances and the placement procedure. Indianapolis shows that an individual city can move closer to its reference under generated distances, while the aggregate comparison still favors the actual-distance benchmark. The benchmark establishes a reference for the procedure as run, rather than requiring the same ranking for every target.

Limitations

Limits the authors state

The authors present the results as evidence that geographic information can be elicited and used in a limited inference task. They distinguish that evidence from the degree of accuracy required for real-world applications. Some answers differ from the reference values, and the resulting map positions can differ from those obtained with actual distances. The suggested use of relative orientation reflects this distinction. An approximate layout may be informative about the broad relationship among cities while remaining unsuitable for a precise point location.

The experimental scope is also bounded by language and by the available systems. The prompts are in English. The authors plan to extend the investigation to other languages, larger systems, and practical applications. Their focus on open systems is a methodological choice tied to transparency and reproducibility. It yields evidence about OPT, LLaMA, and Alpaca under the stated conditions. The awareness and layout results narrow that scope further, since those experiments use LLaMA-13B after the coordinate comparison.

The authors identify prompting as an area where performance could change. They suggest continuous prompts, which are learned input vectors in place of readable query wording, as a possible way to improve coordinate coverage and accuracy. Those prompts would be harder for a person to inspect than English sentences. The reported results concern the wording and examples used in the experiments. Training continuous prompts and measuring the claimed improvement remain proposals. The same distinction applies to targeted tuning for a geographic use case.

The paper also acknowledges differences between an estimated layout and the locations it attempts to reconstruct. Its last experiment evaluates whether supplied dissimilarities are useful for the purpose. The geometric output is derived with known anchors and a fitted transformation, and the authors scope the finding to the contribution of generated information to that process. This qualification is central to reading the result as evidence about geospatial reasoning.

Limits that follow from the setup

The worldwide experiment is worldwide in the coverage of its city list. Its population threshold of greater than 100k confines the evidence to relatively large cities in that database. Small settlements, physical features, ambiguous street-level references, and other kinds of geographic entities lie outside the setup. The in-depth spatial wording and reconstruction experiments are narrower geographically. They work with 93 cities chosen from across the contiguous United States. The presence of a global coordinate test does not supply global evidence for the behavior observed in the US proximity prompts.

There are also limits to the comparison across scales. A prompt such as near leaves room for a criterion appropriate to the locations at issue. The study measures how distributions shift for a given list and given prompt forms. Its maps and ranks do not establish a universal cutoff for what counts as nearby. Likewise, lower regional reconstruction errors are measured over smaller geographic domains with different sets of anchors. Absolute distance error under those settings does not by itself establish that the system knows regional geography better in a way that is independent of scale.

The reported coordinate improvement over Word2Vec uses an earlier result as its comparison. The numerical claim belongs to the comparison the paper makes, and the publication reports different systems and procedures in the prior study. A fresh comparison under identical conditions would give stronger control over differences in evaluation. Similarly, the matched 13B comparison removes variation in parameter count, while leaving architecture, training and design differences together. It establishes a limitation on size as a predictor of performance without identifying a specific cause of the gap.

The two coordinate metrics govern how to interpret the apparent advantage of zero-shot accuracy. If the scored answers under different prompts cover different cities, the resulting means need not be directly comparable as measures of accuracy on the same items. An answer can also be unusable because it fails to express a location in the requested form. A low prediction rate therefore is not, on its own, evidence that the corresponding facts were absent from training or inaccessible through any prompt. The authors’ explanation of why zero-shot generations sometimes return no coordinates remains a hypothesis about the behavior.

In the awareness analysis, CC100 is a proxy for training material. Its sentence-level counts cover a limited kind of textual association. A city pair can be related through a longer passage, a shared topic, different names for the same place, or a series of descriptions that a count within a sentence does not capture. Since the study compares ranks from the corpus and the generations, it can show that a simple co-occurrence account fits some prompt conditions better than others. The analysis cannot establish how the system acquired the associations or rule out more complicated explanations rooted in training text.

The same restraint applies to the phrase geospatial awareness. In this experiment its evidence is behavioral. The wording shifts the locations of the generated places in directions broadly consistent with the spatial terms. The experiment provides no direct observation of the internal representation responsible for that shift. The results support the paper’s use of awareness as a description of generation under these conditions. A stronger claim about how the system conceptualizes space would require evidence of a different kind.

Finally, the Pearson correlation of 0.92 measures how the estimated and actual pairwise distances vary together. It does not certify the calibration of any given estimate in kilometers or provide a location error for a particular city. A set of estimates can preserve much of the pattern of separations while making consequential mistakes for individual pairs. The reconstruction partly tests the consequences of such errors, but the fitted layout, known anchors, and scale of evaluation all contribute to its outcome. The experiment demonstrates the usefulness of the distances within that pipeline. It leaves open the accuracy of unassisted spatial inference and performance in an actual decision-making task.

What came after

Coordinates from Context: Using LLMs to Ground Complex Location References cites this study and takes up a related problem with a different kind of input. Bhandari and colleagues name cities explicitly and vary what their prompts request about them. The later paper’s stated task is to ground complex location references, using the surrounding context to connect a reference to coordinates. The connection between the papers is the question of whether geographic information can be recovered from language and expressed as a location. The later task brings the interpretation of the reference itself into the foreground.

The Albany experiment helps explain why that shift matters. Adding a state can resolve ambiguity about a city before the spatial part of the prompt is evaluated. With a complex location reference, determining the intended place is part of the task from the start. An error can arise because the system settles on a different referent or because it gives poor coordinates for the intended one. Bhandari and colleagues expose that distinction with a targeted change to a city name. The later paper’s title places contextual grounding at the center of the inquiry. The citation establishes the connection between their topics, while the extent to which the later work adopts the earlier experimental procedures remains unspecified.

Cite

Cite as Prabin Bhandari, Antonios Anastasopoulos and Dieter Pfoser. 2023. Are Large Language Models Geospatially Knowledgeable?. arXiv:2310.13002.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.48550/arxiv.2310.13002 · arXiv 2310.13002

@misc{bhandari2023are,
  title = {{Are Large Language Models Geospatially Knowledgeable?}},
  author = {Prabin Bhandari, Antonios Anastasopoulos and Dieter Pfoser},
  year = {2023},
  doi = {10.48550/arxiv.2310.13002},
  eprint = {2310.13002},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.48550/arxiv.2310.13002}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/bhandari-2023-large-language-models-geospatially-knowledgeable/

References

31 references, from the paper's own bibliography.

  1. authorpersonIngwer Borg and personPatrick JF Groenen. year2005. booktitleModern multidimensional scaling: Theory and applications. publisherSpringer Science & Business Media. OpenAlex ↗ · Scholar ↗
  2. authorpersonTom Brown, personBenjamin Mann, personNick Ryder, personMelanie Subbiah, personJared D Kaplan, personPrafulla Dhariwal, personArvind Neelakantan, personPranav Shyam, personGirish Sastry, personAmanda Askell, et al. year2020. Language models are few-shot learners. journalAdvances in neural information processing systems volume33 (year2020), pages1877–1901. our card
  3. authorpersonJeff Da, personRonan Le Bras, personXiming Lu, personYejin Choi, and personAntoine Bosselut. year2021. titleAnalyzing commonsense emergence in few-shot knowledge models. arXiv:2101.00297. OpenAlex ↗ · Scholar ↗
  4. authorpersonFederico Dassereto, personLaura Di Rocco, personGiovanna Guerrini, and personMichela Bertolotto. year2019. Evaluating the effectiveness of embeddings in representing the structure of geospatial ontologies. In booktitleInternational Conference on Geographic Information Science. Springer, pages41–57. OpenAlex ↗ · Scholar ↗
  5. authorpersonCurdin Derungs and personRoss S Purves. year2016. Mining nearness relations from an n-grams Web corpus in geographical space. journalSpatial Cognition & Computation volume16, number4 (year2016), pages301–322. OpenAlex ↗ · Scholar ↗
  6. authorpersonJacob Devlin, personMing-Wei Chang, personKenton Lee, and personKristina Toutanova. year2018. titleBert: Pre-training of deep bidirectional transformers for language understanding. our card
  7. authorpersonYanai Elazar, personNora Kassner, personShauli Ravfogel, personAmir Feder, personAbhilasha Ravichander, personMarius Mosbach, personYonatan Belinkov, personHinrich Schütze, and personYoav Goldberg. year2022. titleMeasuring Causal Effects of Data Statistics on Language Model'sFactual'Predictions. arXiv:2207.14251. OpenAlex ↗ · Scholar ↗
  8. authorpersonJared Kaplan, personSam McCandlish, personTom Henighan, personTom B Brown, personBenjamin Chess, personRewon Child, personScott Gray, personAlec Radford, personJeffrey Wu, and personDario Amodei. year2020. Scaling laws for neural language models. journalarXiv:2001.08361 (year2020). our card
  9. authorpersonAnouk Lang. year2019. Spatial dialectics: Pursuing geospatial imaginaries with word embedding models and mapping. journalModernism/Modernity Print Plus (year2019). OpenAlex ↗ · Scholar ↗
  10. authorpersonXiang Lisa Li and personPercy Liang. year2021. Prefix-Tuning: Optimizing Continuous Prompts for Generation. In booktitleProceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers). publisherAssociation for Computational Linguistics, addressOnline, pages4582–4597. https://doi.org/10.18653/v1/2021.acl-long.353 OpenAlex ↗ · Scholar ↗
  11. authorpersonBastien Liétard, personMostafa Abdou, and personAnders Søgaard. year2021. Do Language Models Know the Way to Rome?. In booktitleProceedings of the Fourth BlackboxNLP Workshop on Analyzing and Interpreting Neural Networks for NLP. publisherAssociation for Computational Linguistics, addressPunta Cana, Dominican Republic, pages510–517. https://doi.org/10.18653/v1/2021.blackboxnlp-1.40 OpenAlex ↗ · Scholar ↗
  12. authorpersonXiao Liu, personKaixuan Ji, personYicheng Fu, personWeng Lam Tam, personZhengxiao Du, personZhilin Yang, and personJie Tang. year2021a. titleP-tuning v2: Prompt tuning can be comparable to fine-tuning universally across scales and tasks. our card
  13. authorpersonXiao Liu, personYanan Zheng, personZhengxiao Du, personMing Ding, personYujie Qian, personZhilin Yang, and personJie Tang. year2021b. titleGPT understands, too. OpenAlex ↗ · Scholar ↗
  14. authorpersonTomas Mikolov, personKai Chen, personGreg Corrado, and personJeffrey Dean. year2013. titleEfficient estimation of word representations in vector space. our card
  15. authorpersonF. Pedregosa, personG. Varoquaux, personA. Gramfort, personV. Michel, personB. Thirion, personO. Grisel, personM. Blondel, personP. Prettenhofer, personR. Weiss, personV. Dubourg, personJ. Vanderplas, personA. Passos, personD. Cournapeau, personM. Brucher, personM. Perrot, and personE. Duchesnay. year2011. Scikit-learn: Machine Learning in Python. journalJournal of Machine Learning Research volume12 (year2011), pages2825–2830. OpenAlex ↗ · Scholar ↗
  16. authorpersonMatthew E. Peters, personMark Neumann, personLuke Zettlemoyer, and personWen-tau Yih. year2018. Dissecting Contextual Word Embeddings: Architecture and Representation. In booktitleProceedings of the 2018 Conference on Empirical Methods in Natural Language Processing. publisherAssociation for Computational Linguistics, addressBrussels, Belgium, pages1499–1509. https://doi.org/10.18653/v1/D18-1179 our card
  17. authorpersonFabio Petroni, personTim Rocktäschel, personSebastian Riedel, personPatrick Lewis, personAnton Bakhtin, personYuxiang Wu, and personAlexander Miller. year2019. Language Models as Knowledge Bases?. In booktitleProceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP). publisherAssociation for Computational Linguistics, addressHong Kong, China, pages2463–2473. https://doi.org/10.18653/v1/D19-1250 our card
  18. authorpersonpython visualization. year[n. d.]. booktitleFolium. https://python-visualization.github.io/folium/ OpenAlex ↗ · Scholar ↗
  19. authorpersonPeng Qi, personYuhao Zhang, personYuhui Zhang, personJason Bolton, and personChristopher D. Manning. year2020. Stanza: A Python Natural Language Processing Toolkit for Many Human Languages. In booktitleProceedings of the 58th Annual Meeting of the Association for Computational Linguistics: System Demonstrations. https://nlp.stanford.edu/pubs/qi2020stanza.pdf our card
  20. authorpersonAlec Radford, personJeffrey Wu, personRewon Child, personDavid Luan, personDario Amodei, personIlya Sutskever, et al. year2019. Language models are unsupervised multitask learners. journalOpenAI blog volume1, number8 (year2019), pages9. OpenAlex ↗ · Scholar ↗
  21. authorpersonTara Safavi and personDanai Koutra. year2021. Relational World Knowledge Representation in Contextual Language Models: A Review. In booktitleProceedings of the 2021 Conference on Empirical Methods in Natural Language Processing. publisherAssociation for Computational Linguistics, addressOnline and Punta Cana, Dominican Republic, pages1053–1067. https://doi.org/10.18653/v1/2021.emnlp-main.81 OpenAlex ↗ · Scholar ↗
  22. authorpersonRohan Taori, personIshaan Gulrajani, personTianyi Zhang, personYann Dubois, personXuechen Li, personCarlos Guestrin, personPercy Liang, and personTatsunori B. Hashimoto. year2023. titleStanford Alpaca: An Instruction-following LLaMA model. howpublishedhttps://github.com/tatsu-lab/stanford_alpaca. OpenAlex ↗ · Scholar ↗
  23. authorpersonWaldo R Tobler. year1970. A computer movie simulating urban growth in the Detroit region. journalEconomic geography volume46, numbersup1 (year1970), pages234–240. OpenAlex ↗ · Scholar ↗
  24. authorpersonHugo Touvron, personThibaut Lavril, personGautier Izacard, personXavier Martinet, personMarie-Anne Lachaux, personTimothée Lacroix, personBaptiste Rozière, personNaman Goyal, personEric Hambro, personFaisal Azhar, et al. year2023. titleLlama: Open and efficient foundation language models. our card
  25. authorpersonShinji Umeyama. year1991. Least-squares estimation of transformation parameters between two point patterns. journalIEEE Transactions on Pattern Analysis & Machine Intelligence volume13, number04 (year1991), pages376–380. OpenAlex ↗ · Scholar ↗
  26. authorpersonAshish Vaswani, personNoam Shazeer, personNiki Parmar, personJakob Uszkoreit, personLlion Jones, personAidan N Gomez, personŁukasz Kaiser, and personIllia Polosukhin. year2017. Attention is all you need. journalAdvances in neural information processing systems volume30 (year2017). our card
  27. authorpersonKuansan Wang, personChris Thrasher, personEvelyne Viegas, personXiaolong Li, and personBo-june Paul Hsu. year2010. An overview of Microsoft Web N-gram corpus and applications. journalProceedings of the NAACL HLT 2010 Demonstration Session (year2010), pages45–48. OpenAlex ↗ · Scholar ↗
  28. authorpersonYizhong Wang, personYeganeh Kordi, personSwaroop Mishra, personAlisa Liu, personNoah A Smith, personDaniel Khashabi, and personHannaneh Hajishirzi. year2022. titleSelf-Instruct: Aligning Language Model with Self Generated Instructions. OpenAlex ↗ · Scholar ↗
  29. authorpersonGuillaume Wenzek, personMarie-Anne Lachaux, personAlexis Conneau, personVishrav Chaudhary, personFrancisco Guzmán, personArmand Joulin, and personEdouard Grave. year2020. CCNet: Extracting High Quality Monolingual Datasets from Web Crawl Data. In booktitleProceedings of the Twelfth Language Resources and Evaluation Conference. publisherEuropean Language Resources Association, addressMarseille, France, pages4003–4012. 979-10-95546-34-4 https://aclanthology.org/2020.lrec-1.494 our card
  30. authorpersonThomas Wolf, personLysandre Debut, personVictor Sanh, personJulien Chaumond, personClement Delangue, personAnthony Moi, personPierric Cistac, personTim Rault, personRémi Louf, personMorgan Funtowicz, et al. year2019. titleHuggingface's transformers: State-of-the-art natural language processing. arXiv:1910.03771. our card
  31. authorpersonSusan Zhang, personStephen Roller, personNaman Goyal, personMikel Artetxe, personMoya Chen, personShuohui Chen, personChristopher Dewan, personMona Diab, personXian Li, personXi Victoria Lin, et al. year2022. titleOpt: Open pre-trained transformer language models. our card