Guide to Multi-Turn Dialogue Evaluationο
Introduction to Multi-Turn Dialogueο
Multi-turn dialogue refers to an interactive conversation format between users and the service backend involving multiple exchanges. Unlike single-turn dialogue (where a user asks one question and the system provides one answer), multi-turn dialogue consists of multiple rounds, with each round relying on the content of previous conversations. This dialogue format more closely resembles natural human communication.
Introduction to Evaluation Capabilitiesο
Currently, service-based performance evaluation for multi-turn dialogue data is supported. The compatibility of different service backends and datasets is as follows:
Supported Service Backendsο
β vLLM
β MindIE Service
β SGLang
Supported Datasetsο
β ShareGPT
β MTBench
Quick Startο
Usage Notesο
β οΈ For the SGLang service backend, you need to change the client in the API configuration file to
OpenAIChatStreamSglangClient.π The number of rounds is counted as the actual number of requests (e.g., 2 dialogue groups with 7 total rounds will result in performance metrics for 7 requests in the evaluation results).
Command Explanationο
Take the performance evaluation scenario of ShareGPT multi-turn dialogue on the vLLM service v1/chat interface stream infer backend as an example:
ais_bench --models vllm_api_stream_chat --datasets sharegpt_gen --debug -m perf
Where:
--models: Specifies the model task, i.e., thevllm_api_stream_chatmodel task.--datasets: Specifies the dataset task, i.e., thesharegpt_gendataset task.
Preparations Before Running the Commandο
1. For --modelsο
To use the vllm_api_stream_chat model task, you need to prepare an inference service that supports the /v1/chat/completions sub-service. Refer to π Start an OpenAI-Compatible Server with vLLM to launch the inference service.
2. For --datasetsο
To use the sharegpt_gen dataset task, you need to prepare the ShareGPT dataset by following the instructions in π ShareGPT Dataset.
Modifying Configuration Files for Corresponding Tasksο
Each model task, dataset task, and result presentation task corresponds to a configuration file. These files must be modified before running the command. To find the paths of these configuration files, add --search to the original AISBench command. For example:
# Note: Adding "--mode perf" to the search command does not affect the search results
ais_bench --models vllm_api_stream_chat --datasets sharegpt_gen --mode perf --search
β οΈ Note: Executing the command with
--searchwill print the absolute paths of the configuration files corresponding to the tasks.
The query result will look like this:
06/28 11:52:25 - AISBench - INFO - Searching configs...
ββββββββββββββββ€ββββββββββββββββββββββββββββββββββββββββ€βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Task Type β Task Name β Config File Path β
ββββββββββββββββͺββββββββββββββββββββββββββββββββββββββββͺβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ‘
β --models β vllm_api_stream_chat β /your_workspace/benchmark/ais_bench/benchmark/configs/models/vllm_api/vllm_api_stream_chat.py β
ββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β --datasets β sharegpt_gen β /your_workspace/benchmark/ais_bench/benchmark/configs/datasets/sharegpt/sharegpt_gen.py β
ββββββββββββββββ§ββββββββββββββββββββββββββββββββββββββββ§βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Key Notes on Configuration Filesο
The dataset task configuration file
sharegpt_gen.pyin this quick start requires no additional modifications. For an introduction to dataset task configuration files, refer to π Open-Source Datasets.The model configuration file
vllm_api_stream_chat.pycontains settings related to model operation and must be modified according to your actual environment. Critical fields to modify are annotated in the code below:
from ais_bench.benchmark.models import VLLMCustomAPIChat
from ais_bench.benchmark.utils.postprocess.model_postprocessors import extract_non_reasoning_content
models = [
dict(
attr="service",
type=VLLMCustomAPIChat,
abbr='vllm-api-chat-stream',
path="", # Specify the absolute path to the model's serialized vocabulary file (usually the model weight folder path)
model="", # Specify the name of the model loaded on the server (configure based on the actual model pulled by the vLLM inference service)
stream=True, # stream infer mode
request_rate=0, # Request sending frequency: 1 request is sent to the server every 1/request_rate seconds. If < 0.1, all requests are sent at once.
retry=2,
api_key="", # Customize api_key, which is empty by default
host_ip="localhost", # Specify the IP address of the inference service
host_port=8080, # Specify the port of the inference service
url="", # Customize url, which is empty by default
max_out_len=512, # Maximum number of tokens output by the inference service
batch_size=1, # Maximum concurrency for sending requests
trust_remote_code=False,
generation_kwargs=dict(
temperature=0.01,
ignore_eos=False
),
pred_postprocessor=dict(type=extract_non_reasoning_content),
)
]
Executing the Commandο
After modifying the configuration files, run the following command to start the service-based performance evaluation (β οΈ It is recommended to add --debug for the first execution to print detailed logs, which helps troubleshoot errors during inference service requests):
# Add --debug to the command line
ais_bench --models vllm_api_stream_chat --datasets sharegpt_gen -m perf --debug
Viewing Performance Resultsο
Example of Printed Performance Resultsο
06/05 20:22:24 - AISBench - INFO - Performance Results of task: vllm-api-chat-stream/sharegptdataset:
ββββββββββββββββββββββββββββ€ββββββββββ€βββββββββββββββββββ€βββββββββββββββββββ€βββββββββββββββββββ€βββββββββββββββββββ€βββββββββββββββββββ€βββββββββββββββββββ€βββββββββββββββββββ€βββββββ
β Performance Parameters β Stage β Average β Min β Max β Median β P75 β P90 β P99 β N β
ββββββββββββββββββββββββββββͺββββββββββͺβββββββββββββββββββͺβββββββββββββββββββͺβββββββββββββββββββͺβββββββββββββββββββͺβββββββββββββββββββͺβββββββββββββββββββͺβββββββββββββββββββͺβββββββ‘
β E2EL β total β 2048.2945 ms β 1729.7498 ms β 3450.96 ms β 2491.8789 ms β 2750.85 ms β 3184.9186 ms β 3424.4354 ms β 8 β
ββββββββββββββββββββββββββββΌββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββ€
β TTFT β total β 50.332 ms β 50.6244 ms β 52.0585 ms β 50.3237 ms β 50.5872 ms β 50.7566 ms β 50.0551 ms β 8 β
ββββββββββββββββββββββββββββΌββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββ€
β TPOT β total β 10.6965 ms β 10.061 ms β 10.8805 ms β 10.7495 ms β 10.7818 ms β 10.808 ms β 10.8582 ms β 8 β
ββββββββββββββββββββββββββββΌββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββ€
β ITL β total β 10.6965 ms β 7.3583 ms β 13.7707 ms β 10.7513 ms β 10.8009 ms β 10.8358 ms β 10.9322 ms β 8 β
ββββββββββββββββββββββββββββΌββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββ€
β InputTokens β total β 1512.5 β 1481.0 β 1566.0 β 1511.5 β 1520.25 β 1536.6 β 1563.06 β 8 β
ββββββββββββββββββββββββββββΌββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββ€
β OutputTokens β total β 287.375 β 200.0 β 407.0 β 280.0 β 322.75 β 374.8 β 403.78 β 8 β
ββββββββββββββββββββββββββββΌββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββββββββββββββΌβββββββ€
β OutputTokenThroughput β total β 115.9216 token/s β 107.6555 token/s β 116.5352 token/s β 117.6448 token/s β 118.2426 token/s β 118.3765 token/s β 118.6388 token/s β 8 β
ββββββββββββββββββββββββββββ§ββββββββββ§βββββββββββββββββββ§βββββββββββββββββββ§βββββββββββββββββββ§βββββββββββββββββββ§βββββββββββββββββββ§βββββββββββββββββββ§βββββββββββββββββββ§βββββββ
ββββββββββββββββββββββββββββ€ββββββββββ€βββββββββββββββββββββ
β Common Metric β Stage β Value β
ββββββββββββββββββββββββββββͺββββββββββͺβββββββββββββββββββββ‘
β Benchmark Duration β total β 19897.8505 ms β
ββββββββββββββββββββββββββββΌββββββββββΌβββββββββββββββββββββ€
β Total Requests β total β 8 β
ββββββββββββββββββββββββββββΌββββββββββΌβββββββββββββββββββββ€
β Failed Requests β total β 0 β
ββββββββββββββββββββββββββββΌββββββββββΌβββββββββββββββββββββ€
β Success Requests β total β 8 β
ββββββββββββββββββββββββββββΌββββββββββΌβββββββββββββββββββββ€
β Concurrency β total β 0.9972 β
ββββββββββββββββββββββββββββΌββββββββββΌβββββββββββββββββββββ€
β Max Concurrency β total β 1 β
ββββββββββββββββββββββββββββΌββββββββββΌβββββββββββββββββββββ€
β Request Throughput β total β 0.4021 req/s β
ββββββββββββββββββββββββββββΌββββββββββΌβββββββββββββββββββββ€
β Total Input Tokens β total β 12100 β
ββββββββββββββββββββββββββββΌββββββββββΌβββββββββββββββββββββ€
β Prefill Token Throughput β total β 17014.3123 token/s β
ββββββββββββββββββββββββββββΌββββββββββΌβββββββββββββββββββββ€
β Total generated tokens β total β 2299 β
ββββββββββββββββββββββββββββΌββββββββββΌβββββββββββββββββββββ€
β Input Token Throughput β total β 608.7438 token/s β
ββββββββββββββββββββββββββββΌββββββββββΌβββββββββββββββββββββ€
β Output Token Throughput β total β 115.7835 token/s β
ββββββββββββββββββββββββββββΌββββββββββΌβββββββββββββββββββββ€
β Total Token Throughput β total β 723.5273 token/s β
ββββββββββββββββββββββββββββ§ββββββββββ§βββββββββββββββββββββ
π‘ For the meaning of specific performance parameters, refer to π Explanation of Performance Evaluation Results.
Viewing Detailed Performance Dataο
After executing the AISBench command, detailed task execution data is saved to a default output path. The output path is indicated in the printed logs during runtime. For example:
06/28 15:13:26 - AISBench - INFO - Current exp folder: outputs/default/20250628_151326
This log indicates that detailed task data is stored in outputs/default/20250628_151326 (relative to the directory where the command was executed).
Implement via Custom Config Filesο
π‘ The above multi-turn dialogue performance evaluation scenario can also be implemented through the Custom Config File Method. The configuration file is essentially a Python script that supports all Python syntax such as loops, conditional judgments, list comprehensions, etc. You can write models, datasets, summarizer, and other configurations into a single file, write once and reuse multiple times. See the βMulti-Turn Dialogue Performance Evaluationβ example in Running AISBench with Custom Config Files.
Viewing Detailed Performance Dataο
20250628_151326 # Unique directory generated for each experiment based on timestamp
βββ configs # Auto-saved dump of all configuration files
βββ logs # Runtime logs (no log files are saved if --debug is added to the command, as logs are printed directly to the terminal)
β βββ performance/ # Logs from the inference phase
βββ performance # Performance evaluation results
βββ vllm-api-chat-stream/ # Name of the "service-based model configuration" (corresponds to the `abbr` parameter in the model task configuration file)
βββ sharegptdataset.csv # Per-request performance output (CSV), matching the "Performance Parameters" table in the printed results
βββ sharegptdataset.json # End-to-end performance output (JSON), matching the "Common Metric" table in the printed results
βββ sharegptdataset_details.h5 # Full-granularity ITL data (Inter-Token Latency)
βββ sharegptdataset_details.json # Full detailed metrics
βββ sharegptdataset_plot.html # Request concurrency visualization report (HTML)
π‘ The sharegptdataset_plot.html report (a request concurrency visualization) is recommended to be opened in browsers such as Chrome or Edge. It shows the latency of each request and the number of concurrent service requests perceived by the client at each moment.
β οΈ Note: In multi-turn dialogue scenarios, the upper chart connects multiple requests in each dialogue group into a single line. Therefore, the vertical axis represents the index of multi-turn dialogue data groups (not concurrency).

For instructions on how to view the charts in the specific HTML file, please refer to π Guide to Using Performance Test Visualization Concurrent Charts