B ias G uard: A Reasoning-Enhanced Bias Detection Tool for Large Language Models (2025)

Abstract: Identifying bias in LLM-generated content is a crucial prerequisite for ensuring fairness in LLMs. Existing methods, such as fairness classifiers and LLM-based judges, face limitations related to difficulties in understanding underlying intentions and the lack of criteria for fairness judgment. In this paper, we introduce BiasGuard, a novel bias detection tool that explicitly analyzes inputs and reasons through fairness specifications to provide accurate judgments. BiasGuard is implemented through a two-stage approach: the first stage initializes the model to explicitly reason based on fairness specifications, while the second stage leverages reinforcement learning to enhance its reasoning and judgment capabilities. Our experiments, conducted across five datasets, demonstrate that BiasGuard outperforms existing tools, improving accuracy and reducing over-fairness misjudgments. We also highlight the importance of reasoning-enhanced decision-making and provide evidence for the effectiveness of our two-stage optimization pipeline.

## introduction large language models (llms) have recently demonstrated remarkable capabilities due to their vast training data and large parameter sizes. however, llms may inherit societal biases from their training data, such as stereotypes and toxic language targeting specific groups, and may propagate and reinforce these biases during deployment. identifying biases in llm-generated text is crucial for the fairness evaluation of llms @xcite and content moderation during inference @xcite , serving as an essential prerequisite for ensuring the fairness of llms. given the high cost and inefficiency of human annotations, existing works have aimed to develop automated bias detection tools. some ap- ## method problem formulation the task of bias detection can be formalized as the development of a bias detection tool, denoted as π. this tool takes as input a text x, which represents the output generated by upstream llms, and provides a judgment @xmath0. typically, this judgment is a straightforward conclusion, such as "biased" or "unbiased." in this paper, to address the limitations of existing methods in understanding underlying intentions and fairness criteria, we propose the development of biasguard π θ , which explicitly reasons through a chain of thought (cot) process, guided by fairness specifications s, before arriving at a final conclusion y. this can be formally expressed as π θ (cot, y|s, x). ## conclusion this paper investigates the potential of deliberate reasoning in the bias detection task to address the limitations of existing methods. by carefully designing specifications to guide analysis and judgment, and advancing reasoning through a two-stage training approach, we develop biasguard. empirical results validate the effectiveness of biasguard in improving accuracy and reducing over-fairness. we hope our findings and biasguard will contribute to future research aimed at enhancing the fairness of large language models.