Manuscript Offprint

arXiv:2609.00454

Location-Aware Language Models via Secondary Embeddings

Gokul Srinivasagan, Munir Georges

Gokul Srinivasagan and Munir Georges

AImotion Bavaria, Technische Hochschule Ingolstadt, Germany {Gokul.Srinivasagan, Munir.Georges}@thi.de

Abstract. Pretrained transformer-based language models achieve strong performance across a wide range of NLP tasks but remain limited in encoding geo-locational semantics, leading to suboptimal representations of place names and spatial entities. In this work, we propose a lightweight, model-agnostic approach for injecting geo-spatial awareness into pretrained embeddings without modifying the tokenizer or requiring costly retraining. Our method augments input representations with structured geographic signals by combining location names with their corresponding latitude and longitude, and employs a location-focused masking to better align textual representations with real-world spatial relationships. This design allows the model to incorporate geo-spatial context while preserving existing semantic and syntactic knowledge. Experimental results demonstrate substantial improvements in geo-spatial alignment while maintaining comparable performance on standard NLP benchmarks such as GLUE. The method is computationally efficient, requiring only minutes of additional training, and generalizes across multiple model architectures and scales.

Keywords: Language models · Masked language modeling (MLM) · Geo-locations

1 Introduction

Recent advances in pretrained language models such as BERT [2] and RoBERTa [11] have demonstrated a remarkable ability to capture semantic and syntactic relationships between words. Despite this success, these models often struggle with specialized domains that require additional contextual grounding. In particular, geo-locational awareness is essential for understanding spatial relationships and providing contextually relevant outputs such as route descriptions, targeted advertisements, and localized search results. However, existing models largely fail to encode geographic semantics effectively for entities such as cities, landmarks, or regions.

As illustrated in Figure 1, embeddings of city names are not well structured in the latent space, largely due to the absence of explicit geographic grounding in language models. For instance, the cities Saarbrücken and Salzburg appear close to each other in BERT's embedding space, even though they are geographically

Gokul Srinivasagan and Munir Georges

Figure

Fig. 1. Comparison between the actual geographic location of cities (left) and their corresponding t-SNE visualization in the BERT embedding space (right). The visualization shows that cities which are geographically distant often appear close together in the embedding space, highlighting the lack of geo-spatial awareness in pretrained language models.

distant. This discrepancy highlights the model's inability to reflect real-world spatial relationships.

A contributing factor to this limitation lies in the tokenization process. While subword tokenization has proven effective for general text representation, it fragments named entities, eroding their unique semantic identity. For example, the city name Ingolstadt is split into subwords "ing", "##ols", and "##tadt", resulting in partial embeddings that fail to capture the entity as a single coherent concept. The issue worsens when different locations share identical names (e.g., Paris, France vs. Paris, Texas), as the model has no geo-spatial information to distinguish between them. Consequently, embeddings of distinct entities often collapse into the same region of the vector space, misrepresenting their relational proximity.

Existing approaches to incorporating geographic information often require architectural modifications or costly retraining procedures, limiting their scalability and practical applicability [9, 10, 4]. A seemingly straightforward solution would be to expand the tokenizer's vocabulary to include all place names. However, this approach is impractical as it significantly increases model size and training costs. For instance, adding merely 1,000 new tokens to the BERT-base vocabulary increases the embedding parameters by approximately 3.2%. Moreover, retraining such a model to integrate the new tokens into its representational space is computationally expensive and may degrade performance on downstream NLP tasks.

To address these limitations, we propose a lightweight and model-agnostic method for integrating geographic information into pretrained embeddings without modifying the tokenizer or requiring large-scale retraining. Our approach injects structured geo-spatial signals into the embedding space, aligning repre-sentations with real-world spatial relationships while preserving existing linguistic knowledge. As a result, the model gains location awareness with minimal computational overhead and no loss in downstream performance.

The main contributions of this work are as follows:

We propose a lightweight method for integrating geo-locational information into pretrained language model embeddings without modifying the tokenizer or vocabulary.

– Our approach enriches the embedding space with structured geographic signals while preserving existing syntactic and semantic knowledge.

– We demonstrate substantial improvements in geo-spatial awareness without degrading performance on downstream benchmarks such as GLUE.

– We also validate the generalizability of our method across different model architectures, scales, and multilingual settings.