Overview

LLM Chatbots are implemented on top of a single-speaker foundation. A new foundation modeled on two streams of tokens, one for each speaker, could allow the generation of more natural conversations, with both parties able to interrupt the other, pause, and react to pauses. This architecture may also support more interesting world models in the LLM.

Motivation

We want to train a full-duplex LLM, an LLM that models its own generated stream simultaneously with a stream of tokens from the user. In this arrangement, an LLM would not have to wait for the user to finish sending a chunk of tekt to the model before the model begins responding, and the user would not have to wait for the model to finish before they begin talking.

Full-duplex systems are not just more analogous to human natural dialogue, they also allow better modeling of human-computer interactions. For instance, when a human coder types the name of a variable and then pauses, their IDE can inform them of the class fields available to that object. The fields are presented in a menu that the human can navigate with arrow keys to make a choice. Modeling this interaction with tool calling would require the LLM to produce a program fragment, and then a tool call requesting the variable completions, and then to resume authoring code in a subsequent LLM inference with its context extended with the result of that tool call. The full-duplex interface achieves "multi-turn" interactions in a single call.

From the perspective of the AI researcher, we want to understand the impact of full-duplex training on the LLM's world model. Do the two separate streams encourage a different internal organization of thought than the current regime of fine tuning a turn-base script on top of largely "monologued" pretraining?

Lastly, we might anticipate that LLM interfaces will experience more pressure for low-latency responses in the future. Full-duplex communication may be required for efficiently communicating in settings where brief interruption and resumption are more efficient than letting each speaker's turn run to completion.

Status Quo (half-duplex)

Mainstream chatbots are half-duplex systems. They support communication in both directions but not at the same time. This is a result of both their training and their user interface.

Chatbots are first pretrained to generate monologues in a single token stream. They are then fine tuned to produce a "monologue" in the form of a script, with control characters indicating who is currently speaking.

This is a good match to their interface: a web UI with a text input, or a web API with a parameter for the user query. Each UI input or user query is marked as "<|user|>" by the interface, sent to the LLM, and appended to the context, followed by "<|assistant|>". The LLM then generates the tokens for the assistant, and returns this to the user.

The half-duplex system does not naturally allow both the assistant and the user to speak simultaneously, ruling out several modes of interaction found in natural conversation, as well as several forms of human-computer interaction. For example:

  • Interjection & interruption: These are second-class patterns in chatbots. They can only be implemented by short-circuiting the LLM's response and patching the token stream. The LLM itself is not signaled than an interruption has happened. Conversely there is no way for the LLM to interrupt the user.
  • Timed pausing: For an LLM, time stops between response and subsequent request. Tokens from the LLM can not come to the user un-prompted.

Prior Art

Tech Stack

How to Contribute

  1. Reach out by email ( imalsogreg@gmail.com ).
  2. Check out the GitHub repository.