SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.03872 · EMNLP · 2024

BLSP-Emo: Towards Empathetic Large Speech-Language Models

Chen Wang, Minpeng Liao, Junhong Wu, Chengqing Zong, Jiajun Zhang, Zhongqiang Huang

arXiv · PDF · Open in the Atlas

Code that ran

7 of 8 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; 3 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 3 failures of our instrument; 1 no recorded run), measured 2026-11-22; 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/2406.03872.json · badge: /api/ran/2406.03872.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
cwang621/blsp-emo canonical (classifier label)
classifier basis: census
7 ran · 1 no recorded run
FunctionStatusWhere it lives
collate_tokens Ran
ran, honoured the contract we drafted
cwang621/blsp-emo/generate.py
code served (permissive licence) · get_code("746ac520906d93d1")
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 int, shape (3, 5) 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)

# The function expects:
# - values: List[List[int]] - a list of token sequences (each sequence is a list of ints)
# - pad_id: int - the padding token id

# Create sample token sequences of varying lengths
values = [
    [1, 2, 3],           # sequence of length 3
    [4, 5, 6, 7, 8],     # sequence of length 5
    [9, 10]              # sequence of length 2
]

pad_id = 0

ARGS = {
    "values": values,
    "pad_id": pad_id
}
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 int, shape (3, 5) — shape (3, 5) 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
dequantize_cache_torch Ran
ran, honoured the contract we drafted
cwang621/blsp-emo/src/modeling_qwen.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from qwenlm/qwen-audio, is pointer only (licence: NOASSERTION) · get_code("d9db9f86b30f9ac0")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from qwenlm/qwen-audio, and GitHub could not classify the licence of that repository (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_dataset Ran
ran on a synthesized input
cwang621/blsp-emo/emotion_text_generation.py
code served (permissive licence) · get_code("dbbd427d8be0e03a")
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 Dataset. 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 logging
import json
import tempfile
import os
from datasets import Dataset

logging.basicConfig(level=logging.INFO)

# Create a temporary manifest file with sample JSON lines
temp_dir = tempfile.mkdtemp()
manifest_path = os.path.join(temp_dir, 'manifest.jsonl')

# Write sample data to the manifest file
sample_data = [
    {"text": "I am happy", "emotion": "joy"},
    {"text": "I am sad", "emotion": "sadness"},
    {"text": "I am angry", "emotion": "anger"},
    {"text": "I am neutral", "emotion": "neutral"},
    {"text": "I am surprised", "emotion": "surprise"},
]

with open(manifest_path, 'w') as f:
    for item in sample_data:
        f.write(json.dumps(item) + '\n')

ARGS = {
    'manifest': manifest_path,
    'nshard': 2,
    'rank': 0,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
datasets — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Dataset — a Dataset output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Dataset output the recorded ndim 1 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
get_shard_range Ran
ran, honoured the contract we drafted
cwang621/blsp-emo/emotion_text_generation.py
code served (permissive licence) · get_code("6fb5e96321718d63")
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, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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 logging

logger = logging.getLogger('emotion text generation')

# Set up logging to see the info output
logging.basicConfig(level=logging.INFO)

ARGS = {
    'tot': 1000,
    'nshard': 4,
    'rank': 1
}
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 tuple, ndim 1, dtype family int — a tuple output has no array shape of its own; none is stated
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
length_to_4d_attention_mask Ran
ran; our contract draft was wrong, not the code
cwang621/blsp-emo/src/modeling_utils.py
code served (permissive licence) · get_code("dcb5bf59a6298eba")
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 4, dtype family float, shape (2, 1, 5, 5) 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)

# Create a small batch of sequence lengths
# lens should be a 1D tensor of shape (B,) containing sequence lengths
lens = torch.tensor([3, 5], dtype=torch.long)

ARGS = {
    "lens": lens
}
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 4, dtype family float, shape (2, 1, 5, 5) — shape (2, 1, 5, 5) 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
length_to_attention_mask Ran
ran; our contract draft was wrong, not the code
cwang621/blsp-emo/src/modeling_utils.py
code served (permissive licence) · get_code("89912aba5efd69fe")
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 int, shape (4, 5) 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)

# lens should be a 1D tensor of sequence lengths
# The function uses: lens.size(0) for batch size, torch.max(lens).item() for max length, lens.device
lens = torch.tensor([3, 5, 2, 4], dtype=torch.long)

ARGS = {
    "lens": lens,
    "reverse": False,
}
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 int, shape (4, 5) — shape (4, 5) 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
quantize_cache_v Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
cwang621/blsp-emo/src/modeling_qwen.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from qwenlm/qwen-audio, is pointer only (licence: NOASSERTION) · get_code("1fec7a76f0d171a6")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from qwenlm/qwen-audio, and GitHub could not classify the licence of that repository (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

apply_rotary_pos_emb Not yet run
unverified (harvested, no recorded run)
cwang621/blsp-emo/src/modeling_qwen.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from qwenlm/qwen-audio, is pointer only (licence: NOASSERTION) · get_code("fbda921818ec02df")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from qwenlm/qwen-audio, and GitHub could not classify the licence of that repository (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 6 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 0 the same month, 3 later) and 2 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
apply_rotary_pos_emb 6 other papers
3 dated earlier, 3 later
2311.07919 (2023-11)
Qwen-Audio: Advancing Universal Audio Understanding via Unified Large-Scale Audio-Language Models
2311.16922 (2023-11)
Mitigating Object Hallucinations in Large Vision-Language Models through Visual Contrastive Decoding
2403.13263 (2024-03)
SC-Tune: Unleashing Self-Consistent Referential Comprehension in Large Vision Language Models
and 3 more not named here
dequantize_cache_torch 3 other papers
2 dated earlier, 1 later
2311.07919 (2023-11)
Qwen-Audio: Advancing Universal Audio Understanding via Unified Large-Scale Audio-Language Models
2402.11809 (2024-02)
Generation Meets Verification: Accelerating Large Language Model Inference with Smart Parallel Auto-Correct Decoding
2410.03007 (2024-10)
FastAdaSP: Multitask-Adapted Efficient Inference for Large Speech Language Model
quantize_cache_v 3 other papers
2 dated earlier, 1 later
2311.07919 (2023-11)
Qwen-Audio: Advancing Universal Audio Understanding via Unified Large-Scale Audio-Language Models
2402.11809 (2024-02)
Generation Meets Verification: Accelerating Large Language Model Inference with Smart Parallel Auto-Correct Decoding
2410.03007 (2024-10)
FastAdaSP: Multitask-Adapted Efficient Inference for Large Speech Language Model
get_shard_range 2 other papers
2 dated earlier
2212.04559 (2022-12)
SpeechLMScore: Evaluating speech generation using speech language model
2309.00916 (2023-09)
BLSP: Bootstrapping Language-Speech Pre-training via Behavior Alignment of Continuation Writing
collate_tokens 1 other paper
1 dated earlier
2309.00916 (2023-09)
BLSP: Bootstrapping Language-Speech Pre-training via Behavior Alignment of Continuation Writing
get_dataset 1 other paper
1 dated earlier
2309.00916 (2023-09)
BLSP: Bootstrapping Language-Speech Pre-training via Behavior Alignment of Continuation Writing

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

The recent release of GPT-4o showcased the potential of end-to-end multimodal models, not just in terms of low latency but also in their ability to understand and generate expressive speech with rich emotions. While the details are unknown to the open research community, it likely involves significant amounts of curated data and compute, neither of which is readily accessible. In this paper, we present BLSP-Emo (Bootstrapped Language-Speech Pretraining with Emotion support), a novel approach to developing an end-to-end speechlanguage model capable of understanding both semantics and emotions in speech and generate empathetic responses. BLSP-Emo utilizes existing speech recognition (ASR) and speech emotion recognition (SER) datasets through a two-stage process. The first stage focuses on semantic alignment, following recent work on pretraining speech-language models using ASR data. The second stage performs emotion alignment with the pretrained speech-language model on an emotion-aware continuation task constructed from SER data. Our experiments demonstrate that the BLSP-Emo model excels in comprehending speech and delivering empathetic responses, both in instruction-following tasks and conversations. 1 * Work was done while at Tongyi Lab. † Corresponding author. 1 Visit https://github.com/cwang621/blsp-emo for code and https://cwang621.github.io/blsp-emo. github.io for demo. That's wonderful news! Congratulations on your upcoming graduation! Graduating is a significant achievement and a major milestone in your life ... Cheerful I'm sorry to hear that you're feeling sad about graduating soon. It's natural to feel a mix of emotions when it comes to leaving behind the ... 🔊🔊 I'm graduating soon. 🔊🔊 I'm graduating soon.

For agents

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

get_harvested_code_for_paper("2406.03872")
get_code_for_paper("2406.03872")
have("2406.03872")

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

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

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

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

Connect an agent — have() is free.