Evaluating LLM Safety
Ensuring model outputs are safe is essential for production systems. This post outlines lightweight tests and metrics to evaluate safety properties.
Key dimensions
- Toxicity: Use automated classifiers and human review to detect offensive language.
- Privacy leakage: Test for extraction of sensitive or training-data-specific content.
- Instruction adherence: Confirm the model refuses or safely responds to disallowed instructions.
Testing approach
- Create adversarial prompt suites (edge cases, illicit instructions).
- Run automated detectors and filter obvious violations.
- Sample flagged outputs for human review and action.
Mitigations
- Prompt-level: add safety guardrails, explicit refusals, and role constraints.
- System-level: apply filters, moderation layers, and rate limits.
Regularly update tests and datasets as new risks surface.