add README.md
Browse files
README.md
CHANGED
|
@@ -12,88 +12,60 @@ language:
|
|
| 12 |
- en
|
| 13 |
---
|
| 14 |
|
| 15 |
-
#
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
|
| 30 |
-
|---|
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
##
|
| 47 |
-
Demonstrates the paper's central finding: at the aggressive 25 Hz / 32-dim
|
| 48 |
-
operating point the codec **collapses** (ESTOI -0.004) unless the encoder's
|
| 49 |
-
latent distribution is Gaussianized with **SIGReg** (lambda = 0.05), which
|
| 50 |
-
restores normal training (ESTOI 0.79). Two checkpoints are identical except for
|
| 51 |
-
this term.
|
| 52 |
-
|
| 53 |
-
### Teacher codec (cd128, FSQ, 12.5 Hz)
|
| 54 |
-
The original higher-rate codec (code dim 128, FSQ quantizer, 237.5 tok/s,
|
| 55 |
-
≈2.85 kbps, PESQ ~2.91). Architecturally distinct from the Q2D2 models — it uses
|
| 56 |
-
finite scalar quantization rather than the Q2D2 lattice. Released because it
|
| 57 |
-
serves as the **distillation teacher** for the 1.6 kbps cd64 student and is a
|
| 58 |
-
useful higher-quality reference point.
|
| 59 |
-
|
| 60 |
-
## Each model folder contains
|
| 61 |
-
- `pytorch_model.pt` — inference checkpoint (`ckpt["state_dict"]` = full
|
| 62 |
-
encoder + Q2D2 quantizer + HiFi-GAN decoder; optimizer / discriminator state
|
| 63 |
-
stripped).
|
| 64 |
-
- `model.safetensors` — the same weights in safetensors format.
|
| 65 |
-
- `config.json` — strides, code dim, frame rate, bitrate, sample rate (24 kHz),
|
| 66 |
-
training step, and the checkpoint's eval metric.
|
| 67 |
-
|
| 68 |
-
## Usage
|
| 69 |
|
| 70 |
```python
|
| 71 |
-
import torch
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
model.
|
| 80 |
-
model.
|
| 81 |
-
|
| 82 |
-
# wav: (1, T) mono @ 24 kHz
|
| 83 |
-
tokens = model.encode(wav) # discrete Q2D2 tokens
|
| 84 |
-
recon = model.decode(tokens) # reconstructed 24 kHz waveform
|
| 85 |
```
|
| 86 |
|
| 87 |
-
|
| 88 |
-
|
|
|
|
| 89 |
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
**emergent** property of the JEPA encoder features, evaluated zero-shot on
|
| 94 |
-
FLEURS.
|
| 95 |
|
| 96 |
-
## Citation
|
| 97 |
```bibtex
|
| 98 |
@inproceedings{shukla2026jepaq2d2,
|
| 99 |
title = {JEPA-Q2D2: A Low-Bitrate Speech Codec with Emergent Cross-Lingual Structure},
|
|
@@ -103,5 +75,6 @@ FLEURS.
|
|
| 103 |
}
|
| 104 |
```
|
| 105 |
|
| 106 |
-
##
|
| 107 |
-
|
|
|
|
|
|
| 12 |
- en
|
| 13 |
---
|
| 14 |
|
| 15 |
+
# jepa-q2d2
|
| 16 |
+
|
| 17 |
+
a 1.6 kbps neural speech codec. a jepa (joint-embedding predictive architecture) encoder feeds q2d2, a geometry-aware 2d rhombic-lattice quantizer, and a hifi-gan decoder. the codec objective is trained without any adversarial loss (a frozen wavlm perceptual loss is used while training the decoder).
|
| 18 |
+
|
| 19 |
+
- code: https://github.com/anant-004/jepa-q2d2
|
| 20 |
+
- paper: apsipa asc 2026
|
| 21 |
+
|
| 22 |
+
## models
|
| 23 |
+
|
| 24 |
+
each folder has `pytorch_model.pt`, `model.safetensors`, and `config.json`.
|
| 25 |
+
|
| 26 |
+
| folder | operating point | quantizer | bitrate | quality |
|
| 27 |
+
|--------|-----------------|-----------|---------|---------|
|
| 28 |
+
| `jepa-q2d2-cd64-12.5hz` | 12.5 hz, code dim 64 (main) | q2d2 | 1.6 kbps (100 tok/s) | pesq 2.53, estoi 0.80 |
|
| 29 |
+
| `jepa-q2d2-sigreg-cd32-25hz` | 25 hz, code dim 32, sigreg | q2d2 | 1.6 kbps (100 tok/s) | estoi 0.79 |
|
| 30 |
+
| `teacher-cd128-fsq-12.5hz` | 12.5 hz, code dim 128 | fsq | ~2.85 kbps (237.5 tok/s) | pesq ~2.91 |
|
| 31 |
+
|
| 32 |
+
quality is on a fixed 50-utterance librilight set. estoi is extended stoi, comparable only within this paper's pipeline. the main cd64 model is ahead of encodec at a comparable rate and ahead of mimi on pesq. the sigreg model is the co-design point: at the aggressive 25 hz / cd32 setting the codec collapses unless the encoder distribution is gaussianized with sigreg. the teacher is the higher-rate fsq codec used to distill the cd64 student.
|
| 33 |
+
|
| 34 |
+
## emergent properties
|
| 35 |
+
|
| 36 |
+
the codec is trained on english read speech only and never sees language or emotion labels. the encoder features still pick up structure it was not supervised on.
|
| 37 |
+
|
| 38 |
+
cross-lingual: a 5-nn probe on frozen pre-quantization features separates 6 fleurs languages at 0.85 (chance 0.167), ahead of mimi 0.63, encodec 0.61, dac 0.45, and close to multilingual ssl models. cluster nmi against language is higher too (0.26 vs encodec 0.10, dac 0.07). the utterance-disjoint number is the same (0.85).
|
| 39 |
+
|
| 40 |
+

|
| 41 |
+
|
| 42 |
+
style and emotion: utterance embeddings separate by speaking style on a hindi 5-class set (angry, excited, neutral, sad, whisper). whisper splits off cleanly and the rest form distinct regions for the jepa encoders, while encodec and dac mix them.
|
| 43 |
+
|
| 44 |
+

|
| 45 |
+
|
| 46 |
+
## usage
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
|
| 48 |
```python
|
| 49 |
+
import torch, soundfile as sf
|
| 50 |
+
from koe.fast.hf_codec import load_codec_from_hf # from the github repo
|
| 51 |
+
|
| 52 |
+
model, info = load_codec_from_hf("main", device="cpu") # downloads weights from here
|
| 53 |
+
print(info)
|
| 54 |
+
|
| 55 |
+
wav, sr = sf.read("in.wav") # mono, resampled to 24 khz internally
|
| 56 |
+
x = torch.from_numpy(wav).float().view(1, 1, -1)
|
| 57 |
+
z_q = model.encode(x)[0] # discrete q2d2 tokens
|
| 58 |
+
recon = model.decode(z_q) # 24 khz waveform
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
```
|
| 60 |
|
| 61 |
+
model code lives in the github repo. the released checkpoints already include the fine-tuned encoder, so inference needs only these files plus the repo code.
|
| 62 |
+
|
| 63 |
+
## training data
|
| 64 |
|
| 65 |
+
librilight, english read speech, 24 khz. the cross-lingual structure above is evaluated zero-shot on fleurs.
|
| 66 |
+
|
| 67 |
+
## citation
|
|
|
|
|
|
|
| 68 |
|
|
|
|
| 69 |
```bibtex
|
| 70 |
@inproceedings{shukla2026jepaq2d2,
|
| 71 |
title = {JEPA-Q2D2: A Low-Bitrate Speech Codec with Emergent Cross-Lingual Structure},
|
|
|
|
| 75 |
}
|
| 76 |
```
|
| 77 |
|
| 78 |
+
## license
|
| 79 |
+
|
| 80 |
+
cc-by-4.0, released for research use.
|