返回
Fine-grained detoxification framework via instance-level prefixes for large language models
DOI:10.1016/j.neucom.2024.128684.png)
摘要
En 中文
Large Language Models (LLMs) have demonstrated remarkable performance across various natural language processing (NLP) tasks. However, their practical usability is often compromised by a propensity to generate toxic content, such as insults, threats, and profanity, particularly in response to adversarial prompts. Several fine-tuning and decoding approaches have been employed to address this challenge to mitigate toxicity. Nevertheless, these methods typically necessitate additional resources, such as high-quality training data or auxiliary models, thereby incurring extra costs. In this paper, we propose a novel detoxification framework, Fine-Grained Detoxification via Instance-Level Prefixes (FGDILP), which effectively mitigates the generation of toxic text without incurring additional training costs. Specifically, FGDILP leverages contextualized representations in attention space by contrasting a positive prefix-prepended prompt against multiple negative prefix-prepended prompts at the instance level. This methodology facilitates the construction of fine-grained subtoxicity vectors, which are subsequently fused to adjust the original generation pathway when responding to raw prompts. Our results demonstrate that FGDILP enables controlled text generation concerning detoxification at both the utterance and context levels. While our method slightly impacts generation fluency and diversity, it significantly outperforms prompt-based baselines regarding detoxification effectiveness. Our code is available at https://github.com/xinykou/FGDILP.
Keyword:
Large language model
Detoxification framework
Safety and security
期刊
IF:
6.5
论文数:
2.5W
被引数:
6.5W
机构
引用论文
Communication cost reduction using sparse ternary compression and encoding for FedAvg利用稀疏三元压缩和编码降低FedAvg通信成本
ANNALS OF THE ASTROPHYSICAL OBSERVATORY OF THE SMITHSONIAN INSTITUTION, VOLUME I.1史密森尼学会天体物理观测台学报,第一卷。1

