微小的种族提示变化就能暴露小模型在检索增强生成中的偏见。
Fairness Testing in Retrieval-Augmented Generation: How Small Perturbations Reveal Bias in Small Language Models
- 通过控制性人口属性扰动测试模型公平性
- 约1/3的逻辑关系因种族相关提示失效
- 提醒开发者警惕检索内容带来的偏见放大
大型语言模型广泛应用但持续引发安全与公平性担忧。除数据投毒、提示注入等攻击外,模型还存在由敏感人口特征(如种族、性取向)引发的不公平行为。此外,模型常产生看似合理却虚假的信息(幻觉)。检索增强生成(RAG)通过结合外部检索与文本生成,可缓解幻觉问题,但其引入的检索内容本身可能带偏见或放大偏见。本研究采用元变换测试(MT),对三个部署于HuggingFace的小语言模型(Llama-3.2-3B-Instruct、Mistral-7B-Instruct-v0.3、Llama-3.1-Nemotron-8B)在情感分析任务中进行公平性测试,均集成于RAG流程。结果表明,微小的人口属性扰动可导致高达1/3的元变换关系失效。详细分析显示,涉及种族提示的扰动是违规的主要原因,并呈现一致的偏见层级。该研究不仅提供对比评估,更强调需谨慎筛选RAG中的检索内容,以防止偏见放大。研究结果为希望使用轻量级模型但不牺牲公平性与可靠性的开发者、测试者及小型组织提供了实用警示。
原文摘要 · Abstract (English)
Large Language Models (LLMs) are widely used across multiple domains but continue to raise concerns regarding security and fairness. Beyond known attack vectors such as data poisoning and prompt injection, LLMs are also vulnerable to fairness bugs. These refer to unintended behaviors influenced by sensitive demographic cues (e.g., race or sexual orientation) that should not affect outcomes. Another key issue is hallucination, where models generate plausible yet false information. Retrieval-Augmented Generation (RAG) has emerged as a strategy to mitigate hallucinations by combining external retrieval with text generation. However, its adoption raises new fairness concerns, as the retrieved content itself may surface or amplify bias. This study conducts fairness testing through metamorphic testing (MT), introducing controlled demographic perturbations in prompts to assess fairness in sentiment analysis performed by three Small Language Models (SLMs) hosted on HuggingFace (Llama-3.2-3B-Instruct, Mistral-7B-Instruct-v0.3, and Llama-3.1-Nemotron-8B), each integrated into a RAG pipeline. Results show that minor demographic variations can break up to one third of metamorphic relations (MRs). A detailed analysis of these failures reveals a consistent bias hierarchy, with perturbations involving racial cues being the predominant cause of the violations. In addition to offering a comparative evaluation, this work reinforces that the retrieval component in RAG must be carefully curated to prevent bias amplification. The findings serve as a practical alert for developers, testers and small organizations aiming to adopt accessible SLMs without compromising fairness or reliability.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。