FairPrompt: Efficient Multi-Objective Prompt Optimization for Fairness Testing in Conversational AI Systems
As conversational AI systems become integral to real-world applications, ensuring fairness and minimizing social bias has become a critical research challenge. Existing fairness testing approaches often rely on exhaustive or template-based prompt generation, which limits scalability and struggles to capture the diversity of natural language. In this paper, we present FairPrompt, a novel multi-objective prompt optimization framework that leverages the Non-dominated Sorting Genetic Algorithm II (NSGA-II) to efficiently identify a high-quality subset of prompts for bias elicitation. Unlike prior methods, FairPrompt explicitly optimizes for three objectives—semantic diversity, bias detection rate, and prompt uniqueness with balanced demographic coverage—within a large prompt search space. The framework operates in five systematic stages: (1) constructing a bias dataset from social group–bias property tuples, (2) generating yes/no, wh-, and choice-based prompts using NLP techniques, (3) applying n-gram, cosine similarity, and embedding-based methods for bias detection, (4) employing NSGA-II to select an optimized “Prompt Set,” and (5) measuring fairness via Bias Detection Rate and Preference Rate across demographic categories.We evaluate FairPrompt on two state-of-the-art conversational AI systems—BlenderBot (400M parameters) and GPT-3.5 Turbo—using Random Sampling and BiasAsker as baselines. Across 30 experimental runs with a 30% prompt sample size, FairPrompt demonstrates up to 50% reduction in computational cost while achieving significantly higher bias detection rates and broader coverage across multiple social dimensions (e.g., gender, race, body, ability). These results establish FairPrompt as a scalable, model-agnostic framework for fairness testing in conversational AI, offering a more efficient and comprehensive pathway toward building robust and socially responsible AI systems.
Authors
- Muhammad Usman Khalid (ORCID: https://orcid.org/0000-0003-1636-3351)
- Shafiq Ur Rehman (ORCID: https://orcid.org/0009-0000-2677-0108)
- Atif Aftab Ahmed Jilani (ORCID: https://orcid.org/0000-0002-8311-8279)
- Volker Gruhn
- Nigar Azhar Butt
- Zunaira Shafqat
Institutions
- National University of Computer and Emerging Sciences (PK)
- Imam Mohammad ibn Saud Islamic University (SA)
- University of Duisburg-Essen (DE)
Publication Details
- Journal
- IEEE Access
- Published
- 2025-01-01
- DOI
- https://doi.org/10.1109/access.2025.3618868
- Citations
- 1
- Primary Topic
- Explainable Artificial Intelligence (XAI)
- Type
- article
- Field-Weighted Citation Impact
- 2.48