SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2309.00916 · 2023

BLSP: Bootstrapping Language-Speech Pre-training via Behavior Alignment of Continuation Writing

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 0 have no contract verdict; 4 failures of our instrument; 1 no recorded run), measured 2026-11-23; 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/2309.00916.json · badge: /api/ran/2309.00916.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 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/blsp/src/speech_text_paired_dataset.py
code served (permissive licence) · get_code("11be103f3c940844")
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 (2, 3) 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 collate_tokens takes:
# 1. values: List[List[int]] - a list of token sequences (each sequence is a list of ints)
# 2. pad_id: int - the padding token id to use for filling

# Create a small example with 2 sequences of different lengths
values = [
    [1, 2, 3],           # sequence of length 3
    [4, 5],              # 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 (2, 3) — shape (2, 3) 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
collate_tokens Ran
ran, honoured the contract we drafted
cwang621/blsp/data_process/asr_text_generation.py
code served (permissive licence) · get_code("25e0884d6d058e54")
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, 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)

# values: List[List[int]] - a list of token sequences (each sequence is a list of integers)
# pad_id: int - the padding token ID to fill shorter sequences

values = [
    [1, 2, 3],           # sequence of length 3
    [4, 5],              # sequence of length 2
    [6, 7, 8, 9],        # sequence of length 4
]

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, 4) — shape (3, 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
get_dataset Ran
ran; our contract draft was wrong, not the code
cwang621/blsp/data_process/asr_text_generation.py
code served (permissive licence) · get_code("115dd5cd6546803f")
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 tempfile
import json
import os

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

# Write sample data to the manifest file
sample_data = [
    {"text": "sample text 1", "id": 0},
    {"text": "sample text 2", "id": 1},
    {"text": "sample text 3", "id": 2},
    {"text": "sample text 4", "id": 3},
    {"text": "sample text 5", "id": 4},
]

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

ARGS = {
    'manifest': manifest_file,
    '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/data_process/asr_text_generation.py
code served (permissive licence) · get_code("9bc4ef43619c4b45")
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('continue writing')

def get_shard_range(tot, nshard, rank):
    assert rank < nshard and rank >= 0, f'invaid rank/nshard {rank}/{nshard}'
    start = round(tot / nshard * rank)
    end = round(tot / nshard * (rank + 1))
    assert start < end, f'start={start}, end={end}'
    logger.info(f'rank {rank} of {nshard}, process {end - start} ({start}-{end}) out of {tot}')
    return (start, end)

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
lengths_to_padding_mask Ran
ran; our contract draft was wrong, not the code
cwang621/blsp/blsp/src/modeling_blsp.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from rainbowluocs/openomni, is pointer only (licence: NONE) · get_code("74f6d53ff93d8db0")
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 rainbowluocs/openomni, and GitHub detected no licence in that repository when it was checked. 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.

load_text_instruction_dataset Ran
ran; our contract draft was wrong, not the code
cwang621/blsp/blsp/src/text_instruction_dataset.py
code served (permissive licence) · get_code("b23800765b9ccdff")
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 MockDataset. 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
from unittest.mock import Mock, MagicMock
import tempfile
import os

torch.manual_seed(0)

# Create a minimal tokenizer that satisfies the function's needs
class MinimalTokenizer:
    def __init__(self):
        self.eos_token = "</s>"
    
    def __call__(self, text):
        # Return a mock object with input_ids attribute
        # Simulate tokenization by creating a list of token ids
        token_count = len(text.split()) + 2
        result = Mock()
        result.input_ids = list(range(token_count))
        return result

# Create a mock dataset
class MockDataset:
    def __init__(self):
        self.column_names = ['instruction', 'output']
    
    def map(self, fn, fn_kwargs=None, remove_columns=None, load_from_cache_file=False):
        # Return self to allow chaining
        return self
    
    def save_to_disk(self, path):
        pass

# Mock datasets.load_dataset to return our mock dataset
original_load_dataset = None

def mock_load_dataset(dataroot, data_files=None, split=None, streaming=False):
    return MockDataset()

# Patch datasets.load_dataset
import datasets
original_load_dataset = datasets.load_dataset
datasets.load_dataset = mock_load_dataset

# Mock datasets.load_from_disk
def mock_load_from_disk(path):
    return MockDataset()

original_load_from_disk = datasets.load_from_disk
datasets.load_from_disk = mock_load_from_disk

# Create temporary directory for dataroot
temp_dir = tempfile.mkdtemp()

# Create tokenizer
tokenizer = MinimalTokenizer()

# Define ARGS
ARGS = {
    'dataroot': temp_dir,
    'manifest_files': 'data.jsonl',
    'max_length': 384,
    'tokenizer': tokenizer
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
datasets, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MockDataset — a MockDataset output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MockDataset 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
process_dataset Ran
ran; our contract draft was wrong, not the code
cwang621/blsp/blsp/src/text_instruction_dataset.py
code served (permissive licence) · get_code("e35ba6d4c2745c08")
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 dict. 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)

Text_Format = '###[Human]:{instruction}\n\n\n###[Assistant]:'

class MockTokenizer:
    def __init__(self):
        self.eos_token = "[EOS]"
    
    def __call__(self, text):
        tokens = text.split()
        return MockTokenizerOutput(tokens)

class MockTokenizerOutput:
    def __init__(self, tokens):
        self.input_ids = list(range(len(tokens)))

batch = {
    'instruction': 'What is AI?',
    'output': 'AI is artificial intelligence'
}

tokenizer = MockTokenizer()

max_length = 128

ARGS = {
    'batch': batch,
    'tokenizer': tokenizer,
    'max_length': max_length
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
clean_text Not yet run
unverified (harvested, no recorded run)
cwang621/blsp/data_process/prepare_alpaca.py
code served (permissive licence) · get_code("61134cad531c377a")
How it ran

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, 4 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 4 later) and 4 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
get_shard_range 2 other papers
1 dated earlier, 1 later
2212.04559 (2022-12)
SpeechLMScore: Evaluating speech generation using speech language model
2406.03872 (2024-06)
BLSP-Emo: Towards Empathetic Large Speech-Language Models
collate_tokens 1 other paper
1 later
2406.03872 (2024-06)
BLSP-Emo: Towards Empathetic Large Speech-Language Models
get_dataset 1 other paper
1 later
2406.03872 (2024-06)
BLSP-Emo: Towards Empathetic Large Speech-Language Models
lengths_to_padding_mask 1 other paper
1 later
2505.02625 (2025-05)
LLaMA-Omni 2: LLM-based Real-time Spoken Chatbot with Autoregressive Streaming Speech Synthesis

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-23.

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 emergence of large language models (LLMs) has sparked significant interest in extending their remarkable language capabilities to speech. However, modality alignment between speech and text still remains an open problem. Current solutions can be categorized into two strategies. One is a cascaded approach where outputs (tokens or states) of a separately trained speech recognition system are used as inputs for LLMs, which limits their potential in modeling alignment between speech and text. The other is an end-to-end approach that relies on speech instruction data, which is very difficult to collect in large quantities. In this paper, we address these issues and propose the BLSP approach that Bootstraps Language-Speech Pre-training via behavior alignment of continuation writing. We achieve this by learning a lightweight modality adapter between a frozen speech encoder and an LLM, ensuring that the LLM exhibits the same generation behavior regardless of the modality of input: a speech segment or its transcript. The training process can be divided into two steps. The first step prompts an LLM to generate texts with speech transcripts as prefixes, obtaining text continuations. In the second step, these continuations are used as supervised signals to train the modality adapter in an end-to-end manner. We demonstrate that this straightforward process can extend the capabilities of LLMs to speech, enabling speech recognition, speech translation, spoken language understanding, and speech conversation, even in zero-shot cross-lingual scenarios.

For agents

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

get_harvested_code_for_paper("2309.00916")
get_code_for_paper("2309.00916")
have("2309.00916")

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

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

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

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

Connect an agent — have() is free.