For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
GPT-Live

Evaluating GPT-Live

In this lesson, we’ll learn how to evaluate a GPT-Live application and measure whether changes to the model, prompt or backend improve its performance.

As we’ve seen, GPT-Live can listen and speak at the same time. It manages the conversation and decides when to delegate work to a backend. That gives us two axes for evaluation: conversation quality and task completion.

GPT-Live
Your backend
Conversation qualityDid the conversation feel natural?
Task completionDid the caller get what they asked for?

1. Conversation quality

Let’s start with the spoken conversation. We can use the metrics below to assess how responsive GPT-Live feels, how often it interrupts the caller and how much silence callers experience during delegation.

Responsiveness

Wait
Response rateRequests answered within a set time limit (for example, 5 seconds).
4 of 6
Response latencyAverage wait from the end of caller speech to those replies.
1.72 s

Conversation flow

Overlap
Interruption rateHow often GPT-Live began speaking over an eligible caller request.
1 of 6
Speaking durationTotal time GPT-Live spent speaking.
17.36 s6.94 s in one turn

Silence during delegation

Silence
Total silenceTime neither voice was speaking during backend work.
0.90 s
Longest pauseLongest uninterrupted stretch of that silence.
0.66 s

These measurements can point us to conversations worth reviewing, but we still need to listen to the audio to judge whether the pacing feels natural. We can add targeted checks for names, numbers or other details the application needs to recognize or say correctly.

2. Task completion

Next, let’s look at whether the application completed the caller’s request correctly. For the delivery agent from Lesson 7, we’ll want to check that the approved order was saved in the backend and that the caller received an accurate confirmation.

We can grade these checks in two ways:

  • Code-based evaluation: For some checks, we can use code to verify that the right tool ran or that the order was saved correctly in the backend.
  • LLM as a judge: For more subjective checks, we can use a separate model to review the transcript and assess whether GPT-Live understood the request, gave a helpful answer and used an appropriate tone.

Code-based evaluation

Was the order saved?
order_count1
order_status"confirmed"

LLM as a judge

Was the response helpful and appropriate in tone?
“You’re all set. It’ll arrive between 7 and 7:15 p.m. Thank you for ordering with us.”
Helpful Gives the delivery window
Tone Courteous and appropriate

Task completion rate

For each scenario, we specify which checks are required and consider the task successful when all required checks pass.

Because results can vary between runs, we recommend evaluating the same scenario multiple times. The task completion rate measures the percentage of valid attempts that pass. Here’s what that could look like for our delivery order example.

Example required checksAttempt 1Attempt 2Attempt 3
Code-based grader
One confirmed order was saved
No unauthorized actions were taken
LLM grader
The caller’s approval was recognized
67%2 of 3 completed

Secondary metrics

In addition to task completion, we can track secondary metrics to help us diagnose failures. We don’t use these scores to determine whether the task was completed, but they can help us understand which parts of the application need attention.

Delegation accuracy

Code-based

A 1 or 0 for whether the delegation decision followed the scenario’s policy.

Semantic quality

LLM as a judge

The average of applicable judge scores for understanding, context, clarification, grounded communication and coherence.

Tool accuracy

Code-based

How closely completed calls match the expected tools and arguments, including missing, extra or prohibited calls.

Cost and latency

Alongside quality, we’ll also want to measure cost and latency. Once we’ve met our quality threshold, these measurements can help us compare different approaches, including which backend model to use.

Cost

GPT-Live and the backend model are billed separately, so make sure to include both when measuring cost.

Latency

For latency, we can measure:

  • Response latency: How long it takes GPT-Live to start replying after the caller finishes speaking.
  • Task completion time: How long it takes the application to complete the request. For a delivery order, we could measure from the caller’s approval to the confirmed receipt.

As with task completion, response times can vary between runs, so we recommend evaluating each scenario multiple times. We can then sort the average response latency from each run from shortest to longest and calculate P50 and P90.

  • P50 is the median response time. It tells us what a typical wait looks like.
  • P90 is the 90th percentile. It helps us understand how long the wait can be for slower responses.

Scenarios to evaluate

Now let’s look at which scenarios to evaluate. We recommend starting with a small set that represents the different requests the application needs to handle.

Direct answer

A question GPT-Live can answer from the context it already has, without delegating or taking action.

Required action

A request that needs backend work. Check the required action, saved result and spoken confirmation.

Correction

A change to an earlier detail. The application should follow the caller’s latest instruction.

Missing information

A request with a required detail missing. GPT-Live should ask for it before proceeding.

Forbidden action

A request the application must not carry out. Verify that the prohibited action never happened.

Audio and conversation conditions

Conditions such as background speech, interruptions, hesitation or a poor connection that could affect the result.

For each scenario, decide what information the application should have and what a successful response would look like.

Build up complexity with Crawl, Walk, and Run

With the metrics and scenarios in place, let’s look at how we’ll run the tests. There’s a lot of complexity to account for, from different audio conditions to longer conversations. To make it easier to iterate, we’ll build up gradually using a Crawl, Walk and Run approach.

Crawl

Clean generated audioPlay one clean, generated request.

Walk

Realistic audioTry the same request with real voices or background noise.

Run

Multi-turn conversationEvaluate a full conversation with a simulated caller.

The GPT-Live evaluation cookbook goes into more detail on these metrics and includes a runnable evaluation harness for all three stages.

Crawl

Let’s start with Crawl. We can use text-to-speech models to make a clean recording of a request, then replay the same audio as we make changes to the application.

Written request“What delivery window did you say?”
Generated audio

The input stays consistent while we evaluate both task completion and the spoken response.

If the request depends on earlier conversation, we can supply that history as text in session.input and test just the new spoken request.

Step 1 of 2

When creating the session, include earlier user and assistant messages as text in session.input.

Your application

Browser

Server

session.input
  1. role: "user"When will the order arrive?
  2. role: "assistant"The verified delivery window is 7:00 to 7:15 p.m.
OpenAI

GPT-Live

Walk

Once those requests work reliably, we move to Walk. We keep the task the same but use recordings of real people. Now we can see whether the application still responds correctly across different accents and recording conditions.

If real recordings aren’t available, we can start with synthetic speech and add effects such as background noise or telephone compression.

These tests can also show whether the assistant asks for clarification when it can’t make out a required detail.

Run

In Run, we evaluate full conversations. This is where we can test whether the assistant remembers earlier details and responds appropriately when the caller corrects or interrupts it.

We do this with two GPT-Live sessions. One is the assistant we’re evaluating. The other plays the caller and has its own goal for the conversation. We connect their audio so each can hear and respond to the other.

Simulated callerGPT-Live
AssistantGPT-Live

Keep evaluating

As we iterate, we recommend making one change at a time and repeating the evaluation. We can keep the tests that already pass as a regression suite and rerun them after each change to make sure we haven’t broken something that was previously working.

Even after the application is in production, we’ll continue sampling real conversations. If we find a failure, we can reproduce it and add it to the evaluation set.

Try it yourself

Use the prompt below to evaluate the food delivery application from the previous lesson.

Evaluate the food delivery application
@OpenAI Developers, help me evaluate the food delivery application from Lesson 7 (https://developers.openai.com/api/training/gpt-live/7-client-delegation.md) using this evaluation lesson and the GPT-Live evaluation harness at https://github.com/openai/openai-cookbook/tree/main/examples/audio/duplex_voice_agent_evaluation. Review the application’s prompt and backend, create representative scenarios and graders, and help me run Crawl, Walk and Run. Measure conversation quality and task completion across repeated attempts, along with cost and latency. Summarize the results and suggest what to improve. Lesson 8: https://developers.openai.com/api/training/gpt-live/8-evaluating-gpt-live.md

And that’s a wrap on the GPT-Live training! We look forward to seeing what you build with it.