[论文解读] Perplexed by Quality: A Perplexity-based Method for Adult and Harmful Content Detection in Multilingual Heterogeneous Web Data
本文提出了一种基于困惑度的方法,通过仅在有害文本上训练语言模型,检测多语言网络数据中的成人及有害内容,将高困惑度文档识别为非有害内容。该方法在大规模、嘈杂、多语言语料库(如 OSCAR)中,相比传统分类器,实现了更高的精确率和更真实的标签分布。
As demand for large corpora increases with the size of current state-of-the-art language models, using web data as the main part of the pre-training corpus for these models has become a ubiquitous practice. This, in turn, has introduced an important challenge for NLP practitioners, as they are now confronted with the task of developing highly optimized models and pipelines for pre-processing large quantities of textual data, which implies, effectively classifying and filtering multilingual, heterogeneous and noisy data, at web scale. One of the main components of this pre-processing step for the pre-training corpora of large language models, is the removal of adult and harmful content. In this paper we explore different methods for detecting adult and harmful of content in multilingual heterogeneous web data. We first show how traditional methods in harmful content detection, that seemingly perform quite well in small and specialized datasets quickly break down when confronted with heterogeneous noisy web data. We then resort to using a perplexity based approach but with a twist: Instead of using a so-called "clean" corpus to train a small language model and then use perplexity so select the documents with low perplexity, i.e., the documents that resemble this so-called "clean" corpus the most. We train solely with adult and harmful textual data, and then select the documents having a perplexity value above a given threshold. This approach will virtually cluster our documents into two distinct groups, which will greatly facilitate the choice of the threshold for the perplexity and will also allow us to obtain higher precision than with the traditional classification methods for detecting adult and harmful content.
研究动机与目标
- 解决从大规模、多语言且嘈杂的网络语料库(如 OSCAR)中过滤成人及有害内容的挑战。
- 克服传统分类模型在异质性高、嘈杂的网络数据上泛化能力不足的局限。
- 开发一种可扩展且高效的有害内容识别方法,保持高精确率和真实的预测分布。
- 探索在多语言数据上以零样本、自监督方式使用困惑度作为内容质量代理的可行性。
- 通过使用轻量级语言模型和快速推理,实现在网络规模上实际部署有害内容检测。
提出的方法
- 仅在 OSCAR 语料库中的成人及有害内容上训练轻量级语言模型(KenLM),以学习此类文本的语言模式。
- 使用训练好的模型为测试集中的每篇文档计算困惑度分数,将高困惑度视为非有害内容的指标。
- 采用基于阈值的选择方法:困惑度高于阈值的文档被分类为非有害,低于阈值的则被标记为潜在有害。
- 利用困惑度分数自然聚类为两类(有害与非有害)的特性,简化阈值选择并提高精确率。
- 在前两种方法中使用 FastText 作为基线比较,重点关注其在大规模数据上的速度与性能。
- 通过使用小型高效的语言模型优化推理速度,实现对大规模多语言语料库的处理(例如,在普通硬件上处理前五大语言仅需 84 小时)。
实验结果
研究问题
- RQ1仅在有害数据上进行训练的基于困惑度的方法,是否能在嘈杂、多语言的网络数据中,优于传统分类模型检测成人及有害内容?
- RQ2在大规模语料库中,传统分类器与基于困惑度的方法在预测有害标签的分布上存在何种差异?
- RQ3在代表性有害数据子集上训练语言模型,能在多大程度上泛化至整个 OSCAR 语料库?
- RQ4基于困惑度的方法是否能在无需大规模人工标注数据集的情况下,实现高精确率和真实的标签分布?
- RQ5基于困惑度的方法在大规模处理多语言网络数据时,其可扩展性与效率如何?
主要发现
- 基于困惑度的方法相比传统分类模型实现了更高的精确率,后者在嘈杂、异质性数据上常产生不真实的标签分布。
- 该方法根据困惑度自然将文档聚类为两类(有害与非有害),从而实现更可靠且直观的阈值选择。
- 仅在有害内容上训练语言模型,使其能有效学习此类文本的语言模式,即使数据量有限。
- 该方法展现出强大的可扩展性,估计在普通硬件上处理 OSCAR 语料库中前五大语言仅需 84 小时。
- 该方法识别出此前未被标注的、数量合理的新型有害文本,与先前研究(如 Kreutzer 等,2022 年)的发现一致。
- 一个局限是模型未能检测到训练数据中未包含的 OSCAR 语料库部分的有害内容,可能由于数据的顺序构建方式以及文件间语言多样性所致。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。