Introduction
Modern Text-to-Speech (TTS) systems have reached high levels of naturalness at the sentence level. however, they often struggle with long-form content like audiobooks or long narrations. When processing text sentence-by-sentence, these systems fail to maintain paragraph-level coherence, leading to abrupt shifts in emotion, speed, and voice quality—a phenomenon often described as "Frankenstein" audio.
Existing solutions typically involve feeding previous sentences as context prompts into a Large Language Model (LLM). This approach faces significant hurdles: the computational cost of the KV cache grows exponentially, long prompts can trigger model hallucinations, and it is difficult to balance immediate local context with long-term stylistic trends. This paper introduces a Context-Aware Memory (CAM) block designed to bring paragraph-level coherence to long-form speech synthesis while maintaining computational efficiency.
The Context-Aware Memory (CAM) Block
The core innovation is the CAM block, which manages historical context through a dynamic three-stage process: compression, retrieval, and updating. Instead of retaining raw historical data, the system uses a Perceiver Resampler to squash variable-length text into a fixed-length set of latent tokens. This ensures a predictable input size regardless of the history's length.
As shown in the inference flow, the model combines long-term memory with the most recent sentence to query relevant prosodic and stylistic cues. A learned gating mechanism, utilizing a sigmoid-weighted scalar, determines how much new information should be merged into the long-term memory for the next step. This allows the model to maintain a consistent "thread" of prosody across an entire chapter.
System Architecture and Prefix Masking
The proposed architecture integrates these memory blocks into a long-context text-to-token language model. The system utilizes separate memory streams for text (CAM-T) and speech (CAM-S). A key finding of the research was that speech-based memory embeddings are more effective than text-based ones for coherence, as they capture acoustic nuances like emotional lilts and pauses that text alone cannot represent.
To further stabilize the model, the authors introduced a Prefix Mask for the LLM. Unlike standard causal masks where tokens only look backward, the Prefix Mask allows memory and prompt tokens to interact bidirectionally. This enables the model to fully "digest" the context before beginning the unidirectional generation of speech tokens, significantly reducing the speech errors often seen in long-context models.
Experimental Results
The model was trained on over 15,000 hours of Mandarin audiobooks and evaluated on 100 complete chapters. The results demonstrate a clear advantage over state-of-the-art baselines:
- Naturalness and Coherence: The model achieved a Mean Opinion Score (MOS) of 3.796 and a Coherence MOS (CoMOS) of 3.992, significantly outperforming sentence-level baselines.
- Accuracy: It recorded the lowest Character Error Rate (4.140%), proving that the memory block helps the model remain faithful to the input text.
- Efficiency: By maintaining a fixed-length memory of 64 tokens, the system avoids the latency and memory issues associated with Retrieval-Augmented Generation (RAG) methods that often use prompts exceeding 900 tokens.
Conclusion and Future Work
By replacing raw historical prompts with a compressed, gated memory block, this research provides a scalable path for long-form TTS. While a gap remains between synthetic output and human narration (typically scoring ~4.4 MOS), the CAM architecture effectively addresses the "computational tax" of long-context retrieval. Future improvements may focus on higher-fidelity training data and refining the source separation process used to clean the massive audiobook datasets.
Summary updated