A company is deploying a generative AI system that generates customer-facing emails. The system must ensure outputs are not toxic, biased, or harmful. Which TWO techniques are most effective for reducing toxicity in model outputs without significantly affecting performance?
RLHF fine-tuning adjusts the model's weights toward human-preferred, non-toxic responses, reducing harmful generations at the source. Because the change is learned rather than bolted on, it preserves general capability better than prompt-only or post-hoc filtering approaches.
Why this answer
Option C is correct because fine-tuning with RLHF directly aligns the model's behavior with human preferences for safe, non-toxic content, teaching it to avoid biased or harmful outputs at the model level without degrading overall generation quality. Option D is correct because a toxicity detection and filtering layer such as Vertex AI Safety Filters evaluates generated text against configurable harm categories and blocks or suppresses toxic outputs before they reach customers, adding a reliable guardrail. Option A is not effective because increasing max output tokens only changes length limits and can actually introduce more opportunities for harmful content.
Option B is not effective because a very low temperature reduces randomness but does not remove learned toxic patterns and can hurt creativity and diversity. Option E is not effective because 50 few-shot examples consume significant context, increase cost and latency, and provide only shallow, prompt-level guidance that is easily bypassed.
Exam trap
A common misconception is that simply adjusting generation parameters (like temperature or token count) or adding more examples can effectively control toxicity, when in fact these methods do not address the root cause of harmful patterns in the model's behavior.