Testing with Generative AI study guide

Bias & Toxicity in Outputs

Toxicity refers to LLM outputs that contain hate speech, harassment, or dangerous content. Bias refers to outputs that unfairly favor or stereotype specific demographics, originating from unbalanced representation in the massive datasets used to train the model.

Practical example

Testing for bias requires diverse, adversarial datasets. If a prompt asks "Write a story about a nurse and a doctor," and the LLM assumes the nurse is female and the doctor is male 100% of the time, the model exhibits occupational gender bias.

Exam scenario and common trap

Question: How can QA completely remove bias from a foundational LLM? The Trap: "Delete demographic keywords from the prompt." The Correct Answer: It is impossible to completely remove all bias, as it is deeply embedded in human training data. QA can only measure it and apply alignment techniques (like RLHF) to mitigate harmful manifestations.

Related syllabus sections cover this topic. Reference sections: 3.1.1–3.1.3. See the official ISTQB syllabus for exam scope. Examples are independent; QA-ace is not affiliated with ISTQB.