SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2304.08177 · 2023

Efficient and Effective Text Encoding for Chinese LLaMA and Alpaca

arXiv · PDF · Open in the Atlas

Code that ran

18 of 24 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; 1 honoured the contract we drafted, 0 violated it and 8 have no contract verdict; 9 failures of our instrument; 6 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/2304.08177.json · badge: /api/ran/2304.08177.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
ymcui/chinese-llama-alpaca canonical (classifier label)
classifier basis: classifier_2025
3 ran · 1 no recorded run
ymcui/chinese-llama-alpaca-2 canonical (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
mryxj/calculate-flops.pytorch community (classifier label)
classifier basis not recorded on the link
5 ran · 5 no recorded run
neukg/techgpt-2.0 community (classifier label)
classifier basis not recorded on the link
4 ran · 0 no recorded run
copy not recorded community
not in the paper's declared repositories
2 ran · 0 no recorded run
ymcui/chinese-llama-alpaca-3 extension (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
jackaduma/Alpaca-LoRA-RLHF-PyTorch community (classifier label)
classifier basis not recorded on the link
1 ran · 0 no recorded run
FunctionStatusWhere it lives
accuracy Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
this paper's copy was not recorded; identical code first harvested from Caiyun-AI/DCFormer
pointer only · get_code("8a38d7c525fad8f1")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

check_has_model Ran
ran on a synthesized input
mryxj/calculate-flops.pytorch/calflops/estimate.py
code served (permissive licence) · get_code("862bec96a19b9582")
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 str. 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 accelerate.utils import is_timm_available, is_transformers_available

# Create test errors for different libraries
timm_error = RuntimeError("Unknown model 'some_model'")
transformers_error = OSError("some_model does not appear to have a file named 'config.json'")
unknown_error = ValueError("Some other error")

ARGS = {
    "error": timm_error
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
accelerate, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
collator Ran
ran; our contract draft was wrong, not the code
jackaduma/Alpaca-LoRA-RLHF-PyTorch/tuning_lm_with_rl.py
code served (permissive licence) · get_code("bda36ad0c44dbd74")
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) 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

torch.manual_seed(0)

# The collator function takes a list of dictionaries and groups values by key
# It expects data to be a list where each element is a dict with the same keys

# Create sample data - a list of dicts with consistent keys
data = [
    {
        "input_ids": torch.tensor([1, 2, 3, 4]),
        "attention_mask": torch.tensor([1, 1, 1, 0]),
        "labels": 0
    },
    {
        "input_ids": torch.tensor([5, 6, 7, 8]),
        "attention_mask": torch.tensor([1, 1, 1, 1]),
        "labels": 1
    }
]

ARGS = {
    "data": data
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
compute_metrics Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
this paper's copy was not recorded; identical code first harvested from Caiyun-AI/DCFormer
pointer only · get_code("6b376a0abe58a427")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

generate_prompt Ran
ran; our contract draft was wrong, not the code
ymcui/chinese-llama-alpaca-3/scripts/inference/inference_hf.py
code served (permissive licence) · get_code("506e15dcebddded4")
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 str. 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

DEFAULT_SYSTEM_PROMPT = 'You are a helpful assistant. 你是一个乐于助人的助手。'

system_format = '<|start_header_id|>system<|end_header_id|>\n\n{content}<|eot_id|>'

user_format = '<|start_header_id|>user<|end_header_id|>\n\n{content}<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\n'

def generate_prompt(instruction):
    return system_format.format(content=DEFAULT_SYSTEM_PROMPT) + user_format.format(content=instruction)

ARGS = {
    'instruction': 'What is the capital of France?'
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
generate_prompt Ran
ran on a synthesized input
neukg/techgpt-2.0/mindspore_inference/techgpt2-alpaca_inference.py
code served (permissive licence) · get_code("5805470da16397ec")
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 str. 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

torch.manual_seed(0)

DEFAULT_SYSTEM_PROMPT = 'You are a helpful assistant. 你是一个乐于助人的助手。请你提供专业、有逻辑、内容真实、有价值的详细回复。'

TEMPLATE = "<s> A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions. USER: [INST] <<SYS>>\n{system_prompt}\n<</SYS>>\n\n{instruction} [/INST] ASSISTANT: "

def generate_prompt(instruction):
    return TEMPLATE.format_map({'instruction': instruction, 'system_prompt': DEFAULT_SYSTEM_PROMPT})

ARGS = {
    'instruction': 'What is the capital of France?'
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
generate_prompt Ran
ran on a synthesized input
neukg/techgpt-2.0/mindspore_inference/techgpt2-atom_inference.py
code served (permissive licence) · get_code("9975d177719247f6")
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 str. 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

TEMPLATE = '<s>Human: {instruction} \n</s><s>Assistant: '

def generate_prompt(instruction):
    return TEMPLATE.format_map({'instruction': instruction})

# The function takes a single parameter: instruction (a string)
# It formats it into the TEMPLATE using format_map
# We need to provide a valid instruction string

ARGS = {
    'instruction': 'What is the capital of France?'
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
generate_transformer_input Ran
ran on a synthesized input
mryxj/calculate-flops.pytorch/calflops/utils.py
code served (permissive licence) · get_code("3095c6f9fc06ee03")
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
from transformers import AutoTokenizer

torch.manual_seed(0)

# Create a minimal tokenizer stand-in that satisfies the function's requirements
class MockTokenizer:
    def __init__(self):
        self.pad_token_id = 0
    
    def encode_plus(self, text, add_special_tokens=True, truncation_strategy=None):
        # Return a minimal valid response
        # encode_plus should return a dict with 'input_ids' and 'attention_mask' at minimum
        return {
            'input_ids': [101, 102],  # [CLS] and [SEP] tokens
            'attention_mask': [1, 1],
            'token_type_ids': [0, 0]
        }

# Create the tokenizer
model_tokenizer = MockTokenizer()

# Define input shape: (batch_size=2, seq_len=8)
input_shape = (2, 8)

# Set device to CPU
device = 'cpu'

ARGS = {
    'model_tokenizer': model_tokenizer,
    'input_shape': input_shape,
    'device': device
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — 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
jsonload Ran
ran; our contract draft was wrong, not the code
ymcui/chinese-llama-alpaca-3/scripts/merge_llama3_with_chinese_lora_low_mem.py
code served (permissive licence) · get_code("1d905d8345954c70")
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 tempfile
import os

# Create a temporary JSON file for testing
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test.json")

# Write a valid JSON file
test_data = {
    "key1": "value1",
    "key2": [1, 2, 3],
    "key3": {"nested": "object"}
}

with open(temp_file, 'w') as f:
    json.dump(test_data, f)

ARGS = {
    "filename": temp_file
}
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
macs_to_string Ran
ran on a synthesized input
mryxj/calculate-flops.pytorch/calflops/utils.py
code served (permissive licence) · get_code("0d2323a5d9352647")
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 str. 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

torch.manual_seed(0)

# Test cases for macs_to_string function
# The function takes macs (int), units (str or None), and precision (int)

ARGS = {
    "macs": 1500000000,  # 1.5 billion MACs
    "units": None,       # Let the function auto-detect units
    "precision": 2       # Default precision
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
name_replace Ran
ran on a synthesized input
neukg/techgpt-2.0/ckpt_weight_convert/convert_weight.py
code served (permissive licence) · get_code("86f93c0600f3a1fd")
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 str. 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)

# The function name_replace takes a single string parameter
# It performs a series of string replacements on HuggingFace parameter names
# to convert them to MindSpore format

# Test with a realistic HuggingFace model parameter name that contains
# multiple patterns that will be replaced
name = "model.layers.0.self_attn.q_proj.weight"

ARGS = {
    "name": name
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
number_to_string Ran
ran on a synthesized input
mryxj/calculate-flops.pytorch/calflops/utils.py
code served (permissive licence) · get_code("fce9fc5087d11c5b")
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 str. 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.

# Setup code for number_to_string function

ARGS = {
    'num': 1500000.5,
    'units': None,
    'precision': 2
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
prepare_model_for_kbit_training Ran
ran; our contract draft was wrong, not the code
ymcui/chinese-llama-alpaca-2/scripts/training/run_clm_pt_with_peft.py
code served (permissive licence) · get_code("591cff6b55ba6bfb")
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 MockModel. 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 MockEmbedding(nn.Module):
    def __init__(self):
        super().__init__()
        self.weight = nn.Parameter(torch.randn(10, 4, dtype=torch.float16))
    
    def forward(self, x):
        return self.weight[x]

class MockNormLayer(nn.Module):
    def __init__(self):
        super().__init__()
        self.weight = nn.Parameter(torch.randn(4, dtype=torch.float16))
        self.bias = nn.Parameter(torch.randn(4, dtype=torch.float16))
    
    def forward(self, x):
        return x

class MockModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.embedding = MockEmbedding()
        self.layer_norm = MockNormLayer()
        self.linear = nn.Linear(4, 3, dtype=torch.float16)
        self.is_loaded_in_8bit = True
        self.is_loaded_in_4bit = False
    
    def get_input_embeddings(self):
        return self.embedding
    
    def enable_input_require_grads(self):
        pass
    
    def gradient_checkpointing_enable(self):
        pass
    
    def forward(self, x):
        x = self.embedding(x)
        x = self.layer_norm(x)
        x = self.linear(x)
        return x

model = MockModel()

ARGS = {
    "model": model,
    "use_gradient_checkpointing": True,
}
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 MockModel — a MockModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MockModel 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
preprocess_logits_for_metrics Ran
ran, honoured the contract we drafted
ymcui/chinese-llama-alpaca/scripts/training/run_clm_pt_with_peft.py
code served (permissive licence) · get_code("d2895bdf14e8f94f")
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 1, dtype family int, shape (2,) 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 checks if logits is a tuple, and if so, extracts the first element
# Then it calls argmax(dim=-1) on the logits tensor
# So we need:
# - logits: either a tensor or a tuple containing a tensor
# - labels: used in function signature but not in the function body

# Create a small logits tensor with shape (batch=2, num_classes=4)
logits_tensor = torch.randn(2, 4)

# Create labels (not used in function but required as parameter)
labels = torch.tensor([0, 1])

# Test with logits as a tensor
ARGS = {
    "logits": logits_tensor,
    "labels": labels
}
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 1, dtype family int, shape (2,) — shape (2,) 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
read_json Ran
ran; our contract draft was wrong, not the code
neukg/techgpt-2.0/ckpt_weight_convert/convert_weight.py
code served (permissive licence) · get_code("c5bcf01d18bba63d")
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) 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 tempfile
import os

# Create a temporary JSON file with test data
temp_dir = tempfile.mkdtemp()
test_json_path = os.path.join(temp_dir, "test.json")

test_data = {
    "key1": "value1",
    "key2": [1, 2, 3],
    "key3": {"nested": "object"}
}

with open(test_json_path, 'w') as f:
    json.dump(test_data, f)

ARGS = {
    "path": test_json_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
translate_state_dict_key Ran
ran; our contract draft was wrong, not the code
ymcui/chinese-llama-alpaca/scripts/merge_llama_with_chinese_lora.py
code served (permissive licence) · get_code("a4f5d0414a1cf9c6")
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 str. 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

# The function takes a single string parameter 'k' (a state dict key)
# and returns a translated key name or None

# Test with various valid state dict keys that the function handles
ARGS = {
    'k': 'base_model.model.model.embed_tokens.weight'
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
transpose Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ymcui/chinese-llama-alpaca/scripts/merge_llama_with_chinese_lora.py
code served (permissive licence) · get_code("8f1a49e9d8b29d83")
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 (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)

# The function takes:
# 1. weight: a tensor that has a .T attribute (transpose)
# 2. fan_in_fan_out: a boolean flag

weight = torch.randn(4, 3)  # Small tensor with distinct dimensions
fan_in_fan_out = True  # Boolean flag

ARGS = {
    "weight": weight,
    "fan_in_fan_out": fan_in_fan_out,
}
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 (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
wrapFunc Ran
ran on a synthesized input
mryxj/calculate-flops.pytorch/calflops/pytorch_ops.py
code served (permissive licence) · get_code("03a510eeef28adc4")
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

torch.manual_seed(0)

# Create a simple function to wrap
def dummy_func(x, y):
    return x + y

# Create a funcFlopCompute that computes flops and macs
def dummy_flop_compute(x, y):
    # Simple computation: just return some flop/mac counts
    flops = 100
    macs = 50
    return flops, macs

# Create old_functions dict to store wrapped functions
old_functions = {}

# Create module_flop_count as a list of lists (stack structure)
module_flop_count = [[]]

# Create module_mac_count as a list of lists (stack structure)
module_mac_count = [[]]

ARGS = {
    "func": dummy_func,
    "funcFlopCompute": dummy_flop_compute,
    "old_functions": old_functions,
    "module_flop_count": module_flop_count,
    "module_mac_count": module_mac_count,
}
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
calculate_flops Not yet run
unverified (harvested, no recorded run)
mryxj/calculate-flops.pytorch/calflops/flops_counter.py
code served (permissive licence) · get_code("e9d40620ba06c476")
How it ran

no invocation recorded.

calculate_flops_hf Not yet run
unverified (harvested, no recorded run)
mryxj/calculate-flops.pytorch/calflops/flops_counter_hf.py
code served (permissive licence) · get_code("25a2892b59109d04")
How it ran

no invocation recorded.

create_empty_model Not yet run
unverified (harvested, no recorded run)
mryxj/calculate-flops.pytorch/calflops/estimate.py
code served (permissive licence) · get_code("ed09fbaf85f7c338")
How it ran

no invocation recorded.

create_empty_model Not yet run
unverified (harvested, no recorded run)
mryxj/calculate-flops.pytorch/calflops/__pycache__/estimate.py
code served (permissive licence) · get_code("e677c1203f29a49d")
How it ran

no invocation recorded.

unpermute Not yet run
unverified (harvested, no recorded run)
ymcui/chinese-llama-alpaca/scripts/merge_llama_with_chinese_lora.py
code served (permissive licence) · get_code("5b22827888d475e4")
How it ran

no invocation recorded.

verify_on_hub Not yet run
unverified (harvested, no recorded run)
mryxj/calculate-flops.pytorch/calflops/estimate.py
code served (permissive licence) · get_code("658e8c21987864b5")
How it ran

no invocation recorded.

Also present in other papers' code

Of 24 samples lifted from this paper's linked repositories, 24 carry a function identity and 0 do not. Of the 24 distinct functions with an identity, 9 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 1 the same month, 9 later) and 15 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
read_json 21 other papers
1 dated earlier, 1 the same month, 19 later
2210.07316 (2022-10)
MTEB: Massive Text Embedding Benchmark
2304.14454 (2023-04)
PMC-LLaMA: Towards Building Open-source Language Models for Medicine
2305.13718 (2023-05)
Exploring Self-supervised Logic-enhanced Training for Large Language Models
and 18 more not named here
transpose 13 other papers
1 dated earlier, 12 later · 9 only as an assembly brick
2106.09685 (2021-06)
LoRA: Low-Rank Adaptation of Large Language Models
2312.03414 (2023-12)
Compressed Context Memory For Online Language Model Interaction
2024.findings-emnlp.619 (2024 (year only))
MEDCARE: Advancing Medical LLMs through Decoupling Clinical Alignment and Knowledge Aggregation
and 10 more not named here
translate_state_dict_key 11 other papers
10 later, 1 same year, order not determinable
2023.findings-emnlp.269 (2023 (year only))
An Empirical Study of Instruction-tuning Large Language Models in Chinese
2305.00447 (2023-05)
TALLRec: An Effective and Efficient Tuning Framework to Align Large Language Model with Recommendation
2306.05064 (2023-06)
K2: A Foundation Language Model for Geoscience Knowledge Understanding and Utilization
and 8 more not named here
unpermute 11 other papers
10 later, 1 same year, order not determinable
2023.findings-emnlp.269 (2023 (year only))
An Empirical Study of Instruction-tuning Large Language Models in Chinese
2305.00447 (2023-05)
TALLRec: An Effective and Efficient Tuning Framework to Align Large Language Model with Recommendation
2306.05064 (2023-06)
K2: A Foundation Language Model for Geoscience Knowledge Understanding and Utilization
and 8 more not named here
collator 9 other papers
2 dated earlier, 7 later
1909.08593 (2019-09)
Fine-Tuning Language Models from Human Preferences
2204.07705 (2022-04)
SUPER-NATURALINSTRUCTIONS: Generalization via Declarative Instructions on 1600+ NLP Tasks
2309.16155 (2023-09)
The Trickle-down Impact of Reward (In-)consistency on RLHF
and 6 more not named here
preprocess_logits_for_metrics 7 other papers
1 dated earlier, 6 later
2010.11934 (2020-10)
mT5: A massively multilingual pre-trained text-to-text transformer
2310.09089 (2023-10)
Qilin-Med: Multi-stage Knowledge Injection Advanced Medical Large Language Model
2310.17230 (2023-10)
Codebook Features: Sparse and Discrete Interpretability for Neural Networks
and 4 more not named here
accuracy 5 other papers
5 later
2310.09089 (2023-10)
Qilin-Med: Multi-stage Knowledge Injection Advanced Medical Large Language Model
2402.16445 (2024-02)
ProLLaMA: A Protein Large Language Model for Multi-Task Protein Language Processing
2403.19928 (2024-03)
DiJiang: Efficient Large Language Models through Compact Kernelization
and 2 more not named here
compute_metrics 3 other papers
3 later
2310.09089 (2023-10)
Qilin-Med: Multi-stage Knowledge Injection Advanced Medical Large Language Model
2402.16445 (2024-02)
ProLLaMA: A Protein Large Language Model for Multi-Task Protein Language Processing
2405.08553 (2024-05)
Improving Transformers with Dynamically Composable Multi-Head Attention
prepare_model_for_kbit_training 3 other papers
3 later
2312.09979 (2023-12)
LoRAMoE: Alleviate World Knowledge Forgetting in Large Language Models via MoE-Style Plugin
2402.16445 (2024-02)
ProLLaMA: A Protein Large Language Model for Multi-Task Protein Language Processing
2404.19245 (2024-04)
HydraLoRA: An Asymmetric LoRA Architecture for Efficient Fine-Tuning

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

Large Language Models (LLMs), such as ChatGPT and GPT-4, have dramatically transformed natural language processing research and shown promising strides towards Artificial General Intelligence (AGI). Nonetheless, the high costs associated with training and deploying LLMs present substantial obstacles to transparent, accessible academic research. While several large language models, such as LLaMA, have been open-sourced by the community, these predominantly focus on English corpora, limiting their usefulness for other languages. In this paper, we propose a method to augment LLaMA with capabilities for understanding and generating Chinese text and its ability to follow instructions. We achieve this by extending LLaMA's existing vocabulary with an additional 20,000 Chinese tokens, thereby improving its encoding efficiency and semantic understanding of Chinese. We further incorporate secondary pre-training using Chinese data and fine-tune the model with Chinese instruction datasets, significantly enhancing the model's ability to comprehend and execute instructions. Our experimental results indicate that the newly proposed model markedly enhances the original LLaMA's proficiency in understanding and generating Chinese content. Additionally, the results on the C-Eval dataset yield competitive performance among the models with several times the size of ours. We have made our pre-trained models, training scripts, and other resources available through GitHub, fostering open research for our community. Chinese LLaMA series: \url{https://github.com/ymcui/Chinese-LLaMA-Alpaca} and Chinese Llama-2 series: \url{https://github.com/ymcui/Chinese-LLaMA-Alpaca-2}

For agents

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

get_harvested_code_for_paper("2304.08177")
get_code_for_paper("2304.08177")
have("2304.08177")

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

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

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

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

Connect an agent — have() is free.