Sound & music · Research feature

AI Model Generates Music in Real Time Using Vocal Input

A new AI system creates musical accompaniments in real time by aligning vocal input with latent audio structures, offering faster and lighter performance than existing models.

Adapted from research by Hei Shing Cheung, Boya Zhang, Jonathan H. Chan.

arXiv preprint revision · 2026-01-04 · Attribution & reuse
In this article
Editorial illustration of sound waves.

Editor’s introduction

The study evaluates SAMUeL, a lightweight latent diffusion model designed to generate music conditioned on vocal input. It uses a soft alignment attention mechanism to combine local and global temporal dependencies across diffusion timesteps, improving the model’s ability to capture multi-scale musical structure. Performance is assessed using AudioBox-Aesthetics, a pre-trained transformer model that offers nuanced audio quality evaluation, addressing limitations of traditional metrics like FAD. The model achieves competitive results with only 15M parameters, outperforming OpenAI Jukebox in content unity and production quality while enabling real-time deployment on consumer devices. A key finding is that increasing U-Net depth reduced training loss without improving perceived audio quality, indicating a disconnect between mathematical optimization and human musical perception. This suggests current training objectives may not adequately reflect perceptual preferences in music generation.

Introduction

Contemporary music generation systems primarily rely on text-conditioned generation or symbolic music representation, creating a significant gap for musicians who conceptualize music through melodic ideas rather than textual descriptions. This limitation is particularly problematic for composers who begin with vocal melodies and require appropriate instrumental accompaniments—a common workflow in music production that existing AI systems fail to address effectively.

Current approaches can be categorized into three paradigms: text-conditioned models that translate natural language into audio, autoregressive systems that generate music sequentially, and symbolic models operating on MIDI representations. While these systems demonstrate impressive capabilities, they fail to support direct musical input conditioning. The semantic gap between musical concepts and textual descriptions, combined with computational requirements that exceed practical deployment constraints, motivates the development of efficient vocal-conditioned generation approaches.

Recent developments include OpenAI’s Jukebox, which generates raw audio with artist and genre conditioning but requires over 6 hours for generation, and Meta’s MusicGen, which provides text and audio conditioning but demands substantial computational resources. Google’s SingSong represents the most relevant prior work, generating instrumental accompaniments from vocal inputs using an adapted AudioLM architecture, but employs autoregressive generation without sophisticated attention mechanisms for capturing complex vocal-accompaniment relationships.

This paper introduces SAMUeL (Soft Alignment Music U-net Latent diffusion), an ultra-lightweight latent diffusion model specifically designed for vocal-conditioned accompaniment generation. The model name reflects its core architectural components: the Soft Alignment attention mechanism that dynamically balances temporal dependencies, the U-net backbone architecture, and operation in compressed latent space for efficiency. SAMUeL directly accepts vocal melodies as input and generates corresponding instrumental backing tracks while maintaining harmonic consistency, rhythmic alignment, and stylistic coherence. SAMUeL operates in compressed latent space using a novel soft alignment attention mechanism that dynamically balances local acoustic patterns with global musical structure.

Our key contributions include: (1) a soft alignment attention mechanism that adaptively combines local and global temporal dependencies based on diffusion timesteps, (2) an end-to-end vocal-conditioned framework bypassing text prompts or symbolic preprocessing, (3) ultra-lightweight architecture achieving 220× parameter reduction with 52× faster inference compared to competing systems, and (4) comprehensive evaluation demonstrating competitive performance despite resource constraints.

Diffusion Models for Audio Generation

Diffusion models have emerged as the dominant paradigm for high-quality audio synthesis, despite computational challenges posed by high-dimensional audio signals and temporal dependencies in musical structure. Early works including DiffWave and WaveGrad demonstrated direct waveform diffusion feasibility but required substantial computational resources.

The development of latent diffusion approaches addressed computational limitations by performing denoising in compressed representations learned by variational autoencoders. This approach proves particularly effective for audio applications where perceptual importance varies across frequency components, enabling VAEs to focus on perceptually relevant features.

Recent audio diffusion advances include AudioLM introducing discrete token representations, MusicLM demonstrating large-scale text-conditioned generation, and Stable Audio Open providing a comprehensive framework with 156M parameter autoencoder, 109M parameter T5 encoder, and 1057M parameter diffusion transformer. These systems establish diffusion model viability for complex musical tasks but primarily focus on text-based conditioning, limiting applicability for direct musical input.

Conditional Audio Generation and Attention Mechanisms

Text-conditioned approaches offer intuitive interfaces but suffer from semantic gaps between textual descriptions and musical concepts. Alternative approaches include chord-based generation providing direct musical control but limited to symbolic representations, and audio-to-audio conditioning focusing on style transfer rather than accompaniment generation.

Transformer vs. Ours SAMUeL employs a U-Net architecture augmented with attention mechanisms inspired by transformers but is distinct in its design. Unlike standard transformers, which rely heavily on Multi-Layer Perceptrons (MLPs) and Layer Normalization contributing significantly to parameter count, SAMUeL omits these components to achieve an ultra-lightweight architecture. Our soft alignment attention mechanism, combining local and global patterns, is tailored for audio applications, leveraging rotary position embeddings (RoPE) for global attention while maintaining computational efficiency.

Latent Space Encoding

We employ the pre-trained VAE component from Stable Audio Open, representing state-of-the-art audio compression optimized for latent diffusion generation. The encoder architecture builds on the Descript Audio Codec framework, featuring fully-convolutional design enabling arbitrary-length processing while maintaining high reconstruction fidelity.

Data Collection

For this study, we introduce POPDB, a dataset of 15,713 vocal-accompaniment pairs derived from popular songs spanning 2000 onward, totaling approximately 200 hours of audio. The dataset construction leveraged the Song Popularity Dataset from Kaggle, which catalogs popular songs with metadata, selected for its diversity across genres and eras.

Audio was acquired using the yt-dlp Python library for automated YouTube downloading, searching by song titles and filtering out playlists and content exceeding 15 minutes. Audio was processed in WAV format at 44.1 kHz to maintain fidelity. Source separation used Demucs to isolate vocal and accompaniment components. Each song was encoded using the Stable Audio Open VAE, producing 1024-token sequences corresponding to 47.55 seconds of audio, then chunked sequentially without overlap. Trailing chunks shorter than 47.55 seconds were discarded.

The 47.55-second chunk size aligns with Stable Audio Open’s VAE optimization, balancing efficiency and performance. We hypothesize that at least half of each chunk contains vocals, based on typical song structures where non-vocal segments (e.g., intros, bridges) are usually under 20 seconds. This assumption requires validation in future work to ensure robust vocal conditioning. The pipeline required approximately 50 hours of computational time, resulting in POPDB containing 15,713 encoded vocal-accompaniment pairs for training.

U-Net Design

This architectural design allows the network to efficiently capture both fine-grained local dependencies and long-range structure in temporal data. By leveraging FiLM and attention-based soft alignment, SAMUeL dynamically integrates conditioning information at multiple scales, enabling more expressive modeling of vocal-guided accompaniment generation.

Soft Alignment Attention Mechanism

The soft alignment attention mechanism represents our core innovation, addressing the challenge of capturing both fine-grained acoustic patterns and global musical structure. Traditional attention mechanisms struggle with extreme sequence lengths in audio applications, while purely local approaches fail to capture long-range musical dependencies such as harmonic progressions and structural relationships.

Our soft alignment attention combines local and global attention patterns through time-dependent weighting reflecting the hierarchical diffusion process. Local attention operates within sliding windows of size 16 on the temporal axis; every chunk is padded with zeros at the beginning and the end. While local attention does not leverage positional embedding to focus on the musical harmonic structure where absolute position is less important, global attention computes relationships across entire sequences using rotary position embeddings for improved positional encoding.

The underlying intuition is to expose the model to the full structure of the song early on, while progressively shifting focus toward fine-grained acoustic interactions between nearby temporal frames as diffusion proceeds. This dual-scale attention strategy allows SAMUeL to model both the precise timing details and the broader musical form, which are critical for generating coherent and expressive musical accompaniments.

The multi-scale attention design enables SAMUeL to capture information at multiple temporal scales essential for musical coherence and quality. Local attention windows preserve fine-grained acoustic relationships between neighboring temporal frames, while global attention maintains awareness of long-range harmonic progressions and structural elements. This dual-scale approach proves particularly effective for musical applications where both micro-timing relationships and macro-structural coherence are critical for perceptual quality.

Architecture Specifications and Training Objective

SAMUeL comprises approximately 15 million parameters distributed across U-Net backbone, attention mechanisms, and conditioning networks. The U-Net backbone contains 3 downsampling and 3 upsampling convolutional blocks, each having two convolutional layers and one FiLM layer. Attention mechanisms utilize 8 heads with 64-dimensional projections, and local attention window size 16 provides effective local modeling while maintaining computational tractability.

Evaluation Methodology and Quantitative Results

We evaluated generated accompaniments using AudioBox-Aesthetics, a pre-trained transformer-based model developed by Meta that provides comprehensive audio quality assessment. This model addresses critical limitations of existing audio evaluation metrics such as Fréchet Audio Distance (FAD), which produces only overall scores without capturing the nuanced aspects of musical quality. Unlike traditional benchmarks that provide uninformative evaluations and amplify individual bias from human-annotated data, AudioBox-Aesthetics represents the only available open-source pre-trained model capable of multi-dimensional audio evaluation.

The AudioBox-Aesthetics model provides objective metrics across four independent dimensions, each scored on a scale from 1 (less desirable) to 10 (more desirable): Production Quality (PQ) measuring technical fidelity and recording quality, Production Complexity (PC) assessing arrangement sophistication and musical intricacy, Content Enjoyment (CE) evaluating subjective appeal and listener satisfaction, and Content Unity (CU) measuring musical coherence and structural consistency. The model was trained on 500 hours of audio samples annotated by 158 expert raters, ensuring robust evaluation standards. The training process emphasized category independence, with low correlation between evaluation dimensions demonstrating that each metric captures distinct aspects of audio quality. Rating distributions span the full evaluation scale, indicating diversity in the collected training data and comprehensive coverage of quality variations.

The original validation study confirmed high correlation between the model’s predicted quality scores and ground truth labels from expert human evaluators, establishing its reliability for objective music quality assessment. This multi-dimensional approach proves particularly valuable for evaluating generative music models, where different aspects of quality may vary independently based on architectural choices and training constraints.

Evaluation compared SAMUeL against Stable Audio Open, MusicGen, OpenAI Jukebox, and ground truth across 10 generated samples, and the average score of the ten tracks are reported in Table I. Due to the small sample size, results are preliminary and require larger-scale validation in future work.

Results reveal competitive performance considering SAMUeL’s smaller scale and training constraints. While achieving lower absolute scores compared to larger systems, SAMUeL outperforms OpenAI Jukebox in Production Quality (5.73 vs 5.30) and Content Unity (4.97 vs 4.66), attributed to Jukebox’s tendency toward noise artifacts. The Production Complexity score (5.14) demonstrates that despite resource constraints, soft alignment attention enables reasonably sophisticated musical arrangements through direct vocal conditioning.

SAMUeL achieves exceptional efficiency with only 15M parameters—220× smaller than MusicGen Large, 20× smaller than MusicGen Small, 80× smaller than Stable Audio Open, and 333× smaller than OpenAI Jukebox. Inference speed of 21 seconds per 47-second audio represents substantial advantages: 52× faster than MusicGen Large and 11× faster than MusicGen Small. While Stable Audio Open achieves comparable inference time, it cannot process direct musical input, positioning SAMUeL as optimal for audio-to-audio conditioning.

Qualitative Analysis and Performance Trade-offs

Subjective evaluation reveals effective vocal-accompaniment alignment regarding harmonic progression consistency and rhythmic synchronization. The soft alignment attention mechanism successfully establishes appropriate temporal relationships between vocal phrases and accompaniment responses, while global context modeling maintains structural coherence throughout generation.

Generated accompaniments exhibit characteristic properties reflecting both strengths and limitations. Audio outputs predominantly feature synthesizer-like timbres, suggesting effective electronic texture generation within latent space constraints. Percussion elements are consistently present and rhythmically aligned with vocal input, though exhibiting noisy characteristics rather than clean, distinct drum sounds.

A notable limitation is SAMUeL’s current inability to generate distinct instrumental sounds with clear acoustic characteristics, reflected in lower content enjoyment scores compared to models trained on larger datasets. Generated accompaniments lack timbral diversity typical of professional recordings, producing more homogeneous sonic palettes dominated by synthesized textures. This limitation stems from compressed latent representation, limited training data, and focus on overall musical structure rather than fine-grained timbral detail—constraints inherent to ultra-lightweight design philosophy.

Despite these constraints, vocal conditioning proves effective for establishing foundational musical relationships. Direct musical input successfully bypasses semantic gaps inherent in text-based approaches, enabling precise control over harmonic progressions and rhythmic alignment difficult to achieve through natural language descriptions.

Discussion and Future Work

SAMUeL demonstrates direct musical input viability for accompaniment generation, addressing a significant gap in current music AI systems. The soft alignment attention mechanism provides effective solutions for capturing multi-scale temporal dependencies in audio, while v-parametrization ensures stable training dynamics suitable for complex musical content.

Efficiency Advantages and Deployment Considerations

A key distinguishing feature is exceptional efficiency compared to existing systems. The ultra-lightweight architecture enables deployment on consumer-grade hardware with minimal memory requirements (2-4GB GPU memory), making professional-quality musical accompaniment generation accessible for mobile devices, edge computing, and resource-constrained environments. This democratization represents significant advancement over existing models requiring enterprise-level computational resources.

Performance trade-offs inherent in efficiency gains are evident in AudioBox-Aesthetics evaluation, where SAMUeL achieves lower absolute scores compared to larger systems. However, the ability to outperform OpenAI Jukebox demonstrates that architectural innovation can compensate for scale limitations. Relatively modest scores in content enjoyment and unity reflect challenges of training with fewer parameters and limited data, yet SAMUeL successfully synthesizes complete multi-track accompaniments—remarkable given resource constraints.

Training Insights and Limitations

Experimentation revealed important phenomena regarding model architecture and training dynamics. A critical finding concerns the relationship between model complexity and perceptual quality: increasing U-Net depth consistently marginally reduced training loss but did not correlate with improved audio quality. This suggests traditional loss metrics may inadequately capture perceptual aspects of musical generation, highlighting fundamental challenges where mathematical optimization objectives diverge from human preferences. Further works could explore alternative training objectives that better align with perceptual quality, such as adversarial training or perceptual loss functions.

Current limitations include fixed-length segment operation limiting applicability to longer compositions requiring structural coherence across sections. The 47-second chunk constraint limits capture of extended musical narratives and relationships spanning longer time scales. Additionally, vocal conditioning could be enhanced through integration with lyrics, chord progressions, or explicit style controls.

A significant constraint affecting SAMUeL’s performance stems from limited training data due to computational resource restrictions. Our model was trained on approximately 200 hours of audio data, substantially less than the 7,300 hours utilized by Stable Audio Open. This 36-fold disparity in training data represents a critical limiting factor, as deep generative models typically exhibit strong scaling behavior with increased data availability. Despite this constraint, SAMUeL demonstrates competitive performance relative to its training data scale, suggesting that the sophisticated soft alignment attention architecture effectively leverages available information. We anticipate that scaling to comparable dataset sizes would yield substantial performance improvements, particularly in timbral diversity and content enjoyment metrics where data-driven learning is most beneficial.

Future work should explore hierarchical generation approaches handling multiple temporal scales simultaneously, enabling coherent composition of complete songs. Variable-length audio processing could increase training data availability and reduce computational requirements. Multi-modal conditioning combining vocal, textual, and symbolic inputs could provide enhanced control for professional workflows.

Conclusion

We have presented SAMUeL (Soft Alignment Music U-net Latent diffusion), a novel latent diffusion model for vocal-conditioned musical accompaniment generation addressing key limitations in existing music AI systems. The soft alignment attention mechanism effectively captures both local acoustic patterns and global musical structure through adaptive temporal mixing, while v-parametrization provides stable training dynamics. Operating in compressed latent space achieves computational efficiency suitable for interactive applications while maintaining audio quality through sophisticated conditioning mechanisms.

SAMUeL’s ultra-lightweight 15M parameter architecture demonstrates significant efficiency advantages: 52× faster inference than MusicGen Large while using 220× fewer parameters, and 11× faster than MusicGen Small while using 20× fewer parameters. While absolute perceptual quality scores are lower than large-scale models due to training constraints, SAMUeL outperforms OpenAI Jukebox and achieves reasonable performance considering exceptional efficiency. This makes it uniquely suitable for real-time creative workflows, mobile applications, and resource-constrained environments where existing models are computationally prohibitive.

This work establishes vocal conditioning as a viable paradigm for efficient music generation and provides foundation for future developments in AI-assisted composition and interactive music systems prioritizing accessibility and real-time capability. SAMUeL’s design philosophy—combining architectural innovation with computational efficiency—opens new possibilities for democratizing AI-powered music creation.