ContextSpeech: Expressive and Efficient Text-to-Speech for Paragraph Reading

Yujia Xiao, Shaofei Zhang, Xi Wang, Xu Tan, Lei He, Frank K. Soong, sheng zhao

Introduction

While modern Text-to-Speech (TTS) systems produce high-quality audio at the sentence level, they often stumble when tasked with reading entire paragraphs or audiobooks. Synthesizing sentences in isolation leads to "context blindness"—a lack of the natural prosodic flow, pitch, and rhythm that connects one sentence to the next. Furthermore, standard Transformer-based models rely on softmax self-attention, which incurs a quadratic computational cost. As input text lengthens, memory usage and latency explode. Finally, isolated sentence models often struggle with "extra-short" sentences (1-2 words), leading to distorted pronunciation, or "extra-long" sentences that cause alignment failures.

To address these challenges, researchers have developed ContextSpeech, a lightweight and efficient TTS system designed specifically for long-form paragraph reading. By combining a memory-cached recurrence mechanism with a hierarchical contextual encoder, ContextSpeech generates speech that is significantly more expressive and coherent than standard sentence-level models, while achieving massive speedups on long sequences.

Architectural Innovations

ContextSpeech introduces three key architectural enhancements to the standard ConformerTTS backbone to capture context and improve efficiency.

ContextSpeech Architecture Overview

1. Memory-Cached Recurrence

Inspired by Transformer-XL, ContextSpeech employs a memory-cached recurrence mechanism. The model caches the hidden states of the previous segment. When processing the current sentence, it reuses these cached states to provide historical context. This allows the model to "look back" without the computational burden of re-processing the entire past sequence, stabilizing the pronunciation of extra-short sentences by borrowing context from previous lines.

2. Hierarchical Text-based Contextual Encoder

To capture global semantics and ensure prosodic flow, the model uses a two-pronged hierarchical approach:

  • Token-level: It extracts BERT embeddings and statistical features (such as a token's position within a sentence) to maintain local precision.
  • Sentence-level: It utilizes a Gated Recurrent Unit (GRU) to process the BERT embeddings of all sentences in a paragraph. This creates a "Paragraph-level Contextual Representation" (PCR) that helps the model understand where a sentence sits within the broader narrative, dictating natural pauses and emphasis.

3. Linearized Self-Attention

To solve the efficiency bottleneck of long-form reading, the authors replace standard quadratic attention with a kernel-based Linearized Self-Attention, reducing computational complexity to $O(L)$. Because linearizing attention can sometimes degrade quality, they pair it with Permute-based Relative Position Encoding (RPE). This ensures the model retains a strong understanding of word order and positional relationships despite the simplified attention mechanism.

Key Insights and Results

The researchers trained and evaluated ContextSpeech on a 70-hour expressive Chinese male audiobook corpus. The evaluation included normal sentences, extra-short sentences (to test robustness), and paragraphs of increasing length (to test efficiency).

Superior Quality and Prosody

The core insight of ContextSpeech is that prosody is hierarchical. By feeding the model both local statistics and global paragraph embeddings, it learns narrative-level delivery.

Mean Opinion Score (MOS) Evaluation

In Mean Opinion Score (MOS) tests, ContextSpeech significantly outperformed the baseline. It reduced the "quality gap" between AI-generated speech and natural human recordings by 76%. Objective metrics also showed significantly higher correlations with human speech in terms of pitch, intensity, and pause duration.

Massive Efficiency Gains

ContextSpeech proves that efficiency doesn't have to sacrifice quality. On extra-long sequences (over 1,500 phonemes), ContextSpeech achieved a 10x speedup in inference latency compared to the baseline, which ran out of memory (OOM) on the same hardware. During the training phase, the model also achieved a 2x speedup and demonstrated twice the memory tolerance.

Limitations and Future Work

While highly effective, the current study is limited to a single-speaker Chinese audiobook dataset. Its performance on multi-speaker datasets or other languages remains an area for future validation. Additionally, because the system relies heavily on BERT embeddings, the quality of its contextual understanding is inherently capped by the capabilities of the underlying language model.

Future iterations may explore broader context windows and integrate explicit global features—such as emotion or style tags—to further enhance the narrative "acting" capabilities of the TTS system.

Summary updated

BibTeX
@inproceedings{xiao2023contextspeech,
  author = {Yujia Xiao and Shaofei Zhang and Xi Wang and Xu Tan and Lei He and Frank K. Soong and sheng zhao},
  title = {{ContextSpeech: Expressive and Efficient Text-to-Speech for Paragraph Reading}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=gaIMkuIFwCG},
}
Figure