# Detecting Legend Items on Historical Maps Using GPT-4o with In-Context Learning

arXiv: https://arxiv.org/abs/2510.08385 · HTML: https://mlsanity.com/paper/2510.08385/

## Key facts

- Cited by 1 papers in the map (data through 14 Oct 2026).
- Builds on 8 of its 20 references that are in the map.
- First posted on arXiv 9 Oct 2025.

## Builds on (most cited first, 8 of 8)

- [LayoutLMv3: Pre-training for Document AI with Unified Text and Image Masking](https://mlsanity.com/paper/2204.08387/) (2022)
- [LayoutParser: A Unified Toolkit for Deep Learning Based Document Image Analysis](https://mlsanity.com/paper/2103.15348/) (2021)
- [GeoLM: Empowering Language Models for Geospatially Grounded Language Understanding](https://mlsanity.com/paper/2310.14478/) (2023)
- [The mapKurator System: A Complete Pipeline for Extracting and Linking Text from Historical Maps](https://mlsanity.com/paper/2306.17059/) (2023)
- [Cross-attention Spatio-temporal Context Transformer for Semantic Segmentation of Historical Maps](https://mlsanity.com/paper/2310.12616/) (2023)
- [Hyper-Local Deformable Transformers for Text Spotting on Historical Maps](https://mlsanity.com/paper/2506.15010/) (2025)
- [An Automatic Approach for Generating Rich, Linked Geo-Metadata from Historical Map Images](https://mlsanity.com/paper/2112.01671/) (2021)
- [DIGMAPPER: A Modular System for Automated Geologic Map Digitization](https://mlsanity.com/paper/2506.16006/) (2025)

## Built on by (most cited first, 1 of 1)

- [Automatic Uncertainty-Aware Synthetic Data Bootstrapping for Historical Map Segmentation](https://mlsanity.com/paper/2511.15875/) (2025)

## Abstract (arXiv)

Historical map legends are critical for interpreting cartographic symbols. However, their inconsistent layouts and unstructured formats make automatic extraction challenging. Prior work focuses primarily on segmentation or general optical character recognition (OCR), with few methods effectively matching legend symbols to their corresponding descriptions in a structured manner. We present a method that combines LayoutLMv3 for layout detection with GPT-4o using in-context learning to detect and link legend items and their descriptions via bounding box predictions. Our experiments show that GPT-4 with structured JSON prompts outperforms the baseline, achieving 88% F-1 and 85% IoU, and reveal how prompt design, example counts, and layout alignment affect performance. This approach supports scalable, layout-aware legend parsing and improves the indexing and searchability of historical maps across various visual styles.
