slprl/PAST

Model

PAST: Phonetic-Acoustic Speech Tokenizer

5

15 commits

2 linked in READMEs

updated Sep 15, 2025

See the code

README

PAST: Phonetic-Acoustic Speech Tokenizer

Authors: Nadav Har-Tuv, Or Tal, Yossi Adi
Affiliation: The Hebrew University of Jerusalem

📄 Paper PDF | 🌐 Project Page | 💻 Code

Schematic of the PAST pipeline. The auxiliary heads use the output of the first vector quantization module as input.

Abstract

We present PAST, a novel end-to-end framework that jointly models phonetic information alongside signal reconstruction, eliminating the need for external pretrained models. Unlike previous approaches that rely on pretrained self-supervised models, PAST employs supervised phonetic data, directly integrating domain knowledge into the tokenization process via auxiliary tasks. Additionally, we introduce a streamable, causal variant of PAST, enabling real-time speech applications. Results demonstrate that PAST surpasses existing evaluated baseline tokenizers across common evaluation metrics, including phonetic representation and speech reconstruction. Notably, PAST also achieves superior performance when serving as a speech representation for speech language models, further highlighting its effectiveness as a foundation for spoken language generation.

Samples

Audio samples are available on our project demo page.

Model List

ModelVariantDescription
PASTFullPAST model trained on LibriSpeech + TIMIT
PAST_streamableStreamableCausal variant with 20ms look-ahead

Usage

Pre-requisites

Install

conda create -n past_env python=3.10 -y
conda activate past_env
pip install git+https://github.com/slp-rl/PAST.git

Clone

git clone https://github.com/slp-rl/PAST.git
conda create -n past_env python=3.10 -y
conda activate past_env
pip install -r requirements.txt

Inference

# ---------------
# load PAST model
# ---------------

from past.models.past_model import PastModel
import torch

device = "cuda" if torch.cuda.is_available() else "cpu"
model = PastModel.from_pretrained("PAST", device=device)  # one of ['PAST', 'PAST_streamable']


# ----------------------------------------------------------------------
# Run on audio: PAST expects a batched input format [Batch, Channels, T]
# ----------------------------------------------------------------------
import torchaudio

def read_one_wav(path, target_sr):
    wav, sr = torchaudio.load(path)
    if sr != target_sr:
        wav = torchaudio.transforms.Resample(sr, target_sr)(wav)
    if wav.shape[0] == 2:
        wav = wav[:1]
    return wav.unsqueeze(0)

wav = read_one_wav("path/to/audio.wav", model.sample_rate).to(device)

with torch.no_grad():
    codes, scale = model.encode(wav)
    reconstructed = model.decode(codes, scale)

Evaluation

See Eval README


Results (from the paper)

Phonetic Information

TokenizerPNMI ↑ABX ↓ WithinABX ↓ AcrossWER ↓ CleanWER ↓ Other
D. HuBERT 5000.673.914.7311.324.7
SpeechTokenizer0.723.434.5018.541.3
X-Codec0.409.4212.617.137.1
PAST0.752.823.5415.736.8
PAST - Streamable0.743.053.8914.332.3

Reconstruction Quality

TokenizerSISNR ↑VISQOL ↑PESQ ↑
EnCodec7.494.483.88
SpeechTokenizer0.444.383.15
X-Codec-7.124.463.33
PAST4.844.403.55
PAST - Streamable3.904.373.40

Speech Language Modeling (sWUGGY)

TokenizersWUGGY ↑ IntersWUGGY ↑ OOV
EnCodec56.353.7
D. HuBERT 50067.955.4
SpeechTokenizer63.755.6
X-Codec55.152.9
PAST71.857.5
PAST - Streamable70.256.3

Citation

If you use PAST in your work, please cite:

@article{har2025past,
    title={Past: Phonetic-acoustic speech tokenizer},
    author={Har-Tuv, Nadav and Tal, Or and Adi, Yossi},
    journal={arXiv preprint arXiv:2505.14470},
    year={2025}
  }

Contributors

ortal1602

12 commits

nadav366

1 commits

slprl/PAST

Model

PAST: Phonetic-Acoustic Speech Tokenizer

5

15 commits

2 linked in READMEs

updated Sep 15, 2025

See the code

README

PAST: Phonetic-Acoustic Speech Tokenizer

Authors: Nadav Har-Tuv, Or Tal, Yossi Adi
Affiliation: The Hebrew University of Jerusalem

📄 Paper PDF | 🌐 Project Page | 💻 Code

Schematic of the PAST pipeline. The auxiliary heads use the output of the first vector quantization module as input.

Abstract

We present PAST, a novel end-to-end framework that jointly models phonetic information alongside signal reconstruction, eliminating the need for external pretrained models. Unlike previous approaches that rely on pretrained self-supervised models, PAST employs supervised phonetic data, directly integrating domain knowledge into the tokenization process via auxiliary tasks. Additionally, we introduce a streamable, causal variant of PAST, enabling real-time speech applications. Results demonstrate that PAST surpasses existing evaluated baseline tokenizers across common evaluation metrics, including phonetic representation and speech reconstruction. Notably, PAST also achieves superior performance when serving as a speech representation for speech language models, further highlighting its effectiveness as a foundation for spoken language generation.

Samples

Audio samples are available on our project demo page.

Model List

ModelVariantDescription
PASTFullPAST model trained on LibriSpeech + TIMIT
PAST_streamableStreamableCausal variant with 20ms look-ahead

Usage

Pre-requisites

Install

conda create -n past_env python=3.10 -y
conda activate past_env
pip install git+https://github.com/slp-rl/PAST.git

Clone

git clone https://github.com/slp-rl/PAST.git
conda create -n past_env python=3.10 -y
conda activate past_env
pip install -r requirements.txt

Inference

# ---------------
# load PAST model
# ---------------

from past.models.past_model import PastModel
import torch

device = "cuda" if torch.cuda.is_available() else "cpu"
model = PastModel.from_pretrained("PAST", device=device)  # one of ['PAST', 'PAST_streamable']


# ----------------------------------------------------------------------
# Run on audio: PAST expects a batched input format [Batch, Channels, T]
# ----------------------------------------------------------------------
import torchaudio

def read_one_wav(path, target_sr):
    wav, sr = torchaudio.load(path)
    if sr != target_sr:
        wav = torchaudio.transforms.Resample(sr, target_sr)(wav)
    if wav.shape[0] == 2:
        wav = wav[:1]
    return wav.unsqueeze(0)

wav = read_one_wav("path/to/audio.wav", model.sample_rate).to(device)

with torch.no_grad():
    codes, scale = model.encode(wav)
    reconstructed = model.decode(codes, scale)

Evaluation

See Eval README


Results (from the paper)

Phonetic Information

TokenizerPNMI ↑ABX ↓ WithinABX ↓ AcrossWER ↓ CleanWER ↓ Other
D. HuBERT 5000.673.914.7311.324.7
SpeechTokenizer0.723.434.5018.541.3
X-Codec0.409.4212.617.137.1
PAST0.752.823.5415.736.8
PAST - Streamable0.743.053.8914.332.3

Reconstruction Quality

TokenizerSISNR ↑VISQOL ↑PESQ ↑
EnCodec7.494.483.88
SpeechTokenizer0.444.383.15
X-Codec-7.124.463.33
PAST4.844.403.55
PAST - Streamable3.904.373.40

Speech Language Modeling (sWUGGY)

TokenizersWUGGY ↑ IntersWUGGY ↑ OOV
EnCodec56.353.7
D. HuBERT 50067.955.4
SpeechTokenizer63.755.6
X-Codec55.152.9
PAST71.857.5
PAST - Streamable70.256.3

Citation

If you use PAST in your work, please cite:

@article{har2025past,
    title={Past: Phonetic-acoustic speech tokenizer},
    author={Har-Tuv, Nadav and Tal, Or and Adi, Yossi},
    journal={arXiv preprint arXiv:2505.14470},
    year={2025}
  }

Contributors

ortal1602

12 commits

nadav366

1 commits