Evaluating LLM Performance on Spatial Concepts
Listen to the summary
Uses a voice available on your device
Audio options
On this page 5 sections
Related concepts 6 concepts
Key Takeaways
- Larger instruction-tuned models perform best, with Llama-3.1-8B achieving 71.7% accuracy on multiple-choice questions.
- Model consistency is generally low, often hovering around 26% for binary questions, which signals unstable factual recall.
- The Mistral-family of models demonstrates significantly weaker performance across all tests compared to other evaluated models.
- Qwen3-8B shows the strongest grounding results, hitting 66.7% accuracy and 44.7% consistency on distance-based spatial tasks.
Summary & Methodology Analysis
The researchers developed a concept-centric benchmark to assess how language models handle spatial logic. The methodology involves constructing a dedicated probing dataset by subsampling 1,000 binary and 1,000 ternary compositional questions. These questions evaluate models on spatial concepts such as direction, distance, and topology. To measure abstraction, the team extracted token embeddings and trained linear classifiers, simple models that map inputs to outputs using a linear function, to predict specific concept classes across random and out-of-distribution splits. This setup helps determine if models have truly abstracted these concepts or are relying on surface-level patterns.
Interactive System Flowchart
Illustrative Implementation
A short sketch of the paper's core idea, not the authors' own code.
# Illustrative sketch (not from the paper)
import torch
import math
# 1. Define spatial concepts and lexical instances
DIRECTIONS = ['N', 'E', 'S', 'W']
DIST_THRESH = 10.0 # distance threshold (km) used in ϕd,th
# 2. Mapping functions from geometric measurements to relational tokens
def phi_theta(bearing):
# bearing in degrees → cardinal direction (simplified ranges)
if 45 <= bearing < 135:
return 'E'
if 135 <= bearing < 225:
return 'S'
if 225 <= bearing < 315:
return 'W'
return 'N'
def phi_d_th(dist, th=DIST_THRESH):
return 'close' if dist <= th else 'far'
# 3. Example entities with pre‑computed geometry (placeholder values)
entities = [('WardA', (0.0, 0.0)), ('WardB', (5.0, 5.0))]
# 4. Generate atomic triplets
atomic_triplets = []
for (sub, (x1, y1)), (obj, (x2, y2)) in [(entities[0], entities[1])]:
dx, dy = x2 - x1, y2 - y1
bearing = (math.degrees(math.atan2(dy, dx)) + 360) % 360
dist = math.hypot(dx, dy)
dir_rel = phi_theta(bearing)
dist_rel = phi_d_th(dist)
atomic_triplets.append((sub, dir_rel, obj))
atomic_triplets.append((sub, dist_rel, obj))
# 5. Create composite triplets by conjunctive combination (same subject/object)
composite_triplets = []
for i in range(len(atomic_triplets)):
for j in range(i+1, len(atomic_triplets)):
s1, r1, o1 = atomic_triplets[i]
s2, r2, o2 = atomic_triplets[j]
if s1 == s2 and o1 == o2:
composite_triplets.append((s1, f"{r1} AND {r2}", o1))
# 6. Generate a Binary‑QA item from a triplet using a template
subj, rel, obj = atomic_triplets[0]
question = f"Is {subj} {rel.lower()} of {obj}?"
answer = "yes"
# 7. Simple linear probe on dummy token embeddings (illustrative)
embedding_dim = 768
# random token embedding for the question
emb = torch.randn(1, embedding_dim)
# linear classifier to predict one of 7 concept classes
probe = torch.nn.Linear(embedding_dim, 7)
logits = probe(emb)
pred_class = torch.argmax(logits, dim=1).item()
// Illustrative sketch (not from the paper)
const math = require('mathjs');
// 1. Spatial concepts and lexical instances
const DIRECTIONS = ['N', 'E', 'S', 'W'];
const DIST_THRESH = 10.0; // km, used in ϕd,th
// 2. Mapping functions
function phiTheta(bearing) {
// bearing in degrees → cardinal direction (simplified)
if (bearing >= 45 && bearing < 135) return 'E';
if (bearing >= 135 && bearing < 225) return 'S';
if (bearing >= 225 && bearing < 315) return 'W';
return 'N';
}
function phiDTh(dist, th = DIST_THRESH) {
return dist <= th ? 'close' : 'far';
}
// 3. Example entities with coordinates (placeholder)
const entities = [
{ name: 'WardA', coord: [0.0, 0.0] },
{ name: 'WardB', coord: [5.0, 5.0] }
];
// 4. Generate atomic triplets
let atomicTriplets = [];
const sub = entities[0];
const obj = entities[1];
const dx = obj.coord[0] - sub.coord[0];
const dy = obj.coord[1] - sub.coord[1];
const bearing = (math.unit(math.atan2(dy, dx), 'rad').toNumber('deg') + 360) % 360;
const dist = math.hypot(dx, dy);
atomicTriplets.push([sub.name, phiTheta(bearing), obj.name]);
atomicTriplets.push([sub.name, phiDTh(dist), obj.name]);
// 5. Composite triplets (conjunctive combination)
let compositeTriplets = [];
for (let i = 0; i < atomicTriplets.length; i++) {
for (let j = i + 1; j < atomicTriplets.length; j++) {
const [s1, r1, o1] = atomicTriplets[i];
const [s2, r2, o2] = atomicTriplets[j];
if (s1 === s2 && o1 === o2) {
compositeTriplets.push([s1, `${r1} AND ${r2}`, o1]);
}
}
}
// 6. Binary‑QA generation from an atomic triplet
const [qSubj, qRel, qObj] = atomicTriplets[0];
const question = `Is ${qSubj} ${qRel.toLowerCase()} of ${qObj}?`;
const answer = 'yes';
// 7. Illustrative linear probe using TensorFlow.js (placeholder tensors)
const tf = require('@tensorflow/tfjs-node');
const embeddingDim = 768;
const emb = tf.randomNormal([1, embeddingDim]); // dummy token embedding
const probe = tf.layers.dense({units: 7, inputShape: [embeddingDim]}); // linear classifier
const logits = probe.apply(emb);
const predClass = logits.argMax(-1).dataSync()[0];
Cross-Examination & FAQs
A deeper dive clarifying mechanics, constraints, and baseline evaluations.
Q1. What is the primary goal of this research?
The goal is to evaluate how well large language models understand and reason about spatial concepts like direction, distance, and topology.
Q2. Which models performed the best in the evaluation?
Larger instruction-tuned models performed the best, specifically Llama-3.1-8B for multiple-choice questions and Qwen3-4B or Qwen3-8B for various binary and grounding tasks.
Q3. Are these models consistent in their reasoning?
No, consistency is generally low. For binary questions, consistency is often around 26%, which indicates that factual recall remains unstable despite moderate accuracy levels.
Q4. How did the researchers measure abstraction?
They extracted token embeddings and used linear classifiers to predict seven concept classes across different data splits.
Q5. What is the compositionality gap?
The compositionality gap measures the difference in performance between atomic and composite questions, with Mistral-v0.3-7B showing the smallest gap at 13%.
Q6. What are the limitations of the study?
The study is limited by using only two real-world geographic regions, potentially narrow concept definitions, and the use of only linear classifiers for probing.
Q7. Did the models perform well on grounding tasks?
Performance varied, with Qwen3-8B achieving 66.7% accuracy on distance tasks, while Mistral-8B remained near the 52% chance level.
Q8. How were the test questions generated?
The researchers created a dataset of 1,000 binary and 1,000 ternary compositional questions based on spatial relations.
Q9. How does the performance of Mistral models compare to others?
Mistral models show substantially lower abstraction performance, with random-split accuracy ranging between 52.8% and 58.0% compared to over 99% for other models.