Skip to content

Make user speech profile identification actually good #12765

Closed

Description

@Git-on-my-level

Problem

User speech profiles (mobile onboarding enroll + later matching) are not reliable enough to trust. Two separate failures:

  1. Most users never get a real voiceprint. Among people who hit the onboarding speech-profile step, most skip.
  2. The ones who enroll still get a weak / inconsistent identity. Enroll and later matching do not use the same speaker model, and enroll is a single noisy Q&A WAV with a raw cosine cutoff.

This is the user's own speech profile (POST /v3/upload-audio → users/{uid}/speech_profile.wav + speaker_embedding), not “other people” teaching (#7187, #6039) and not 3+ speaker diarization (#5470).

Evidence (2026-09-04, read-only)

Adoption (PostHog, mobile iOS/Android/iPadOS, noncanonical — no catalog metric):

  • 30d: 3,204 finished onboarding; 3,266 hit the speech-profile step; 625 completed (19%), 2,692 skipped (81%). 1,200 later opened Settings → Speech Profile.
  • 90d: 8,549 onboarded; 2,017 completed / 6,779 skipped (~23% complete among people who saw the step).
  • Onboarding Step Speech Profile Completed is the All Done button. Failed uploads still complete onboarding (completeAfterUploadFailure still sets profileCompleted). It is not proof the voiceprint landed.

Upload path (prod Cloud Run backend, POST /v3/upload-audio, 2026-08-29 → 2026-09-04, counts only):

  • 553 requests: 444 × 200 (80%), 108 × 400 (20%), 1 × 500.
  • Embeddings stored on almost every 200 (3 extract failures in the week).
  • 400s were dominated by the old 120s duration cap (known ~28% of onboarding uploads). aee08dc (2026-08-31) raised the cap to 180s; 400s fell from 40 on Aug 31 → 5–6/day → 0 so far on Sep 4.

Could not count gs://speech-profiles objects (RO bot lacks storage.objects.list).

Accuracy architecture (origin/main):

  • Enroll + live listen match: HOSTED_SPEAKER_EMBEDDING_API_URL/v2/embedding = pyannote/wespeaker-voxceleb-resnet34-LM, cosine 0.45, clips ≤10s.
  • Post-process match: HOSTED_SPEECH_PROFILE_API_URL = SpeechBrain ECAPA-TDNN (speechbrain/spkrec-ecapa-voxceleb) on the WAV via verify_files.
  • Same user, two embedding spaces. VAD trim on enroll is pyannote VAD with Silero ONNX fallback; multi-speaker reject is client-only.

Goal

A user who records the onboarding Q&A (or Settings recapture) should get a voiceprint that consistently marks their speech as them on later listens, without a second incompatible matcher.

Scope (3 items)

  1. Unify on one embedding stack. Enroll, live SpeakerMatcher, and post-process identification must use the same model and the stored vector. Remove SpeechBrain verify_files as a parallel identity path.
  2. Better enroll method, then a better small model. Centroid of the six answers (not one concatenated WAV); server-side single-speaker + min-speech-after-VAD gates; AS-Norm / relative ranking instead of a raw 0.45 cutoff. Swap ResNet34-LM for ERes2NetV2 or CAM++ in the existing diarizer /v2/embedding service (short-clip SV, not a 580M SSL model).
  3. Honest telemetry. Distinct events for skip / upload 200 / upload 4xx / embedding stored / live match accept|reject. Stop treating All Done as enroll success.

Out of scope

Acceptance

  • One embedding model ID on enroll write and live/post read; a test fails if those paths disagree.
  • Onboarding complete no longer implies a stored profile; Settings can recapture.
  • Prod: upload 4xx rate stays low after the 180s cap; new match telemetry exists; skip vs success remain separate.

Related

Activity

  1. added
    enhancement
    backend
    understand
    p2
    on Sep 4, 2026
  2. Git-on-my-level commented on Sep 9, 2026

    @Git-on-my-level
    MemberAuthor

    Closed by #12893 (merge commit d324a95): /v3/upload-audio now extracts and stores the speaker embedding before overwriting GCS profile audio (503 on extract/store failure, so a 200 means the voiceprint landed), and onboarding enroll telemetry now distinguishes skip/continue from upload/embedding success. The broader matching-quality rework landed earlier in #12935.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendembeddingsenhancementmobileonboardingp2understand

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions