SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.05540 · 2024

A Fine-tuning Dataset and Benchmark for Large Language Models for Protein Understanding

arXiv · PDF · Open in the Atlas

Code that ran

6 of 7 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 0 have no contract verdict; 6 failures of our instrument; 1 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/2406.05540.json · badge: /api/ran/2406.05540.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
tsynbio/proteinlmdataset canonical (classifier label)
classifier basis: census
6 ran · 1 no recorded run
FunctionStatusWhere it lives
fix_json_file Ran
ran; our contract draft was wrong, not the code
tsynbio/proteinlmdataset/benchmark/benchmark_1_QnA_generation.py
code served (permissive licence) · get_code("0e7eb70abfb0f1e1")
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 json
import re
import tempfile
import os

# Create a temporary file with invalid JSON (trailing commas)
temp_dir = tempfile.mkdtemp()
file_path = os.path.join(temp_dir, "test.json")

# Write invalid JSON with trailing commas
invalid_json_content = '''
{
    "name": "John",
    "age": 30,
    "items": [1, 2, 3,],
}
'''

with open(file_path, 'w', encoding='utf-8') as f:
    f.write(invalid_json_content)

ARGS = {
    'file_path': 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 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
get_valid_articles Ran
ran; our contract draft was wrong, not the code
tsynbio/proteinlmdataset/benchmark/benchmark_3_coherence_check.py
code served (permissive licence) · get_code("3205e56833e087e1")
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 tempfile
import json
import os

# Create a temporary directory to simulate the article storage
temp_dir = tempfile.mkdtemp()

# Create mock article files
mock_articles = {
    'PMC0001234': {'full_text': 'This is a valid article with content.'},
    'PMC0005678': {'full_text': 'Another valid article.'},
    'PMC0009999': {'full_text': ''},  # Empty full_text
}

for pmc_id, data in mock_articles.items():
    file_name = 'article_' + pmc_id[3:] + '.json'
    file_path = os.path.join(temp_dir, file_name)
    with open(file_path, 'w') as f:
        json.dump(data, f)

# Monkey patch the file path in the function to use our temp directory
original_get_valid_articles = None

def get_valid_articles_patched(lst):
    rst = []
    no_file = []
    for i in lst:
        file_pmc_id = i
        file_name = 'article_' + file_pmc_id[3:] + '.json'
        file_path = os.path.join(temp_dir, file_name)
        try:
            with open(file_path, 'r') as f:
                data = json.load(f)
        except:
            no_file.append(i)
            continue
        raw = data.get('full_text')
        if raw is None or len(raw) == 0:
            continue
        rst.append(i)
    return (rst, no_file)

# Define arguments for the function
ARGS = {
    'lst': ['PMC0001234', 'PMC0005678', 'PMC0009999', 'PMC9999999']
}

# Store the patched function for use
import sys
current_module = sys.modules[__name__]
current_module.get_valid_articles = get_valid_articles_patched
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 — 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
insert_CoT Ran
ran; our contract draft was wrong, not the code
tsynbio/proteinlmdataset/sft/ECoT_3_insert_in_template.py
code served (permissive licence) · get_code("62984862f9ea67d5")
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 numpy as np

torch.manual_seed(0)

# Construct enzyme_data dictionary with required keys
enzyme_data = {
    'Comments': 'Catalyzes the phosphorylation of glucose to glucose-6-phosphate.',
    'Reaction': 'ATP + D-glucose <=> ADP + D-glucose 6-phosphate',
    'Accepted name': 'Hexokinase',
    'Other name(s)': 'Glucose kinase; ATP:glucose 6-phosphotransferase'
}

# Construct seq as a list of amino acid symbols
seq = ['M', 'A', 'V', 'L', 'E', 'K', 'G', 'S']

# Define ARGS mapping
ARGS = {
    'enzyme_data': enzyme_data,
    'seq': seq
}
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 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
large_chunk Ran
ran; our contract draft was wrong, not the code
tsynbio/proteinlmdataset/benchmark/benchmark_2_save_data_into_vectorDB.py
code served (permissive licence) · get_code("41672abaf4370094")
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 list, ndim 1, dtype family float; 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 torch
import numpy as np

# Analyze the function: large_chunk(lst)
# - Takes a list parameter 'lst'
# - Iterates over items in lst
# - Calls len(item) on each item - so items must have a length
# - Calls ' '.join(current_chunk) - so items must be strings
# - The function chunks a list of strings into groups where total word count <= 5000

# Create test data: a list of strings
lst = [
    "word1 word2 word3",  # 3 words
    "word4 word5",  # 2 words
    "word6 word7 word8 word9",  # 4 words
    "word10",  # 1 word
    " ".join([f"word{i}" for i in range(11, 5011)]),  # 5000 words to trigger chunking
    "word5011 word5012",  # 2 words (should start new chunk)
]

ARGS = {
    "lst": lst
}
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 list, ndim 1, dtype family float — a list 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
last_token_pool Ran
ran; our contract draft was wrong, not the code
tsynbio/proteinlmdataset/benchmark/embedding_model.py
code served (permissive licence) · get_code("2ded070fabe7bdc7")
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
from torch import Tensor

torch.manual_seed(0)

# Create small tensors for testing
batch_size = 2
seq_length = 5
hidden_dim = 4

# Create last_hidden_states: (batch_size, seq_length, hidden_dim)
last_hidden_states = torch.randn(batch_size, seq_length, hidden_dim)

# Create attention_mask: (batch_size, seq_length)
# Test case 1: left padding (all sequences are fully attended)
attention_mask = torch.ones(batch_size, seq_length, dtype=torch.long)

ARGS = {
    "last_hidden_states": last_hidden_states,
    "attention_mask": attention_mask,
}
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
sft_template_insert Ran
ran; our contract draft was wrong, not the code
tsynbio/proteinlmdataset/sft/template.py
code served (permissive licence) · get_code("ebb6e8256c900010")
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 copy

instruction_template = {'Function': {'instruction': 'The sequence of the protein is as follows. Please analyze the sequence and describe the functions of this protein.', 'input': 'Presented here is a sequence of amino acids in a protein: <seq> {sequence} </seq>', 'output': 'The determined function(s) of the protein include(s): {output}'}, 'Subunit structure': {'instruction': 'Examine this protein sequence and provide a comprehensive description of its subunit structure, including details on how the subunits are organized and interact with each other.', 'input': 'Presented here is a sequence of amino acids in a protein: <seq> {sequence} </seq>', 'output': "Based on the analysis, the protein's subunit structure is characterized by: {output}"}, 'Involvement in disease': {'instruction': 'Analyze this protein sequence for any known associations with diseases, including details on the nature of the involvement and relevant diseases.', 'input': 'Presented here is a sequence of amino acids in a protein: <seq> {sequence} </seq>', 'output': 'This protein is associated with the following disease(s): {output}'}, 'Post-translational modification': {'instruction': 'Identify and describe any post-translational modifications in the given protein sequence, including types of modifications and their locations.', 'input': 'Presented here is a sequence of amino acids in a protein: <seq> {sequence} </seq>', 'output': 'The post-translational modification(s) identified in this protein include(s): {output}'}, 'Tissue specificity': {'instruction': 'Examine the provided protein sequence and detail its tissue specificity, including which tissues or organ systems the protein is predominantly expressed in.', 'input': 'Presented here is a sequence of amino acids in a protein: <seq> {sequence} </seq>', 'output': 'The tissue specificity of this protein is characterized by: {output}'}, 'Induction': {'instruction': 'Investigate and describe any known inducers or conditions that lead to the expression of this protein.', 'input': 'Presented here is a sequence of amino acids in a protein: <seq> {sequence} </seq>', 'output': 'The known inducer(s) or condition(s) leading to the expression of this protein include(s): {output}'}}

def sft_template_insert(template_name, context):
    if template_name in instruction_template:
        this_template = copy.deepcopy(instruction_template[template_name])
        this_template['input'] = this_template['input'].format(sequence=context['Sequence'])
        this_template['output'] = this_template['output'].format(output=context[template_name])
        return this_template
    else:
        return None

ARGS = {
    'template_name': 'Function',
    'context': {
        'Sequence': 'MKVLWAALLVTFLAGCAKAKAVGPDPFTAEMLAAFEGATNNFTMTADTATS',
        'Function': 'Catalytic activity involved in metabolic processes'
    }
}
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 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
multichoice Not yet run
unverified (harvested, no recorded run)
tsynbio/proteinlmdataset/benchmark/benchmark_your_model.py
code served (permissive licence) · get_code("f632bacbcc1a0bd4")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 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 6 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
last_token_pool 8 other papers
2 dated earlier, 6 later
2402.12997 (2024-02)
Towards Trustworthy Reranking: A Simple yet Effective Abstention Mechanism
2404.06347 (2024-04)
RAR-b: Reasoning as Retrieval Benchmark
2407.10834 (2024-07)
MetaLLM: A High-performant and Cost-efficient Dynamic Framework for Wrapping LLMs
and 5 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

The parallels between protein sequences and natural language in their sequential structures have inspired the application of large language models (LLMs) to protein understanding. Despite the success of LLMs in NLP, their effectiveness in comprehending protein sequences remains an open question, largely due to the absence of datasets linking protein sequences to descriptive text. Researchers have then attempted to adapt LLMs for protein understanding by integrating a protein sequence encoder with a pre-trained LLM. However, this adaptation raises a fundamental question: "Can LLMs, originally designed for NLP, effectively comprehend protein sequences as a form of language?" Current datasets fall short in addressing this question due to the lack of a direct correlation between protein sequences and corresponding text descriptions, limiting the ability to train and evaluate LLMs for protein understanding effectively. To bridge this gap, we introduce ProteinLMDataset, a dataset specifically designed for further self-supervised pretraining and supervised fine-tuning (SFT) of LLMs to enhance their capability for protein sequence comprehension. Specifically, ProteinLMDataset includes 17.46 billion tokens for pretraining and 893,000 instructions for SFT. Additionally, we present ProteinLMBench, the first benchmark dataset consisting of 944 manually verified multiple-choice questions for assessing the protein understanding capabilities of LLMs. ProteinLMBench incorporates protein-related details and sequences in multiple languages, establishing a new standard for evaluating LLMs' abilities in protein comprehension. The large language model InternLM2-7B, pretrained and fine-tuned on the ProteinLMDataset, outperforms GPT-4 on ProteinLMBench, achieving the highest accuracy score.

For agents

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

get_harvested_code_for_paper("2406.05540")
get_code_for_paper("2406.05540")
have("2406.05540")

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

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

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

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

Connect an agent — have() is free.