Beyond One-Size-Fits-All: Personalized Harmful Content Detection with In-Context Learning
On the map: LLM safety and security → Safety alignment, refusal and guardrails
Abstract (arXiv)
The proliferation of harmful online content--e.g., toxicity, spam, and negative sentiment--demands robust and adaptable moderation systems. However, prevailing moderation systems are centralized and task-specific, offering limited transparency and neglecting diverse user preferences--an approach ill-suited for privacy-sensitive or decentralized environments. We propose a novel framework that leverages in-context learning (ICL) with foundation models to unify the detection of toxicity, spam, and negative sentiment across binary, multi-class, and multi-label settings. Crucially, our approach enables lightweight personalization, allowing users to easily block new categories, unblock existing ones, or extend detection to semantic variations through simple prompt-based interventions--all without model retraining. Extensive experiments on public benchmarks (TextDetox, UCI SMS, SST2) and a new, annotated Mastodon dataset reveal that: (i) foundation models achieve strong cross-task generalization, often matching or surpassing task-specific fine-tuned models; (ii) effective personalization is achievable with as few as one user-provided example or definition; and (iii) augmenting prompts with label definitions or rationales significantly enhances robustness to noisy, real-world data. Our work demonstrates a definitive shift beyond one-size-fits-all moderation, establishing ICL as a practical, privacy-preserving, and highly adaptable pathway for the next generation of user-centric content safety systems. To foster reproducibility and facilitate future research, we publicly release our code on GitHub and the annotated Mastodon dataset on Hugging Face.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in Safety alignment, refusal and guardrails, one of 12 directions in LLM safety and security. Builds on 36 of its 60 references that are in the map. First posted on arXiv 29 Oct 2025.
Builds on
36 of 60 references.
References · 36
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
- 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,170
- 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,944
- 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,326
- 2022Large Language Models are Zero-Shot Reasonerscited by 4,374
- 2023Qwen Technical Reportcited by 3,344
- 2023Mistral 7Bcited by 3,164
- 2022Scaling Instruction-Finetuned Language Modelscited by 3,024
24 more
- 2019ALBERT: A Lite BERT for Self-supervised Learning of Language Representationscited by 2,790
- 2022Emergent Abilities of Large Language Modelscited by 2,512
- 2020Don't Stop Pretraining: Adapt Language Models to Domains and Taskscited by 1,565
- 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,434
- 2021What Makes Good In-Context Examples for GPT-3?cited by 1,195
- 2019EDA: Easy Data Augmentation Techniques for Boosting Performance on Text Classification Taskscited by 807
- 2021Learning To Retrieve Prompts for In-Context Learningcited by 648
- 2019SMART: Robust and Efficient Fine-Tuning for Pre-trained Natural Language Models through Principled Regularized Optimizationcited by 254
- 2022Can language models learn from explanations in context?cited by 249
- 2021Muppet: Massive Multi-task Representations with Pre-Finetuningcited by 192
- 2017Deep Learning for Hate Speech Detection in Tweetscited by 180
- 2023Compositional Exemplars for In-context Learningcited by 144
- 2021BERT: A Review of Applications in Natural Language Processing and Understandingcited by 109
- 2023Dr.ICL: Demonstration-Retrieved In-context Learningcited by 72
- 2021Designing Toxic Content Classification for a Diversity of Perspectivescited by 65
- 2021Text Detoxification using Large Pre-trained Neural Modelscited by 52
- 2020Comparing BERT against traditional machine learning text classificationcited by 46
- 2023You Only Prompt Once: On the Capabilities of Prompt Learning on Large Language Models to Tackle Toxic Contentcited by 39
- 2019Fine-grained Sentiment Classification using BERTcited by 38
- 2023A Wide Evaluation of ChatGPT on Affective Computing Taskscited by 30
- 2018Convolutional Neural Networks for Toxic Comment Classificationcited by 24
- 2023Efficient Toxic Content Detection by Bootstrapping and Distilling Large Language Modelscited by 21
- 2023Spam-T5: Benchmarking Large Language Models for Few-Shot Email Spam Detectioncited by 13
- 2024SpamDam: Towards Privacy-Preserving and Adversary-Resistant SMS Spam Detectioncited by 3
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2025SMARTER: A Data-efficient Framework to Improve Toxicity Detection with Explanation via Self-augmenting Large Language Models
- 2025Towards Safer Social Media Platforms: Scalable and Performant Few-Shot Harmful Content Moderation Using Large Language Models
- 2025STEMTOX: From Collaborative Tags to Fine-Grained Toxic Meme Detection via Entropy-Guided Multi-Task Learning
- 2021Toxicity Detection can be Sensitive to the Conversational Context
- 2025MemeArena: Automating Context-Aware Unbiased Evaluation of Harmfulness Understanding for Multimodal Large Language Models
- 2025LLM-based Semantic Augmentation for Harmful Content Detection
- 2024Just KIDDIN: Knowledge Infusion and Distillation for Detection of INdecent Memes
- 2025Re-ranking Using Large Language Models for Mitigating Exposure to Harmful Content on Social Media Platforms