Using In-Context Learning to Improve Dialogue Safety
Not on the map. Why?
Abstract (arXiv)
While large neural-based conversational models have become increasingly proficient dialogue agents, recent work has highlighted safety issues with these systems. For example, these systems can be goaded into generating toxic content, which often perpetuates social biases or stereotypes. We investigate a retrieval-based method for reducing bias and toxicity in responses from chatbots. It uses in-context learning to steer a model towards safer generations. Concretely, to generate a response to an unsafe dialogue context, we retrieve demonstrations of safe responses to similar dialogue contexts. We find our method performs competitively with strong baselines without requiring training. For instance, using automatic evaluation, we find our best fine-tuned baseline only generates safe responses to unsafe dialogue contexts from DiaSafety 4.04% more than our approach. Finally, we also propose a re-ranking procedure which can further improve response safeness.
Key facts. Cited by 42 papers in the map (data through 13 Oct 2026). Builds on 65 of its 91 references that are in the map. First posted on arXiv 2 Feb 2023.
Builds on
65 of 91 references.
References · 65
- 2017Attention Is All You Needcited by 60,106
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,304
- 2014Adam: A Method for Stochastic Optimizationcited by 37,093
- 2020Language Models are Few-Shot Learnerscited by 32,320
- 2022Training language models to follow instructions with human feedbackcited by 15,856
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,221
- 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,107
- 2017Deep reinforcement learning from human preferencescited by 3,871
- 2020Dense Passage Retrieval for Open-Domain Question Answeringcited by 3,797
- 2022Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedbackcited by 3,691
- 2022OPT: Open Pre-trained Transformer Language Modelscited by 3,500
- 2022Constitutional AI: Harmlessness from AI Feedbackcited by 3,011
38 more
- 2022Scaling Instruction-Finetuned Language Modelscited by 3,007
- 2019The Curious Case of Neural Text Degenerationcited by 2,893
- 2019Fine-Tuning Language Models from Human Preferencescited by 2,139
- 2022LaMDA: Language Models for Dialog Applicationscited by 1,219
- 2021Scaling Language Models: Methods, Analysis & Insights from Training Gophercited by 1,201
- 2021What Makes Good In-Context Examples for GPT-3?cited by 1,191
- 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,126
- 2021A General Language Assistant as a Laboratory for Alignmentcited by 1,041
- 2020MPNet: Masked and Permuted Pre-training for Language Understandingcited by 976
- 2021GLaM: Efficient Scaling of Language Models with Mixture-of-Expertscited by 896
- 2022Few-Shot Parameter-Efficient Fine-Tuning is Better and Cheaper than In-Context Learningcited by 891
- 2019Plug and Play Language Models: A Simple Approach to Controlled Text Generationcited by 797
- 2019CTRL: A Conditional Transformer Language Model for Controllable Generationcited by 757
- 2023The Flan Collection: Designing Data and Methods for Effective Instruction Tuningcited by 736
- 2021Learning To Retrieve Prompts for In-Context Learningcited by 643
- 2020Recipes for building an open-domain chatbotcited by 593
- 2018Wizard of Wikipedia: Knowledge-Powered Conversational agentscited by 530
- 2022Improving alignment of dialogue agents via targeted human judgementscited by 529
- 2018Texygen: A Benchmarking Platform for Text Generation Modelscited by 486
- 2021MetaICL: Learning to Learn In Contextcited by 452
- 2021DExperts: Decoding-Time Controlled Text Generation with Experts and Anti-Expertscited by 437
- 2022ToxiGen: A Large-Scale Machine-Generated Dataset for Adversarial and Implicit Hate Speech Detectioncited by 421
- 2021Self-Diagnosis and Self-Debiasing: A Proposal for Reducing Corpus-Based Bias in NLPcited by 337
- 2022Can language models learn from explanations in context?cited by 249
- 2022Quark: Controllable Text Generation with Reinforced Unlearningcited by 237
- 2020Learning from the Worst: Dynamically Generated Datasets to Improve Online Hate Detectioncited by 221
- 2016Ex Machina: Personal Attacks Seen at Scalecited by 209
- 2022BlenderBot 3: a deployed conversational agent that continually learns to responsibly engagecited by 198
- 2021Process for Adapting Language Models to Society (PALMS) with Values-Targeted Datasetscited by 181
- 2019The Second Conversational Intelligence Challenge (ConvAI2)cited by 179
- 2019Build it Break it Fix it for Dialogue Safety: Robustness from Adversarial Human Attackcited by 176
- 2022In-context Examples Selection for Machine Translationcited by 172
- 2020Recipes for Safety in Open-domain Chatbotscited by 170
- 2019Queens are Powerful too: Mitigating Gender Bias in Dialogue Generationcited by 152
- 2021RedditBias: A Real-World Resource for Bias Evaluation and Debiasing of Conversational Language Modelscited by 149
- 2017ParlAI: A Dialog Research Software Platformcited by 139
- 2020Can You Put it All Together: Evaluating Conversational Agents' Ability to Blend Skillscited by 131
- 2022ProsocialDialog: A Prosocial Backbone for Conversational Agentscited by 109
50 most cited of 65 All 65 (JSON)
Built on by
Citing papers per year: 2023: 13; 2024: 14; 2025: 9; 2026: 6.
42 papers.
Sort:
By area:
- 2023StarCoder: may the source be with you!cited by 797
- 2023Bias and Fairness in Large Language Models: A Surveycited by 636
- 2023In-context Vectors: Making In Context Learning More Effective and Controllable Through Latent Space Steeringcited by 243
- 2023Domain Specialization as the Key to Make Large Language Models Disruptive: A Comprehensive Surveycited by 135
- 2024Bias and Unfairness in Information Retrieval Systems: New Challenges in the LLM Eracited by 98
- 2024Detoxifying Large Language Models via Knowledge Editingcited by 87
- 2023In-Context Learning with Iterative Demonstration Selectioncited by 74
- 2024Self-Debiasing Large Language Models: Zero-Shot Recognition and Reduction of Stereotypescited by 59
- 2025FairSteer: Inference Time Debiasing for LLMs with Dynamic Activation Steeringcited by 39
- 2024AI Safety in Generative AI Large Language Models: A Surveycited by 33
- 2023Beyond Task Performance: Evaluating and Reducing the Flaws of Large Multimodal Models with In-Context Learningcited by 30
- 2024Deconstructing The Ethics of Large Language Models from Long-standing Issues to New-emerging Dilemmas: A Surveycited by 23
30 more
- 2024High-Dimension Human Value Representation in Large Language Modelscited by 20
- 2023Building Trustworthy NeuroSymbolic AI Systems: Consistency, Reliability, Explainability, and Safetycited by 14
- 2023Fine-tune Language Models to Approximate Unbiased In-context Learningcited by 12
- 2023Tackling Bias in Pre-trained Language Models: Current Trends and Under-represented Societiescited by 11
- 2024Potential and Challenges of Model Editing for Social Debiasingcited by 10
- 2023Learn What NOT to Learn: Towards Generative Safety in Chatbotscited by 8
- 2023PlugMed: Improving Specificity in Patient-Centered Medical Dialogue Generation using In-Context Learningcited by 8
- 2024Should We Fine-Tune or RAG? Evaluating Different Techniques to Adapt LLMs for Dialoguecited by 7
- 2024SAIL: Sample-Centric In-Context Learning for Document Information Extractioncited by 6
- 2025BiasFilter: An Inference-Time Debiasing Framework for Large Language Modelscited by 6
- 2025TalkDep: Clinically Grounded LLM Personas for Conversation-Centric Depression Screeningcited by 6
- 2023JAB: Joint Adversarial Prompting and Belief Augmentationcited by 5
- 2023Beyond Output Matching: Bidirectional Alignment for Enhanced In-Context Learningcited by 5
- 2024Investigating Adversarial Trigger Transfer in Large Language Modelscited by 5
- 2025Adaptive Detoxification: Safeguarding General Capabilities of LLMs through Toxicity-Aware Knowledge Editingcited by 5
- 2024Synergizing In-context Learning with Hints for End-to-end Task-oriented Dialog Systemscited by 4
- 2024On LLM Wizards: Identifying Large Language Models' Behaviors for Wizard of Oz Experimentscited by 4
- 2025Thinking with Nothinking Calibration: A New In-Context Learning Paradigm in Reasoning Large Language Modelscited by 4
- 2025Understanding the Generalization of In-Context Learning in Transformers: An Empirical Studycited by 3
- 2026Mitigating the Safety-utility Trade-off in LLM Alignment via Adaptive Safe Context Learningcited by 2
- 2024Self-Supervised Position Debiasing for Large Language Modelscited by 1
- 2024GrounDial: Human-norm Grounded Safe Dialog Response Generationcited by 1
- 2026A Concise Agent is Less Expert: Revealing Side Effects of Using Style Features on Conversational Agentscited by 1
- 2026Learning to Select Visual In-Context Demonstrationscited by 1
- 2025From Measurement to Mitigation: Exploring the Transferability of Debiasing Approaches to Gender Bias in Maltese Language Modelscited by 0
- 2025Dialogue Systems Engineering: A Survey and Future Directionscited by 0
- 2025Comp-X: On Defining an Interactive Learned Image Compression Paradigm With Expert-driven LLM Agentcited by 0
- 2026RoTRAG: Rule of Thumb Reasoning for Conversation Harm Detection with Retrieval-Augmented Generationcited by 0
- 2026Detoxification for LLM: From Dataset Itselfcited by 0
- 2026RISA: Response Inspection and Selective Actions for Refusal Calibration in Large Language Modelscited by 0
- 2026RISA: Response Inspection and Selective Actions for Refusal Calibration in Large Language Models1 Sep 2026
- 2026Detoxification for LLM: From Dataset Itself21 Apr 2026
- 2026RoTRAG: Rule of Thumb Reasoning for Conversation Harm Detection with Retrieval-Augmented Generation19 Apr 2026
- 2026Learning to Select Visual In-Context Demonstrations24 Mar 2026
- 2026Mitigating the Safety-utility Trade-off in LLM Alignment via Adaptive Safe Context Learning14 Feb 2026
- 2026A Concise Agent is Less Expert: Revealing Side Effects of Using Style Features on Conversational Agents15 Jan 2026
- 2025Comp-X: On Defining an Interactive Learned Image Compression Paradigm With Expert-driven LLM Agent21 Aug 2025
- 2025TalkDep: Clinically Grounded LLM Personas for Conversation-Centric Depression Screening6 Aug 2025
- 2025Thinking with Nothinking Calibration: A New In-Context Learning Paradigm in Reasoning Large Language Models5 Aug 2025
- 2025Dialogue Systems Engineering: A Survey and Future Directions4 Aug 2025
- 2025From Measurement to Mitigation: Exploring the Transferability of Debiasing Approaches to Gender Bias in Maltese Language Models3 Jul 2025
- 2025BiasFilter: An Inference-Time Debiasing Framework for Large Language Models28 May 2025
30 more
- 2025Adaptive Detoxification: Safeguarding General Capabilities of LLMs through Toxicity-Aware Knowledge Editing28 May 2025
- 2025FairSteer: Inference Time Debiasing for LLMs with Dynamic Activation Steering20 Apr 2025
- 2025Understanding the Generalization of In-Context Learning in Transformers: An Empirical Study19 Mar 2025
- 2024SAIL: Sample-Centric In-Context Learning for Document Information Extraction22 Dec 2024
- 2024On LLM Wizards: Identifying Large Language Models' Behaviors for Wizard of Oz Experiments10 Jul 2024
- 2024AI Safety in Generative AI Large Language Models: A Survey6 Jul 2024
- 2024Should We Fine-Tune or RAG? Evaluating Different Techniques to Adapt LLMs for Dialogue10 Jun 2024
- 2024Deconstructing The Ethics of Large Language Models from Long-standing Issues to New-emerging Dilemmas: A Survey8 Jun 2024
- 2024Synergizing In-context Learning with Hints for End-to-end Task-oriented Dialog Systems24 May 2024
- 2024Investigating Adversarial Trigger Transfer in Large Language Models24 Apr 2024
- 2024Bias and Unfairness in Information Retrieval Systems: New Challenges in the LLM Era17 Apr 2024
- 2024High-Dimension Human Value Representation in Large Language Models11 Apr 2024
- 2024Detoxifying Large Language Models via Knowledge Editing21 Mar 2024
- 2024Potential and Challenges of Model Editing for Social Debiasing21 Feb 2024
- 2024GrounDial: Human-norm Grounded Safe Dialog Response Generation14 Feb 2024
- 2024Self-Debiasing Large Language Models: Zero-Shot Recognition and Reduction of Stereotypes3 Feb 2024
- 2024Self-Supervised Position Debiasing for Large Language Models2 Jan 2024
- 2023Beyond Output Matching: Bidirectional Alignment for Enhanced In-Context Learning28 Dec 2023
- 2023Building Trustworthy NeuroSymbolic AI Systems: Consistency, Reliability, Explainability, and Safety5 Dec 2023
- 2023Tackling Bias in Pre-trained Language Models: Current Trends and Under-represented Societies3 Dec 2023
- 2023JAB: Joint Adversarial Prompting and Belief Augmentation16 Nov 2023
- 2023In-context Vectors: Making In Context Learning More Effective and Controllable Through Latent Space Steering11 Nov 2023
- 2023In-Context Learning with Iterative Demonstration Selection15 Oct 2023
- 2023Fine-tune Language Models to Approximate Unbiased In-context Learning5 Oct 2023
- 2023Beyond Task Performance: Evaluating and Reducing the Flaws of Large Multimodal Models with In-Context Learning1 Oct 2023
- 2023Bias and Fairness in Large Language Models: A Survey2 Sep 2023
- 2023Domain Specialization as the Key to Make Large Language Models Disruptive: A Comprehensive Survey30 May 2023
- 2023PlugMed: Improving Specificity in Patient-Centered Medical Dialogue Generation using In-Context Learning19 May 2023
- 2023StarCoder: may the source be with you!9 May 2023
- 2023Learn What NOT to Learn: Towards Generative Safety in Chatbots21 Apr 2023
- 2025Thinking with Nothinking Calibration: A New In-Context Learning Paradigm in Reasoning Large Language Modelscited by 4
- 2026Mitigating the Safety-utility Trade-off in LLM Alignment via Adaptive Safe Context Learningcited by 2
- 2025Comp-X: On Defining an Interactive Learned Image Compression Paradigm With Expert-driven LLM Agentcited by 0
- 2026RoTRAG: Rule of Thumb Reasoning for Conversation Harm Detection with Retrieval-Augmented Generationcited by 0
- 2026RoTRAG: Rule of Thumb Reasoning for Conversation Harm Detection with Retrieval-Augmented Generation19 Apr 2026
- 2026Mitigating the Safety-utility Trade-off in LLM Alignment via Adaptive Safe Context Learning14 Feb 2026
- 2025Comp-X: On Defining an Interactive Learned Image Compression Paradigm With Expert-driven LLM Agent21 Aug 2025
- 2025Thinking with Nothinking Calibration: A New In-Context Learning Paradigm in Reasoning Large Language Models5 Aug 2025
- 2023JAB: Joint Adversarial Prompting and Belief Augmentationcited by 5
- 2025Adaptive Detoxification: Safeguarding General Capabilities of LLMs through Toxicity-Aware Knowledge Editingcited by 5
- 2026RISA: Response Inspection and Selective Actions for Refusal Calibration in Large Language Modelscited by 0
- 2026RISA: Response Inspection and Selective Actions for Refusal Calibration in Large Language Models1 Sep 2026
- 2025Adaptive Detoxification: Safeguarding General Capabilities of LLMs through Toxicity-Aware Knowledge Editing28 May 2025
- 2023JAB: Joint Adversarial Prompting and Belief Augmentation16 Nov 2023
- 2023StarCoder: may the source be with you!cited by 797
- 2023Bias and Fairness in Large Language Models: A Surveycited by 636
- 2023In-context Vectors: Making In Context Learning More Effective and Controllable Through Latent Space Steeringcited by 243
- 2023Domain Specialization as the Key to Make Large Language Models Disruptive: A Comprehensive Surveycited by 135
- 2024Bias and Unfairness in Information Retrieval Systems: New Challenges in the LLM Eracited by 98
- 2024Detoxifying Large Language Models via Knowledge Editingcited by 87
- 2023In-Context Learning with Iterative Demonstration Selectioncited by 74
- 2024Self-Debiasing Large Language Models: Zero-Shot Recognition and Reduction of Stereotypescited by 59
- 2024AI Safety in Generative AI Large Language Models: A Surveycited by 33
- 2024Deconstructing The Ethics of Large Language Models from Long-standing Issues to New-emerging Dilemmas: A Surveycited by 23
- 2024High-Dimension Human Value Representation in Large Language Modelscited by 20
- 2023Building Trustworthy NeuroSymbolic AI Systems: Consistency, Reliability, Explainability, and Safetycited by 14
12 most cited of 30 All 30 (JSON)
- 2026Detoxification for LLM: From Dataset Itself21 Apr 2026
- 2025TalkDep: Clinically Grounded LLM Personas for Conversation-Centric Depression Screening6 Aug 2025
- 2025Dialogue Systems Engineering: A Survey and Future Directions4 Aug 2025
- 2025From Measurement to Mitigation: Exploring the Transferability of Debiasing Approaches to Gender Bias in Maltese Language Models3 Jul 2025
- 2025BiasFilter: An Inference-Time Debiasing Framework for Large Language Models28 May 2025
- 2025Understanding the Generalization of In-Context Learning in Transformers: An Empirical Study19 Mar 2025
- 2024SAIL: Sample-Centric In-Context Learning for Document Information Extraction22 Dec 2024
- 2024On LLM Wizards: Identifying Large Language Models' Behaviors for Wizard of Oz Experiments10 Jul 2024
- 2024AI Safety in Generative AI Large Language Models: A Survey6 Jul 2024
- 2024Should We Fine-Tune or RAG? Evaluating Different Techniques to Adapt LLMs for Dialogue10 Jun 2024
- 2024Deconstructing The Ethics of Large Language Models from Long-standing Issues to New-emerging Dilemmas: A Survey8 Jun 2024
- 2024Synergizing In-context Learning with Hints for End-to-end Task-oriented Dialog Systems24 May 2024
12 newest of 30 All 30 (JSON)