Automatic Speech Recognition
Transformers
Safetensors
meralion3
meralion
meralion-3
custom_code
File size: 23,225 Bytes
58b7249
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
---
license: other
license_name: meralion-public-license-v3
license_link: https://huggingface.co/datasets/MERaLiON/MERaLiON_Public_Licence/blob/main/MERaLiON-Public-Licence-v3.pdf
extra_gated_fields:
  First Name: text
  Last Name: text
  Country: country
  Affiliation: text
  Job title:
    type: select
    options:
    - Student
    - Research Graduate
    - AI developer/Researcher
    - Other
  I consent to being contacted by the MERaLiON team for feedback or follow-up regarding my experience using the model: checkbox
extra_gated_description: >-
  By downloading this model, you acknowledge that you have read and agree to be bound by the Terms and Conditions set out in this document [MERaLiON Public License v3](https://huggingface.co/datasets/MERaLiON/MERaLiON_Public_Licence/blob/main/MERaLiON-Public-Licence-v3.pdf).
  The information you provide will be collected, stored, processed, and shared in accordance with the [A*STAR Privacy Policy](https://www.a-star.edu.sg/privacy-statement).
extra_gated_button_content: Submit
datasets:
- MERaLiON/Multitask-National-Speech-Corpus-v1
language:
- en
- zh
- ms
- ta
- id
- th
- vi
metrics:
- wer
- bleu
base_model:
- openai/whisper-large-v3
- google/gemma-2-9b-it
library_name: transformers
tags:
- meralion
- meralion-3
---

<h1 align="center">🔥 MERaLiON-3 🔥</h1>

<p align="center">
  <a href="https://huggingface.co/MERaLiON/MERaLiON-3-10B">🚀 MERaLiON-3-10B</a>
</p>

<p align="center">
  <a href="https://meralion.org/demo/">💻 Web Demo</a> |
  ⚙️ vLLM coming soon
</p>

## Introduction 
We are pleased to announce the release of our flagship speech-text large language model, [**MERaLiON-3-10B**](https://huggingface.co/MERaLiON/MERaLiON-3-10B). MERaLiON-3-10B demonstrates competitive performance across benchmark evaluations in Age Recognition, Gender Recognition, Spoken Question Answering (SQA), and Contextual Paralinguistic Question Answering (CPQA) in the Southeast Asian context. These results are comparable to those achieved by other state-of-the-art AudioLLMs, including Gemini 3 Flash and Qwen3 Omni Instruct. MERaLiON-3-10B maintains its competitive performance in other tasks such as Multilingual Automatic Speech Recognition (ASR), Speech Translation (ST), Audio Scene Understanding and general speech comprehension vis-à-vis MERaLiON-2-10B.

We constructed a benchmark containing speech and prompts in Malay, Indonesian, English, Chinese, Tamil, Thai and Vietnamese to better represent the Southeast Asian context. The following table presents task-specific evaluation scores, assessed using the LLM-as-a-Judge framework across multiple datasets. Higher scores indicate better performance. We will open-source these benchmarks separately as part of a paper. See the [Evaluation](#performance) section for detailed benchmarks.

| Benchmark | MERaLiON-3-10B | MERaLiON-2-10B | Qwen3 Omni | Gemini 3 Flash | GPT 4o Audio |
| :--- | :---: | :---: | :---: | :---: | :---: |
| Age (commonvoice-en, ta, th, vi, zh) | 75.41 | 61.77 | 70.38 | <u>**77.00**</u> | 68.90 |
| Gender (Multi-dataset) | <u>**96.67**</u> | 54.19 | 95.34 | 81.72 | 40.25 |
| Spoken Q&A (SQA) | <u>**61.50**</u> | 56.76 | 58.74 | 59.75 | 57.48 |
| Contextual paralinguistic Q&A (CPQA) | <u>**57.33**</u> | 48.31 | 54.21 | 54.07 | 54.54 |

## Model Description: 

MERaLiON stands for **M**ultimodal **E**mpathetic **R**easoning **a**nd **L**earning **i**n **O**ne **N**etwork, with models tailored for **Singapore’s multilingual and multicultural landscape**, as well as the wider **Southeast Asian region**. 

MERaLiON-3-10B is finetuned on **150,000 hours of speech and audio data** across **6 diverse tasks**: Automatic Speech Recognition (ASR), SQA, Spoken Dialogue Summarization (SDS), Audio Captioning (AC), Audio-Scene Question Answering (ASQA) and CPQA. 

- **Developed by:** I<sup>2</sup>R, A\*STAR, Singapore
- **Model type:** Multimodal LLM
- **Language(s):** Primarily English (Global and Singapore), Chinese, with support for audio of regional languages including Malay, Tamil, Indonesian, Thai, and Vietnamese.
- **Audio:** **Mono** channel audio, **16000** hz, up to **300** seconds.
- **License:** [MERaLiON Public License](https://huggingface.co/datasets/MERaLiON/MERaLiON_Public_Licence/blob/main/MERaLiON-Public-Licence-v3.pdf)
- **Demo:** [MERaLiON-AudioLLM Web Demo](https://meralion.org/demo/)

## Performance: 

We benchmarked MERaLiON-3-10B against Qwen3 Omni, Gemini 3 Flash, GPT 4o Audio, and MERaLiON-2-10B, and it performed the best on 44 out of 59 benchmarks for tasks related to age recognition, gender recognition, SQA, and CPQA. MERaLiON-3-10B maintains competitive performance vis-à-vis MERaLiON-2-10B on the Audiobench benchmarks.

**Age recognition**

Age recognition tasks categorise speakers as teens (10-19), adults (20-59), or seniors (60-100). The prompts are either in English, or in the same language as the audio. LLM-as-a-judge is used to evaluate the correctness of each response.

| Dataset | Lang | Var | MERaLiON-3-10B | MERaLiON-2-10B | Qwen3 Omni | Gemini 3 Flash | GPT 4o Audio |
| :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| Commonvoice | en | eng | 64.30 | 63.10 | 64.20 | <u>**68.00**</u> | 65.00 |
| | | sea | 64.30 | 63.10 | 64.20 | <u>**68.00**</u> | 65.00 |
| | ta | eng | 78.00 | 64.65 | 73.50 | <u>**79.00**</u> | 71.00 |
| | | sea | 58.00 | 47.90 | 48.40 | <u>**78.00**</u> | 62.00 |
| | th | eng | <u>**81.68**</u> | 57.81 | 78.06 | 77.00 | 78.00 |
| | | sea | 76.39 | 42.19 | 64.13 | <u>**84.00**</u> | 53.00 |
| | vi | eng | <u>**91.96**</u> | 73.23 | 84.39 | 81.00 | 86.00 |
| | | sea | <u>**91.48**</u> | 64.35 | 77.67 | 87.00 | 81.00 |
| | zh | eng | 74.30 | 72.40 | <u>**75.60**</u> | 75.00 | 83.00 |
| | | sea | <u>**73.70**</u> | 69.00 | 73.60 | 73.00 | 45.00 |
| **Average** | | | 75.41 | 61.77 | 70.38 | <u>**77.00**</u> | 68.90 |

**Gender recognition**

The gender recognition benchmark consists of speech samples in Indonesian, Tamil, Thai, Vietnamese, Chinese, Malay, English, and Khmer. The text prompts are either in English, or in the same language as the audio. LLM-as-a-judge is used to evaluate the correctness of each response.

| Dataset | Lang | Var | MERaLiON-3-10B | MERaLiON-2-10B | Qwen3 Omni | Gemini 3 Flash | GPT 4o Audio |
| :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| commonvoice | id | eng | <u>**97.10**</u> | 45.20 | 96.80 | 86.00 | 46.00 |
| | | sea | <u>**97.20**</u> | 57.30 | 96.10 | 90.00 | 53.93 |
| | ta | eng | <u>**97.40**</u> | 53.00 | 96.80 | 65.00 | 33.00 |
| | | sea | <u>**97.10**</u> | 40.40 | 81.90 | 71.00 | 35.00 |
| | th | eng | <u>**97.86**</u> | 50.07 | 96.92 | 87.00 | 50.00 |
| | | sea | <u>**97.99**</u> | 23.96 | 95.18 | 82.00 | 40.00 |
| | vi | eng | <u>**99.22**</u> | 24.05 | 98.82 | 87.00 | 26.00 |
| | | sea | <u>**99.22**</u> | 14.64 | 96.86 | 88.00 | 35.00 |
| | zh | eng | <u>**98.20**</u> | 53.70 | <u>**98.20**</u> | 89.00 | 49.00 |
| | | sea | <u>**98.30**</u> | 35.50 | 98.10 | 82.00 | 21.00 |
| emota | ta | eng | <u>**100.00**</u> | 67.31 | 99.89 | 83.00 | 25.00 |
| | | sea | <u>**100.00**</u> | 48.93 | 97.65 | 86.00 | 33.00 |
| fleurs | en | eng | <u>**100.00**</u> | 58.27 | <u>**100.00**</u> | 73.00 | 78.00 |
| | | sea | <u>**100.00**</u> | 58.27 | <u>**100.00**</u> | 73.00 | 78.00 |
| | km | eng | <u>**100.00**</u> | 56.60 | <u>**100.00**</u> | 94.00 | 62.00 |
| | | sea | 99.48 | 43.40 | <u>**100.00**</u> | 99.00 | 15.00 |
| indowavesentiment | id | eng | <u>**100.00**</u> | 71.67 | <u>**100.00**</u> | 84.00 | 60.00 |
| | | sea | <u>**100.00**</u> | 60.67 | <u>**100.00**</u> | 88.00 | 14.00 |
| m3ed | zh | eng | 93.30 | 84.30 | <u>**94.30**</u> | 73.00 | 23.00 |
| | | sea | 93.70 | 70.70 | <u>**94.40**</u> | 72.00 | 12.00 |
| openslr | ta | eng | <u>**100.00**</u> | 55.30 | 99.00 | 75.00 | 47.00 |
| | | sea | <u>**100.00**</u> | 37.80 | 87.90 | 81.00 | 36.00 |
| sg streets | en | eng | <u>**100.00**</u> | 89.63 | <u>**100.00**</u> | 87.00 | 32.00 |
| | | sea | <u>**100.00**</u> | 89.63 | <u>**100.00**</u> | 87.00 | 32.00 |
| asr-smaldusc | ms | eng | <u>**99.40**</u> | 52.40 | 98.60 | 97.00 | 76.00 |
| | | sea | <u>**99.40**</u> | 44.00 | 98.80 | 99.00 | 24.00 |
| thai elderly speech | th | eng | 99.09 | 68.15 | <u>**99.29**</u> | 77.00 | 46.00 |
| | | sea | <u>**98.99**</u> | 26.92 | 97.39 | 76.00 | 51.00 |
| thai ser | th | eng | <u>**91.41**</u> | 63.46 | 90.47 | 85.00 | 44.00 |
| | | sea | <u>**91.41**</u> | 61.78 | 89.74 | 76.00 | 34.00 |
| vietnam-celeb | vi | eng | <u>**73.90**</u> | 65.80 | 73.80 | 62.00 | 41.00 |
| | | sea | 73.80 | 61.40 | <u>**74.00**</u> | 61.00 | 36.00 |
| **Average** | | | <u>**96.67**</u> | 54.19 | 95.34 | 81.72 | 40.25 |

**Spoken question and answer (SQA)**

The benchmark consists of speech in English, Malay, Tamil, and Chinese, with text prompts in English containing questions related to the speech. As studies have found that LLM judges tend to favor longer, verbose answers even if they are not as clear, high-quality, or accurate as shorter alternatives, we have adjusted the judge's prompt to address verbosity bias.

| Dataset | MERaLiON-3-10B | MERaLiON-2-10B | Qwen3 Omni | Gemini 3 Flash | GPT 4o Audio |
| :--- | :---: | :---: | :---: | :---: | :---: |
| ytb_sqa_batch1 | <u>**67.65**</u> | 65.89 | 66.66 | 63.25 | 60.43 |
| ytb_sqa_batch3_ms | <u>**58.00**</u> | 50.40 | 56.25 | 57.75 | 55.80 |
| ytb_sqa_batch3_ta | 58.55 | 53.60 | 52.25 | <u>**59.45**</u> | 56.25 |
| ytb_sqa_batch3_zh_en | <u>**61.80**</u> | 57.15 | 59.80 | 58.55 | 57.45 |
| **Average** | <u>**61.50**</u> | 56.76 | 58.74 | 59.75 | 57.48 |

**Contextual paralinguistic question and answer (CPQA)**

The audio includes both speech and non-speech elements, and when no speech is present, LLMs are expected to reason solely based on acoustic or musical elements. The speech samples were in languages of Chinese, Malay, Tamil, English, a mix of any of the languages (codeswitch), or could include dialects such as Hokkien. To test for robustness in instruction following, the text prompts were designed to be diverse, and were written in any of the following languages: English, Malay, Tamil, Indonesian, Vietnamese, Chinese, or Thai. LLMs are expected to reply in the same language as the text prompt. Similar to SQA, we have adjusted the judge's prompt to address verbosity bias.

| Dataset | MERaLiON-3-10B | MERaLiON-2-10B | Qwen3 Omni | Gemini 3 Flash | GPT 4o Audio |
| :--- | :---: | :---: | :---: | :---: | :---: |
| yx_youtube_zh | <u>**59.40**</u> | 50.18 | 57.27 | 54.67 | 54.79 |
| yx_youtube_codeswitch | <u>**61.80**</u> | 47.36 | 55.56 | 59.40 | 60.32 |
| yx_youtube_dialect | <u>**59.20**</u> | 47.72 | 56.36 | 55.36 | 54.92 |
| yx_youtube_ms | <u>**60.40**</u> | 46.16 | 53.88 | 57.00 | 56.36 |
| yx_youtube_ta | <u>**58.40**</u> | 38.88 | 49.60 | 56.60 | 54.64 |
| yx_youtube_en | <u>**58.64**</u> | 51.60 | 56.76 | 53.52 | 52.88 |
| ytb_short_eval_cpqa_human1 | <u>**54.64**</u> | 47.57 | 53.95 | 47.42 | 49.97 |
| ytb_short_eval_cpqa_llm1 | <u>**59.42**</u> | 56.25 | 56.07 | 54.94 | 52.44 |
| ytb_long_eval_cpqa_llm1 | <u>**60.46**</u> | 57.48 | 57.44 | 54.94 | 56.32 |
| ytb_long_eval_cpqa_human1 | <u>**60.94**</u> | 51.33 | 59.21 | 56.34 | 55.00 |
| Emotional-YTB-MY_zh_30_test_CPQA_v1 | 51.81 | 46.81 | 51.22 | 51.07 | <u>**53.41**</u> |
| Emotional-YTB-MY_ms_30_test_CPQA_v1 | 50.40 | 44.82 | 48.79 | 49.12 | <u>**53.01**</u> |
| Emotional-YTB-MY_ta_test_CPQA_v1 | 49.77 | 41.88 | 48.62 | 52.56 | <u>**54.96**</u> |
| **Average** | <u>**57.33**</u> | 48.31 | 54.21 | 54.07 | 54.54 |

**Automatic Speech Recognition (ASR), instruction following and audio understanding**

MERaLiON-3-10B continues to demonstrate competitive performance in ASR, instruction following and audio understanding as compared to MERaLiON-2-10B, with improvements on most metrics on Audiobench. Please visit [AudioBench benchmark](https://huggingface.co/spaces/MERaLiON/AudioBench-Leaderboard) for dataset-level evaluation results.

| Benchmark | MERaLiON-3-10B | MERaLiON-2-10B | MERaLiON-2-10B-ASR | MERaLiON-2-3B |
| :--- | :---: | :---: | :---: | :---: |
| ASR (lower better) | <u>**0.125**</u> | 0.1485 | 0.1332 | 0.1697 |
| Speech Instruction | <u>**76.90**</u> | 70.20 | 13.40 | 19.10 |
| Audio Scene Question Answering | <u>**56.98**</u> | 51.14 | 49.51 | 46.14 |
| Spoken QA (Singlish) | <u>**67.25**</u> | 66.55 | 61.85 | 59.70 |
| Audio Captioning | <u>**38.31**</u> | 35.60 | 34.47 | 33.24 |
| Spoken Dialogue Summarisation | <u>**56.45**</u> | 53.10 | 55.80 | 48.55 |
| Spoken QA (English) | <u>**83.42**</u> | 79.74 | 73.98 | 68.72 |
| Music Understanding | <u>**76.07**</u> | 63.94 | 60.66 | 55.60 |
| Accent Recognition | 57.47 | 41.82 | 47.79 | <u>**60.05**</u> |
| Speech Translation | <u>**28.83**</u> | 27.39 | 28.54 | 22.13 |


## How to Use
> [!WARNING]
> **Out of Scope use**: This model is not intended for use in tool calling, math, and coding tasks.

MERaLiON-3 requires `transformers` version `4.56.2`

```
pip install transformers==4.50.1
pip install librosa
```

To run in GPU, MERaLiON-3 requires `flash-attn`.

```
pip install flash-attn --no-build-isolation
```

> [!TIP]
> Should you face any difficulties installing the above packages, you can try installing within this Docker container instead:
> `pytorch/pytorch:2.5.1-cuda12.1-cudnn9-devel`, whose cuda and torch environments have been tested working.

### Audio Input

- For ASR tasks, the maximum audio length is suggested to be 30 seconds at 16,000 Hz.
- For general speech & audio understanding tasks, the maximum audio length which we tested for was up to 300 seconds at 16,000 Hz sampling rate.

### Text Prompt

MERaLiON-3 is trained with this prompt template: 

```
Instruction: <TextHere> \nFollow the text instruction based on the following audio: <SpeechHere>
```

It is generally recommended to follow this template, i.e., replace `<TextHere>` with your text instruction while leaving the `<SpeechHere>` untouched. We list a few useful example prompts here: 

**Standard prompts for better accuracy**

```python
prompt_template = "Instruction: {query} \nFollow the text instruction based on the following audio: <SpeechHere>"

transcription_prompt = prompt_template.format(query="Please transcribe this speech.")
translation_prompt = prompt_template.format(query="Please translate the speech into Malay")
summarization_prompt = prompt_template.format(query="Please summarize this speech")
audio_captioning_prompt_1 = prompt_template.format(query="Please describe the audio")
audio_captioning_prompt_2 = prompt_template.format(query="Please create a caption for the audio")
audio_scene_understanding_prompt = prompt_template.format(query="Are there people crying in the audio?")
speech_as_instruction_prompt = prompt_template.format(query="Please respond to the audio") # given a speech instruction is provided in the audio clip.
emotion_recognition_prompt_1 = prompt_template.format(query="What is the emotion of the speaker")
emotion_recognition_prompt_2 = prompt_template.format(query="Describe the paralinguistic features of the audio")
gender_recognition_prompt = prompt_template.format(query="What is the gender of the speaker")
```

**More flexible prompts for enriched responses**

```python
prompt_template = "Instruction: {query} \nFollow the text instruction based on the following audio: <SpeechHere>"

prompt_1 = prompt_template.format(query="describe the paralinguistics feature and return in json format.")
prompt_2 = prompt_template.format(query="Please summarize the content of the speech and analyse the paralinguistics features of this audio. Return in json format.")
prompt_3 = prompt_template.format(query="Please translate this speech to Singapore's 4 official languages.")
```


**AI agent prompts (beyond the default prompt template)**

```python
prompt_1 = \
"""
You are MERaLiON-AudioLLM, an empathic AI assistant developed by A*STAR. MERaLiON stands for Multimodal Empathetic Reasoning and Learning in One Network.
You are a friendly and empathetic conversational partner, and is proficient in understanding human emotions, accents, and genders from paralinguistic features.
Maintain a tone that is warm, non-judgmental, and supportive while replying to user. 

User's voice:  <SpeechHere>
"""
```

### Huggingface Inference with CPU

```python
import librosa
from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor

repo_id = "MERaLiON/MERaLiON-3-10B"

processor = AutoProcessor.from_pretrained(
    repo_id, 
    trust_remote_code=True,
    )
model = AutoModelForSpeechSeq2Seq.from_pretrained(
    repo_id,
    use_safetensors=True,
    trust_remote_code=True,
)

prompt_template = "Instruction: {query} \nFollow the text instruction based on the following audio: <SpeechHere>"
transcribe_prompt = "Please transcribe this speech."
translate_prompt = "Can you please translate this speech into written Chinese?"

# batch inference of 2 samples
conversation = [
    [{"role": "user", "content": prompt_template.format(query=transcribe_prompt)}],
    [{"role": "user", "content": prompt_template.format(query=translate_prompt)}],
]

chat_prompt = processor.tokenizer.apply_chat_template(
    conversation=conversation,
    tokenize=False,
    add_generation_prompt=True
)

# Use audio at 16000hz.
audio_array, sample_rate = librosa.load("/path/to/your/audio/file", sr=16000)
audio_array = [audio_array]*2
inputs = processor(text=chat_prompt, audios=audio_array)

# adjust the `max_new_tokens` based on your use case.
# Please note the inclusion of `no_repeat_ngram_size=6`.
outputs = model.generate(**inputs, max_new_tokens=256, no_repeat_ngram_size=6)
generated_ids = outputs[:, inputs['input_ids'].size(1):]
response = processor.batch_decode(generated_ids, skip_special_tokens=True)
```

### Huggingface GPU Inference

```python
import torch
import librosa
from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor

repo_id = "MERaLiON/MERaLiON-3-10B"
device = "cuda"

processor = AutoProcessor.from_pretrained(
    repo_id, 
    trust_remote_code=True,
    )
model = AutoModelForSpeechSeq2Seq.from_pretrained(
    repo_id,
    use_safetensors=True,
    trust_remote_code=True,
    attn_implementation="flash_attention_2",
    torch_dtype=torch.bfloat16
).to(device)

prompt_template = "Instruction: {query} \nFollow the text instruction based on the following audio: <SpeechHere>"
transcribe_prompt = "Please transcribe this speech."
translate_prompt = "Can you please translate this speech into written Chinese?"

# batch inference of 2 samples
conversation = [
    [{"role": "user", "content": prompt_template.format(query=transcribe_prompt)}],
    [{"role": "user", "content": prompt_template.format(query=translate_prompt)}],
]

chat_prompt = processor.tokenizer.apply_chat_template(
    conversation=conversation,
    tokenize=False,
    add_generation_prompt=True
)

# Use audio at 16000hz.
audio_array, sample_rate = librosa.load("/path/to/your/audio/file", sr=16000)
audio_array = [audio_array]*2
inputs = processor(text=chat_prompt, audios=audio_array)

inputs = inputs.to(device, dtype=torch.bfloat16)

# adjust the `max_new_tokens` based on your use case.
# Please note the inclusion of `no_repeat_ngram_size=6`.
outputs = model.generate(**inputs, max_new_tokens=256, no_repeat_ngram_size=6)
generated_ids = outputs[:, inputs['input_ids'].size(1):]
response = processor.batch_decode(generated_ids, skip_special_tokens=True)
```

## ⚠️ Disclaimer

The current MERaLiON-3 has not been specifically aligned for safety and may generate content that is inappropriate, offensive, or harmful. Developers and users are responsible for performing their own safety fine-tuning and implementing necessary security measures. The authors shall not be held liable for any claims, damages, or other liabilities arising from the use of the released models, weights, or code.

### Compute and Infrastructure

MERaLiON-3 was trained on the [**ASPIRE 2A+**](https://help.nscc.sg/aspire2aplus/about/) Supercomputer Cluster, provided by [**National Supercomputing Centre (NSCC)**](https://www.nscc.sg/), Singapore. ASPIRE 2A+ cluster provides multiple H100 nodes, with each compute node equipped with 8 Nvidia H100 GPUs, 2 TB of RAM, and 30 TB of locally attached NVMe storage. These nodes are interconnected via a rail-optimised, full fat-tree topology, utilising 400 Gb/s NDR InfiniBand cables. Additionally, the cluster incorporates a 2.5 PB SSD-based Lustre file system, linked to the H100 nodes through high-speed InfiniBand connections. 

With a global batch size of 768, we trained the current release of MERaLiON-3 for around 200k steps, which took around 2 days to complete using 16 nodes, 128 H100 GPUs.

## 📚 Citation

If you find our work useful, please cite our papers:

[MERaLiON-AudioLLM: Bridging Audio and Language with Large Language Models](https://arxiv.org/abs/2412.09818) <br>
[AudioBench: A Universal Benchmark for Audio Large Language Models](https://aclanthology.org/2025.naacl-long.218/) <br>
[Advancing Singlish Understanding: Bridging the Gap with Datasets and Multimodal Models](https://arxiv.org/abs/2501.01034) <br>
[MoWE-Audio: Multitask AudioLLMs with Mixture of Weak Encoders](https://arxiv.org/abs/2409.06635) <br>
[MERaLiON-TextLLM: Cross-Lingual Understanding of Large Language Models in Chinese, Indonesian, Malay, and Singlish](https://arxiv.org/abs/2501.08335) <br>

```
@misc{he2024meralionaudiollmtechnicalreport,
      title={MERaLiON-AudioLLM: Bridging Audio and Language with Large Language Models}, 
      author={{MERaLiON Team}},
      year={2024},
      eprint={2412.09818},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2412.09818}, 
}
```

```
@article{wang2024audiobench,
    title={AudioBench: A Universal Benchmark for Audio Large Language Models},
    author={Wang, Bin and Zou, Xunlong and Lin, Geyu and Sun, Shuo and Liu, Zhuohan and Zhang, Wenyu and Liu, Zhengyuan and Aw, AiTi and Chen, Nancy F},
    journal={NAACL},
    year={2025}
    }
```

```
@article{wang2025advancing,
    title={Advancing Singlish Understanding: Bridging the Gap with Datasets and Multimodal Models},
    author={Wang, Bin and Zou, Xunlong and Sun, Shuo and Zhang, Wenyu and He, Yingxu and Liu, Zhuohan and Wei, Chengwei and Chen, Nancy F and Aw, AiTi},
    journal={arXiv preprint arXiv:2501.01034},
    year={2025}
    }
```

```
@article{zhang2024mowe,
    title={MoWE-Audio: Multitask AudioLLMs with Mixture of Weak Encoders},
    author={Zhang, Wenyu and Sun, Shuo and Wang, Bin and Zou, Xunlong and Liu, Zhuohan and He, Yingxu and Lin, Geyu and Chen, Nancy F and Aw, Ai Ti},
    journal={ICASSP},
    year={2025}
    }
```

```
@misc{huang2025meraliontextllmcrosslingualunderstandinglarge,
      title={MERaLiON-TextLLM: Cross-Lingual Understanding of Large Language Models in Chinese, Indonesian, Malay, and Singlish}, 
      author={Xin Huang and Tarun Kumar Vangani and Minh Duc Pham and Xunlong Zou and Bin Wang and Zhengyuan Liu and Ai Ti Aw},
      year={2025},
      eprint={2501.08335},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2501.08335}, 
}
```