Xiaol.x
AI-assisted summary of Can a Recurrent LLM Write a Song? Inside LiuBai-RWKV + YuE2 — original source. Check the original for full context.
Source published:
Key ideas
- LiuBai-RWKV replaces the transformer autoregressive stage in YuE2 with a 3-billion-parameter RWKV-7 model, generating discrete semantic tokens with a constant-memory footprint instead of an expanding KV-cache. (0:00)
- To bypass the unreleased YuE2 audio encoder, the author created R1A, an inverse tokenizer that converts MERT-v2 features to YuE2 semantic tokens with a 0.981 MERT cosine similarity and ~0.33 WER. (1:52)
- Interleaving lyrics and audio tokens at the section level (R3.1 format) reduced generation Word Error Rate from 1.37 to 1.05 compared to monolithic serialization (G3), but distinct lyric word overlap remains stuck at roughly 10%. (5:09)
- The model reliably renders genre timbre, song structure, and vocal textures across six diverse styles, but exact lyric adherence remains the core unsolved failure mode of the recurrent architecture. (5:57)
Detailed notes
## Background Published on YouTube by Xiaol.x on September 25, 2026, this video introduces LiuBai-RWKV, an experimental 3-billion-parameter RWKV-7 music generator designed to turn style prompts and lyrics into YuE2 semantic tokens for stereo audio rendering. According to the page description, the project is presented as an honest research build rather than a finished commercial Suno replacement, detailing recurrent memory mechanics, token serialization, and why lyric adherence remains an unsolved challenge.
## TL;DR LiuBai-RWKV replaces the standard transformer in YuE2's music generation pipeline with an RWKV-7 architecture, maintaining a constant-memory recurrent state while autoregressively emitting discrete semantic tokens at 25 codes per second. Because the upstream audio encoder was unreleased, the author developed R1A—a custom bridge mapping MERT-v2 features to YuE2 semantic tokens—to prepare the Suno-94k dataset for training across four A100 GPUs. Restructuring the sequence layout from monolithic lyric blocks (G3) to section-interleaved blocks (R3.1) proved crucial, significantly lowering Word Error Rate and preventing total vocal collapse. Despite successfully generating realistic instrumentals, vocal textures, and verse-chorus arrangements across six diverse genres, the model still frequently produces phonetic babble rather than requested lyrics, highlighting the ongoing difficulty of cross-modal alignment without cross-attention.
## Atmosphere & style The presentation carries the grounded, unpretentious tone of an open-source engineering lab notebook, pointedly avoiding commercial AI hype in favor of raw audio and transparent ablation metrics. Xiaol.x communicates with methodical, analytical clarity, guiding viewers through architectural trade-offs and pragmatic workarounds before playing uncurated, warts-and-all audio demonstrations. The resulting experience feels intellectually candid and deeply authentic, balancing genuine enthusiasm for recurrent sequence modeling with an unflinching examination of the model's vocal alignment failures.
## Bulletin - [00:00](https://www.youtube.com/watch?v=NyJZCDt6wws&t=0s) LiuBai-RWKV replaces the transformer autoregressive stage in YuE2 with a 3-billion-parameter RWKV-7 model, generating discrete semantic tokens with a constant-memory footprint instead of an expanding KV-cache. - [01:52](https://www.youtube.com/watch?v=NyJZCDt6wws&t=112s) To bypass the unreleased YuE2 audio encoder, the author created R1A, an inverse tokenizer that converts MERT-v2 features to YuE2 semantic tokens with a 0.981 MERT cosine similarity and ~0.33 WER. - [05:09](https://www.youtube.com/watch?v=NyJZCDt6wws&t=309s) Interleaving lyrics and audio tokens at the section level (R3.1 format) reduced generation Word Error Rate from 1.37 to 1.05 compared to monolithic serialization (G3), but distinct lyric word overlap remains stuck at roughly 10%. - [05:57](https://www.youtube.com/watch?v=NyJZCDt6wws&t=357s) The model reliably renders genre timbre, song structure, and vocal textures across six diverse styles, but exact lyric adherence remains the core unsolved failure mode of the recurrent architecture.
## Key takeaways - [00:00](https://www.youtube.com/watch?v=NyJZCDt6wws&t=0s) LiuBai-RWKV acts as a high-level musical planner that outputs discrete YuE2 semantic tokens instead of generating raw audio directly. - [00:00](https://www.youtube.com/watch?v=NyJZCDt6wws&t=0s) The semantic token vocabulary contains 32,768 codes emitted at 25 tokens per second, where each token governs roughly 40 milliseconds of audio. - [01:52](https://www.youtube.com/watch?v=NyJZCDt6wws&t=112s) YuE2's downstream non-autoregressive (NAR) acoustic model and audio VAE are kept intact to handle waveform synthesis. - [01:52](https://www.youtube.com/watch?v=NyJZCDt6wws&t=112s) Because YuE2 lacked an upstream audio encoder, the custom R1A tokenizer was built to map MERT-v2 audio representations directly into YuE2 tokens. - [03:36](https://www.youtube.com/watch?v=NyJZCDt6wws&t=216s) Training was conducted on a cleaned subset of 93,058 songs from the Suno-94k corpus across 4× NVIDIA A100 GPUs using BF16 precision. - [03:36](https://www.youtube.com/watch?v=NyJZCDt6wws&t=216s) RWKV-7 uses fixed-size recurrent state updates to avoid the linear memory scaling of transformer KV-caches during streaming audio generation. - [05:09](https://www.youtube.com/watch?v=NyJZCDt6wws&t=309s) Monolithic sequence formatting (G3) failed because placing lyrics thousands of tokens before audio caused the network to behave as an unconditional generator. - [05:09](https://www.youtube.com/watch?v=NyJZCDt6wws&t=309s) The R3.1 serialization format solves long-distance credit assignment by interleaving local section metadata, lyrics, and audio code blocks. - [05:57](https://www.youtube.com/watch?v=NyJZCDt6wws&t=357s) Testing across punk, Motown, metal, reggaeton, jazz, and ambient prompts showed strong genre adaptation and vocal tone alongside persistent phonetic drift. - [06:45](https://www.youtube.com/watch?v=NyJZCDt6wws&t=405s) R3.1 beat the G3 baseline in 15 out of 20 evaluation prompts and imposed a +0.106 nats penalty under permuted text, confirming real conditioning on local lyric blocks. - [07:50](https://www.youtube.com/watch?v=NyJZCDt6wws&t=470s) Future research focuses on finer line-level interleaving, timestamp forced-alignment, and audio-grounded CTC or ASR loss objectives to improve lyric fidelity.
## Detailed walkthrough ### [00:00](https://www.youtube.com/watch?v=NyJZCDt6wws&t=0s) Rethinking Song Generation: LiuBai-RWKV and Semantic Tokens
The project explores whether a language model can compose complete songs without relying on a continually ballooning transformer attention cache. LiuBai-RWKV tackles this as a research experiment using a 3-billion-parameter RWKV-7 architecture. Instead of outputting raw audio waveforms directly, the model takes a text style caption alongside written lyrics and autoregressively predicts a stream of discrete semantic music tokens. These tokens are subsequently handed off to YuE2's rendering pipeline to produce stereo audio. The creator emphasizes that this is an honest research build rather than a finished commercial Suno replacement, characterized by real checkpoints, uncurated audio samples, and distinct failure modes.
```mermaid flowchart LR accTitle: LiuBai-RWKV System Pipeline accDescr: Pipeline showing inputs feeding into RWKV-7 to produce semantic tokens, which are decoded by YuE2 into audio. subgraph Inputs ["Input Prompts"] A["Style Caption"] B["Structured Lyrics"] end subgraph Core ["LiuBai (Planner)"] C["RWKV-7 3B LLM"] end subgraph Renderer ["YuE2 Stack (Renderer)"] D["Semantic Tokens\n(32,768 Codebook)"] E["NAR Acoustic Model"] F["Audio VAE"] G["Stereo Audio"] end A --> C B --> C C --> D D --> E E --> F F --> G ```
Within this design, LiuBai acts as the high-level musical planner, predicting compact structural instructions while leaving acoustic realization to a fixed renderer. Songs are broken into standard structural units—intros, verses, choruses, and bridges. At runtime, each generated section is framed by dedicated boundary markers, beginning with `<sos>` and `<soa>`, followed by a sequence of YuE2 semantic codes, and terminating with `<eoa>`. Rather than representing discrete notes or raw sample slices, these tokens function as dense musical blueprints:
- **Semantic Codebook:** 32,768 discrete token IDs. - **Vocabulary Placement:** In the R3.1 setup, audio codes occupy token IDs 65,544 and above inside the RWKV vocabulary. - **Temporal Resolution:** Emitted at 25 codes per second, meaning each semantic token spans approximately 40 milliseconds of audio. - **Rendering Pipeline:** YuE2 expands the compact semantic instructions into dense acoustic details via a non-autoregressive (NAR) stage before the VAE decodes the final stereo waveform.
---
[01:52](https://www.youtube.com/watch?v=NyJZCDt6wws&t=112s) Decoupling the Architecture and the R1A Audio Inverse Tokenizer
YuE2 serves as both the conceptual benchmark and the rendering partner for this build. Under standard YuE2 operation, an autoregressive language model generates semantic tokens, a non-autoregressive model builds acoustic representations, and a variational autoencoder (VAE) synthesizes the waveform. LiuBai preserves the latter two stages unchanged, replacing only the text-to-semantic-token language modeling stage with RWKV-7. This clean architectural separation holds the token representation and rendering engine fixed, providing a controlled testbed to see if a recurrent model can handle complex musical composition. The computational upside is substantial—retaining a constant-size memory state during inference—but the model faces the steep challenge of learning the alignment between lyrics, song sections, and musical tokens without cross-attention.
A significant hurdle arose during training: YuE2 had not released the upstream audio encoder required to tokenize raw song data into YuE2 semantic tokens. To circumvent this, the author developed a custom inverse tokenizer dubbed R1A:
- **Feature Extraction:** R1A maps from MERT-v2 self-supervised audio representations directly to predicted YuE2 semantic tokens. - **Teacher-Student Alignment:** It is trained alongside a joint teacher that runs predicted tokens through the frozen YuE2 rendering stack across 20 unseen evaluation songs. - **Validation Results:** The resulting R1A tokenizer head achieved a Word Error Rate (WER) of ~0.33 when transcribed against reference text, with an audio feature alignment score of 0.981 MERT cosine similarity. - **Scope of Metrics:** These figures confirm that the synthetic token bridge and round-trip audio reconstruction are reliable enough to generate training data for the subsequent RWKV experiments.
---
[03:36](https://www.youtube.com/watch?v=NyJZCDt6wws&t=216s) Training Scale, Recurrent Memory, and Serialization Formats
The training pipeline relies primarily on the Suno-94k dataset, which consists of 94,174 songs totaling roughly 5,423 hours of music annotated with style tags and structured lyrics. Following data cleaning and filtering against the YuE2 pipeline requirements, the corpus settled at 93,058 usable songs. The baseline RWKV model was trained from scratch across 4× NVIDIA A100 GPUs using BF16 mixed-precision arithmetic, an 8,000-token context window, and an expanded vocabulary accommodating the 32,768 semantic audio codes.
Traditional transformer decoders store past keys and values in an expanding KV-cache, causing memory requirements to scale linearly with song length. By contrast, RWKV-7 updates a fixed-size recurrent hidden state at every step. This makes streaming generation attractive because the computational memory footprint never balloons. However, the author cautions that recurrent state updates are not "a magic musical memory"; the network must still deduce timing, repetition patterns, and genre shifts purely from sequence structure.
```mermaid flowchart TD accTitle: G3 vs R3.1 Sequence Serialization Comparison accDescr: Diagram illustrating the structural differences between the monolithic G3 sequence and the section-interleaved R3.1 format. subgraph G3 ["G3 Monolithic Format (Long Distance)"] direction LR G1["[Style Caption]"] --> G2["[Full Lyrics Block]"] --> G3A["[Audio Tokens: Section 1]"] --> G4["[Audio Tokens: Section 2]"] end subgraph R31 ["R3.1 Interleaved Format (Local Conditioning)"] direction LR R1["[Header]"] --> R2["[Sec 1 Text]"] --> R3A["[Sec 1 Audio]"] --> R4["[Sec 2 Text]"] --> R5["[Sec 2 Audio]"] end ```
The physical serialization of sequence tokens proved to be the decisive factor in whether the model learned to associate lyrics with music:
- **G3 Format (Monolithic Whole-Song Layout):** The earlier G3 training run concatenated metadata and lyrics entirely at the front of the sequence, followed by an unbroken block of audio tokens. Because lyric text sat thousands of tokens away from its corresponding audio, the network functioned as an unconditional music generator and failed to link specific words to vocal passages. - **R3.1 Format (Interleaved Section Layout):** R3.1 restructured sequences into repeating local blocks: a section marker (e.g., verse, chorus), the specific lyric text for that section, the audio start token (`<soa>`), the local YuE2 semantic codes, and an audio end token (`<eoa>`). Interleaving text and audio blocks drastically reduced the credit assignment distance, enabling section-by-section decoding.
---
[05:57](https://www.youtube.com/watch?v=NyJZCDt6wws&t=357s) Evaluation Across Six Genres and the Lyric Adherence Dilemma
To verify real-world generalization rather than relying on cherry-picked highlights, generation was evaluated across six diverse prompts from held-out evaluation sets:
1. **Punk:** *"Don't try to understand me"* 2. **Motown:** *"Curly hair"* 3. **Industrial Metal:** *"DB82Xure"* 4. **Reggaeton:** *"Bailando"* 5. **Jazz:** *"Night and Day"* 6. **Ambient:** *"Não gosto de frutas"*
The listening tests showcase LiuBai's core strengths alongside its most glaring failure mode. The model easily captures surface musical qualities: instrumental timbre matches the requested genres, vocal deliveries possess realistic human textures, and arrangements adhere to conventional verse-chorus song structures. Yet when listening closely to vocal performance, the generated singing often diverges into phonetic babble or hallucinated phrases that bear no resemblance to the input prompts: "The model can learn a musical surface before it learns reliable text to voice alignment."
Comparative evaluation against the monolithic G3 baseline shows measurable architectural gains:
| Evaluation Metric | G3 Run (Monolithic) | R3.1 Run (Interleaved) | Notes / Observations | |:--- |:--- |:--- |:--- | | **Mean Word Error Rate (WER)** | 1.37 | **1.05** | Measured on 20 held-out prompts against requested lyrics | | **Head-to-Head Win Rate** | 5 / 20 prompts | **15 / 20 prompts** | R3.1 eliminated catastrophic collapse where singing degraded completely | | **Permuted Text Loss Penalty** | Baseline | **+0.106 nats** | Teacher-forcing with scrambled text confirms local conditioning has taken effect | | **Lyric Word Overlap** | Minimal | **~10% distinct words** | Highlights persistent failure to sing exact transcript words | | **Style Metric (MERT Cosine)** | ~0.79 | **~0.79** | Genre and instrumentation stability remain consistent across runs |
---
[07:50](https://www.youtube.com/watch?v=NyJZCDt6wws&t=470s) Next Research Steps and Open-Source Roadmap
The quantitative and qualitative evidence points to a single core conclusion: section-level interleaving significantly stabilizes song structure and local conditioning, but true lyric adherence remains an unsolved challenge for the recurrent architecture. To close the remaining gap between musical form and phonetic precision, several concrete research directions are planned:
- **Fine-Grained Alignment:** Expanding forced-alignment preprocessing to provide precise timestamp boundaries linking lyrics directly to audio blocks in the training dataset. - **Line-Level Block Serialization:** Moving beyond stanza-level blocks toward finer-grained, line-by-line interleaving to bring text prompts into even closer proximity with their corresponding audio codes. - **Acoustic and Perceptual Loss Objectives:** Introducing loss functions anchored to the rendered audio signal, such as Connectionist Temporal Classification (CTC) losses, automatic speech recognition (ASR) reward signals, or flow-matching losses derived from the joint teacher model. - **Open-Source Licensing:** Working around license constraints tied to the upstream YuE2 ecosystem so LiuBai-RWKV can be released cleanly as an open-source toolchain.
The video concludes by inviting developers to inspect the project repository, which documents these limitations, training run metrics, and negative results openly. Rather than being swayed by single polished audio clips, observers are encouraged to track the project's ongoing pull requests and check whether future runs improve the core lyric binding metric.
## Notable quotes > [00:00](https://www.youtube.com/watch?v=NyJZCDt6wws&t=0s) This is an honest research build—not a finished Suno replacement. — Xiaol.x
> [00:00](https://www.youtube.com/watch?v=NyJZCDt6wws&t=0s) The model captures genre, vocal texture, and song-like structure, but often fails to sing the requested lyrics accurately. — Xiaol.x
> [01:52](https://www.youtube.com/watch?v=NyJZCDt6wws&t=112s) The computational upside is substantial—retaining a constant-size memory state during inference—but the model faces the steep challenge of learning the alignment between lyrics, song sections, and musical tokens without cross-attention. — Xiaol.x
> [03:36](https://www.youtube.com/watch?v=NyJZCDt6wws&t=216s) recurrent state updates are not 'a magic musical memory'; the network must still deduce timing, repetition patterns, and genre shifts purely from sequence structure. — Xiaol.x
> [03:36](https://www.youtube.com/watch?v=NyJZCDt6wws&t=216s) Because lyric text sat thousands of tokens away from its corresponding audio, the network functioned as an unconditional music generator and failed to link specific words to vocal passages. — Xiaol.x
> [05:57](https://www.youtube.com/watch?v=NyJZCDt6wws&t=357s) The model can learn a musical surface before it learns reliable text to voice alignment. — Xiaol.x
> [05:57](https://www.youtube.com/watch?v=NyJZCDt6wws&t=357s) R3.1 eliminated catastrophic collapse where singing degraded completely — Xiaol.x
> [07:50](https://www.youtube.com/watch?v=NyJZCDt6wws&t=470s) section-level interleaving significantly stabilizes song structure and local conditioning, but true lyric adherence remains an unsolved challenge for the recurrent architecture. — Xiaol.x
## Mentioned LiuBai-RWKV, RWKV-7, YuE, YuE2, Suno, Suno-94k, MERT-v2, MMS forced alignment, HeartTranscriptor, BlinkDL, M-A-P, Xiaol.x, NVIDIA A100, R1A
## Video description I’m building LiuBai-RWKV, a 3-billion-parameter RWKV-7 music generator that turns style and lyrics into YuE2 semantic tokens, then renders them into stereo audio.
This episode explains:
- How semantic music tokens represent a song - How RWKV maintains recurrent memory during generation - Where YuE2’s AR, NAR, and VAE stages fit - How R3.1 improves over the earlier G3 format - Six generated songs across punk, Motown, metal, reggaeton, jazz, and ambient - Why lyric adherence is still the central unsolved problem
This is an honest research build—not a finished Suno replacement. The model captures genre, vocal texture, and song-like structure, but often fails to sing the requested lyrics accurately.
Chapters:
00:00 The hook 00:50 What semantic tokens look like 01:52 Where YuE2 fits 02:40 The missing audio encoder 03:36 Data and training 04:27 What RWKV remembers 05:09 How a song is serialized 05:57 Six generated songs 06:45 The evidence 07:50 What comes next 08:42 Closing thoughts
Code, samples, and experiment logs: https://github.com/xiaol/LiuBai-RWKV
Credits: RWKV-7 by BlinkDL; YuE/YuE2 by M-A-P; MERT-v2; MMS forced alignment; HeartTranscriptor; suno-94k.
[Source](https://www.youtube.com/watch?v=NyJZCDt6wws)