InstructSpeech: Following Speech Editing Instructions via Large Language Models

Rongjie Huang, Ruofan Hu, Yongqi Wang, Zehan Wang, Xize Cheng, Ziyue Jiang, Zhenhui Ye, Dongchao Yang, Luping Liu, Peng Gao, Zhou Zhao

Introduction

Traditional speech editing systems are highly constrained. They typically only allow for predefined operations—like inserting or replacing specific words—and require the user to manually draw a mask or provide exact timestamps over the audio segment they want to change. Furthermore, these systems largely ignore the acoustic attributes of speech, such as emotion, pacing, volume, and style.

Ideally, a user should be able to simply tell a system what to do using natural language, such as "speed up the pronunciation" or "add the word 'hello' at the beginning." However, building an instruction-guided speech editor is incredibly difficult due to a massive scarcity of paired training data and the sheer complexity of getting a model to accurately locate and manipulate specific audio features without degrading overall sound quality.

InstructSpeech introduces the first large language model capable of editing both the semantic content and acoustic attributes of speech using free-form natural language instructions. By leveraging a novel multi-step reasoning approach and a custom synthetically generated dataset, the model eliminates the need for manual audio masking and achieves state-of-the-art results across diverse speech editing tasks.

Spectrograms demonstrating InstructSpeech modifying an input audio clip based on various natural language instructions.

Methodology

To overcome the hurdles of traditional speech editing, the authors frame the process as a sequence-to-sequence task and introduce several novel techniques:

  • Synthetic Triplet Data Generation: To solve the data scarcity problem, the authors combined a text-based LLM (GPT-3.5-Turbo) with various pre-trained speech generative models to automatically create a massive dataset of triplets: [instruction, input speech, output speech].
  • Multiscale Transformer Architecture: InstructSpeech operates on discrete speech tokens (using SoundStream for acoustics and Hubert for semantics) and text tokens. It utilizes a global transformer for long-range context and a local transformer for fine-grained patch prediction.
  • Learned Task Embeddings: To ensure the model faithfully follows the prompt, a fine-tuned Flan-T5-XL model reads the instruction, classifies the intended task, and feeds a "task embedding" to the main model to guide the generation process. This explicit task routing drastically reduces the chance of hallucinations (e.g., changing the volume when asked to change the speed).
  • Multi-Step Reasoning for Audio: For "free-form" semantic editing where no manual mask is provided, the model acts like it's using a chain-of-thought. It first recognizes the phonemes, predicts the frame-level alignment, and then edits the target region. This completely removes the friction of requiring users to provide exact audio timestamps.
  • Hierarchical Adapter: For few-shot adaptation to new tasks, the authors introduce an efficient fine-tuning method that updates only 1% of the model's parameters, specifically targeting cross-attention and bias/norm layers.

Datasets and Evaluation

The model was trained on a diverse mix of datasets, including LibriTTS, VCTK, ESD (for emotion), Librilight, LibriSpeech, and Audioset.

Because evaluating instruction-following in audio is highly subjective, the authors introduced Contrastive Instruction-Speech Pretraining (CISP). This newly trained metric, based on CLAP, measures the multimodal alignment between the text instruction and the resulting edited speech to ensure the model faithfully executed the prompt.

Key Results

InstructSpeech achieves state-of-the-art performance across 11 different speech editing and processing tasks, proving that synthetic data is a viable bridge for bootstrapping highly capable instruction-following audio models.

  • Semantic Editing: For region-based edits, the model achieved a Word Error Rate (WER) of just 5.6%. For the much harder free-form edits (no masks), it achieved a Phone Error Rate (PER) of 7.3%.
  • Acoustic Editing: The model demonstrated high accuracy in manipulating emotion (55.2% accuracy) and style (90.6% accuracy) while keeping the original semantic content intact.
  • Human Evaluation: In subjective listening tests, the 520M parameter model scored a high Mean Opinion Score (MOS) of 4.01 and a Similarity MOS (SMOS) of 3.95, outperforming baselines like EditSpeech and A3T in both naturalness and faithfulness.
  • Scaling: The architecture scales predictably. Increasing the model size from 160M (Base) to 520M (Medium) to 1.2B (Large) parameters consistently improved performance across all metrics.

Limitations and Future Work

While InstructSpeech represents a significant leap forward, several challenges remain:

  • Tokenizer Bottleneck: The model's output quality is heavily dependent on the quality of the underlying audio tokenizer (SoundStream/Hubert).
  • Open-Domain Generalization: While it handles the benchmark well, truly open-domain instruction editing—handling wild, out-of-distribution user prompts—remains a challenge.
  • Compute Constraints: Longer audio sequences require significantly more computational resources and can suffer from quality degradation if training data for long sequences is sparse.
  • Future Directions: Currently, speed editing is applied globally across the whole clip. Future iterations could support fine-grained, phoneme-level duration control.
  • Ethical Risks: The authors acknowledge the obvious risks of deepfakes and non-consensual voice cloning, suggesting that the community will need to train auxiliary classifiers to detect these synthetic edits.

Summary updated

BibTeX
@inproceedings{huang2024instructspeech,
  author = {Rongjie Huang and Ruofan Hu and Yongqi Wang and Zehan Wang and Xize Cheng and Ziyue Jiang and Zhenhui Ye and Dongchao Yang and Luping Liu and Peng Gao and Zhou Zhao},
  title = {{InstructSpeech: Following Speech Editing Instructions via Large Language Models}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=xlWcdtCyOC},
}
Figure