Alpa अल्प

Inside Alpa — follow one sound from letter to voice

Choose a verse or type your own Sanskrit. Everything below is computed live in your browser from Alpa v0.2’s real 4,531,723 weights (8.4 MB, int8-stored). Click any token in the ribbon to trace it step by step—from Devanagari rules to 24 kHz glottal pulses—and intervene at any layer to hear what changes.

0 / 180
Loading Alpa v0.2 inspector (8.4 MB)…
Waiting for model… ← / → step token · Space play/stop

01Script → Phonemes & Syllable Weight

text.js · 0 learned parameters · 47-symbol SLP1 inventory

Before any neural weight runs, a deterministic Sanskrit reader unpacks your Devanagari into 47 sound symbols: every inherent a stays spoken, anusvāra assimilates to the next stop’s class, aspirated stops split into plain + h so the English base model could aspirate immediately, and every vowel receives its metrical weight—laghu (light, 1) or guru (heavy, 2)—in place of English stress.

Live intervention · Override Syllable Weight
For the selected vowel token, force its syllable weight and re-run Alpa live:
Output: tokens[N], weight[N] Next · 02 The 0.2% Lookup Tables ↓

02The 0.2% Lookup Tables & English Transplant

10,368 params · Vital bottleneck #1 (94.0% error if scrambled)

Each token looks up three 192-number vectors and sums them: its sound row (tokens.weight), its syllable-weight row (syllable_weight), and the text-side voice row (voices). Alpa began by rewriting only these two language tables (0.2% of tiny-voca’s English weights), seeding retroflexes ट ड ण ष as 70% dental + 30% English ɹ so a short CPU run could pull them apart.

Real 192-d vectors summed for the selected token
All 47 Sanskrit tokens (2D PCA of tokens.weight) · click any dot
Time travel · Hear the English transplant before vs. after CPU training

03Text Encoder — Context, Coarticulation & Early Pitch

4 transformer+conv blocks · 1,588,480 params (35.1%)

Four blocks read the whole token sequence in parallel. Each block combines 4-head rotary self-attention (long-range context, pauses, clause structure) with a kernel-7 depthwise convolution + 640-d GELU feed-forward layer (local ±3-token coarticulation). Even before audio frames exist, Run 53’s linear probes show pitch is already 57% predictable by Block 4.

Encoder attention arcs from selected token
All 16 heads (4 blocks × 4 heads) · click any cell to inspect
Run 53 linear probes: what each stage knows (held-out female speech)

04The Prism — Duration Prediction, Expansion & Voice Identity

123,906 params · Vital bottleneck #2 (76.9% error if scrambled)

Here Alpa leaps from discrete symbols to real time. A tiny convolutional predictor gives every token an integer count of 10.7 ms frames—or collapses word spaces to 0 frames when its pause logit is negative. Each token state fans out across its frames, gets a 3-number intra-phoneme clock (progress, remaining, log length), and receives frame_voices—the 192-number vector that actually decides who is speaking.

Click any token or frame ribbon to lock onto it · silent spaces collapse to dashed ticks
Live intervention · Run 53 Discovery: Decouple Text-Side vs. Sound-Side Voice Rows

Move Text-side (voices, Stage 2) and Sound-side (frame_voices, Stage 4) independently, then press Play. Notice that flipping Text-side barely shifts pitch, while flipping Sound-side switches the speaker’s identity and pitch register.

05Prosody Stack — Where Pitch, Voicing & Loudness Settle

2 frame blocks · 794,240 params (17.5%) · pitch R² hits 98%

Two frame-rate transformer blocks predict three numbers every 10.7 ms: continuous pitch (F0), voicing probability (with a rule clamping vowels voiced so creaky vowels never whisper), and loudness. Surprisingly, Run 53 found that scrambling the 768-weight prosody_projection that feeds those three numbers forward into Stage 6 barely changes speech—because the 192-d hidden stream already carries the prosody.

Click or drag along the timeline to inspect any 10.7 ms frame across Stages 5–7
Live intervention · Prosody Controls & Run 53 Feedback Ablation

06Acoustic Stack — The 16.4% Attention Paradox

5 frame blocks · 1,985,600 params (43.8% of the whole model)

Five frame-rate blocks translate hidden states into vocal-tract control vectors. Look inside and a striking asymmetry appears: self-attention across these five blocks accounts for 741,120 weights (16.4% of Alpa) and looks 100–1,200 ms away, yet contributes far less than the local depthwise-convolution + FFN half. Test it live below by switching off all five acoustic attention layers at once.

Relative update size (‖Δ‖/‖x‖) for the active token across all 11 blocks
Live intervention · Bypass Any Sublayer in All 11 Blocks 22 / 22 active

07Source-Filter Voice Box & Polish → 24 kHz Sound

25,862 params (0.57%) · Vital bottlenecks #3 & #4 (98.6% & 26.2% error)

Alpa has no neural vocoder. Two tiny linear heads predict complex cepstra that shape two physical excitations: a band-limited glottal pulse train at F0 and white breath noise. In v0.1, the network built hiss out of pitched pulses—giving sibilants like श a metallic buzz. Polish fixed it with zero retraining by putting a per-sound frequency wall: pulses below, white noise above, plus ×1.6 formant sharpening.

Vocal-tract filter response |H(f)| at selected frame
Live 24 kHz spectrogram & dual waveform (gold = harmonic, rose = noise) · click to scrub
Live Mixing Desk · Solo Branches Instantly & Dissect Polish
Instant branch solo (works mid-playback):
Polish mode (re-synthesizes live):

08Anatomy — All 4,531,723 Weights & Real Weight-Shuffle Lesions

3.5% vital bottleneck vs. 96.5% redundant transformer bulk

Every single weight of alpa-v0.2.pt is drawn below at 1 pixel per parameter (−3σ teal · 0 obsidian · +3σ gold). Hover or click any rectangle to read its exact tensor shape and singular-value effective rank—notice how the final sound block’s attention output uses only 17.6% of its rank, showing faint horizontal stripes right inside the matrix. Below, listen to Run 53’s true weight-shuffle lesions on real alpa-v0.2.pt weights.

Real weight matrix pixels of Alpa v0.2
Hover or tap any matrix rectangle above to inspect its tensor name, shape, and effective rank.
Run 53 · Real Weight-Shuffle Lesions (on नटः पटं धरति, शान्तिः।) Su-śrotā error rates from Run 53 (8 held-out sentences)

What is real, and what is precomputed