Benchmarking — Unique AI Documentation

Benchmarking

Overview

The benchmarking service of Unique is designed to evaluate and ensure the quality of responses from language models and virtual assistants. It allows users to:

This tool is critical for organizations looking to optimize the effectiveness and reliability of their AI-powered solutions.

Generate your Benchmarking ground truth

If you have not created a benchmarking set with typical questions and expected answers yet, there are basically two ways of doing so. One, very intuitive way (see Option 1), is by prompting the questions directly into the chat interface and rate them with the feedback option. Another way (see Option 2) is to create the first answers with the benchmarking template in the benchmarking interface.

Option 1: Directly generate your benchmarking answers yourself

You can gather your benchmarking answers by prompting your questions directly in to single chat conversations and rate them

Step 1: Gather typical questions per space

Step 2: Pull Feedback and apply first improvements

Step 3: Enter the questions and answers in the benchmarking template

Option 2: Automatically generating benchmark answers

You can also automatically let the benchmarking create answers for you.

Step 1: Gather typical questions per space

Fill in the following columns:

Step 2: Upload the Excel File to the Benchmarking

Step 3: Download file with automatically generated answers and review and classify it

If the questions were completed you will see a green tag indicating “ready” next to the file.

Tip: Include negative examples in your benchmarking set enables you to compare the quality of answers over time. Example: with GPT-3.5 80% of the answers were correct (“yes”), and with GPT-4 used 90% of the answers were correct.

Compare Answers with Benchmark

Step 1: Upload benchmarking file

Step 2: Download the benchmarking file

Step 3: Review Flags within file (incl. column description)

It is recommended to FILTER the final_flag (column Z) for TRUE and manually evaluate how the new answers are different from the benchmark answers.

The columns with “flags” in their name perform an automated test using GPT to evaluate if the benchmark answer and the newly generated answer match.

Column Z (final_flag) is a summary of all the tests., meaning if a deviation was found in one of the tests (TRUE), the final flag will always be TRUE.

Explanation of the columns:

Step 4: Add manual evaluation flagged answers

We recommend you to add an additional column AB where you add the result of your review (human review). You can name it “human_review_answer_correct” and add a “yes” or “no” as answer. Similar to column D (correct_benchmark), you evaluate here if the new answers are correct or not.

For all the answers with final_flag=TRUE , it is recommended to manually review it and evaluate if the answer is different from the benchmark but still correct. If it is correct add a “yes” in the column “human_review_answer_correct”.

With the automated tests, we estimate a high probability for all the answers with the final_flag = FALSE to be correct and you could set all these columns to “yes” after reviewing some single samples.

This is the first version of the automated tests. Please report to us if you notice that some flags tend to have a lot of false positive results, meaning the result is TRUE but the answers are correct and comparable.

Definition of benchmark metrics/scores

The evaluation of whether a generated response is considered equivalent to the benchmark run is carried out by combining numerous metrics. Even if a single metric shows a possible anomaly, a possible deviation is signaled and noted for manual analysis. This section explains the different metrics in detail.

Embedding Comparison

This metric assesses the degree of similarity between the embeddings of the reference answer and the new benchmark answer. A high similarity score indicates substantial content overlap between the two answers. The threshold score for comparison is set at a value of 0.92. Should the similarity score fall below this threshold, it is deemed a considerable divergence between the new benchmark response and the reference answer. In this case, the system marks the result of this test as TRUE, otherwise as FALSE.

Contradiction Comparison

This metric evaluates the consistency between the reference response and the response from a new benchmark test by checking for contradictions. Both responses are submitted to a GPT model for analysis. If the model detects any contradictory statements between the two, it will return TRUE, indicating inconsistency. If no contradictions are found, it will return FALSE, confirming that the responses are consistent.

Extent Comparison

This metric is designed to evaluate the comprehensiveness and overlap of the two answers, the reference, and new benchmark run, in relation to the benchmark question. The reference answer is assumed to contain the expected information. The objective is to ascertain whether one of the answers addresses the question more thoroughly than the other. The outcome is binary (true/false): if either the new benchmark answer or the reference answer provides a more comprehensive response to the question, the metric is set to TRUE. In this case, the two answers do not provide a response to the user’s question to the same extent. Conversely, if both answers exhibit equal comprehensiveness in addressing the question, the response is FALSE.

Hallucination

The purpose of this metric is to determine if all information contained in the response is purely taken from the provided sources, meaning that the model is not hallucinating. A GPT-4o call evaluates whether the answer is (a) fully, (b) partially, or (c) not at all supported by the provided sources.

If the generated answer is only partially or not at all supported by the provided sources, this indicates hallucination, and the metric is set to TRUE, else to FALSE.

Reference (Source) Comparison

This metric compares the reference sources from the reference and the new answer. The purpose is to analyze if the same documents were taken to generate the answer, which indicates a consistent answer content. If all sources contained in the reference answer are also part of the new answer, this metric is FALSE, or else TRUE.

Module Comparison

If an assistant contains multiple modules, a module selector chooses the most suitable module for a user input. The choice of the module has a big impact of the answer structure and quality, as each module is optimized for a different use case (e.g. knowledge search or translation). Therefore it is crucial that the module choice is consistent for the same user input. This metric compares the chosen module for the reference and benchmark run. If there is an overlap, the metric is FALSE, else TRUE.

Final Flag

The final assessment of whether a generated response is considered equivalent to the benchmark run is made by combining all of the above metrics. Only if all metrics are marked asFALSE is the new response considered equivalent to the reference response. If at least one metric is TRUE, this response is marked as potentially deviating and must be analyzed manually.

Error Codes

Error Code Description
Benchmark_01 Skipping row because of missing data (question or assistant)
Benchmark_02 Benchmark object of BenchmarkEntry not found
Benchmark_03 Provided Assistant not found
Benchmark_04 User message (question) not found after creation of message.
Benchmark_05 Assistant message (answer) not found after creation of message or not marked as completed (External Modules)
Benchmark_06 Assistant message (answer) has no originalText for further processing
Benchmark_07 Error while doing the benchmark of an entry
Benchmark_08 Missing result of the comparison of a benchmark entry
correct_benchmark not set?
Benchmark_09 MessageCreate Failed - Could not create a new chat and send the message
Benchmark_10 Error while validating the results of a benchmark entry
Benchmark_98 Benchmarking: Run Aborted
Benchmark_99 General Error

Adopt benchmark set

After changing to a new version of prompts or LLMs for a space you shall also change your benchmarking set, as usually the answers were improved compared to the original benchmark set. Just create a new file and copy the column J-N from your last run to column E-I.