Towards Safer Pretraining: Analyzing and Filtering Harmful Content in Webscale datasets for Responsible LLMs
On the map: LLM safety and security → Safety alignment, refusal and guardrails
Abstract (arXiv)
Large language models (LLMs) have become integral to various real-world applications, leveraging massive, web-sourced datasets like Common Crawl, C4, and FineWeb for pretraining. While these datasets provide linguistic data essential for high-quality natural language generation, they often contain harmful content, such as hate speech, misinformation, and biased narratives. Training LLMs on such unfiltered data risks perpetuating toxic behaviors, spreading misinformation, and amplifying societal biases which can undermine trust in LLM-driven applications and raise ethical concerns about their use. This paper presents a large-scale analysis of inappropriate content across these datasets, offering a comprehensive taxonomy that categorizes harmful webpages into Topical and Toxic based on their intent. We also introduce a prompt evaluation dataset, a high-accuracy Topical and Toxic Prompt (TTP), and a transformer-based model (HarmFormer) for harmful content filtering. Additionally, we create a new multi-harm open-ended toxicity benchmark (HAVOC) and provide crucial insights into how models respond to adversarial toxic inputs. We share TTP, TTP-Eval, HAVOC and a sample of C4 inferenced on HarmFormer. Our work offers insights into ensuring safer LLM pretraining and serves as a resource for Responsible AI (RAI) compliance.
Key facts. Cited by 9 papers in the map (data through 14 Oct 2026). Placed in Safety alignment, refusal and guardrails, one of 12 directions in LLM safety and security. Builds on 24 of its 31 references that are in the map. First posted on arXiv 4 May 2025.
Builds on
24 of 31 references.
Closest ancestors · 1
Same direction, newest first
Other references · 23
- 2017Attention Is All You Needcited by 60,361
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2023GPT-4 Technical Reportcited by 18,396
- 2024The Llama 3 Herd of Modelscited by 14,715
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
- 2019Unsupervised Cross-lingual Representation Learning at Scalecited by 3,935
- 2020Longformer: The Long-Document Transformercited by 3,413
- 2023Sparks of Artificial General Intelligence: Early experiments with GPT-4cited by 2,592
- 2024Phi-3 Technical Report: A Highly Capable Language Model Locally on Your Phonecited by 1,917
- 2020RealToxicityPrompts: Evaluating Neural Toxic Degeneration in Language Modelscited by 1,255
- 2023Llama Guard: LLM-based Input-Output Safeguard for Human-AI Conversationscited by 1,207
11 more
- 2024The FineWeb Datasets: Decanting the Web for the Finest Text Data at Scalecited by 1,160
- 2021Documenting Large Webtext Corpora: A Case Study on the Colossal Clean Crawled Corpuscited by 492
- 2021A Survey on Automated Fact-Checkingcited by 378
- 2022A Holistic Approach to Undesired Content Detection in the Real Worldcited by 356
- 2020HateBERT: Retraining BERT for Abusive Language Detection in Englishcited by 207
- 2023A Pretrainer's Guide to Training Data: Measuring the Effects of Data Age, Domain Coverage, Quality, & Toxicitycited by 182
- 2021What's in the Box? A Preliminary Analysis of Undesirable Content in the Common Crawl Corpuscited by 80
- 2024Data, Data Everywhere: A Guide for Pretraining Dataset Constructioncited by 11
- 2023It's All in the Embedding! Fake News Detection Using Document Embeddingscited by 7
- 2022Suicidal Ideation Detection on Social Media: A Review of Machine Learning Methodscited by 4
- 2023Illicit Darkweb Classification via Natural-language Processing: Classifying Illicit Content of Webpages based on Textual Informationcited by 3
Built on by
Citing papers per year: 2025: 5; 2026: 4.
9 papers.
- 2025An Embarrassingly Simple Defense Against LLM Abliteration Attackscited by 13
- 2025Guardians and Offenders: A Survey on Harmful Content Generation and Safety Mitigation of LLMcited by 9
- 2025Turning the Spell Around: Lightweight Alignment Amplification via Rank-One Safety Injectioncited by 5
- 2026Reflections and New Directions for Human-Centered Large Language Modelscited by 2
- 2025Going over Fine Web with a Fine-Tooth Comb: Technical Report of Indexing Fine Web for Problematic Content Search and Retrievalcited by 0
- 2025On the Sensitivity of Instruction-tuned LLMs to Harmful Sentences in Long Inputscited by 0
- 2026Safety Is Not Universal: The Selective Safety Trap in LLM Alignmentcited by 0
- 2026Phoenix-VL 1.5 Medium Technical Reportcited by 0
- 2026Epistemic Injustice in Language Models: An Audit of Pretraining Filters and Guardrailscited by 0
- 2026Epistemic Injustice in Language Models: An Audit of Pretraining Filters and Guardrails4 Jun 2026
- 2026Phoenix-VL 1.5 Medium Technical Report11 May 2026
- 2026Reflections and New Directions for Human-Centered Large Language Models7 May 2026
- 2026Safety Is Not Universal: The Selective Safety Trap in LLM Alignment7 Jan 2026
- 2025On the Sensitivity of Instruction-tuned LLMs to Harmful Sentences in Long Inputs7 Oct 2025
- 2025Going over Fine Web with a Fine-Tooth Comb: Technical Report of Indexing Fine Web for Problematic Content Search and Retrieval29 Aug 2025
- 2025Turning the Spell Around: Lightweight Alignment Amplification via Rank-One Safety Injection28 Aug 2025
- 2025Guardians and Offenders: A Survey on Harmful Content Generation and Safety Mitigation of LLM7 Aug 2025
- 2025An Embarrassingly Simple Defense Against LLM Abliteration Attacks25 May 2025
Similar, not cited
Close in wording, no citation either way
- 2025HarmMetric Eval: Benchmarking Metrics and Judges for LLM Harmfulness Assessment
- 2025Something Just Like TRuST : Toxicity Recognition of Span and Target
- 2025<think> So let's replace this phrase with insult... </think> Lessons learned from generation of toxic texts with LLMs
- 2025Understanding and Mitigating Toxicity in Image-Text Pretraining Datasets: A Case Study on LLaVA
- 2026HarmProfile: Characterizing Harmful Distributions in Frontier LLMs
- 2024ToxiCraft: A Novel Framework for Synthetic Generation of Harmful Information
- 2024Realistic Evaluation of Toxicity in Large Language Models
- 2024Toxicity of the Commons: Curating Open-Source Pre-Training Data