Leveraging Moment Injection for Enhanced Semi-supervised Natural Language Inference with Large Language Models (2025)

Abstract: Natural Language Inference (NLI) is crucial for evaluating models’ Natural Language Understanding (NLU) and reasoning abilities. The development of NLI, in part, has been driven by the creation of large datasets, which require significant human effort. This has spurred interest in semi-supervised learning (SSL) that leverages both labeled and unlabeled data. However, the absence of hypotheses and class labels in NLI tasks complicates SSL. Prior work has used class-specific fine-tuned large language models (LLMs) to generate hypotheses and assign pseudo-labels but discarded many LLM-constructed samples during training to ensure the quality. In contrast, we propose to leverage all LLM-constructed samples by handling potentially noisy samples by injecting the moments of labeled samples during training to properly adjust the level of noise. Our method outperforms strong baselines on multiple NLI datasets in low-resource settings.

## introduction natural language inference (nli) is a sentence pair classification task aimed at identifying the relationship between two sentences by determining whether they reflect entailment, neutral, or contradiction. nli plays a key role in assessing a model's capacity for natural language understanding (nlu) and reasoning. the advancement of nli, partially, has been fueled along with the creation of large datasets such as snli @xcite , mnli @xcite , and anli @xcite . however, creating a large-scale nli benchmark requires a considerable amount of human effort since human annotators should generate texts that requires logical reasoning and inference. for example, during the creation of the snli and mnli datasets, human workers are given unlabeled premises and are prompted to generate hypotheses corresponding to each class label-entailment, neutral, contradiction. the high cost and complexity of labeling nli data have driven interest in semi-supervised learning (ssl), which utilizes both labeled and unlabeled data. however, unlike single-sentence classification, unlabeled data in nli is more challenging to handle because one of the sentence pairs (typically the hypothesis) and the class label are missing, requiring significant human annotation. consequently, to effectively use unlabeled data for ssl in nli, the challenge of missing hypotheses and class labels should be addressed. to address the challenge of missing hypotheses and class labels in semi-supervised learning (ssl) for natural language inference (nli), @xcite proposed a method that generates hypotheses and assigns initial pseudo-labels using class-specifically fine-tuned large language models (llms; e.g., bart @xcite ). for each unlabeled premise, one hypothesis is generated for each class in the labeled dataset. however, since llms may not always generate the most relevant or accurate output on the first attempt, the resulting data possibly contains noisy samples that degrade performance if used directly. to mitigate this, they employed self-training, specifically pseudo-labeling @xcite . in their proposed approach, a task classifier (e.g., bert) generates a pseudo-label for each llm-generated sample. if the pseudo-label from the class-specifically finetuned llm does not match the one from the task classifier, the sample is considered low quality and discarded. furthermore, even when the pseudolabels match, they discard less confident (noisy) samples, following the common practice in pseudolabeling. previous research on pseudo-labeling typically uses a fixed (or even flexible) confidence threshold, assuming that pseudo-labels with confidence scores above the threshold are of high quality, while those below are of low quality so discard @xcite @xcite . this possibly results in excluding a substantial number of samples. to tackle this, @xcite proposed to utilize all pseudo-labeled samples by applying lower weights to less confident pseudo-labeled samples during training. while this approach significantly enhances the diversity of the training data compared to earlier methods, erroneous pseudo-labels can still be included with high weights as training continues. to this end, we propose a method of leveraging llm-generated pseudo-labeled samples without discarding any to ensure a model is exposed to a wide range of data while minimizing the impact of noisy samples. in our approach, we first construct pseudo-labeled samples by using one of the recent state-of-the-art llms, llama 3. specifically, given a small amount of labeled data, we first fine-tune llama 3 with low-rank adaptation (lora; hu et al. ( 2021 )) for every class. we then use these class-specific lora-tuned llms for generating hypotheses for a given unlabeled premise along with assigning the initial pseudo-label. for example, given a premise 'a man cutting down a tree during winter', we produce three hypotheses, one for each class, 'entailment,' 'contradiction,' and 'neutral,' by using the corresponding class-specific lora-tuned llm. afterward, unlike the previous ssl research that usually discards samples, we propose to leverage all llm-constructed samples but with injecting the moments of labeled data into llm-constructed data. this allows us to calibrate the noisiness of the potentially mislabeled llm-constructed samples, making them more beneficial for training. our proposed method is inspired by the work proposed by @xcite which revealed that the moments (a.k.a., mean and standard deviation) of latent features obtained from various layers of deep networks play a central role in image recognition tasks. they showed that swapping a sample's moments of latent features to another sample allows a model to capture the underlying structure of both samples through the normalized features (from the original image) and the moments (from the other image). inspired by this, we inject the moments of labeled data into llm-constructed data that makes the llm-constructed samples follow the distribution and underlying structure of labeled samples. this results in potentially noisy llm-constructed samples behaving as labeled samples but with a proper noise level. consequently, we effectively harness llm-constructed data to boost the performance of ssl on nli. we validate our method on various nli datasets and show our method achieves competitive performance compared to strong baselines. ## conclusion we proposed an enhanced semi-supervised learning framework for natural language inference 644 (nli), which constructs pseudo-labeled samples using large language models (llms), and introduced moment injection to ensure the quality of llm-constructed samples since llm might fail to be accurate on their first try. our proposed method leverages all llm-generated samples instead of discarding them if less confident as in the previous works, so enhances the exposure of a model to a broader range of samples. we empirically validate that our method achieves competitive performance compared to strong baselines for various nli datasets in low-resource settings.