SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2109.05522 · 2021

TEASEL: A Transformer-Based Speech-Prefixed Language Model

arXiv · PDF · Open in the Atlas

Code that ran

2 of 4 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 2 have no contract verdict; 0 failures of our instrument; 2 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/2109.05522.json · badge: /api/ran/2109.05522.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
tjdevWorks/TEASEL community (classifier label)
classifier basis not recorded on the link
2 ran · 2 no recorded run
FunctionStatusWhere it lives
read_config Ran
ran on a synthesized input
tjdevWorks/TEASEL/fine_tune_mosi.py
code served (permissive licence) · get_code("85dc36593047cd6a")
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 os
import tempfile
import yaml

# Create a temporary config file
temp_dir = tempfile.mkdtemp()
config_file = os.path.join(temp_dir, "config.yaml")

config_data = {
    'SAMPLING_RATE': 16000,
    'MAX_TIME': 10,
    'some_other_key': 'value'
}

with open(config_file, 'w') as f:
    yaml.dump(config_data, f)

# Create a simple args-like object
class Args:
    def __init__(self):
        self.num_epochs = 5
        self.max_text_length = 512
        self.max_time = 10
        self.learning_rate = 0.001
        self.warmup_proportion = 0.1
        self.batch_size = 32

args_obj = Args()

ARGS = {
    'config_file': config_file,
    'args': args_obj
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
yaml — 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
train_loop Ran
ran on a synthesized input
tjdevWorks/TEASEL/fine_tune_mosi.py
code served (permissive licence) · get_code("9193f7ddaa9cf98e")
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
from torch.optim import Adam
from torch.optim.lr_scheduler import StepLR
import wandb

torch.manual_seed(0)

# Mock wandb to avoid actual logging
class MockWandB:
    def log(self, data):
        pass

wandb.log = MockWandB().log

# Define a minimal model that matches the function's usage
class SimpleAudioTextModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(8, 1)  # 4 (audio) + 4 (text) -> 1 (score)
    
    def forward(self, audio_input, input_ids, attention_mask, gt_scores):
        # audio_input: (batch, 4)
        # input_ids: (batch, 4)
        # attention_mask: (batch, 4)
        # gt_scores: (batch, 1)
        combined = torch.cat([audio_input, input_ids.float()], dim=1)  # (batch, 8)
        logits = self.linear(combined)  # (batch, 1)
        
        # Return object with loss and logits attributes
        class Output:
            pass
        output = Output()
        output.logits = logits
        output.loss = torch.mean((logits - gt_scores) ** 2)
        return output

# Create model and optimizer
model = SimpleAudioTextModel()
optimizer = Adam(model.parameters(), lr=0.001)
scheduler = StepLR(optimizer, step_size=1, gamma=0.9)

# Create train dataloader with 3 batches
# Each batch: (audio_input, input_ids, attention_mask, gt_scores)
train_dataloader = []
for _ in range(3):
    audio_input = torch.randn(2, 4)  # batch_size=2, audio_dim=4
    input_ids = torch.randint(0, 100, (2, 4))  # batch_size=2, seq_len=4
    attention_mask = torch.ones(2, 4, dtype=torch.long)  # batch_size=2, seq_len=4
    gt_scores = torch.randn(2)  # batch_size=2
    train_dataloader.append((audio_input, input_ids, attention_mask, gt_scores))

# Configuration dict
config = {
    'gradient_accumulation_step': 1,
}

# Device
device = torch.device('cpu')

ARGS = {
    'train_dataloader': train_dataloader,
    'model': model,
    'optimizer': optimizer,
    'scheduler': scheduler,
    'device': device,
    'config': config,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, tqdm, wandb — 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
fetch_datasets Not yet run
unverified (harvested, no recorded run)
tjdevWorks/TEASEL/dataset/utils.py
code served (permissive licence) · get_code("5cea9353bf9a31cb")
How it ran

no invocation recorded.

fetch_mosi_datasets Not yet run
unverified (harvested, no recorded run)
tjdevWorks/TEASEL/dataset/utils.py
code served (permissive licence) · get_code("5d719c8bf75f49ef")
How it ran

no invocation recorded.

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 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.

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

Multimodal language analysis is a burgeoning field of NLP that aims to simultaneously model a speaker's words, acoustical annotations, and facial expressions. In this area, lexicon features usually outperform other modalities because they are pre-trained on large corpora via Transformer-based models. Despite their strong performance, training a new self-supervised learning (SSL) Transformer on any modality is not usually attainable due to insufficient data, which is the case in multimodal language learning. This work proposes a Transformer-Based Speech-Prefixed Language Model called TEASEL to approach the mentioned constraints without training a complete Transformer model. TEASEL model includes speech modality as a dynamic prefix besides the textual modality compared to a conventional language model. This method exploits a conventional pre-trained language model as a cross-modal Transformer model. We evaluated TEASEL for the multimodal sentiment analysis task defined by CMU-MOSI dataset. Extensive experiments show that our model outperforms unimodal baseline language models by 4% and outperforms the current multimodal state-of-the-art (SoTA) model by 1% in F1-score. Additionally, our proposed method is 72% smaller than the SoTA model.

For agents

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

get_harvested_code_for_paper("2109.05522")
get_code_for_paper("2109.05522")
have("2109.05522")

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

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

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

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

Connect an agent — have() is free.