SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2304.01196 · 2023

Baize: An Open-Source Chat Model with Parameter-Efficient Tuning on Self-Chat Data

arXiv · PDF · Open in the Atlas

Code that ran

9 of 9 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 7 have no contract verdict; 2 failures of our instrument; 0 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/2304.01196.json · badge: /api/ran/2304.01196.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
project-baize/baize-chatbot canonical (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
ilyagusev/rulm community (classifier label)
classifier basis not recorded on the link
8 ran · 0 no recorded run
FunctionStatusWhere it lives
count_punct_part Ran
ran on a synthesized input
ilyagusev/rulm/data_processing/convert_wiki.py
code served (permissive licence) · get_code("946c00212a9b2ca3")
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 float, 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 string

def count_punct_part(sentence):
    punct_count = 0.0
    all_count = 0.0
    for ch in sentence:
        if ch in string.punctuation:
            punct_count += 1.0
        all_count += 1.0
    return punct_count / all_count

# The function takes a single parameter: sentence (a string)
# It iterates over each character and counts punctuation
# We need to provide a valid string argument

ARGS = {
    "sentence": "Hello, world! This is a test."
}
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 float, 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
fix_blocks Ran
ran on a synthesized input
ilyagusev/rulm/data_processing/convert_pikabu.py
code served (permissive licence) · get_code("2865270475e4174e")
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.

# Setup code for fix_blocks function

ARGS = {
    'blocks': [
        {
            'type': 'i',
            'data': {
                'large': 'https://example.com/image_large.jpg',
                'small': 'https://example.com/image_small.jpg'
            }
        },
        {
            'type': 'i',
            'data': {
                'large': None,
                'small': 'https://example.com/image_small_fallback.jpg'
            }
        },
        {
            'type': 'v',
            'data': {
                'url': 'https://example.com/video.mp4'
            }
        },
        {
            'type': 't',
            'data': 'This is some text content'
        },
        {
            'type': 'vf',
            'data': {
                'mp4': {
                    'url': 'https://example.com/video_formatted.mp4'
                }
            }
        },
        {
            'type': 'if',
            'data': {}
        }
    ]
}
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 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
generate_prompt Ran
ran; our contract draft was wrong, not the code
project-baize/baize-chatbot/finetune.py
pointer only (licence: GPL-3.0) · get_code("5062c499830f8141")
How it ran

The body of this sample is withheld: GPL-3.0, as GitHub detects it on this paper's repository, project-baize/baize-chatbot, is not in the permissive set Syntology serves inline. 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.

get_txt_filepaths_from_zip Ran
ran on a synthesized input
ilyagusev/rulm/data_processing/convert_math.py
code served (permissive licence) · get_code("3efcae771b30defb")
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 zipfile
import io

# Create a mock zip archive in memory
zip_buffer = io.BytesIO()
with zipfile.ZipFile(zip_buffer, 'w', zipfile.ZIP_DEFLATED) as zf:
    # Add some files that match the pattern
    zf.writestr('whole_corpus/train/file1.txt', 'content1')
    zf.writestr('whole_corpus/train/file2.txt', 'content2')
    zf.writestr('whole_corpus/train/subdir/file3.txt', 'content3')
    # Add files that don't match the pattern
    zf.writestr('whole_corpus/test/file4.txt', 'content4')
    zf.writestr('whole_corpus/train/file5.pdf', 'content5')
    zf.writestr('other/train/file6.txt', 'content6')

# Reset buffer position and open the archive
zip_buffer.seek(0)
archive = zipfile.ZipFile(zip_buffer, 'r')

ARGS = {
    'archive': archive
}
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 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
group Ran
ran on a synthesized input
ilyagusev/rulm/rulm/preprocess.py
code served (permissive licence) · get_code("e859eeeeacc6d379")
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 itertools import chain

torch.manual_seed(0)

# The function `group` takes:
# - examples: a dict where values are lists/sequences of sequences
# - block_size: an integer
#
# The function concatenates all values for each key, then chunks them into blocks
# of size block_size.

# Build a minimal valid examples dict
# Each value should be a list of lists/sequences
examples = {
    "input_ids": [[1, 2], [3, 4], [5, 6]],  # 3 lists of 2 elements each
    "attention_mask": [[1, 1], [1, 0], [1, 1]],  # same structure
}

# block_size should be a reasonable integer
block_size = 4

ARGS = {
    "examples": examples,
    "block_size": block_size,
}
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
parse_single_txt Ran
ran on a synthesized input
ilyagusev/rulm/data_processing/convert_math.py
code served (permissive licence) · get_code("867a04baecf6e451")
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 zipfile
import io

# Create a mock zip file with test data
zip_buffer = io.BytesIO()
with zipfile.ZipFile(zip_buffer, 'w') as zf:
    # Create a valid txt file with paired questions and answers
    content = """What is the capital of France?
Paris
What is 2 + 2?
4
How do I learn Python?
Practice"""
    zf.writestr('test.txt', content.encode('utf-8'))

zip_buffer.seek(0)
zip_file = zipfile.ZipFile(zip_buffer, 'r')
path_to_txt = 'test.txt'

ARGS = {
    'path_to_txt': path_to_txt,
    'zip_file': zip_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 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
run Ran
ran on a synthesized input
ilyagusev/rulm/rulm/preprocess.py
code served (permissive licence) · get_code("ee90615c40f12cae")
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
from itertools import chain

torch.manual_seed(0)

# Create a minimal tokenizer stand-in class
class MinimalTokenizer:
    def __call__(self, text, truncation=True, max_length=10000000, padding=False, return_length=True):
        # Simulate tokenizer output
        # For a list of texts, return tokenized outputs
        if isinstance(text, list):
            batch_size = len(text)
        else:
            batch_size = 1
            text = [text]
        
        # Create mock token ids of varying lengths
        output = {
            'input_ids': [[101, 2054, 2003, 1045] for _ in range(batch_size)],
            'token_type_ids': [[0, 0, 0, 0] for _ in range(batch_size)],
            'attention_mask': [[1, 1, 1, 1] for _ in range(batch_size)],
            'length': [4 for _ in range(batch_size)]
        }
        return output

# Create position_ids tensor
position_ids = torch.arange(10000000)

# Create example batch with text field
examples = {
    'text': ['hello world', 'foo bar']
}

# Create tokenizer
tokenizer = MinimalTokenizer()

# Set block_size
block_size = 8

ARGS = {
    'examples': examples,
    'tokenizer': tokenizer,
    'block_size': block_size,
    'position_ids': position_ids
}
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
strip_accents Ran
ran; our contract draft was wrong, not the code
ilyagusev/rulm/data_processing/convert_wiki.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from emeryberger/CSrankings, is pointer only (licence: NOASSERTION) · get_code("b34f5dfa407987e8")
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 emeryberger/CSrankings, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

tokenize Ran
ran on a synthesized input
ilyagusev/rulm/rulm/preprocess.py
code served (permissive licence) · get_code("c02b4d79f99f3178")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a minimal stand-in tokenizer that mimics HuggingFace tokenizer behavior
class MockTokenizer:
    def __call__(self, text, truncation=True, max_length=10000000, padding=False, return_length=True):
        # Simulate tokenizer output
        # Return a dict with 'input_ids', 'attention_mask', 'token_type_ids', and 'length'
        if isinstance(text, str):
            text = [text]
        
        batch_size = len(text)
        # Simulate token lengths between 5 and 8
        lengths = [5 + i % 4 for i in range(batch_size)]
        
        outputs = {
            'input_ids': [[101, 2054, 2003, 1045, 1999] + [0] * (8 - l) for l in lengths],
            'attention_mask': [[1] * l + [0] * (8 - l) for l in lengths],
            'token_type_ids': [[0] * 8 for _ in range(batch_size)],
            'length': lengths
        }
        return outputs

# Create examples dict with 'text' key
examples = {
    'text': ['Hello world', 'This is a test']
}

# Create tokenizer instance
tokenizer = MockTokenizer()

# Create position_ids tensor - should have enough positions for max tokens
position_ids = torch.arange(0, 10000000, dtype=torch.long)

# Define ARGS dictionary with all parameters
ARGS = {
    'examples': examples,
    'tokenizer': tokenizer,
    'position_ids': position_ids
}
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

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 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 8 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
strip_accents 2 other papers
1 dated earlier, 1 later
1910.06262 (2019-10)
Restoring ancient text using deep learning: a case study on Greek epigraphy
2601.02578 (2026-01)
DataParasite Enables Scalable and Repurposable Online Data Curation

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

Chat models, such as ChatGPT, have shown impressive capabilities and have been rapidly adopted across numerous domains. However, these models are only accessible through a restricted API, creating barriers for new research and progress in the field. We propose a pipeline that can automatically generate a high-quality multi-turn chat corpus by leveraging ChatGPT to engage in a conversation with itself. Subsequently, we employ parameter-efficient tuning to enhance LLaMA, an open-source large language model. The resulting model, named Baize, demonstrates good performance in multi-turn dialogues with guardrails that minimize potential risks. Furthermore, we propose a new technique called Self-Distill with Feedback, to further improve the performance of the Baize models with feedback from ChatGPT. The Baize models and data are released for research purposes only at https://github.com/project-baize/baize-chatbot. An online demo is also available at https://huggingface.co/spaces/project-baize/chat-with-baize.

For agents

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

get_harvested_code_for_paper("2304.01196")
get_code_for_paper("2304.01196")
have("2304.01196")

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

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

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

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

Connect an agent — have() is free.