Metadata Conditioned Large Language Models for Localization

Anjishnu Mukherjee, Ziwei Zhu, Antonios Anastasopoulos · OpenReview

TL;DR

This paper introduces "metadata conditioning" as a simple yet effective way to make large language models (LLMs) understand and generate geographically localized content. By prepending metadata like URLs and country tags to training data, they show that LLMs can achieve better in-region performance without sacrificing global generalization, even outperforming models trained on much more data.

What Problem Does This Paper Address?

Standard LLMs are trained on massive, diverse datasets, but this often leads to a "homogenized" or "western-centric" behavior. This means they might not accurately reflect the nuances of local knowledge, customs, or facts that vary significantly across different regions. For example, wedding dress colors differ culturally. Existing methods to address this are often computationally expensive or applied post-training. This paper aims to find a more efficient, integrated approach to localize LLMs during their core training phase.

Methods

The core innovation is metadata conditioning. This involves prepending structured metadata (like verified URLs, country tags, and continent tags) to each document in the training corpus. This allows the LLM to learn associations between the text content and its geographic origin.

The researchers pre-trained 31 LLMs (0.5B and 1B parameter scales) using the LLaMA 3 architecture on the "News on the Web" (NOW) corpus. They conducted four main experiments:

  1. Local Models: Comparing metadata-conditioned local models (trained on a single continent) against non-conditioned controls.
  2. Global Models: Investigating if a single global model (trained on all continents) can be localized using metadata at inference time, comparing it to local models.
  3. Ablation Studies: Testing the impact of different metadata granularities (e.g., URL-only vs. URL+Country+Continent) and the necessity of data from all regions.
  4. Downstream Evaluation: Instruction-tuning the best models and evaluating them on a custom benchmark of localized factual knowledge.

Datasets

  • Training Data: "News on the Web" (NOW) corpus, a large-scale English news dataset annotated with publication year, source URL, and country of origin. This data was further processed to include continent tags.
  • Evaluation Benchmarks:
    • Continent-specific test sets derived from the NOW corpus.
  • A custom-built benchmark of 800 localized news Multiple-Choice Questions (MCQs), designed to test factual knowledge specific to different regions.

Key Insights and Ideas

  • Metadata is Powerful, Even Simple Metadata: URL-level metadata alone captures a significant portion of the geographic signal needed for localization, often outperforming models trained with more comprehensive metadata. This suggests LLMs can infer a lot from domain names and website structures.
  • Localization Without Sacrificing Generalization: Metadata conditioning improves performance within a specific region without hurting the model's ability to generalize to other regions.
  • Global Models Can Be Localized: A single, large global model can achieve localization comparable to region-specific models by simply being conditioned on metadata during training and inference. This is more efficient than training many separate models.
  • Data Balance Matters: While metadata is powerful, it cannot fully compensate for a lack of training data from certain regions. Balanced regional data coverage is still essential for robust performance.
  • Efficiency Gains: Metadata conditioning significantly improves learning efficiency, allowing models trained on smaller datasets to match the performance of much larger, conventionally trained models.

Key Results

  • Metadata-conditioned local models ([LOCAL]) consistently showed lower perplexity on in-region test sets compared to non-conditioned controls.
  • Metadata-conditioned global models ([GLOBAL]) achieved lower perplexity than their non-conditioned counterparts (GLOBAL) on both local and global test sets.
  • The [GLOBAL] model achieved accuracy comparable to LLaMA-3.2-1B-INSTRUCT on the localized news MCQ benchmark, despite being trained on substantially less data. This highlights a significant learning efficiency improvement.
  • Ablation studies showed that URL-only metadata was surprisingly effective, and that excluding data from any single continent consistently degraded performance, underscoring the need for balanced regional data.

Limitations and Future Work

  • Model Architecture: The study focused on the LLaMA 3 architecture. Future work could explore if these benefits transfer to other LLM families.
  • Language and Domain: Experiments were limited to English news articles. Extending metadata conditioning to multilingual settings and other domains (like literature or conversational text) is a crucial next step.
  • Data Accessibility: The study used a licensed news dataset. Exploring metadata conditioning on more broadly accessible datasets like Common Crawl would be valuable.
  • Ethical Considerations: The authors highlight the potential for reinforcing stereotypes if metadata is misapplied. Responsible deployment requires careful consideration of fairness, inclusivity, and preventing misuse, especially in user-facing applications.

Summary updated

Abstract

Large language models are typically trained by treating text as a single global distribution, often resulting in geographically homogenized behavior. We study metadata conditioning as a lightweight approach for localization, pre-training 31 models (at 0.5B and 1B parameter scales) from scratch on large-scale English news data annotated with verified URLs, country tags, and continent tags, covering 4 continents and 17 countries. Across four controlled experiments, we show that metadata conditioning consistently improves in-region performance without sacrificing cross-region generalization, enables global models to recover localization comparable to region-specific models, and improves learning efficiency. Our ablation studies demonstrate that URL-level metadata alone captures much of the geographic signal, while balanced regional data coverage remains essential, as metadata cannot fully compensate for missing regions. Finally, we introduce a downstream benchmark of 800 localized news MCQs and show that after instruction tuning, metadata conditioned global models achieve accuracy comparable to LLaMA-3.2-1B-Instruct, despite being trained on substantially less data. Together, these results establish metadata conditioning as a practical and compute-efficient approach for localization of language models.
BibTeX
@misc{mukherjee2026metadata,
  author = {Anjishnu Mukherjee and Ziwei Zhu and Antonios Anastasopoulos},
  title = {{Metadata Conditioned Large Language Models for Localization}},
  year = {2026},
  eprint = {2601.15236},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2601.15236},
}
Figure