SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2407.04051 · 2024

FunAudioLLM: Voice Understanding and Generation Foundation Models for Natural Interaction Between Humans and LLMs

arXiv · PDF · Open in the Atlas

Code that ran

10 of 10 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 8 failures of our instrument; 0 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2407.04051.json · badge: /api/ran/2407.04051.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
FunAudioLLM/SenseVoice canonical (classifier label)
classifier basis: census
9 ran · 0 no recorded run
xingchensong/s3tokenizer reimplementation (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
FunctionStatusWhere it lives
create_sensevoice_model Ran
ran; our contract draft was wrong, not the code
FunAudioLLM/SenseVoice/long_audio_no_vad.py
code served (permissive licence) · get_code("be9e79b09e9b1c3f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned MockAutoModelClass. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

class MockAutoModelClass(nn.Module):
    """Mock auto model class that simulates SenseVoice model loading."""
    def __init__(self, model, device, disable_update):
        super().__init__()
        self.model = model
        self.device = device
        self.disable_update = disable_update
    
    def __call__(self, *args, **kwargs):
        return self

ARGS = {
    "auto_model_class": MockAutoModelClass,
    "model_name": "sensevoice-small",
    "device": "cpu",
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MockAutoModelClass — a MockAutoModelClass output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MockAutoModelClass output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
export_dummy_inputs Ran
ran on a synthesized input
FunAudioLLM/SenseVoice/export_meta.py
code served (permissive licence) · get_code("45fa8b136cb3c441")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

class DummyModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def forward(self, x):
        return x

model = DummyModel()

ARGS = {
    'self': model
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
export_forward Ran
ran; our contract draft was wrong, not the code
FunAudioLLM/SenseVoice/export_meta.py
code served (permissive licence) · get_code("19aab5f362ccf5f0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Build a minimal embed module that returns embeddings
class EmbedModule(nn.Module):
    def __init__(self, vocab_size=10, embedding_dim=4):
        super().__init__()
        self.embedding = nn.Embedding(vocab_size, embedding_dim)
    
    def forward(self, x):
        return self.embedding(x)

# Build a minimal encoder that returns (output, lengths)
class EncoderModule(nn.Module):
    def __init__(self, input_dim=4, output_dim=5):
        super().__init__()
        self.linear = nn.Linear(input_dim, output_dim)
    
    def forward(self, speech, speech_lengths):
        # speech shape: (batch, seq_len, input_dim)
        # output shape: (batch, seq_len, output_dim)
        encoder_out = self.linear(speech)
        return encoder_out, speech_lengths

# Build a minimal CTC module
class CTCModule(nn.Module):
    def __init__(self, input_dim=5, num_classes=50):
        super().__init__()
        self.ctc_lo = nn.Linear(input_dim, num_classes)

# Build the self object with all required attributes
class ExportModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.embed = EmbedModule(vocab_size=10, embedding_dim=4)
        self.encoder = EncoderModule(input_dim=4, output_dim=5)
        self.ctc = CTCModule(input_dim=5, num_classes=50)
    
    def forward(self, speech, speech_lengths, language, textnorm, **kwargs):
        language_query = self.embed(language.to(speech.device)).unsqueeze(1)
        textnorm_query = self.embed(textnorm.to(speech.device)).unsqueeze(1)
        print(textnorm_query.shape, speech.shape)
        speech = torch.cat((textnorm_query, speech), dim=1)
        speech_lengths += 1
        event_emo_query = self.embed(torch.LongTensor([[1, 2]]).to(speech.device)).repeat(speech.size(0), 1, 1)
        input_query = torch.cat((language_query, event_emo_query), dim=1)
        speech = torch.cat((input_query, speech), dim=1)
        speech_lengths += 3
        encoder_out, encoder_out_lens = self.encoder(speech, speech_lengths)
        if isinstance(encoder_out, tuple):
            encoder_out = encoder_out[0]
        ctc_logits = self.ctc.ctc_lo(encoder_out)
        return (ctc_logits, encoder_out_lens)

# Create arguments
batch_size = 2
seq_len = 6
embedding_dim = 4

model = ExportModel()

ARGS = {
    'self': model,
    'speech': torch.randn(batch_size, seq_len, embedding_dim),
    'speech_lengths': torch.tensor([seq_len, seq_len], dtype=torch.long),
    'language': torch.randint(0, 10, (batch_size,), dtype=torch.long),
    'textnorm': torch.randint(0, 10, (batch_size,), dtype=torch.long),
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
format_str Ran
ran; our contract draft was wrong, not the code
FunAudioLLM/SenseVoice/webui.py
code served (permissive licence) · get_code("df46a8419573e3a7")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

# The function format_str takes a single parameter 's' which is a string
# It iterates through emoji_dict and replaces special tokens with their emoji equivalents
# The function returns a modified string

ARGS = {
    's': '<|Speech|> Hello <|HAPPY|> <|nospeech|><|Event_UNK|>'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
format_str_v2 Ran
ran; our contract draft was wrong, not the code
FunAudioLLM/SenseVoice/webui.py
code served (permissive licence) · get_code("8454be6adc9ddaa4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

# Setup code for format_str_v2

def format_str_v2(s):
    emoji_dict = {'<|nospeech|><|Event_UNK|>': '❓', '<|zh|>': '', '<|en|>': '', '<|yue|>': '', '<|ja|>': '', '<|ko|>': '', '<|nospeech|>': '', '<|HAPPY|>': '😊', '<|SAD|>': '😔', '<|ANGRY|>': '😡', '<|NEUTRAL|>': '', '<|BGM|>': '🎼', '<|Speech|>': '', '<|Applause|>': '👏', '<|Laughter|>': '😀', '<|FEARFUL|>': '😰', '<|DISGUSTED|>': '🤢', '<|SURPRISED|>': '😮', '<|Cry|>': '😭', '<|EMO_UNKNOWN|>': '', '<|Sneeze|>': '🤧', '<|Breath|>': '', '<|Cough|>': '😷', '<|Sing|>': '', '<|Speech_Noise|>': '', '<|withitn|>': '', '<|woitn|>': '', '<|GBG|>': '', '<|Event_UNK|>': ''}
    
    emo_dict = {'<|HAPPY|>': '😊', '<|SAD|>': '😔', '<|ANGRY|>': '😡', '<|NEUTRAL|>': '', '<|FEARFUL|>': '😰', '<|DISGUSTED|>': '🤢', '<|SURPRISED|>': '😮'}
    
    event_dict = {'<|BGM|>': '🎼', '<|Speech|>': '', '<|Applause|>': '👏', '<|Laughter|>': '😀', '<|Cry|>': '😭', '<|Sneeze|>': '🤧', '<|Breath|>': '', '<|Cough|>': '🤧'}
    
    emo_set = {'😊', '😔', '😡', '😰', '🤢', '😮'}
    event_set = {'🎼', '👏', '😀', '😭', '🤧', '😷'}
    
    sptk_dict = {}
    for sptk in emoji_dict:
        sptk_dict[sptk] = s.count(sptk)
        s = s.replace(sptk, '')
    emo = '<|NEUTRAL|>'
    for e in emo_dict:
        if sptk_dict[e] > sptk_dict[emo]:
            emo = e
    for e in event_dict:
        if sptk_dict[e] > 0:
            s = event_dict[e] + s
    s = s + emo_dict[emo]
    for emoji in emo_set.union(event_set):
        s = s.replace(' ' + emoji, emoji)
        s = s.replace(emoji + ' ', emoji)
    return s.strip()

# Test input: a simple string with some special tokens
test_input = "hello <|HAPPY|> world <|BGM|>"

ARGS = {
    's': test_input
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
format_str_v3 Ran
ran; our contract draft was wrong, not the code
FunAudioLLM/SenseVoice/webui.py
code served (permissive licence) · get_code("5565f8d59ef72ba2")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

# format_str_v3 takes a single string parameter 's'
# The function processes special tokens, languages, emotions, and events
# by replacing them with emojis and formatting the output string

ARGS = {
    's': '<|zh|>你好<|HAPPY|><|Speech|>hello<|en|>world<|NEUTRAL|>'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
load_audio_cpp_model_spec Ran
ran; our contract draft was wrong, not the code
FunAudioLLM/SenseVoice/runtime/llama.cpp/export_sensevoice_gguf.py
code served (permissive licence) · get_code("51218edc823a6583")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import json
import tempfile
import os

# Create a temporary directory and file for the model spec
temp_dir = tempfile.mkdtemp()
spec_file_path = os.path.join(temp_dir, "model_spec.json")

# Create a valid model spec that matches the function's requirements
valid_spec = {
    "schema_version": 1,
    "family": "sense_asr",
    "model_name": "test_model",
    "version": "1.0"
}

# Write the spec to a file
with open(spec_file_path, 'w', encoding='utf-8') as f:
    json.dump(valid_spec, f)

ARGS = {
    "path": spec_file_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
merge_transcripts Ran
ran; our contract draft was wrong, not the code
FunAudioLLM/SenseVoice/long_audio_no_vad.py
code served (permissive licence) · get_code("eb667117f53a99ce")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

# Analyze the function: merge_transcripts takes texts (iterable of strings)
# and two keyword-only parameters: min_overlap_chars and max_overlap_chars (both ints)
# The function processes text strings, does case-insensitive comparisons, and concatenates them

# Construct test data
texts = [
    "The quick brown fox jumps over",
    "over the lazy dog. This is",
    "is a test of the merge function",
    "",  # empty string to test skip logic
    "function works correctly"
]

ARGS = {
    "texts": texts,
    "min_overlap_chars": 4,
    "max_overlap_chars": 200,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
sequence_mask Ran
ran; our contract draft was wrong, not the code
FunAudioLLM/SenseVoice/model.py
code served (permissive licence) · get_code("8c9161f8d6f989d3")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Construct arguments for sequence_mask
lengths = torch.tensor([2, 3], dtype=torch.int64)
maxlen = 4
dtype = torch.float32
device = None

ARGS = {
    "lengths": lengths,
    "maxlen": maxlen,
    "dtype": dtype,
    "device": device,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
sinusoids Ran
ran, honoured the contract we drafted
xingchensong/s3tokenizer/s3tokenizer/model.py
code served (permissive licence) · get_code("e529c9641c178fe0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (8, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import torch

torch.manual_seed(0)

ARGS = {
    "length": 8,
    "channels": 4,
    "max_timescale": 10000,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (8, 4) — shape (8, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 9 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
sinusoids 9 other papers
7 dated earlier, 2 later
2212.04356 (2022-12)
Robust Speech Recognition via Large-Scale Weak Supervision
2306.05284 (2023-06)
Simple and Controllable Music Generation
2307.03183 (2023-07)
Whisper-AT: Noise-Robust Automatic Speech Recognizers are Also Strong General Audio Event Taggers
and 6 more not named here

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

This report introduces FunAudioLLM, a model family designed to enhance natural voice interactions between humans and large language models (LLMs). At its core are two innovative models: SenseVoice, which handles multilingual speech recognition, emotion recognition, and audio event detection; and CosyVoice, which facilitates natural speech generation with control over multiple languages, timbre, speaking style, and speaker identity. SenseVoice-Small delivers exceptionally low-latency ASR for 5 languages, and SenseVoice-Large supports high-precision ASR for over 50 languages, while CosyVoice excels in multi-lingual voice generation, zero-shot in-context learning, cross-lingual voice cloning, and instruction-following capabilities. The models related to SenseVoice and CosyVoice have been open-sourced on Modelscope and Huggingface, along with the corresponding training, inference, and fine-tuning codes released on GitHub. By integrating these models with LLMs, FunAudioLLM enables applications such as speech-to-speech translation, emotional voice chat, interactive podcasts, and expressive audiobook narration, thereby pushing the boundaries of voice interaction technology. Demos are available at https://fun-audio-llm.github.io, and the code can be accessed at https://github.com/FunAudioLLM.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2407.04051")
get_code_for_paper("2407.04051")
have("2407.04051")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2407.04051.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2407.04051.svg)](https://syntology.ai/paper/2407.04051)

Connect an agent — have() is free.