Full-Duplex Real-Time Voice Interaction: Architecture and Engineering Practices

    This article explains how real-time voice interaction evolved from cascaded pipelines to end-to-end speech models and finally to full-duplex systems that can listen and speak at the same time. It covers the core decision loop behind full-duplex behavior, layered task scheduling between a front-end voice model and stronger back-end models, key streaming pipeline concerns such as endpointing, echo cancellation and jitter buffering, tiered safety handling, and evaluation metrics that go beyond average latency.

    1. Why Voice Interaction Has Long Been Difficult

    For a long time, voice interaction was the weak point of conversational AI. The reason is that traditional implementations split a single spoken exchange into three serial stages: speech to text, text reasoning by a language model, and text to speech. This cascaded structure has two inherent flaws.

    The first is stacked latency. Each of the three modules needs buffering, decoding, and network round trips, so end-to-end delay is the sum of the per-stage costs. After the user stops speaking, there is a noticeable wait before any response is heard.

    The second is information loss. Converting speech to text discards paralinguistic information such as intonation, emotion, pauses, laughter, and background noise. The model only sees “clean” text, and the synthesized output lacks emotional depth, making the interaction feel mechanical and disjointed.

    The industry then moved to end-to-end unified modeling, using one model that takes audio in and produces audio out. This significantly compressed latency and preserved more acoustic detail. But early solutions still followed a turn-based convention: the system was either listening or speaking, and users could not naturally interject, backchannel, or change their minds mid-sentence.

    2. How Three Generations of Architecture Evolved

    The evolution of real-time voice interaction can be summarized in three generations.

    • First generation: cascaded pipeline. Speech recognition, text reasoning, and speech synthesis run in sequence. It is simple to engineer and reuses existing text capabilities, but latency is high and information loss is large.
    • Second generation: end-to-end speech models. A unified model replaces the pipeline, lowering latency and improving expressiveness, but interaction is still turn-based and lacks true concurrent awareness.
    • Third generation: full-duplex real-time speech models. The model has both input and output channels and can continuously process audio input and audio output at the same time, achieving “listen and speak simultaneously.”

    The key change in the third generation is not “faster” but turning interaction from “turns” into a “stream.” Instead of waiting for a complete sentence to finish before starting to think, the system makes high-frequency decisions continuously over the audio stream.

    3. Core Mechanisms of the Full-Duplex Architecture

    The essence of full duplex is concurrency. Each time a small chunk of audio arrives, the system must answer one question: what should be done right now. A typical decision set includes: keep listening, start speaking, stay silent, pause, accept an interruption, end the current output, and call an external tool.

    These decisions fire several times per second, so the engineering implementation usually adopts a sliding window plus incremental inference: the model maintains dialogue state and audio context, incrementally encodes newly arrived audio chunks, and emits a lightweight decision head rather than regenerating a full response every time.

    The decision loop can be understood schematically as follows:

    1. while session.active:
    2. audio_chunk = stream.read(frame_ms=20) # Continuously read input audio
    3. state.update(audio_chunk) # Incrementally update context
    4. action = policy.decide(state) # High-frequency decision: listen/speak/stop/interrupt/call tool
    5. if action.kind == "speak":
    6. for token in generator.stream(state):
    7. out_stream.write(vocoder(token)) # Generate and play at the same time
    8. elif action.kind == "interrupt":
    9. out_stream.flush() # Stop the current output immediately

    Two engineering points matter here. First, output must be generated as a stream and played as a stream; otherwise it cannot be stopped in time when the user interjects. Second, interruption handling must be lightweight enough that clearing the playback buffer is more reliable than renegotiating the session.

    4. Task Tiering and Back-End Coordination

    Real-time speech models aim for interaction fluency, while complex reasoning, web retrieval, and long-form generation demand more compute and more time. The reasonable approach is tiered scheduling: the front-end model maintains the dialogue rhythm and voice performance, delegates high-complexity tasks to a stronger back-end model, and brings the conclusion back into the conversation in natural spoken language once it is ready.

    This design brings three benefits: the conversation does not stall because of a single complex query; the front end can first give a short acknowledgment to confirm the request and reduce user anxiety; and back-end results can be filled in asynchronously, leaving room for retries on failure.

    Consistency needs attention: any commitment the front end makes to the user must align with the back-end result, otherwise the experience breaks with “it was promised but not delivered.” In practice, the front end usually only confirms and transitions, and does not state specific conclusions in advance.

    5. Key Design Decisions in the Streaming Pipeline

    Shipping a usable real-time voice system requires handling several problems on the pipeline beyond the model itself.

    1. Endpoint detection. Deciding whether the user has finished speaking requires combining silence duration, semantic completeness, and falling prosody signals; a single threshold tends to cut too early or lag.
    2. Echo and noise. When the device plays audio out loud, the system hears its own voice and must run echo cancellation, otherwise it interrupts itself in a loop.
    3. Jitter buffer. Network jitter requires an adaptive buffer: too small causes stutter, too large sacrifices responsiveness.
    4. Interruption recovery. After an interruption, context must be preserved so users can change their minds instead of starting over.
    5. Observability. Monitoring, alerting, and logging for first-token latency, interruption response latency, sentence-segmentation accuracy, and task delegation success rate are what make continuous optimization possible.

    6. Tiered Safety Handling

    The real-time nature of voice makes the traditional “generate first, review after” approach hard to apply, so safety checks need to be moved earlier and tiered. A common strategy takes different actions by risk level: at low risk, continue the conversation and guide it naturally; at medium risk, narrow the topic and decline to expand; at high risk, terminate the current output immediately or even end the session.

    Supporting measures include input-side risk recognition of spoken content, dual verification of both audio and text on the output side, and session-level state tracking against leading questions. All handling must complete within a few hundred milliseconds, which requires the safety model to be lightweight, or to run as a hybrid of rules and models.

    7. Evaluation and Optimization Recommendations

    Evaluating real-time voice capability cannot rely on average latency alone. Coverage should include at least these dimensions:

    • Responsiveness: tail percentiles of first-audio latency and interruption response latency;
    • Naturalness: win rate in human preference comparisons, and the degree of paralinguistic information preserved;
    • Task completion: completion rate and result consistency for tasks that need retrieval or reasoning;
    • Robustness: performance under noise, weak networks, and multiple speakers;
    • Safety: accuracy and false-positive rate of tiered handling.

    For optimization, reduce tail latency before the average, because user perception is determined by the worst experience; then improve the robustness of endpoint detection and interruption handling; and only then extend capability boundaries through back-end coordination.

    8. Working with General Cloud Capabilities

    Production environments usually need the real-time voice pipeline deployed on a container platform with elastic scaling, a message queue to carry asynchronous model callbacks, object storage to keep desensitized audio samples, and logging plus monitoring and alerting to close the loop. Baidu AI Cloud can support this kind of general capability for the architecture above, while the full-duplex design and scheduling strategy on the model side remain the core determinants of the experience.