In-Context Prompt Editing for Conditional Audio Generation

Ernie Chang, Pin-Jie Lin, Yang Li, Sidd Srinivasan, Gaël Le Lan, David Kant, Yangyang Shi, Forrest N. Iandola, Vikas Chandra

TL;DR

This paper tackles the problem of audio quality degradation in text-to-audio generation when users provide prompts that differ from the data the model was trained on. They propose a novel "in-context prompt editing" framework that uses training captions as examples to guide a large language model (LLM) in refining user prompts, significantly improving audio quality.

What Problem Does This Paper Address?

Modern text-to-audio (TTA) generation models, while impressive, struggle when faced with real-world user prompts that deviate from the specific text-audio pairs they were trained on. This "distributional shift" causes the model's internal text representations to become inaccurate, leading to a noticeable drop in the quality of the generated audio. The authors highlight that collecting data for every possible user prompt is impractical, leaving a gap between a model's performance on training data and its real-world utility. They observe a consistent degradation in audio quality when models encounter these out-of-distribution prompts.

Methods

The core of the paper is the proposed in-context prompt editing framework. This framework leverages the power of instruction-tuned Large Language Models (LLMs) to refine user prompts. The key innovation lies in using demonstrative exemplars from the original training captions.

Here's a breakdown of their approach:

  1. De-duplication of Training Prompts: To efficiently handle large training datasets, they first de-duplicate similar prompts using the MinHash algorithm and Jaccard Index. This step ensures that the exemplars are diverse and representative.
  2. Retrieval of Demonstrative Exemplars: They employ K-means clustering on the training prompts (using sentence embeddings from SBERT) to group similar captions. For a given user prompt, they then retrieve the top-M closest neighbors from these clusters. These retrieved prompts serve as the "demonstrative exemplars."
  3. LLM-based Prompt Editing: The user's original prompt is then augmented with an instruction and the retrieved demonstrative exemplars. This combined input is fed to an LLM (specifically LLaMA-70B) to generate an edited prompt. The LLM is essentially guided by the examples to produce a prompt that is more aligned with the model's training distribution.

They also introduce a metric called "prompt divergence" (rdiv), based on KL divergence of encoded text features, to quantify the shift between prompt distributions and correlate it with audio quality.

Datasets

  • Training Data: AudioCAPS [17] and BBC Sounds [2] datasets are used for their training captions, which serve as the source for demonstrative exemplars.
  • Evaluation Data: A benchmark of 1,525 free-form user prompts (referred to as "Open-prompts") was collected for evaluation.

Key Insights and Ideas

  • Distributional Shift is a Major Bottleneck: The paper strongly emphasizes that the mismatch between training and user prompt distributions is a primary cause of poor audio quality in TTA systems.
  • Exemplars are Crucial for LLM Guidance: Simply using LLMs for prompt editing isn't enough. Providing relevant, in-context examples (demonstrative exemplars from training data) significantly improves the LLM's ability to generate effective edits.
  • In-Domain Exemplars Outperform Out-Domain: Using exemplars from the same domain as the training data leads to better audio quality than using exemplars from a different domain.
  • Prompt Divergence Correlates with Audio Quality: The proposed "prompt divergence" metric shows a strong correlation with audio quality metrics like FAD, providing a way to predict or understand performance drops.
  • No Retraining Required: A significant advantage is that this framework can be applied without needing to retrain the TTA model itself, making it a practical post-hoc solution.

Key Results

  • The proposed retrieval-based in-context prompt editing framework significantly enhances audio quality across various metrics (CLAP, FAD, subjective human evaluation) compared to using raw user prompts or LLM editing alone.
  • The framework achieved a notable improvement in FAD scores (e.g., +0.37 improvement when using in-domain exemplars).
  • Human evaluations also showed improvements in both audio quality (SUB) and relevance to edited prompts (OBJ).
  • The paper demonstrates a strong correlation between reduced prompt divergence (rdiv) and improved audio quality (lower FAD).

Limitations and Future Work

  • Inference Efficiency: While the framework improves quality, it adds computational overhead during inference due to the retrieval and LLM editing steps. The authors note that the search time for exemplars scales linearly with the training data size.
  • LLM Prompting Nuances: The paper mentions that using LLMs "as-is" can lead to ill-formulated prompts, implying that careful prompt engineering for the LLM itself is still important.
  • Future Work: The authors suggest exploring more efficient retrieval mechanisms and further investigating the impact of different LLM configurations and exemplar selection strategies. They also hint at the potential for this approach to be applied to other conditional generation tasks.

Summary updated

BibTeX
@inproceedings{chang2024context,
  author = {Ernie Chang and Pin-Jie Lin and Yang Li and Sidd Srinivasan and Gaël Le Lan and David Kant and Yangyang Shi and Forrest N. Iandola and Vikas Chandra},
  title = {{In-Context Prompt Editing for Conditional Audio Generation}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2024},
  doi = {10.1109/icassp48485.2024.10446431},
}
Figure