Safety Evaluation of Large Language Models: Ten Engineering Practices for Design, Execution, and Reporting

    This article outlines ten practical engineering practices for conducting safety evaluations of large language models (LLMs). It covers the three key phases—design, execution, and reporting—with a focus on defining clear risk boundaries, building diverse test sets, calibrating automated scorers, handling statistical significance, preserving failure cases, and ensuring reproducible pipelines. The guidance emphasizes that rigorous process, not raw scores, is what makes evaluation results trustworthy for deployment decisions.

    Introduction

    Safety evaluation of large language models is an ongoing engineering task that must be performed both before and after deployment. The questions it answers are concrete: in which risk scenarios does the model produce inappropriate content, how often does this happen, and how does the result change when configuration is altered? If the evaluation process is sloppy, the resulting scores cannot guide decision-making and may even mislead the team. Below, we present ten actionable engineering practices, organized into three phases: design, execution, and reporting.

    Phase 1: Design

    1. Define Evaluation Objectives and Risk Boundaries Upfront

    Before starting any evaluation, the team needs to document three things. First, which risk category is being addressed—for example, fraud guidance, self-harm related conversations, or generation of policy-violating information. Second, in which usage scenario the risk may appear—such as a public-facing conversational application, an embedded enterprise assistant, or developers directly calling the model API. Third, what counts as an acceptable response. Without explicit judgment criteria, every reviewer will apply their own interpretation of “safe,” making results impossible to compare across evaluations. It is recommended to organize the objectives into a table, with each row containing the risk category, usage scenario, judgment criteria, and responsible person.

    2. Split Test Coverage by Risk Category

    A single overall score masks structural problems. A model may perform well on routine policy-violation requests, but that does not guarantee it remains stable when gradually induced during a multi-turn conversation. Test sets should be split by risk category, with each category reported separately. Multi-turn scenarios need their own design, because single-turn tests often fail to trigger the state drift that appears in long dialogues.

    3. Build a Diverse Test Set and Isolate Training Data

    Test samples should cover direct requests, paraphrased requests, role-playing, step-by-step decomposition, multiple languages, and colloquial expressions. If samples are taken from public corpora, it is necessary to check whether those samples already appear in the model’s training data; otherwise, scores will be inflated. In practice, a common approach is to split the test set into a public set and a private set. The private set is used only for evaluation immediately before release and is not shared externally, reducing the risk of overfitting.

    Phase 2: Execution

    4. Treat Product Configuration as an Experimental Variable

    The same model can perform very differently under different system prompts, tool permissions, and filtering policies. Suppose a model, when called directly through the API, achieves a 60% appropriate-response rate on self-harm related tests; after adding a carefully tuned system prompt, the rate rises to 94% on the same test set. This 34-percentage-point gap comes primarily from configuration changes, not from a change in the model’s intrinsic capability. Therefore, evaluation reports must record the model version, system prompt version, sampling parameters such as temperature, whether external tools are enabled, and the actual product form the user interacts with.

    5. Calibrate the Scorer with Human Annotations

    Many evaluations use another model as an automatic scorer. The scorer itself can make mistakes, especially on samples with ambiguous semantics or those requiring contextual understanding. A practical approach is to draw a subset of samples, have two or more human reviewers independently annotate them, and compute inter-annotator agreement. Then use these human-annotated results to measure the automatic scorer’s accuracy and its bias direction. If the scorer is systematically too lenient or too strict on a particular risk category, this should be noted in the report, and the scoring prompt should be improved.

    6. Use Sample Size and Significance to Judge Whether Differences Are Credible

    A common mistake in evaluation is treating random fluctuation as a real difference. Suppose two versions score 98% and 94% on a fraud-guidance test, a difference of only 4 percentage points. Using the common approximate formula for a two-proportion test, to identify such a difference at a 95% confidence level with 80% power, roughly 373 samples per group are needed. If each group contains only 50 samples, the 4-point difference falls almost entirely within the margin of error. Reports should include sample size, confidence intervals, and test conclusions, to avoid interpreting insignificant differences as improvement or regression.

    Sample code for estimating the required sample size:

    1. import math
    2. def required_sample_size(p1, p2, z_alpha=1.96, z_beta=0.84):
    3. """Estimate the required sample size per group for a two-proportion test (two-sided approximate formula)."""
    4. variance_sum = p1 * (1 - p1) + p2 * (1 - p2)
    5. diff = p1 - p2
    6. n = ((z_alpha + z_beta) ** 2) * variance_sum / (diff ** 2)
    7. return math.ceil(n)
    8. print(required_sample_size(0.98, 0.94)) # Outputs approximately 373

    7. Keep Failure Cases – Do Not Rely Only on Average Scores

    An average score does not tell the team where the problems are. Every evaluation should retain all failure samples and perform slice-and-dice analyses by risk category, language, and usage scenario. For failures with high severity, even if the rate is very low, a separate post-mortem should be written, describing the triggering conditions, the model’s actual behavior, and the mitigation measures to be taken.

    8. Build a Reproducible Evaluation Pipeline

    Evaluation results should be reproducible by others. The pipeline must fix the test set version, scoring prompt version, random seed (where applicable), and runtime environment. Each run should generate structured logs recording inputs, outputs, scoring results, and metadata. Early on, manually copying and pasting results may be acceptable, but it quickly becomes untrustworthy.

    Phase 3: Reporting

    9. Write Reports Using a Uniform Template

    A usable report should at minimum contain the following: the evaluation objective and scope, the composition of the test set, a full description of the tested configuration, the scoring method and its calibration results, the main conclusions, a summary of failure cases, and the boundaries of applicability. The conclusions should explicitly state “which scenarios these results apply to, and which scenarios they do not.” The reader should be able to judge from the report alone whether the numbers support the decision they need to make.

    10. When Comparing, Only Compare Results Under Identical Configurations

    Cross-configuration or cross-version comparisons are the most common source of erroneous conclusions. Differences between two report scores may be caused by a model change, but also by a change in system prompt, test set, or scorer. If a comparison is needed, keep all other variables unchanged and change only one factor at a time. When variables cannot be controlled, the report should explicitly state which results are not comparable.

    Continuous Operation

    Safety evaluation is not a one-time effort. Model updates, prompt adjustments, and new features can all change the risk distribution. It is recommended to integrate the core test set into the release pipeline, automatically running regression tests after every change. Meanwhile, new test samples should be added periodically to cover risks not included in the existing test set. With authorization and proper anonymization, online logs can also provide clues for new samples.

    Conclusion

    The value of safety evaluation for large language models depends on the rigor of the process. The score itself is only an output; what truly guides decision-making is a clear definition of risk, controlled experimental configurations, a calibrated scoring method, and an honest description of uncertainty. By adopting these ten practices into the team’s workflow, evaluation results can become a credible engineering basis for action.