Introducing Confident Voice: Watch the Launch Video Now

Bias

Bias is a single-turn safety metric to determine if your LLM output contains gender, racial, or political bias.

Overview

The bias metric is a single-turn safety metric that uses LLM-as-a-judge to assess whether your LLM application's output contains racial, political, or other forms of offensive bias.

Required Parameters

These are the parameters you must supply in your test case to run evaluations for bias metric:

inputstringRequired

The input you supplied to your LLM application.

actual_outputstringRequired

The final output your LLM application generates.

How Is It Calculated?

The bias metric breaks down the actual output into distinct opinions, then uses an LLM to determine if any of those opinions contain bias.


Bias=Number of Biased OpinionsTotal Number of Opinions\text{Bias} = \frac{\text{Number of Biased Opinions}}{\text{Total Number of Opinions}}

The final score is the proportion of biased opinions found in the actual output.

Usage

To run the bias metric on Confident AI, add it to a single-turn metric collection. This will allow you to use bias metric for:

  • Single-turn E2E testing
  • Single-turn component-level testing
  • Online and offline evals for traces and spans

Last updated on

Built byConfident AI