--- license: apache-2.0 base_model: Qwen/Qwen3-Omni-30B-A3B-Instruct base_model_relation: finetune library_name: transformers pipeline_tag: audio-classification tags: - audio - turn-taking - end-of-turn-detection - interruption-detection - lora - ms-swift - custom-inference datasets: - ASLP-lab/Easy-Turn-Trainset - pipecat-ai/smart-turn-data-v3.2-train --- # Turn-Detection-S1 ### Audio turn completion, interruptions, and backchannels **Fine-tuned Qwen3-Omni-30B-A3B-Instruct · Five semantic actions / seven state labels · Apache-2.0** [Model weights](https://huggingface.co/Beagledata/Turn-Detection-S1) · [Quick start](#quick-start) · [License](LICENSE) **Language:** English | [中文](README_zh.md) Turn-Detection-S1 predicts when a speech assistant should consider responding, waiting, or handling a user interruption. It takes audio and the application's current assistant playback state, then scores the labels available in that state. It is fine-tuned from [Qwen3-Omni-30B-A3B-Instruct](https://huggingface.co/Qwen/Qwen3-Omni-30B-A3B-Instruct). ## Contents - [Core features](#core-features) - [Labels](#labels) - [Benchmark results](#benchmark-results) - [Metric comparison](#metric-comparison) - [Client request latency](#client-request-latency) - [Quick start](#quick-start) - [Training and evaluation](#training-and-evaluation) - [Limitations](#limitations) - [License and acknowledgements](#license-and-acknowledgements) - [Source code and feedback](#source-code-and-feedback) ## Core features | Capability | Description | | --- | --- | | Turn completion | Distinguishes finished speech, incomplete speech, and background when the assistant is silent | | Interruption and backchannel | Distinguishes completed interruptions, brief feedback, unfinished speech, and background during playback | | State-conditioned scoring | Uses three listening labels or four speaking labels according to caller-supplied playback state | | Single-forward prediction | Uses Qwen3-Omni-30B-A3B-Instruct audio understanding and reads candidate answer-token logits in one forward pass, without generating explanations | | Application integration | The runtime in `eval/` provides CLI inference and an HTTP API returning labels and probabilities | | Open weights | Apache-2.0, retaining attribution to the Qwen3-Omni-30B-A3B-Instruct base model | ## Labels | Assistant playback | Output label | Meaning | Illustrative example (not an observed prediction) | | --- | --- | --- | --- | | Off | `listen_complete` | The user has finished and yielded the floor | “Check tomorrow's weather in Beijing.” | | Off | `listen_incomplete` | The user is still speaking or holding the floor | “I'd like to ask about, um…” | | Off | `listen_background` | Background unrelated to the target interaction | Ambient noise, bystanders, or playback echo | | On | `speak_interrupt` | A completed request to stop, correct, or take the floor | “Stop a moment. I meant tomorrow.” | | On | `speak_backchannel` | Finished brief feedback without requesting the floor | “Mm-hmm, right.” | | On | `speak_incomplete` | The user has started but not finished an utterance | “Wait, what I wanted was…” | | On | `speak_background` | Background unrelated to the target interaction | Ambient noise, bystanders, or playback echo | The application must provide the real `assistant_speaking` state. The same words can express different intentions in context; these examples are illustrations, not measured model predictions. ## Benchmark results ### Public evaluation sets Turn-Detection-S1 scores come from the complete native Transformers run `merged-20261111_051726-1672084` on 2026-11-11, using temperature T=1 with calibration disabled. Other models retain their historical results. | Dataset | Samples | Correct | Accuracy | Semantic Macro-F1 | | --- | ---: | ---: | ---: | ---: | | Easy-Turn | 800 | 789 | **98.625%** | **99.00%** | | Smart-Test-4000 | 4,000 | 3,871 | **96.775%** | **96.81%** | **Evaluation conditions:** These are **state-conditioned single-window** results. Playback state was constructed using label rules and sample-ID hashes. Input audio was mono 16 kHz PCM16, retaining at most the final 8 seconds. Macro averages cover ground-truth-supported labels only. Easy-Turn covers five state labels and Smart-Test three; neither has background ground truth. ### Comparison on shared samples The main comparison uses original semantic labels: listen_complete→complete; listen_incomplete/speak_incomplete→incomplete; speak_interrupt→wait; speak_backchannel→backchannel; both background labels→invalid. Only labels are merged; predictions are retained, and options are not renormalized based on ground truth. ## Metric comparison | Dataset | Model | N | Accuracy | Macro precision | Macro recall | Macro-F1 | | --- | --- | --- | --- | --- | --- | --- | | easyturn | TurnSense 1.1 GPU | 600 | 96.17% | 96.19% | 96.17% | 96.17% | | easyturn | Smart-Turn 3.2 CPU | 600 | 76.00% | 78.21% | 76.00% | 75.52% | | easyturn | Smart-Turn 3.2 GPU | 600 | 77.17% | 78.26% | 77.17% | 76.94% | | easyturn | Qwen3-Omni-30B-A3B-Instruct | 600 | 92.33% | 93.40% | 92.33% | 92.53% | | easyturn | Turn-Detection-S1 | 600 | 98.17% | 98.33% | 98.17% | 98.25% | | smart-test | TurnSense 1.1 GPU | 4000 | 26.28% | 75.97% | 26.28% | 38.86% | | smart-test | Smart-Turn 3.2 CPU | 4000 | 92.50% | 92.59% | 92.50% | 92.50% | | smart-test | Smart-Turn 3.2 GPU | 4000 | 93.88% | 93.89% | 93.88% | 93.87% | | smart-test | Qwen3-Omni-30B-A3B-Instruct | 4000 | 69.40% | 80.43% | 69.40% | 66.35% | | smart-test | Turn-Detection-S1 | 4000 | 96.78% | 96.87% | 96.78% | 96.81% | ![Metrics on shared evaluation samples](image/01_metric_comparison.png) Accuracy is computed over all shared samples. Precision, recall, and F1 are equally averaged over the two ground-truth target classes, complete and incomplete. Predictions outside those targets remain errors and are not renormalized. Turn-Detection-S1 received constructed assistant-state metadata that the other audio models did not receive. Services and execution environments also differ. These figures compare the current S1 run with historical baselines; they are not a controlled comparison with identical information. The TurnSense figures here come from our evaluation, not its official model card. ### Client request latency | Dataset | Model | N | Mean ms | P50 ms | P90 ms | Serial samples/s | | --- | --- | --- | --- | --- | --- | --- | | easyturn | TurnSense 1.1 GPU | 600 | 638.60 | 648.29 | 657.59 | 1.57 | | easyturn | Smart-Turn 3.2 CPU | 600 | 64.91 | 47.66 | 54.51 | 15.41 | | easyturn | Smart-Turn 3.2 GPU | 600 | 5.36 | 4.18 | 5.26 | 186.68 | | easyturn | Qwen3-Omni-30B-A3B-Instruct | 600 | 222.09 | 226.87 | 247.68 | 4.50 | | easyturn | Turn-Detection-S1 | 600 | 120.38 | 94.68 | 160.56 | 8.31 | | smart-test | TurnSense 1.1 GPU | 4000 | 543.53 | 649.01 | 659.98 | 1.84 | | smart-test | Smart-Turn 3.2 CPU | 4000 | 165.56 | 192.63 | 296.12 | 6.04 | | smart-test | Smart-Turn 3.2 GPU | 4000 | 4.07 | 3.42 | 4.63 | 245.65 | | smart-test | Qwen3-Omni-30B-A3B-Instruct | 4000 | 229.76 | 221.62 | 275.89 | 4.35 | | smart-test | Turn-Detection-S1 | 4000 | 97.50 | 96.29 | 110.90 | 10.26 | ![Client request latency and serial throughput](image/02_latency_comparison.png) Turn-Detection-S1 latency comes from the native Transformers run above and includes local audio reading/decoding, preprocessing and inference. First-call overhead is retained; independent GPU kernel time was not measured. Other models retain historical timing. The chart uses logarithmic axes. Historical ONNX runs used warmup=20 and remote runs warmup=0. ONNX timing includes mixing, resampling, features and inference; remote timing additionally includes encoding, HTTP, queueing and parsing. Both historical paths exclude file reading/decoding, whereas this Jev run includes it. Hardware, models and execution environments also differ, so this is not a controlled speed ranking. Table samples/s equals N × 1000 / cumulative per-sample latency; it is neither whole-run wall-clock throughput nor concurrent capacity. Independent `gpu_latency_ms` and `inference_latency_ms` were not recorded in this run. ## Quick start This Hugging Face repository contains model artifacts and documentation at its root. Inference, serving, evaluation tools, and test-set instructions are included in `eval/`. Run the commands below from `eval/`. Download the repository from Hugging Face, including the code in `eval/` (test WAV files are prepared separately): ```bash hf download Beagledata/Turn-Detection-S1 --local-dir Turn-Detection-S1 cd Turn-Detection-S1 cd eval ``` ### 1. Install dependencies Activate an isolated Python >= 3.10 environment and install CUDA-enabled PyTorch suitable for the server first. From `eval/`, run: ```bash bash scripts/01_install.sh ``` Alternatively, run the equivalent commands directly (choose either the script or these commands): ```bash python -m pip install -e '.[datasets]' ``` This runs `python -m pip install -e '.[datasets]'` and prints the PyTorch version and CUDA availability. Dependencies are declared in `pyproject.toml`; the datasets extra installs PyArrow for raw Parquet conversion in step 2; merged weights do not require the PEFT/adapter extra. Confirm `CUDA available: True` before continuing. All three scripts use the current environment's `python`, falling back to `python3`, or an explicit `PYTHON=/absolute/path/to/python`. Use the same environment for all steps. ### 2. Convert and validate the original test sets Before step 2, keep this layout in the code repository when using default paths: ```text Turn-Detection-S1/eval/ ├── datasets/ │ ├── README.md # Dataset instructions; recommended │ ├── Easy-Turn-Testset/ # Complete original Easy-Turn test set │ ├── smart-turn-data-v3.2-test/ # Complete original Smart-Turn v3.2 test set │ ├── easyturn/ # Documentation/licenses copied during export │ │ ├── LICENSE │ │ ├── README.md │ │ └── SOURCE_README.md │ ├── smart-test-4000/ # Documentation/licenses copied during export │ │ ├── LICENSE │ │ ├── README.md │ │ └── SOURCE_README.md │ └── v3-public/ # Generated by step 2; do not create an empty directory │ ├── easyturn/ # audio/, test.jsonl, summary.json, docs/licenses │ └── smart-test-4000/ # audio/, test.jsonl, summary.json, docs/licenses └── results/ └── reference/ # Frozen IDs, labels, states and audio hashes ├── easyturn.predictions.jsonl └── smart-test-4000.predictions.jsonl ``` Keep the original upstream layouts and audio. See the code repository's `datasets/README.md` for required lists and Parquet shards. Old `audio/`, `test.jsonl` and `summary.json` files directly under `datasets/easyturn/` and `datasets/smart-test-4000/` are not inputs to the current steps 2 and 3 and do not need uploading; retain the three documentation/license files shown in each directory. Step 3 reads the generated `datasets/v3-public/`; keep its audio, manifests and accompanying files together. Step 2 validates and reuses a complete existing export without requiring the original datasets. Rebuilding requires the originals, documentation/licenses and `results/reference/` again. Keep the remaining source code and configuration files as usual. With the default layout above, run: ```bash bash scripts/02_validate_data.sh ``` Use the original datasets on the evaluation server (paths may contain spaces): ```bash EASYTURN_DIR=/path/to/Easy-Turn-Testset \ SMART_TEST_DIR=/path/to/smart-turn-data-v3.2-test \ bash scripts/02_validate_data.sh ``` Without these variables, sources default to `datasets/Easy-Turn-Testset` and `datasets/smart-turn-data-v3.2-test` inside this project. The default input is the full original Smart-Turn v3.2 test snapshot; conversion selects the frozen historical 4000 IDs. You can also point `SMART_TEST_DIR` to an existing 4000-row raw Parquet subset. Step 2 converts to `datasets/v3-public/` and validates paths, SHA256 hashes, audio format and label/state consistency for **800** Easy-Turn and **4000** Smart-Test samples. Audio is mono 16 kHz PCM16 WAV, keeping at most the last 8 seconds. No model is loaded and sources are unchanged. Later runs fully validate and reuse existing output. Damaged or incomplete output causes an error; use a new `DATASETS_DIR` to rebuild. Git excludes `datasets/**/audio/`. Convert from the originals on the server without uploading a local audio export. Step 2 does not download the originals automatically. To change the output directory, set the same `DATASETS_DIR` for steps 2 and 3: ```bash EASYTURN_DIR=/path/to/Easy-Turn-Testset \ SMART_TEST_DIR=/path/to/smart-turn-data-v3.2-test \ DATASETS_DIR=datasets/v3-public-new bash scripts/02_validate_data.sh DATASETS_DIR=datasets/v3-public-new bash scripts/03_evaluate.sh # model: ../; data and results: inside eval/ ``` Equivalent direct commands (choose either these or the script): ```bash python scripts/prepare_v3_testsets.py \ --easyturn /path/to/Easy-Turn-Testset \ --smart-test /path/to/smart-turn-data-v3.2-test \ --output datasets/v3-public --reuse-existing python evaluate.py --manifest datasets/v3-public/easyturn/test.jsonl --validate-only python evaluate.py --manifest datasets/v3-public/smart-test-4000/test.jsonl --validate-only ``` ### 3. Evaluate merged weights Place the full model merged from the original `checkpoint-1100` (or the full model downloaded from this HF repository) at the repository root (`../` when running from `eval/`). Include `config.json`, all weight shards and their index, processor/tokenizer files and the original `scoring_head.json`. Do not leave an adapter's `adapter_config.json` in this directory: it selects the adapter loading path. ```bash bash scripts/03_evaluate.sh # Optional: specify a model directory and a new output directory. # Relative paths are resolved from eval/. The default model directory is .. . bash scripts/03_evaluate.sh models/Turn-Detection-S1 results/runs/merged-check ``` Alternatively, run the equivalent commands directly (choose either the script or these commands): ```bash RUN_OUTPUT="results/runs/merged-$(date +%Y%m%d_%H%M%S)-$$" python evaluate.py --model .. \ --device cuda:0 --dtype bfloat16 --attn-implementation sdpa \ --calibration ../calibration.json \ --manifest datasets/v3-public/easyturn/test.jsonl --out "$RUN_OUTPUT/easyturn" \ --manifest datasets/v3-public/smart-test-4000/test.jsonl --out "$RUN_OUTPUT/smart-test-4000" ``` By default this reads the converted data from `datasets/v3-public/` validated in step 2. This starts one `evaluate.py` process, loads the model once and sequentially evaluates all 800 Easy-Turn and 4000 Smart-Test samples, without `--limit`. It uses native Transformers/PyTorch, one GPU (`cuda:0`), BF16, SDPA and temperature calibration from `../calibration.json`. No HTTP server, vLLM, separate base-model download or LoRA weights are needed. Select another GPU with `DEVICE=cuda:1 bash scripts/03_evaluate.sh`; the selected GPU must have enough memory for inference. The script now loads `../calibration.json` by default: listening uses `choice:3` (T≈1.01754) and speaking uses `choice:4` (T≈1.37385). The report records `provenance.calibration_enabled=true`. To select another file: ```bash CALIBRATION=/path/to/calibration.json bash scripts/03_evaluate.sh /path/to/model ``` The published 2026-11-11 scores above came from a run with calibration disabled and have not been replaced with a calibrated rerun. Use this command to match that T=1 setting: ```bash CALIBRATION=none bash scripts/03_evaluate.sh /path/to/model ``` Temperature scaling adjusts probabilities and confidence. Positive temperature preserves label ordering mathematically and does not guarantee an improvement in Accuracy/F1. Each run defaults to a new `results/runs/merged-TIMESTAMP-PID/` directory with per-dataset `predictions.jsonl` and `report.json` files. Inspect `classification.accuracy`, `classification.macro_f1`, `semantic.macro_f1` and `is_full_run=true`. The main benchmark table reports semantic Macro-F1. A specified output directory must not already exist; scripts stop on errors. These are single-window results conditioned on constructed `assistant_speaking` state. Published S1 scores now use the complete native Transformers run above; historical ms-swift results remain in the code repository under `results/reference/`. ### Download and run one sample (optional) After the weights are published, the runtime accepts this model's Hub ID and downloads it on first use: ```bash python infer.py --model Beagledata/Turn-Detection-S1 \ --audio example.wav --assistant-speaking false python infer.py --model Beagledata/Turn-Detection-S1 \ --audio example.wav --assistant-speaking true ``` Alternatively, download the files first: ```bash hf download Beagledata/Turn-Detection-S1 --local-dir models/Turn-Detection-S1 python infer.py --model models/Turn-Detection-S1 \ --audio example.wav --assistant-speaking false ``` The default temperature is T=1. To enable the accompanying calibration, add `--calibration models/Turn-Detection-S1/calibration.json`. Merged weights do not require `--base-model`. Predictions are returned in `answers.turn.choice` and `probabilities`. This task uses custom candidate scoring; the generic `pipeline("audio-classification")` is not a drop-in replacement. ### HTTP service (optional) ```bash python serve.py --model Beagledata/Turn-Detection-S1 --host 127.0.0.1 --port 8000 ``` The service exposes `/health`, `/v1/models`, and `/v1/systemone`. See the [evaluation guide](https://huggingface.co/Beagledata/Turn-Detection-S1/blob/main/eval/README.md) for API requests and the [test-set directory](https://huggingface.co/Beagledata/Turn-Detection-S1/tree/main/eval/datasets) for the 4,800-sample benchmark and evaluation tools. ## Training and evaluation The model was fine-tuned with LoRA rank 32, alpha 64, learning rate 5e-5, and a three-epoch budget. The processed pool contains 156,925 samples from Easy-Turn, Smart-Turn and MUSAN noise, with 141,232 assigned to training. On the separate internal test set of 3,923 samples, accuracy was 97.04% and seven-label Macro-F1 was 97.87%. See [EVALUATION.md](EVALUATION.md) for data distributions, label recalls, experiment provenance and timing boundaries. ## Limitations - Public sets do not assess background recall. Smart-Test's speaking group contains incomplete speech only, so its 99.90% accuracy does not establish interruption/backchannel discrimination. - Performance is conditional on correct external playback state. These results do not establish streaming event latency or robustness to deployment devices, echo, noise and accents. - This release requires a Qwen3-Omni-30B-A3B-Instruct GPU environment. CPU, ONNX and quantized deployments have not been benchmarked. ## License and acknowledgements Fine-tuned weights are released under [Apache License 2.0](LICENSE), permitting no-charge research, personal and commercial use, modification and redistribution subject to its terms. The base model was developed and released by the Qwen team: [Qwen3-Omni-30B-A3B-Instruct](https://huggingface.co/Qwen/Qwen3-Omni-30B-A3B-Instruct). Its official model page declares Apache-2.0; the official license text is available in [Qwen3-Omni/LICENSE](https://github.com/QwenLM/Qwen3-Omni/blob/main/LICENSE). Base-model attribution and fine-tuning modifications are recorded in [NOTICE](NOTICE). Thanks to Qwen, ms-swift, OmniJev/OneJev, Easy-Turn, Smart-Turn and MUSAN. Datasets and dependencies retain their own licenses. This independent derivative is not endorsed by the upstream authors. ## Source code and feedback [Source code](https://huggingface.co/Beagledata/Turn-Detection-S1/tree/main/eval) · [Hugging Face Discussions](https://huggingface.co/Beagledata/Turn-Detection-S1/discussions)