DuplexPO
Decoupling Conversational Dynamics in Full-Duplex Spoken Models through Reinforcement Learning (NeurIPS 2026)
Paper · Demo page · Algorithm notes · Adapter guide
DuplexPO teaches a full-duplex spoken dialogue model when to speak without changing what it says: RL over short dynamics-critical windows of real human conversation, scored by the Factorized Conversational Dynamics Reward (FCDR), with a KL anchor to the instruction-tuned SFT model. The model's turn-taking, backchanneling, and barge-in handling improve while QA, instruction-following, and reasoning benchmarks are maintained.
This repository is the reference implementation of the data construction, reward, and event-level GRPO objective from the paper. The package is framework-neutral and covers:
- constructing dynamics-critical events (windows) from aligned full-duplex dialogue (Fisher-style word alignments, Seamless-style utterances, or any source with the same shape);
- scoring arbitrary policy rollouts with the FCDR reward and turning them into event-grouped GRPO training records (advantages, loss mask, KL reference).
It runs on the Python standard library alone (PyTorch is needed only for the
optional torch_batch_loss helper) and works with any speech-token vocabulary,
trainer, or runtime.
What this repository provides
- transcript canonicalization adapters and the Fisher / Seamless construction profiles, with the exact thresholds used for the paper;
- dynamics-critical window construction and deterministic selection;
- the FCDR reward with two token decoders;
- event-grouped advantages and the reference GRPO loss (
torch_batch_loss); - a machine-readable recipe (
recipes/paper_v1.json) with content hashes; - conformance checks and hashed example outputs for validating outside adapters.
The paper checkpoint was trained with the NeMo Toolkit on top of the
Nemotron-VoiceChat recipe (Qwen2.5-7B-Instruct backbone, Parakeet encoder,
CosyVoice2 codec) on licensed Fisher / Seamless Interaction data. Any policy
trained in that stack or another one plugs in through Rollout /
TraceDecoder; docs/ADAPTER_GUIDE.md walks through the integration.
Stable boundary
canonical Conversation
-> transcript construction
selected Window (one GRPO group per conversational event)
-> any policy/runtime
Rollout -> pluggable TraceDecoder -> ActionTrace
-> factorized conversational-dynamics reward
GRPORecord {window, group_id, reward, advantage, action_ids, loss_mask, ref_logprobs}
-> any trainer backend
The schemas under src/duplexpo_portable/schemas/ are the public compatibility
boundary. Framework adapters are deliberately thin and disposable.
Install
pip install duplexpo
This installs the duplexpo_portable package and the duplexpo command.
Python 3.9+ and no third-party dependencies. For the development version:
git clone https://github.com/LiYuxin44/DuplexPO_official.git
cd DuplexPO_official
pip install -e .
Quick start
Run the complete synthetic example (window construction, FCDR scoring, GRPO records, and conformance checks) from a clone of this repository:
duplexpo construct \
--profile fisher \
--input examples/conversations.jsonl \
--output /tmp/duplexpo-windows.jsonl \
--audit-output /tmp/duplexpo-audit.jsonl \
--segments-output /tmp/duplexpo-segments.jsonl
duplexpo prepare \
--windows /tmp/duplexpo-windows.jsonl \
--rollouts examples/rollouts.jsonl \
--output /tmp/duplexpo-grpo.jsonl
duplexpo conformance \
--windows /tmp/duplexpo-windows.jsonl \
--rollouts examples/rollouts.jsonl \
--records /tmp/duplexpo-grpo.jsonl
Without installing, PYTHONPATH=src python -m duplexpo_portable.cli is a
drop-in replacement for duplexpo. The window, audit, and GRPO-record outputs
match examples/expected/ byte for byte (examples/README.md).
--segments-output holds the user/agent segments the reward is defined on;
render the teacher-forced prefix of each window from it (see
docs/ADAPTER_GUIDE.md).
For token-based models, emit one action_ids entry per sampled frame instead
of trace and add --bos-ids 1 --eos-id 2 --pad-id 0 (explicit speech BOS) or
--silence-ids 0 --eos-id 2 (no BOS: speech starts at the first non-silence
token). For a different action language, implement one method:
class MyTraceDecoder:
def decode(self, rollout, window):
return ActionTrace(speech=(SpeechInterval(start_s=..., end_s=...),))
Then call prepare_grpo_update(...). The policy and trainer never need to
share internal classes with this package.
Paper recipe represented here
- 80 ms frame grid;
- 1.0 s training lead and 2.0 s post-event buffer;
- at most three eligible full turns and one backchannel per conversation;
- four rollouts per selected event (the caller controls generation count);
- per-event population mean/std reward normalization, epsilon
1e-8, clipped to[-5, 5]; - sampled-token-only policy gradient;
- Schulman KL estimator against frozen SFT reference logprobs with beta
0.2(behavior logprobs only by explicit opt-in); - the reported FCDR reward (onset Gaussian, backchannel plateau, 0.75 no-stop scale);
- training setup (full-parameter, 64 x A800, lr 1e-5, conversation-level
batches) recorded in
recipes/paper_v1.jsonundertraining.
See docs/ALGORITHM.md for equations and fidelity notes.
Repository map
src/duplexpo_portable/construction.py: Fisher/Seamless construction profiles, leak-safe splitting, quality audit, and balanced mixing.src/duplexpo_portable/backchannel_lexicon.py: paper-time English 1--5 gram taxonomy.src/duplexpo_portable/windows.py: critical-window construction and selection.src/duplexpo_portable/rewards.py: token-neutral FCDR and two token decoders.src/duplexpo_portable/grpo.py: grouped advantages and reference loss.src/duplexpo_portable/recipes/paper_v1.json: wheel-bundled, machine-readable recipe.src/duplexpo_portable/conformance.py: executable checks for outside adapters.src/duplexpo_portable/adapters/: generic, TRL, verl, and NeMo RL bridges.src/duplexpo_portable/schemas/: JSON Schema compatibility contracts.examples/: synthetic inputs plus hashed, byte-for-byte conformance outputs.tests/: dependency-free unit and end-to-end tests (PYTHONPATH=src python -m unittest discover -s tests).docs/:ALGORITHM.md(windows, reward, loss, training setup),DATA_CONSTRUCTION.md,PROTOCOL.md,ADAPTER_GUIDE.md.
Data
Dataset adapters (adapters/datasets.py) canonicalize licensed Fisher and
Seamless Interaction transcripts into Conversation records. Audio paths or
tensors travel through metadata; the construction and GRPO protocol operate on
timing metadata only, so the pipeline runs on transcripts alone.
Citation
@article{li2026duplexpo,
title = {Decoupling Conversational Dynamics in Full-Duplex Spoken Models through Reinforcement Learning},
author = {Li, Yuxin and Wu, Donghang and Lin, Guan-Ting and Lee, Hung-yi and Qin, Chengwei and Chen, Zhehuai and Chen, Chen},
journal = {arXiv preprint arXiv:2607.07148},
year = {2026}
}
License
The code in this repository is released under the MIT License. Datasets, model checkpoints, and third-party model code retain their original licenses.
Metadata
Release files for duplexpo 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| duplexpo-0.1.0.tar.gz | 62.1 kB | With provenance | Details for duplexpo-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| duplexpo-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for duplexpo-0.1.0-py3-none-any.whl |
Total release size: 112.2 kB
Release files / duplexpo-0.1.0.tar.gz
| Download URL | duplexpo-0.1.0.tar.gz |
|---|---|
| Size | 62.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dcead30947c1c5c1084a3a59a38fda1a707f6a766fff447d5367bf3229a2b43a
|
|
BLAKE2b-256 checksum How to use checksums |
521d005e2f0c83d2cb7059e532e3c0814ceb2dc1285bc13fe5ac88343f671317
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logRelease files / duplexpo-0.1.0-py3-none-any.whl
| Download URL | duplexpo-0.1.0-py3-none-any.whl |
|---|---|
| Size | 50.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
560edd541e8234043b5774541101a0572d63af4e13773b80546f181da0e22955
|
|
BLAKE2b-256 checksum How to use checksums |
43167fce34e9fb2d57eeeff183d2017577695b6136d485bee2d97343cdcd6173
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logSecurity for duplexpo 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for duplexpo-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.