Modern machine learning thrives on scale, but scaling up data collection often means introducing massive amounts of noise. Whether relying on web scraping, distant supervision, or pseudo-labeling from large language models (LLMs), the resulting datasets frequently contain misalignments, factual errors, and hallucinations. When models are trained on this "dirty" data, they internalize these errors, leading to downstream hallucinations and poor generalization.
To break this cycle, a powerful paradigm has emerged: using Natural Language Inference (NLI) as a rigorous semantic filter to prune training data. Instead of relying on surface-level heuristics or vector similarity, this approach frames data validation as a formal logical check.
The Core Mechanism: Mapping Data to Premise and Hypothesis
How do we use a model trained to detect logical entailment to clean a dataset for a completely different task? The core intuition relies on a simple translation step: mapping the input context to a premise and the candidate target label to a hypothesis.
[Input Context] ───► Premise
│
▼
[ NLI Model ] ───► Entailment? ───► Keep Sample
▲ │
│ ▼
[Target Label] ───► Hypothesis Discard if No
If the NLI model determines that the premise logically entails the hypothesis, the data point is retained. If it detects a contradiction or a lack of explicit support, the sample is discarded. This simple constraint ensures that a model only learns from examples where the target output is strictly grounded in the provided input.
Cleaning Distant Supervision and Information Extraction
Information Extraction (IE) models turn unstructured text into structured <subject, relation, object> triplets. To build large datasets, researchers often use distant supervision—automatically pairing text with existing knowledge base facts. However, just because a text mentions "Paris" and "France" doesn't mean it explicitly states that Paris is the capital of France.
To solve this, Pere-Lluís Huguet Cabot et al. introduced REBEL: Relation Extraction By End-to-end Language generation, which uses NLI to verify that candidate relational triplets are explicitly supported by the source text. By converting the triplets into natural language hypotheses, the NLI model filters out ungrounded facts. The authors extended this principle in REDFM: a Filtered and Multilingual Relation Extraction Dataset, employing a cross-encoder as a critic to validate multilingual triplets.
Similarly, Chenxi Whitehouse et al. applied NLI filtering in WebIE: Faithful and Robust Information Extraction on the Web to mitigate the noise of open-web data extraction. When generating instruction-tuning datasets for IE, Honghao Gui et al. demonstrated in InstructIE: A Bilingual Instruction-based Information Extraction Dataset that converting extracted facts into hypotheses and running an NLI check drastically reduces model hallucinations during training.
This bidirectional alignment is also critical when building paired datasets; Ali Mousavi 0003 et al. showed in Construction of Paired Knowledge Graph - Text Datasets Informed by Cyclic Evaluation that filtering out misaligned knowledge graph-to-text pairs prevents models from learning to hallucinate missing facts. For dynamic updates, Daniel Daza et al. leveraged LLMs in EMERGE: A Benchmark for Updating Knowledge Graphs with Emerging Textual Knowledge to verify whether textual evidence explicitly justifies updating a structured knowledge graph.
Eliminating Hallucinations in Summarization and Generation
In generative tasks like abstractive summarization, human-written targets often contain "extrinsic fluff"—stylistic flourishes or background knowledge not present in the source text. Training models on these targets teaches them to hallucinate.
In Multilingual Summarization with Factual Consistency Evaluation, Roee Aharoni et al. filtered noisy web-scraped summarization datasets by checking the logical entailment between source documents and summaries, removing examples that failed the check. This concept applies equally to non-textual sources: Saad Obaid ul Islam et al. used NLI filtering in Tackling Hallucinations in Neural Chart Summarization to scrub ungrounded descriptions from chart summarization datasets, forcing models to prioritize strict factual alignment over stylistic flourishes.
This filtering strategy is also vital for training models to generate citations. In Effective Large Language Model Adaptation for Improved Grounding and Citation Generation, Xi Ye 0003 et al. used an external NLI model to verify candidate responses against source documents, curating high-quality grounded examples to fine-tune smaller models. Similarly, Sirui Xia et al. developed Ground Every Sentence: Improving Retrieval-Augmented LLMs with Interleaved Reference-Claim Generation, which filters out training pairs where a generated claim is not logically entailed by its selected reference document, enforcing a strict relationship between source evidence and derived statements.
To prevent models from hallucinating details absent from specific contexts, Zhuhao Wang et al. demonstrated in LLM-RG4: Flexible and Factual Radiology Report Generation across Diverse Input Contexts that pruning ground-truth radiology reports ensures they only contain information logically inferable from the available subset of imaging inputs.
Refining Pseudo-Labels and Evaluation Prompts
Beyond extraction and summarization, NLI filtering acts as a safeguard during data augmentation and pseudo-labeling. In cross-domain aspect-based sentiment analysis, Haining Wang et al. introduced Refining and Synthesis: A Simple yet Effective Data Augmentation Framework for Cross-Domain Aspect-based Sentiment Analysis, treating the original text as a premise and the augmented text as a hypothesis to discard contradictions and halt error propagation.
The logic also works in reverse to prevent "double-correct" answers in multiple-choice question generation. In DisGeM: Distractor Generation for Multiple Choice Questions with Span Masking, Devrim Cavusoglu et al. used NLI to ensure that generated distractor options are not logically entailed by the context, making them contextually plausible yet semantically distinct from the correct answer.
For automated evaluation, Olivia Wiles et al. developed Revisiting text-to-image evaluation with Gecko: on metrics, prompts, and human rating, which uses NLI-based question filtering to validate that automatically generated evaluation questions are strictly derived from the source prompt, removing logically disconnected queries. Finally, even in stance classification, Lifeng Jin et al. showed in Distant finetuning with discourse relations for stance classification that NLI can filter silver-labeled sentence pairs, ensuring that linguistic connectives match the true underlying logical relationship.
Why It Works: Semantic Similarity vs. Logical Entailment
Why can't we just use traditional metrics like BLEU, ROUGE, or vector-based cosine similarity to filter data?
The answer lies in the fundamental difference between similarity and truth. Two sentences can share 90% of their vocabulary or sit close together in an embedding space while expressing completely contradictory facts. For example, consider these two statements:
- The experimental drug is completely safe for young children.
- The experimental drug is highly unsafe for young children.
Under surface-level or embedding-based metrics, these sentences are nearly identical because they share a tight context. However, their logical relationship is a direct contradiction.
NLI models are explicitly trained to look past surface-level overlap and evaluate directional truth conditions. By treating data cleaning as an entailment problem, researchers leverage a model's sensitivity to negation, quantifiers, and logical structure. This ensures that the training signal enforces strict grounding rather than vague topical relevance, effectively neutralizing hallucinations at the source.
Key Foundational Work
Improving Distantly Supervised Document-Level Relation Extraction Through Natural Language Inference (2022) — contributed 3 concept elements to this direction.
REBEL: Relation Extraction By End-to-end Language generation (2021) — contributed 2 concept elements to this direction.
Distant finetuning with discourse relations for stance classification (2022) — contributed 1 concept elements to this direction.