fast-vibevoice-notes / MASTER_HANDOFF.md
ACloudCenter's picture
Master handoff: complete project record — goals, phases, results, techniques, artifacts, failures, open threads — self-contained for a fresh reviewer
4444a2e verified
|
Raw History Blame Contribute Delete
12.7 kB
# MASTER HANDOFF — Emotion-Steerable Finetuned VibeVoice
**Project:** Fast, emotionally-steerable, multi-party dialogue TTS on VibeVoice-1.5B
**Dates:** 2026-09-26 → 2026-10-03 | **Budget:** $250 granted; ~$110 spent, ~$110 unspent
**Read this first.** Every claim below is backed by a banked artifact. Depth lives in the per-phase files listed at the end.
---
## 1. ORIGINAL GOALS (user's words, distilled)
1. VibeVoice-class model fine-tuned so it can be **emotionally steered per speaker per turn** (documentary: narrator + witnesses; multiparty characters talking back and forth)
2. **Much faster** than stock VibeVoice (~1 min audio per 1 min generation on beefy GPU — user wanted a fraction of that)
3. Keep VibeVoice's strengths: multi-speaker long-form, prosody that carries across turns, voice consistency
## 2. FINAL DELIVERABLE (what exists NOW, all on the Hub)
| Artifact | Where | Status |
|---|---|---|
| **Joint-finetuned model (dialogue)** | `ACloudCenter/vibevoice-lora-joint` → `fullv3/lora/` | ✅ ear-certified: intelligible multi-speaker dialogue, WER 0.356 vs stock 0.029, SIM 0.931 vs 0.937 |
| **Emotion-tuned model (tags v1)** | same repo → `emo3/lora/` | ✅ trained (warm-start from fullv3), eval_loss 0.918→0.841 |
| **Emotion+quality model (ship)** | same repo → `emo4/lora/` | ✅ trained on clean data (warm-start from emo3), eval_loss 0.67 stable |
| **Merged experimental model** | `ACloudCenter/vibevoice-1.5b-joint-merged` | ⚠ quality-chaos — DO NOT DEPLOY (kept as evidence) |
| **Curated final samples (27 wavs, 9 story-ordered folders + README)** | `ACloudCenter/vibevoice-final-samples` | ✅ START HERE for listening |
| **All intermediate samples** | `ACloudCenter/vibevoice-eval-jointv1`, `ACloudCenter/vibevoice-emotion-probe` | ✅ ~60 wavs |
| **Research/ops notes (29 files)** | `ACloudCenter/fast-vibevoice-notes` (this repo) | ✅ |
**Ship recipe (verified):** emo4 adapter (load via vibevoice-community `lora_loading.py`) · **20 DDPM steps** (4× high-band vs 10, user-confirmed cleaner) · `<emotion>` tags in script text · per-speaker clean emotional reference clips · CFG 1.3 · greedy text.
## 3. THE CENTRAL DISCOVERY (the paper's spine)
**VibeVoice's LLM and diffusion head are a tightly co-adapted pair. Modifying the head alone fails catastrophically in closed loop — no matter how well it trains offline.**
Evidence chain (all controlled, all banked):
1. **5 head-only attempts failed** (4 ours: v-pred family escalating recipes; 1 user's: CFM/MeanFlow LongFlow) — all trained to *better-than-stock offline fit*, all produced babble/runaway in real generation
2. **Mechanism found (C/E mismatch 2×2):** stock head is condition-robust (teacher-forced 0.96 / closed-loop 0.96); finetuned head collapses offline-on/online-off (0.50 / 1.36) — teacher-forced "leak" training destroys the condition-robustness the loop needs
3. **Joint adaptation works (the control):** LLM-LoRA + head trained TOGETHER on DailyTalk dialogue → first finetuned model that speaks (WER 0.356, ear-verified). n=5 failures vs n=1 success, one variable changed.
4. **Stability-boundary corollary:** any weight perturbation (3 independent merges, extra epochs) reshuffles WHICH samples fail (WER band 0.32–0.41 adapter / 0.53–0.79 merged), mean barely moves. Only stock is fully stable.
5. **Reference conditioning is TOTAL:** reference clips transmit emotion AND accent AND noise floor into generation (F0 300→184 Hz across emotion arms; accents transferred; noise floor transferred 60×).
## 4. PHASE-BY-PHASE (chronological, what/learned/cost)
| Phase | What happened | Key result | Cost |
|---|---|---|---|
| P0 Grounding | Trainer CLI/data contract verified; manifest prep built; preflight harness born | `prep_dailytalk.py`, `preflight.py` | ~$5 |
| P1 Head-only attempts (v1-v4 + LongFlow) | 4 escalating head recipes — all offline-good, closed-loop babble | Negative result + diagnosis target | ~$15 |
| P2 Diagnosis | 2×2 teacher-forced vs closed-loop matrix; capture pipeline (own rollouts) | **C/E mismatch mechanism** | ~$10 |
| P3 User's LongFlow head | CFM/MeanFlow head trained on captured states | Offline-good, loop-babble; KEEPING stopping proved stopping/content separability | ~$5 |
| P4 Joint finetune v4 | LLM-LoRA r8 + full head FT + connectors, 950 steps DailyTalk, non-reentrant ckpt | **BREAKTHROUGH: speaks. WER 0.356/SIM 0.931, ear-verified** | ~$5 |
| P5 Eval + polish | 9-dialogue closed-loop harness (6-layer fixes); 2-epoch polish (eval_loss 0.968→0.888) | joint2 = statistical wash vs fullv3; chaos confirmed 3rd way | ~$12 |
| P6 Merge campaign | 3 merges (bf16/fp32/re-run), all mechanically clean | RTF fixed (1.56→~1.0) but WER chaos 0.53–0.79 → **MERGE CLOSED** | ~$8 |
| P7 Speed campaign | cProfile + ladder: LLM 47%, head 8%, **python glue 44%**; compile 1.40 vs 1.37 (no gain); vLLM absent (0 hits) | Speed verdict: launch-bound; honest ceiling ~1.3–1.5×; documented for the Claude session | ~$6 |
| P8 Emotion research | Sub-agent lit scan: R1 reference-clip emotion (community+paper verified), R3 tags, IndexTTS2 mechanism, datasets | EmoV-DB/CREMA-D/RAVDESS/ESD mapped | ~$0 |
| P9 Emotion probes | v1 CREMA-D (F0 300→184 Hz); v2 palette/drama/switch (user: "I hear the emotions"); v3 RAVDESS US-accent 8-emotion palette | **R1 ADOPTED**; accent transfer discovered (fixed via RAVDESS) | ~$8 |
| P10 R3 emotion-LoRA | Warm-start from fullv3, 800 steps CREMA-D tags (+DailyTalk anti-forgetting); 3 tag-eval runs (2 with named bugs, fixed) | Tags shift F0 −87 Hz with refs held constant; **R3 ADOPTED as tag+matching-refs**; tags-alone → voice-drift artifact (documented negative) | ~$12 |
| P11 Quality diagnosis + emo4 | Noise-floor A/B: static is REFERENCE-carried (CREMA-D floor 0.003→gen 0.0059 vs RAVDESS 0.0001); 20 DDPM = 4× high-band; emo4 = 1600 steps on clean RAVDESS+filtered data | **Quality fixed**: emo4 banked, eval_loss 0.67 stable; ship = 20 DDPM | ~$10 |
## 5. RESULTS TABLE (the numbers)
| Configuration | WER (closed loop) | SIM | Duration behavior | RTF (a10g-small) |
|---|---|---|---|---|
| stock | 0.029 | 0.937 | sane | 0.89–1.14 |
| **fullv3 joint (ship lineage)** | **0.356** (band 0.32–0.41) | 0.931 | sane | 1.36–1.79 |
| joint2 polish | 0.317/0.407 (2 runs) | 0.929–0.931 | sane | ~1.43–1.59 |
| emo3 (tags v1) | not WER-eval'd | — | — | — |
| emo4 (clean scale-up, 20 DDPM) | ear-check pending | — | full-length in eval draws | ~1.53 @ 20 steps |
| merged ×3 | 0.53–0.79 | 0.90–0.92 | chaotic | ~1.0 |
| All 5 head-only | ~1.0 (babble) | 0.45–0.70 | runaway 137–172 s | — |
Run-to-run WER variance ±0.1 (DDPM sampling noise); WER is single-draw noisy — multi-seed eval recommended for future claims.
## 6. TECHNIQUES / RECIPES (copy-paste ready)
**Training recipe (the one that works):** LLM-LoRA r=8 α=32 on q/k/v/o/gate/up/down + FULL diffusion-head FT + connector adapters · CE(text) 0.04 + diffusion MSE 1.4 · bs1×accum16 · lr 2.5e-5 fresh / 1e-5 continue · cosine 3% warmup · max_grad_norm 0.8 · gradient_checkpointing **use_reentrant:false** (REQUIRED for LoRA grads) · voice_prompt_drop 0.2 · DailyTalk-format JSONL `{text, audio, voice_prompts:[...]}` (voice_prompts MUST be lists).
**Warm-start recipe:** load previous stage via peft's own `_load_language_model` (raw `load_state_dict` is a key-name no-op!) + `diffusion_head_full.bin` + connector `.bin`s — chain: base → fullv3(dialogue) → emo3(tags) → emo4(quality).
**Emotion recipes:** R1 = emotional reference clips per speaker slot (zero training; verified). R3 = `<emotion>` plain-text tags + emotion-matched DIFFERENT-clip same-actor prompts (800 steps minimum; tags-alone → voice drift; ship = tags + matching refs). R4 (unbuilt): IndexTTS2-style emotion-embedding prefix (arXiv 2506.21619 mechanism).
**Eval recipe:** 9 fixed 2-speaker dialogues (3 tiers), Carter/Maya refs, 10 DDPM (now 20), CFG 1.3, greedy; Whisper-large-v3 `return_timestamps=True`; resemblyzer SIM; per-arm F0/RMS garnish; **user ears = certified instrument** (Whisper hallucinates fluent text on babble; F0 ≠ perceived emotion).
**Inference quality knobs:** 20 DDPM steps (+13% time, 4× high-band) · clean references (noise floor < 0.001 filter) · noise is ref-carried (60× measured).
## 7. ENVIRONMENT PINS + GOTCHAS (proven; full detail in preflight-discipline.md)
torch==2.6.0 · transformers==4.51.3 (4.57+ rejects checkpoint) · peft==0.15.2 (≥0.17 conflicts diffusers 0.29) · diffusers==0.29.0 · datasets==3.6.0 · **setuptools<81** (resemblyzer→webrtcvad pkg_resources) · librosa 0.11 · code: vibevoice-community/VibeVoice @ d5895e7 (inference+lora_loading), voicepowered-ai/VibeVoice-finetuning @ f743686 (trainer).
GOTCHAS (each cost a job): HF cache = relative symlinks (copyfile, never os.replace) · trainer `-e .` upgrades torch (re-pin after) · `sys`/`importlib` unbound in patched main() contexts · nested-quote string surgery fails (patch in committed .sh files) · dataclass exec needs sys.modules registration · eval OOM → expandable_segments + small val · a10g-large sometimes = 22.3GB · aggregate 'loss' logging spikes are accumulation-window artifacts · log tail only ~20 lines (grep pushed logs via uv jobs) · wrapper order: install deps BEFORE preflight · `--label_names input_ids` required for eval_loss with this collator · early_stopping_patience is a callback arg not a TrainingArguments field.
## 8. OPERATIONS DISCIPLINE (institutionalized after failures)
preflight.py (binaries/exact-pins/repos/paths) runs before every job · kill-fast on failed asserts · every submission named `ml-intern-*` · verify pushes within minutes · one variable per run · user ears = certification instrument · foreign repo writes (tucson/az-civic/pima) = the user's OTHER project, no conflict, shared budget only.
## 9. OPEN THREADS (handed off / optional)
1. **Speed research — IN PROGRESS by Claude (separate session):** brief = `speed-verdict-for-research.md`. Closed levers: merge/compile/vLLM/DDPM-reduction. Open: python-glue surgery (44% of gen time; ceiling ~1.3–1.5×), CFG batching, production batching, hardware scaling, distillation. Chaos constraint: any weight/precision change must be re-evaluated closed-loop.
2. **R3 scale-up (optional, ~$10):** 1600 steps on clean US emotional data (RAVDESS done; add EmoV-DB US actors w/ noise filter; Expresso = premium if licensed) — stronger tag channel. emo4 is the warm-start.
3. **SOAR on-trajectory training (optional, ~$15–20):** the only method targeting the stability-boundary chaos; train on the model's own rollouts. Scripts sketched: train_soar.py/train_soar_v2.py in this repo (earlier head-only era — needs rework for joint model).
4. **Paper (optional, ~$0–2):** complete arc banked; spine = §3 evidence chain; systems findings (peft tax, merge chaos, compile dead-end, ref-quality transfer) + emotion-steering wedge as the positive result.
5. **Multi-speaker >3:** untested post-finetune; stock demo caps at 4 slots; probe ran 3 successfully.
## 10. FILE INDEX (this repo, fast-vibevoice-notes)
**Handoff/state:** MASTER_HANDOFF.md (this) · project-state.md · session-resume.md · master-summary.md
**Research:** emotion-research.md · speed-verdict-for-research.md · paper-feasibility.md · eval-design.md · longflow-audit.md
**Results:** eval-results-joint.md · eval-results-joint2.md · ear-check-joint.md · emotion-probe-verdicts.md · baseline-results.md · v3-results.md · diagnosis-results.md · eval-results.md · eval-results-v4.md
**Ops:** preflight-discipline.md · preflight.py · session logs (emo-train-log*.txt, merge-log*.txt, eval-log-*.txt, quality-probe-log.txt, emotion-probe-*.txt)
**Code:** prep_dailytalk.py (manifest builder) · emo_data_prep.py · emo4_data_prep.py · eval_joint.py (canonical closed-loop eval) · eval_2x2.py · emotion_probe.py/_v2/_v3 · emotion_tagged_eval.py · quality_probe.py · speed_profile.py · speed_cprofile.py · speed_ladder_adapter.py · collect_final_samples.py · train_soar.py/_v2 (legacy) · wrappers (*.sh — proven job chains)
**Data/capsules:** v4-caps.tar.gz (capture-era), epoch2-losses/summaries, mf640_gen.py (LongFlow-era)
## 11. HOW TO VERIFY (30 minutes)
1. Listen: `vibevoice-final-samples` in folder order (README has the guide)
2. Metrics: this file §5; per-phase files for raw numbers
3. Weights: `vibevoice-lora-joint` → emo4/lora (ship), fullv3/lora (dialogue-only)
4. Reproduce an eval: `eval_joint.py` + `emotion_probe_v3.py` + `emotion_tagged_eval.py` with the pinned env (§7)
5. Resume anything: session-resume.md + preflight.py + the wrappers