SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2506.11350 · 2025

GLAP: General contrastive audio-text pretraining across domains and languages

arXiv · PDF · Open in the Atlas

Code that ran

8 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; 0 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 3 failures of our instrument; 2 no recorded run), measured 2026-11-24; 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/2506.11350.json · badge: /api/ran/2506.11350.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
xiaomi-research/dasheng-glap canonical (classifier label)
classifier basis not recorded on the link
8 ran · 2 no recorded run
FunctionStatusWhere it lives
cached Ran
ran; our contract draft was wrong, not the code
xiaomi-research/dasheng-glap/glap_model/grad_cache/functional.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from cxcscmu/longembeddinganalysis, is pointer only (licence: NONE) · get_code("7f1946b9c385a5cf")
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 cxcscmu/longembeddinganalysis, 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.

cat_input_tensor Ran
ran; our contract draft was wrong, not the code
xiaomi-research/dasheng-glap/glap_model/grad_cache/functional.py
code served (permissive licence) · get_code("fab5db4632e2fa87")
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 function. 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
from torch import Tensor

torch.manual_seed(0)

# The function cat_input_tensor is a decorator that takes a Callable and returns a decorated function
# It doesn't actually call the function within the decorator definition itself, just wraps it
# So we need to provide a simple function that accepts tensors/lists of tensors and returns a Tensor

def dummy_loss_fn(*args, **kwargs) -> Tensor:
    """A simple function that returns a tensor, used to test the decorator"""
    # Sum all tensor arguments
    result = torch.tensor(0.0)
    for arg in args:
        if isinstance(arg, Tensor):
            result = result + arg.sum()
    for val in kwargs.values():
        if isinstance(val, Tensor):
            result = result + val.sum()
    return result

ARGS = {
    "func": dummy_loss_fn
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
exists Ran
ran on a synthesized input
xiaomi-research/dasheng-glap/glap_model/dataset.py
code served (permissive licence) · get_code("c4895a0012bf6dfc")
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 bool, ndim 0, dtype family float, shape () 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)

def exists(x) -> bool:
    return x is not None

ARGS = {
    "x": None
}
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 bool, ndim 0, dtype family float, shape () — shape () 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
fast_warn_and_continue Ran
ran on a synthesized input
xiaomi-research/dasheng-glap/glap_model/dataset.py
code served (permissive licence) · get_code("df75b65d469704ea")
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 bool, ndim 0, dtype family float, shape () 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 warnings
import torch

def fast_warn_and_continue(exn):
    warnings.warn(repr(exn))
    return True

# Create a simple exception to pass as argument
test_exception = ValueError("Test error message")

ARGS = {
    "exn": test_exception
}
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 bool, ndim 0, dtype family float, shape () — shape () 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
freeze_model Ran
ran on a synthesized input
xiaomi-research/dasheng-glap/glap_model/models/glap.py
code served (permissive licence) · get_code("0ec2f1bb15ab20d3")
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 SimpleModel. 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 SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
        self.relu = nn.ReLU()
    
    def forward(self, x):
        return self.relu(self.linear(x))

mdl = SimpleModel()

ARGS = {
    "mdl": mdl
}
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 SimpleModel — a SimpleModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleModel 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
gather_input_tensor Ran
ran; our contract draft was wrong, not the code
xiaomi-research/dasheng-glap/glap_model/grad_cache/functional.py
code served (permissive licence) · get_code("7917a2079ec6b095")
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 function. 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
from torch import Tensor
from torch import distributed as dist
from unittest.mock import MagicMock, patch

torch.manual_seed(0)

# Mock distributed functions since we're not in a real distributed setup
def mock_get_world_size():
    return 2

def mock_get_rank():
    return 0

def mock_all_gather(gathered_list, tensor):
    # Simulate all_gather by filling the list with the tensor
    for i in range(len(gathered_list)):
        gathered_list[i].copy_(tensor)

# Create a simple loss function to be decorated
def simple_loss(pred: Tensor, target: Tensor) -> Tensor:
    """A simple loss function that takes two tensors and returns a scalar."""
    return torch.nn.functional.mse_loss(pred, target)

# Create another variant that uses kwargs
def loss_with_kwargs(pred: Tensor, target: Tensor, weight: Tensor = None) -> Tensor:
    """Loss function that accepts keyword arguments."""
    loss = torch.nn.functional.mse_loss(pred, target)
    if weight is not None:
        loss = loss * weight.mean()
    return loss

# Patch the distributed module
with patch('torch.distributed.get_world_size', mock_get_world_size):
    with patch('torch.distributed.get_rank', mock_get_rank):
        with patch('torch.distributed.all_gather', mock_all_gather):
            # Create test tensors
            pred_tensor = torch.randn(2, 4)
            target_tensor = torch.randn(2, 4)
            weight_tensor = torch.randn(2, 3)

ARGS = {
    'func': simple_loss,
    'axis': 0
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
gather_tensors Ran
ran on a synthesized input
xiaomi-research/dasheng-glap/glap_model/trainer.py
code served (permissive licence) · get_code("0245565a9267ff41")
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 (4, 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
import torch.distributed as dist
from unittest.mock import Mock, MagicMock

torch.manual_seed(0)

# Mock the distributed environment since we're in a single-process context
class MockDistributed:
    def __init__(self):
        self._world_size = 2
        self._rank = 0
    
    def get_world_size(self):
        return self._world_size
    
    def get_rank(self):
        return self._rank
    
    def all_gather(self, gathered_list, tensor):
        # Simulate gathering by filling each slot with a copy of the tensor
        for i in range(len(gathered_list)):
            gathered_list[i].copy_(tensor)

# Replace dist functions with mocks
original_get_world_size = dist.get_world_size
original_get_rank = dist.get_rank
original_all_gather = dist.all_gather

mock_dist = MockDistributed()
dist.get_world_size = mock_dist.get_world_size
dist.get_rank = mock_dist.get_rank
dist.all_gather = mock_dist.all_gather

# Create a small tensor for testing
t = torch.randn(2, 4)

ARGS = {
    "t": t,
    "dim": 0
}
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 (4, 4) — shape (4, 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
load_or_download_pretrained_checkpoint Ran
ran on a synthesized input
xiaomi-research/dasheng-glap/glap_model/models/glap.py
code served (permissive licence) · get_code("10059c78cc1632fe")
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 tempfile
import os

torch.manual_seed(0)

# Create a temporary checkpoint file to simulate a local checkpoint
temp_dir = tempfile.mkdtemp()
temp_checkpoint = os.path.join(temp_dir, 'checkpoint.pt')

# Create a dummy state dict with some tensors
dummy_state_dict = {
    'layer1.weight': torch.randn(4, 3),
    'layer1.bias': torch.randn(4),
    'layer2.weight': torch.randn(5, 4),
}

# Save it to disk
torch.save(dummy_state_dict, temp_checkpoint)

ARGS = {
    'pretrained_url': temp_checkpoint
}
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
decode_torch_audio Not yet run
unverified (harvested, no recorded run)
xiaomi-research/dasheng-glap/glap_model/dataset.py
code served (permissive licence) · get_code("061cc02ff1e95a46")
How it ran

no invocation recorded.

parse_spectransforms Not yet run
unverified (harvested, no recorded run)
xiaomi-research/dasheng-glap/glap_model/models/audioencoders/dasheng_audioencoder.py
code served (permissive licence) · get_code("018ad58b48112aa9")
How it ran

no invocation recorded.

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, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 3 later) and 7 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
cached 3 other papers
2 dated earlier, 1 later
2402.09906 (2024-02)
Generative Representational Instruction Tuning
2404.04163 (2024-04)
Dwell in the Beginning: How Language Models Embed Long Documents for Dense Retrieval
2510.00523 (2025-10)
VIRTUE: Visual-Interactive Text-Image Universal Embedder
cat_input_tensor 3 other papers
2 dated earlier, 1 later
2402.09906 (2024-02)
Generative Representational Instruction Tuning
2404.04163 (2024-04)
Dwell in the Beginning: How Language Models Embed Long Documents for Dense Retrieval
2510.00523 (2025-10)
VIRTUE: Visual-Interactive Text-Image Universal Embedder
gather_input_tensor 3 other papers
2 dated earlier, 1 later
2402.09906 (2024-02)
Generative Representational Instruction Tuning
2404.04163 (2024-04)
Dwell in the Beginning: How Language Models Embed Long Documents for Dense Retrieval
2510.00523 (2025-10)
VIRTUE: Visual-Interactive Text-Image Universal Embedder

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

Repositories linked to this paper

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

Abstract

Contrastive Language Audio Pretraining (CLAP) is a widely-used method to bridge the gap between audio and text domains. Current CLAP methods enable sound and music retrieval in English, ignoring multilingual spoken content. To address this, we introduce general language audio pretraining (GLAP), which expands CLAP with multilingual and multi-domain abilities. GLAP demonstrates its versatility by achieving competitive performance on standard audio-text retrieval benchmarks like Clotho and AudioCaps, while significantly surpassing existing methods in speech retrieval and classification tasks. Additionally, GLAP achieves strong results on widely used sound-event zero-shot benchmarks, while simultaneously outperforming previous methods on speech content benchmarks. Further keyword spotting evaluations across 50 languages emphasize GLAP's advanced multilingual capabilities. Finally, multilingual sound and music understanding is evaluated across four languages. Checkpoints and Source: https://github.com/xiaomi-research/dasheng-glap.

For agents

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

get_harvested_code_for_paper("2506.11350")
get_code_for_paper("2506.11350")
have("2506.11350")

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

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

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

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

Connect an agent — have() is free.