A Context-Aware Approach for Enhancing Data Imputation with Pre-trained Language Models

Ahatsham Hayat, Mohammad R. HasanCOLING 2025

TL;DR

This paper introduces CRILM, a novel approach that leverages pre-trained language models (LMs) to generate context-specific descriptions for missing values in tabular data. This method significantly improves imputation accuracy, especially in challenging "missing not at random" (MNAR) scenarios, by providing LMs with richer contextual information than traditional methods.

What Problem Does This Paper Address?

Handling missing data in tabular datasets is a persistent challenge in machine learning. Traditional imputation methods often rely on numerical estimations, which can introduce biases, particularly when data is missing not at random (MNAR). MNAR occurs when the probability of a value being missing depends on unobserved factors, making it difficult to impute accurately without understanding the underlying context. Existing methods struggle with this, often requiring complete data or failing to capture the nuances of different missingness mechanisms. This paper aims to bridge this gap by using the contextual understanding capabilities of large language models (LLMs) to create more informative representations of missing data.

Methods

The core of CRILM is a two-phase process:

  1. Contextualization and Descriptor Generation: Large language models (LLMs) are used to generate natural language descriptions for missing values. Instead of simply marking a value as "missing," CRILM prompts LLMs to create descriptive phrases that capture the context of the missing attribute. For example, for a missing "malic acid" value in a wine dataset, the descriptor might be "Malic acid quantity missing for this wine sample." This transforms the tabular data into a "missingness-aware contextualized natural language dataset."
  2. Downstream Task Adaptation: This enriched, text-based dataset is then used to fine-tune smaller pre-trained language models (LMs) for downstream tasks like classification. The LMs are instructed to use the generated contextual descriptors to inform their predictions, effectively learning to handle missing data in a context-aware manner.

This approach leverages the broad knowledge of LLMs for descriptor generation and the efficiency of smaller LMs for fine-tuning, making it cost-effective.

Datasets

The authors evaluated CRILM on six real-life multivariate classification datasets from the UCI repository:

  • Iris
  • Wine
  • Seeds
  • Glass Identification
  • Ionosphere
  • Breast Cancer Wisconsin

These datasets were selected for their prior use in imputation studies, ensuring a fair comparison with existing methods.

Key Insights and Ideas

  • Language Models as Contextual Imputers: The fundamental idea is that LMs, with their vast understanding of language and context, can generate more informative placeholders for missing data than simple numerical imputation.
  • Bridging Tabular and Textual Data: CRILM effectively bridges the gap between structured tabular data and unstructured text by converting numerical imputation problems into NLP tasks.
  • MNAR is the Key Challenge: The paper strongly emphasizes that MNAR scenarios are the most difficult and where traditional methods falter. CRILM's success in these cases is a major highlight.
  • Feature-Specific Descriptors Matter: The research found that using contextually relevant, feature-specific descriptors significantly outperforms generic placeholders like "NaN" or "Missing value." This highlights the importance of tailoring the "missingness signal" to the specific attribute.
  • Cost-Effectiveness: By using LLMs for zero-shot inference (descriptor generation) and smaller LMs for fine-tuning, the approach is computationally efficient and practical for resource-constrained environments.

Key Results

  • Superior Performance: CRILM consistently outperformed baseline imputation methods across MCAR, MAR, and MNAR missingness mechanisms on all tested datasets.
  • Significant Gains in MNAR: The most impressive improvements were seen in MNAR scenarios, with CRILM achieving up to a 10% performance gain over the best-performing baselines.
  • Closing the Gap to Complete Data: CRILM effectively narrowed the performance gap between datasets with missing values and their fully complete counterparts.
  • Llama vs. FLAN-T5: The larger Llama model generally showed slightly better performance than the smaller FLAN-T5, likely due to its increased capacity, but both benefited significantly from CRILM.
  • Descriptor Impact: Generic descriptors like "NaN" led to worse performance compared to feature-specific ones. Among generic descriptors, "Missing value" performed best.

Limitations and Future Work

  • LLM Quality Dependency: CRILM's effectiveness is tied to the quality and domain relevance of the LLMs used for descriptor generation. If LLMs lack exposure to similar data, imputation quality might suffer.
  • Scalability: Processing very large datasets with CRILM, even with smaller LMs for fine-tuning, could still present scalability challenges.
  • Domain Specialization: While CRILM performs well across general missingness mechanisms, its application in highly specialized domains requiring deep expert knowledge for interpretation needs further exploration.
  • Task Type Focus: The current evaluation primarily focused on classification tasks. Future work should investigate CRILM's efficacy on other task types.
  • Future Work: The authors suggest extending CRILM to diverse data types such as time-series, images, and unstructured text.

Summary updated

BibTeX
@inproceedings{hayat2025context,
  author = {Ahatsham Hayat and Mohammad R. Hasan},
  title = {{A Context-Aware Approach for Enhancing Data Imputation with Pre-trained Language Models}},
  booktitle = {International Conference on Computational Linguistics},
  year = {2025},
}
Figure