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

Yujia Xiao, Shaofei Zhang, Xi Wang, Xu Tan, Lei He, Sheng Zhao, Frank K. Soong, Tan Lee · DOI

Abstract

While state-of-the-art Text-to-Speech (TTS) systems generate high-quality natural speech at the sentence level, they face significant challenges in paragraph and long-form reading. These deficiencies stem from the neglect of cross-sentence contextual information and high computational/memory costs associated with long sequences. This paper introduces ContextSpeech, a lightweight yet effective TTS system designed for paragraph-level synthesis. ContextSpeech utilizes a memory-cached recurrence mechanism to incorporate global context, a hierarchical textual encoder to broaden semantic scope, and linearized self-attention to ensure computational efficiency. Experimental results demonstrate that ContextSpeech significantly improves prosodic expressiveness and voice quality while achieving a 10x speedup over standard models for long-form content.

Introduction

Modern TTS systems have reached near-human quality for isolated sentences. However, when tasked with reading paragraphs, these systems often fail to maintain prosodic coherence. The research identifies three primary hurdles in long-form synthesis:

  1. Contextual Ignorance: Treating sentences in isolation leads to inconsistent emotional tones and unnatural pauses.
  2. Computational Bottlenecks: The quadratic complexity ($O(L^2)$) of standard Transformer self-attention causes significant latency and "Out of Memory" (OOM) errors during long-form generation.
  3. Length Sensitivity: Models often struggle with stability for extra-short sentences (lacking context) or extra-long sentences (alignment issues).

Proposed Method: ContextSpeech

ContextSpeech addresses these challenges by modifying the standard ConformerTTS backbone with three architectural innovations:

1. Memory-Cached Recurrence (MR)

Inspired by Transformer-XL, this mechanism caches the hidden states of previous segments. This allows the model to access historical information without re-processing the entire past sequence, effectively broadening the receptive field and ensuring a smooth prosodic flow across sentence boundaries.

2. Text-based Contextual Encoder (TCE)

To capture global semantics, ContextSpeech employs a hierarchical approach to text encoding:

  • Token-level: Integrates BERT embeddings with statistical features, such as the specific index of a word within a sentence or paragraph.
  • Sentence-level: A Gated Recurrent Unit (GRU) processes BERT embeddings across all sentences in a paragraph to create a Paragraph-level Contextual Representation (PCR).

3. Efficient Self-Attention (ESA)

To mitigate computational costs, the system replaces standard softmax-based attention with linearized self-attention. This reduces complexity to $O(L)$, enabling the synthesis of long sequences with minimal memory overhead. To maintain spatial awareness, the model incorporates permute-based Relative Position Encoding (RPE).

Experimental Results

Dataset and Setup

The model was evaluated using a high-quality Chinese audiobook corpus consisting of approximately 70 hours of expressive narration by a single male speaker (~35,000 sentences). Testing was conducted across three distinct sets: Set-A (standard length), Set-B (extra-short sentences), and Set-C (incremental lengths for efficiency testing).

Performance and Quality

  • Subjective Quality: ContextSpeech achieved a Mean Opinion Score (MOS) of 7.93/10, nearly matching the natural recording score of 7.99/10. It significantly outperformed baseline models in emotion, style matching, and prosody.
  • The "Short Sentence" Solution: One-word sentences, which are often muffled in baseline models, showed marked improvement in clarity. By utilizing paragraph-level context, ContextSpeech correctly determines the intended prosody for isolated words.
  • Efficiency: For long sequences (~1500 phones), ContextSpeech achieved a 10x speedup compared to the baseline. While standard models suffered OOM errors on very long sequences, ContextSpeech remained stable and low-latency.
  • MOS Gap Reduction: The system reduced the "MOS gap" (the quality difference between synthetic and natural speech) by 76% compared to the baseline.

Conclusion

ContextSpeech demonstrates that incorporating hierarchical context and linearized attention can solve the dual challenges of quality and efficiency in paragraph-level TTS. While currently focused on a single-speaker Chinese corpus, the architecture provides a robust framework for future multi-speaker and multi-lingual long-form synthesis. Future work may explore dynamic context windowing and the integration of end-to-end waveform generation to further refine the system.

Summary updated

BibTeX
@inproceedings{xiao2023contextspeech,
  author = {Yujia Xiao and Shaofei Zhang and Xi Wang and Xu Tan and Lei He and Sheng Zhao and Frank K. Soong and Tan Lee},
  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