We introduce
MERaLiON-SpeechEncoder-2
, our next-generation multilingual speech encoder that was pre-trained from scratch on a greatly expanded corpus of
1.4 million hours
of unlabeled audio, with a
strong focus on Southeast Asian (SEA) languages and accents
. As a speech foundation model, it encodes speech into a general-purpose, multilingual acoustic representation that can serve as a high-performance backbone for a wide range of downstream tasks — including automatic speech recognition (ASR), speech translation, speaker and language identification, and emotion recognition.
This model can be finetuned on custom datasets, allowing developers to build speech systems tailored to their specific needs.
Unlike many existing models optimized for high-resource, Western languages, MERaLiON-SpeechEncoder-2 is designed from the ground up to reflect the linguistic diversity and complexity of Southeast Asia. Our training data was curated to contain a substantial amount originating from Singapore and SEA, including 60,000 hours of Singapore-accented speech, with a further 160,000 hours covering Singapore’s official languages Chinese, Malay and Tamil, along with a smaller portion of dialects like Hokkien and Cantonese. SEA data amounts to 200,000 hours, including significant proportions of Malay, Thai, Indonesian, Vietnamese, with smaller amounts of Tagalog, Burmese, Javanese, Sundanese, Khmer and Lao. See below for a regional breakdown of the language coverage of our pre-training data.
Model Highlights
Small model size
With only
630M parameters (≈2.5 GB in memory)
, the model is easily deployable on most commercial GPUs, eliminating the need for distributed or large-scale compute setups.
Natively multilingual
Building on
MERaLiON-SpeechEncoder-v1
(which focused on English and Singlish), this version expands to include
English, Chinese, Malay, Tamil, Thai, Indonesian, and Vietnamese, along with codeswitching support across these languages
. Given the wide coverage of languages in the training corpus, it may also be applicable beyond the officially supported languages.
Competitive performance on downstream speech tasks
The model retains near state-of-the-art results on the SUPERB benchmark for English, and showcases strong multilingual capabilities demonstrated through its integration into a
high-performance ASR system
.
Innovative pre-training techniques
MERaLiON-SpeechEncoder-2 was trained from scratch with a
novel extension of the BEST-RQ self-supervised objective
, by using more informative latent targets. We also adopted the
Muon optimizer
, which has previously only been shown to outperform the widely-used AdamW optimizer for LLM training. We find its advantages also carry over to speech-based models.
Model Summary
Developed by:
I
2
R, A*STAR
Model type:
Speech Encoder
Language(s):
English (Global & Singapore), Chinese, Malay, Tamil, Thai, Indonesian, and Vietnamese.
For details on background, pre-training, tuning experiments and evaluation, please refer to our
technical report
.
Benchmarks
SUPERB
Model
Overall Score
PR↓
ASR↓
KS↑
QbE↑
SID↑
ASV↓
SD↓
ER↑
IC↑
SF (F1↑ / CER↓)
HuBERT large
82.25
3.53
3.62
95.29
0.0354
90.33
5.98
5.75
67.62
98.76
89.91 / 21.76
WavLM large
84.77
3.06
3.44
97.86
0.0886
95.49
3.77
3.24
70.62
99.31
92.21 / 18.36
MERaLiON-SpeechEncoder-v1
82.62
3.14
4.16
97.63
0.0590
91.09
5.18
5.06
68.02
98.60
88.99 / 23.89
MERaLiON-SpeechEncoder-2
82.72
3.40
4.96
97.57
0.0575
88.96
3.93
3.90
68.80
98.95
89.50 / 23.46
SUPERB
is an English-based benchmark for speech encoders covering a wide range of downstream speech tasks across domains such as recognition, detection, semantics, speaker, and paralinguistics, where each task is finetuned separately with a frozen encoder.
MERaLiON-SpeechEncoder-2 is competitive to state-of-the-art, improving slightly against our own v1 model on speaker and paralinguistic tasks.
Automatic Speech Recognition (ASR)
Leveraging on the multilingual capabilities of MERaLiON-SpeechEncoder-2, we further finetuned the model for ASR on supervised speech data to produce a lightweight MERaLiON-SpeechEncoder-2-ASR-CTC, which is competitive to models many times its size in transcribing the target languages, while offering much faster inference speeds. It outperforms the popular Whisper large v3 across most languages in
Audiobench
and maintains close performance on FLEURS. Our comprehensive internal benchmarking, shown in the 'Overall ASR Performance', also contains several private datasets in addition to Audiobench and FLEURS.
Direct Use
The following code snippet can be used to directly obtain latent features i.e. encoded speech by forwarding through the model. Inputs into the model are expected to be 80-dimensional Mel-spectrogram features transformed from audio sample at 16kHz. The AutoFeatureExtractor method can carry out this conversion.
import torch
from datasets import load_dataset
from transformers import AutoModel, AutoFeatureExtractor
repo_id = 'MERaLiON/MERaLiON-SpeechEncoder-2'
device = 'cuda'if torch.cuda.is_available() else'cpu'# load model and feature extractor
model = AutoModel.from_pretrained(
repo_id,
trust_remote_code=True,
)
model = model.to(device)
feature_extractor = AutoFeatureExtractor.from_pretrained(
repo_id,
trust_remote_code=True
)
# prepare data
data = load_dataset("distil-whisper/librispeech_long", "clean",
split="validation")
defbatch_collater(data):
tensors = []
for idx, sample inenumerate(data):
tensors.append(sample['audio']['array'])
return tensors
audio_array = batch_collater(data)
inputs = feature_extractor(audio_array, sampling_rate=16_000,
return_attention_mask=True,
return_tensors='pt', do_normalize=False)
inputs = inputs.to(device)
# model inference to obtain featureswith torch.no_grad():
model.eval()
output = model(input_values=inputs['input_values'],
attention_mask=inputs['attention_mask'],
output_hidden_states=True)
# output is a Wav2Vec2BaseModelOutput or tuple containing:# last_hidden_state: torch.FloatTensor containing hidden states of the last layer of the model# extract_features: torch.FloatTensor containing extracted features from the convolution downsampling layers# hidden_states: tuple(torch.FloatTensor) containing hidden states of each layer of the model# attentions: tuple(torch.FloatTensor) containing attention states of each layer of the model
Downstream Use
Speech encoders are normally used in finetuning setups to provide the frontend to downstream speech applications. We provide an example below of an ASR finetuning setup with Huggingface. Please refer to this
blog
for the full ASR finetuning recipe using Huggingface Trainer. Alternatively, the Huggingface model can be loaded to any other frameworks such as Pytorch or ESPnet for custom finetuning loops.
The model was trained with 64 H100 GPUs across 8 nodes for collectively around 3.5 million steps. The SEA data split was upsampled in the last phase of training. Training time took approximately 15 days.
Citation
If you find our work useful, please cite our technical report:
@misc{huzaifah2024speechfoundationmodelsingapore,
title={MERaLiON-SpeechEncoder: Towards a Speech Foundation Model for Singapore and Beyond},
author={{MERaLiON Team}},
year={2024},
eprint={2412.11538},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2412.11538},
}
Runs of MERaLiON MERaLiON-SpeechEncoder-2 on huggingface.co
237
Total runs
0
24-hour runs
4
3-day runs
-81
7-day runs
-81
30-day runs
More Information About MERaLiON-SpeechEncoder-2 huggingface.co Model
MERaLiON-SpeechEncoder-2 huggingface.co is an AI model on huggingface.co that provides MERaLiON-SpeechEncoder-2's model effect (), which can be used instantly with this MERaLiON MERaLiON-SpeechEncoder-2 model. huggingface.co supports a free trial of the MERaLiON-SpeechEncoder-2 model, and also provides paid use of the MERaLiON-SpeechEncoder-2. Support call MERaLiON-SpeechEncoder-2 model through api, including Node.js, Python, http.
MERaLiON-SpeechEncoder-2 huggingface.co is an online trial and call api platform, which integrates MERaLiON-SpeechEncoder-2's modeling effects, including api services, and provides a free online trial of MERaLiON-SpeechEncoder-2, you can try MERaLiON-SpeechEncoder-2 online for free by clicking the link below.
MERaLiON MERaLiON-SpeechEncoder-2 online free url in huggingface.co:
MERaLiON-SpeechEncoder-2 is an open source model from GitHub that offers a free installation service, and any user can find MERaLiON-SpeechEncoder-2 on GitHub to install. At the same time, huggingface.co provides the effect of MERaLiON-SpeechEncoder-2 install, users can directly use MERaLiON-SpeechEncoder-2 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
MERaLiON-SpeechEncoder-2 install url in huggingface.co: