INTERNATIONAL JOURNAL OF INTELLIGENT SYSTEMS AND DATA SCIENCE

BiasScope: Inference-Time Bias Detection and Mitigation for Fair Natural Language Processing (NLP) Using Retrieval-Augmented Generation and Prompt Engineering

Published in issue

October 2026

Volume / Issue

Vol. 1 No. 5

Access

Open access

View PDF

The article details presented on this page reflect the published version of record. Readers may access the full-text PDF, review the citation information, and export the reference in supported citation formats.

Abstract

The appearance of social stereotypes in Large Language Models (LLMs) is a crucial concern in research on fairness in the context of Natural Language Processing (NLP). This study focuses on gender bias, occupational stereotypes, gender comparisons, and trait attributions. Numerous mitigation techniques depend on fine-tuning and post-processing, which are typically expensive and difficult to audit. BiasScope is a lightweight framework that uses prompt engineering and RAG to detect and mitigate model biases at inference time without changing weights. We generate responses through the Gemini 2.5 Flash API in our implementation. The system (1) provides a baseline reply, followed by (2) scoring by a lexicon- and pattern-based detector with transparent functioning. When bias is detected, (3) it retrieves fairness guidance, followed by (4) generating a mitigated response from an augmented prompt. The mean composite bias score on the 26-prompt evaluation set is reduced by 72.1% after mitigation. This composite score combines four detector signals: toxicity, counterfactual sensitivity, stereotype co-occurrence, and sentiment and sentiment is treated as one signal among four, not as proof of bias. No formal user study of response quality was conducted; qualitative inspection of the outputs is reported in Section 4. BiasScope is designed to support multiple LLM backends and is fully traceable from detection to mitigation. It provides an effective means of achieving fairness and accountability in production Natural Language Processing (NLP).
Keywords:Responsible Artificial IntelligencePrompt EngineeringNatural Language Processing (NLP)Retrieval-Augmented Generation (RAG)Bias MitigationLarge Language Models (LLMs)

Cite this Article

Use the following citation when referencing this publication in academic or professional work.

R. K. R. Ambati, "BiasScope: Inference-Time Bias Detection and Mitigation for Fair Natural Language Processing (NLP) Using Retrieval-Augmented Generation and Prompt Engineering", Int. J. Intell. Syst. Data Sci., vol. 1, no. 5, Oct. 2026, doi: https://doi.org/10.67231/xbkga555.

DOWNLOAD CITATION

BiasScope: Inference-Time Bias Detection and Mitigation for Fair Natural Language Processing (NLP) Using Retrieval-Augmented Generation and Prompt Engineering | International Journal of Intelligent Systems and Data Science