5月14日凌晨,OpenAI推出了最新的生成模型GPT-4o,带来了一系列震撼的功能,用技术彻底颠覆了产品形态。产品最大的亮点在于:以近乎完美的交互方式,为每位用户带来GPT-4级别的智能体验。在语音方面,GPT-4o做到了实时低延迟,平均响应时间与人类反应速度相当,输出的语音能够理解极度贴合对话上下文,能够理解人类的情感情绪,听觉质量上佳,与真人无异。
-
语音如何离散化? -
如何让LLM理解语音的token?加入语音token之后,LLM在语音数据的理解上是否具有涌现性? -
LLM如何合成/解码语音?
语义token: 用MLM建模语音的上下文依赖



声学token:压缩+离散

语音的统一表征?

语音的其他表征:MEL依旧有用!
AudioLM:最初的SLM


AudioPaLM[9]:整合LLM

SALMONN[10]:让LLM理解语音

SpeechGPT/SpeechGPT-
Gen/SpeechAlign:向LLM的训练方法看齐



-
要想让LLM输出上下文连贯的高表现力语音,必须要让LLM看到语义token和声学token,只有语义token,那语音就会显得呆板机械,只有声学token,那语音就不知所云;
-
LLM的指令微调同样可以迁移到语音-文本多模态领域中,LLM的指令微调同样可以带来如同NLP一样的涌现性;
-
高质量指令微调数据集的构建应该是最大的瓶颈!一下子让LLM同时做语音理解和语音生成,难度非常大。不如分步进行。
-
如果要分步进行的话,要先实现一个类似于SALMONN[10]那样的多模态理解模型和一个强大的Zero-shot TTS模型。前者用于给语音数据打上丰富的标签,可以是情感情绪、韵律、音高、语速,也可以是口音、意图和说话环境;后者则用于生成高质量的语音数据。毕竟,高质量的、文本和语音严格对齐的TTS数据实在是太少了,尤其是中文领域。有了这两个模型的加持,我们其实就能够构造出高质量的指令微调数据集。我不知道OpenAI是否有SALMONN这样的模型,但OpenAI的OpenVoice模型应该足够为其提供高质量的语音数据了。
Zero-shot TTS
前面说到,SLM词表中包含了语音的语义token和声学token。语义token保证生成语音与对话上下文的连贯性,声学token保证了合成语音的质量和表现力。要想做到合成上下文连贯的高自然度语音,有两个问题必须要解决:
-
语音既有语义token,又有声学token,应该要如何解码成语音?
-
SLM在合成语音的过程中是否能够遵循多轮对话中的文本指令和语音指令?这个很重要!这允许模型根据用户的即时要求来生成语音回复。比如说,OpenAI演示视频中出现的:“将语速提高两倍”、“采用更加机械化的语气”这样的要求。
Zero-shot TTS












TTS对指令的遵循


TTS总结
-
在LLM大行其道、scaling law大显神威的时代,TTS模型的训练数据规模已经突破了万小时,甚至达到了数十万小时的级别。在大数据的加持下,TTS任务上也涌现出了in-context learning能力。
-
语音信息的解码通常都要层次化或者多步进行,不能一步到位。自回归、扩散模型和流匹配都能在TTS中发挥作用;
-
借鉴NLP instruction fine-tuning和文生图的经验,TTS模型同样可以遵循文本指令或者语音指令,合成符合用户即时要求的语音,摆脱对参考音频的依赖,这或许也能规避一些知识产权的困扰(比如最近有名的寡姐投诉OpenAI事件)。同时,用户也能在对话过程中随时切换语音回复的风格,这一点在OpenAI的demo中有很明确的体现。另外,不知道大家有没有注意,GPT-4o合成的语音是可以是放映所处的声学环境的:有一段语音背后似乎是有钢琴声的。
-
text-guided zero-shot TTS在模型架构上和zero-shot TTS有非常大的相似性。但训练数据可能较为缺乏。先开发zero-shot TTS,再用类似SALMONN那样的多模态理解模型来打标签(类似DALLE3的做法),这样数据集构造方式,可能会是更好的选择。
-
如果要做流式推理,外接类似HIFIGAN这样的声码器的方式可能不是好的选择。HIFIGAN并不天然支持流式解码。相反地,诸如SoundStream和Encodec这样的方法,同时有流式变体和非流式变体;
-
先做语义token的解码,这个解码大概率是自回归解码。语义token毕竟是建模上下文依赖关系,自回归方法已经在NLP上证明了这一点;
-
然后做声学token的解码,扩散或者flow-matching可能是更好的选择。扩散模型或者流匹配可以很好地修补语音的细节;
-
语音交互如何做到低延迟?大概率要求流式切片处理,主要工作在于工程优化,用C++重写算子。推理框架的话,用tensorrt、mnn这些都行。上下文所述的音频离散化方法,诸如SoundStream和Encodec,其实也支持流式处理。
-
语音对话中的打断如何实现?个人认为有两种可能的方案:turn-based和流式处理。所谓的turn-based方案,是比较工程化的,简答概括一下就是:检测是否有停顿,如果一段时间内没有声音,模型就开始返回语音回复。另一种流式方案,则是:模型一直在接受用户的流式语音输入,判断是否应该输出语音回复,一个充分训练的模型应该是能够准确预测出语音词表中的[START]和[END]的。
-
用自然语言提示去合成音色稳定的语音,摆脱对参考音频的依赖,在业务中能够更加灵活,至少比克隆已有人物/角色的语音的方式更加方便,更不容易出戏。举个例子,在开放世界剧情类游戏的研发阶段,我们会设定一些profile赋予NPC,让玩家跟NPC聊天。我们曾经用克隆《原神》、《崩坏:星穹铁道》已有角色的方式赋予这些NPC角色语音,但放在那些欧美背景的NPC中,就是很有违和感,没有现实世界中的accent,不够decent。
-
剧情任务中的配音会更加真人化、更有沉浸感。过年期间过《崩坏:星穹铁道》花火和黑天鹅的同行任务的时候,部分NPC角色会有六公主的翻译腔,这是花火行于欢愉命途的恶趣味,空气中顿时充满了快活的味道。如果走bv2、gsv的语音克隆方案,应该是很难有这种效果的。而且,玩家在剧情任务中势必会经过不同的地势地貌,至少室内、室外的声音听起来是有不同的。室内的声音至少会有回响、混响的吧。这种感觉语音克隆方案也是无法做到的。

-
audio & text tokenizer的实现应该是语音离散化部分所用的技术,例如SoundStream、Encodec、SpeechTokenizer,或者是MEL+VQ最后配合声码器来解码;参考zero-shot TTS、AudioLM/AudioPaLM、SpeechGPT-Gen等工作的结果,LLM中语音token的解码应该是要走层次化或者多步的方法,先解码语义特征,再解码声学特征,或者是先解码MEL,再加一个HIFIGAN这样的声码器。另外,如果做audio/speech/music这样的通用声合成的话,可能也能通过prompt来控制。AudioLDM2虽然做了这方面的工作,但audio/music和speech的参数其实是不一样的,说到底还不是同一个模型。
-
对于指令微调,数据集的构造非常重要,大概率要用到合成数据。其一,网络上高质量语音数据的量级远远不及文本,直接拿ASR数据来做肯定会影响模型合成语音的音质;其二,大语言模型合成的instruction往往触及不到语音的细粒度特征,这样的instruction其实无法准确详尽地描述text和speech之间的关系。因而,需要引入强大的zero-shot TTS模型合成高质量语音,然后用多模态语音理解模型来为合成语音打标签,当然也可以评分做筛选什么的。
-
最后是要让大模型的输出对齐人类的偏好。这方面的方法有很多,有DPO、PPO什么的,都可以用。

[1] Baevski A, Zhou Y, Mohamed A, et al. wav2vec 2.0: A framework for self-supervised learning of speech representations[J]. Advances in neural information processing systems, 2020, 33: 12449-12460.
[2] Hsu W N, Bolte B, Tsai Y H H, et al. Hubert: Self-supervised speech representation learning by masked prediction of hidden units[J]. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 2021, 29: 3451-3460.
[3] Chung Y A, Zhang Y, Han W, et al. W2v-bert: Combining contrastive learning and masked language modeling for self-supervised speech pre-training[C]//2021 IEEE Automatic Speech Recognition and Understanding Workshop (ASRU). IEEE, 2021: 244-250.
[4] Van Den Oord A, Vinyals O. Neural discrete representation learning[J]. Advances in neural information processing systems, 2017, 30.
[5] Zeghidour N, Luebs A, Omran A, et al. Soundstream: An end-to-end neural audio codec[J]. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 2021, 30: 495-507.
[6] Défossez A, Copet J, Synnaeve G, et al. High fidelity neural audio compression[J]. arXiv preprint arXiv:2210.13438, 2022.
[7] Zhang X, Zhang D, Li S, et al. Speechtokenizer: Unified speech tokenizer for speech large language models[J]. arXiv preprint arXiv:2308.16692, 2023.
[8] Borsos Z, Marinier R, Vincent D, et al. Audiolm: a language modeling approach to audio generation[J]. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 2023.
[9] Rubenstein P K, Asawaroengchai C, Nguyen D D, et al. Audiopalm: A large language model that can speak and listen[J]. arXiv preprint arXiv:2306.12925, 2023.
[10] Changli Tang, Wenyi Yu, Guangzhi Sun, Xianzhao Chen, Tian Tan, Wei Li, Lu Lu, Zejun Ma, Chao Zhang. SALMONN: Towards Generic Hearing Abilities for Large Language Models
[11] Zhang D, Li S, Zhang X, et al. Speechgpt: Empowering large language models with intrinsic cross-modal conversational abilities[J]. arXiv preprint arXiv:2305.11000, 2023.
[12] Zhang D, Zhang X, Zhan J, et al. SpeechGPT-Gen: Scaling Chain-of-Information Speech Generation[J]. arXiv preprint arXiv:2401.13527, 2024.
[13] Zhang D, Li Z, Li S, et al. SpeechAlign: Aligning Speech Generation to Human Preferences[J]. arXiv preprint arXiv:2404.05600, 2024.
[14] Chen Q, Chu Y, Gao Z, et al. Lauragpt: Listen, attend, understand, and regenerate audio with gpt[J]. arXiv preprint arXiv:2310.04673, 2023.
[15] Wu S, Fei H, Qu L, et al. Next-gpt: Any-to-any multimodal llm[J]. arXiv preprint arXiv:2309.05519, 2023.
[16] Wang C, Chen S, Wu Y, et al. Neural codec language models are zero-shot text to speech synthesizers[J]. arXiv preprint arXiv:2301.02111, 2023.
[17] Anil R, Dai A M, Firat O, et al. Palm 2 technical report[J]. arXiv preprint arXiv:2305.10403, 2023.
[18] Lee Y, Yeon I, Nam J, et al. VoiceLDM: Text-to-Speech with Environmental Context[C]//ICASSP 2024-2024 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP). IEEE, 2024: 12566-12571.
[19] Lyth D, King S. Natural language guidance of high-fidelity text-to-speech with synthetic annotations[J]. arXiv preprint arXiv:2402.01912, 2024.
[20] Betker J. Better speech synthesis through scaling[J]. arXiv preprint arXiv:2305.07243, 2023.
[21] Xin D, Tan X, Shen K, et al. RALL-E: Robust Codec Language Modeling with Chain-of-Thought Prompting for Text-to-Speech Synthesis[J]. arXiv preprint arXiv:2404.03204, 2024.
[22] Wang C, Zeng C, Zhang B, et al. HAM-TTS: Hierarchical Acoustic Modeling for Token-Based Zero-Shot Text-to-Speech with Model and Data Scaling[J]. arXiv preprint arXiv:2403.05989, 2024.
[23] Ren Y, Hu C, Tan X, et al. Fastspeech 2: Fast and high-quality end-to-end text to speech[J]. arXiv preprint arXiv:2006.04558, 2020.
[24] Rombach R, Blattmann A, Lorenz D, et al. High-resolution image synthesis with latent diffusion models[C]//Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. 2022: 10684-10695.
[25] Shen K, Ju Z, Tan X, et al. Naturalspeech 2: Latent diffusion models are natural and zero-shot speech and singing synthesizers[J]. arXiv preprint arXiv:2304.09116, 2023.
[26] Ju Z, Wang Y, Shen K, et al. NaturalSpeech 3: Zero-shot speech synthesis with factorized codec and diffusion models[J]. arXiv preprint arXiv:2403.03100, 2024.
[27] Liu H, Tian Q, Yuan Y, et al. AudioLDM 2: Learning holistic audio generation with self-supervised pretraining[J]. arXiv preprint arXiv:2308.05734, 2023.
[28] Jiang Z, Ren Y, Ye Z, et al. Mega-tts: Zero-shot text-to-speech at scale with intrinsic inductive bias[J]. arXiv preprint arXiv:2306.03509, 2023.
[29] Jiang Z, Liu J, Ren Y, et al. Mega-tts 2: Zero-shot text-to-speech with arbitrary length speech prompts[J]. arXiv preprint arXiv:2307.07218, 2023.
[30] Łajszczak M, Cámbara G, Li Y, et al. BASE TTS: Lessons from building a billion-parameter text-to-speech model on 100K hours of data[J]. arXiv preprint arXiv:2402.08093, 2024.
[31] Li Y A, Han C, Mesgarani N. Styletts: A style-based generative model for natural and diverse text-to-speech synthesis[J]. arXiv preprint arXiv:2205.15439, 2022.
[32] Li Y A, Han C, Raghavan V, et al. Styletts 2: Towards human-level text-to-speech through style diffusion and adversarial training with large speech language models[J]. Advances in Neural Information Processing Systems, 2024, 36.
[33] Guo Z, Leng Y, Wu Y, et al. Prompttts: Controllable text-to-speech with text descriptions[C]//ICASSP 2023-2023 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP). IEEE, 2023: 1-5.
[34] Yang D, Liu S, Huang R, et al. Instructtts: Modelling expressive TTS in discrete latent space with natural language style prompt[J]. arXiv preprint arXiv:2301.13662, 2023.
[35] Vyas A, Shi B, Le M, et al. Audiobox: Unified audio generation with natural language prompts[J]. arXiv preprint arXiv:2312.15821, 2023.
[36] Lee S H, Choi H Y, Kim S B, et al. HierSpeech++: Bridging the Gap between Semantic and Acoustic Representation of Speech by Hierarchical Variational Inference for Zero-shot Speech Synthesis[J]. arXiv preprint arXiv:2311.12454, 2023.
[37] Yang D, Tian J, Tan X, et al. Uniaudio: An audio foundation model toward universal audio generation[J]. arXiv preprint arXiv:2310.00704, 2023.
[38] Huang R, Zhang C, Wang Y, et al. Make-a-voice: Unified voice synthesis with discrete representation[J]. arXiv preprint arXiv:2305.19269, 2023.


