Table of Contents
Fetching ...

Semi-Supervised Learning for Large Language Models Safety and Content Moderation

Eduard Stefan Dinuta, Iustin Sirbu, Traian Rebedea

TL;DR

This paper tackles the labeling bottleneck in LLM safety by applying semi-supervised learning (SSL) to detect harmful prompts and responses. It analyzes several SSL methods—FixMatch, MarginMatch, and MultiMatch—and introduces task-specific augmentation using LLMs, demonstrating that SSL with unlabeled data substantially boosts performance over supervised baselines, especially in low-data scenarios. On the WildGuard-related datasets, SSL with LLM-based augmentation achieves near fully supervised performance using only 2000 labeled examples, and outperforms traditional backtranslation augmentations in most cases. The results suggest significant practical value for deploying safer LLMs with reduced labeling costs, and point to future work on richer unlabeled data sources and larger models for even better generalization.

Abstract

Safety for Large Language Models (LLMs) has been an ongoing research focus since their emergence and is even more relevant nowadays with the increasing capacity of those models. Currently, there are several guardrails in place for all public LLMs and multiple proposed datasets for training safety classifiers. However, training these safety classifiers relies on large quantities of labeled data, which can be problematic to acquire, prone to labeling errors, or often include synthetic data. To address these issues, we suggest a different approach: utilizing semi-supervised learning techniques, which leverage both labeled and unlabeled data, to improve the performance on the safety task. We analyze the improvements that these techniques can offer for both prompts given to Large Language Models and the responses to those requests. Moreover, since augmentation is the central part of semi-supervised algorithms, we demonstrate the importance of using task-specific augmentations, which significantly increase the performance when compared to general-purpose augmentation techniques.

Semi-Supervised Learning for Large Language Models Safety and Content Moderation

TL;DR

This paper tackles the labeling bottleneck in LLM safety by applying semi-supervised learning (SSL) to detect harmful prompts and responses. It analyzes several SSL methods—FixMatch, MarginMatch, and MultiMatch—and introduces task-specific augmentation using LLMs, demonstrating that SSL with unlabeled data substantially boosts performance over supervised baselines, especially in low-data scenarios. On the WildGuard-related datasets, SSL with LLM-based augmentation achieves near fully supervised performance using only 2000 labeled examples, and outperforms traditional backtranslation augmentations in most cases. The results suggest significant practical value for deploying safer LLMs with reduced labeling costs, and point to future work on richer unlabeled data sources and larger models for even better generalization.

Abstract

Safety for Large Language Models (LLMs) has been an ongoing research focus since their emergence and is even more relevant nowadays with the increasing capacity of those models. Currently, there are several guardrails in place for all public LLMs and multiple proposed datasets for training safety classifiers. However, training these safety classifiers relies on large quantities of labeled data, which can be problematic to acquire, prone to labeling errors, or often include synthetic data. To address these issues, we suggest a different approach: utilizing semi-supervised learning techniques, which leverage both labeled and unlabeled data, to improve the performance on the safety task. We analyze the improvements that these techniques can offer for both prompts given to Large Language Models and the responses to those requests. Moreover, since augmentation is the central part of semi-supervised algorithms, we demonstrate the importance of using task-specific augmentations, which significantly increase the performance when compared to general-purpose augmentation techniques.
Paper Structure (8 sections, 6 equations, 1 table)