SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.12524 · EMNLP · 2023

TheoremQA: A Theorem-driven Question Answering Dataset ♠

Xinyi Wang, Ming Yin, Wenhu Chen, Pan Lu, Xueguang Ma, Max Ku, Yixin Wan, Jianyu Xu

arXiv · PDF · Open in the Atlas

Code that ran

10 of 10 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 6 have no contract verdict; 4 failures of our instrument; 0 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/2305.12524.json · badge: /api/ran/2305.12524.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
THUDM/VisualGLM-6B canonical (classifier label)
classifier basis: census
9 ran · 0 no recorded run
wenhuchen/theoremqa canonical (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
FunctionStatusWhere it lives
build_prompt Ran
ran on a synthesized input
THUDM/VisualGLM-6B/cli_demo_hf.py
code served (permissive licence) · get_code("b7583b2677118645")
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 numpy as np

# Analyze the function:
# - history: expects an iterable of (query, response) tuples
# - prefix: a string that gets prepended to the prompt
# The function builds a prompt string by iterating through history
# and formatting query-response pairs with Chinese text

# Create small valid arguments
prefix = "你好,这是开始。"

history = [
    ("第一个问题是什么?", "第一个回答。"),
    ("第二个问题呢?", "第二个回答。"),
]

ARGS = {
    "history": history,
    "prefix": prefix,
}
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 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
clear_fn Ran
ran on a synthesized input
THUDM/VisualGLM-6B/web_demo.py
code served (permissive licence) · get_code("a5e88863540a1e1c")
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 numpy as np

torch.manual_seed(0)

def clear_fn(value):
    return ('', [('', 'Hi, What do you want to know about this image?')], None)

# The function takes a single parameter 'value' and doesn't use it in the body
# We can pass any valid Python object
ARGS = {
    'value': 'test_input'
}
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 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
create_reader_request Ran
ran; our contract draft was wrong, not the code
wenhuchen/theoremqa/zero_shot_eval/run_gpt4.py
code served (permissive licence) · get_code("51f39dd563f707dd")
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 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 numpy as np
from typing import Dict, Any

torch.manual_seed(0)

example = {
    "Question": "What is the capital of France?"
}

ARGS = {
    "example": example
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, 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_input Ran
ran on a synthesized input
THUDM/VisualGLM-6B/model/infer_util.py
code served (permissive licence) · get_code("761f8ed7104063cc")
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.

from PIL import Image
from io import BytesIO
import base64

# Create a small test image
def create_test_image():
    img = Image.new('RGB', (64, 64), color='red')
    return img

# Encode image to base64
def encode_image(image):
    buffered = BytesIO()
    image.save(buffered, format="PNG")
    img_str = base64.b64encode(buffered.getvalue()).decode()
    return img_str

# Create test image and encode it
test_image = create_test_image()
encoded_image = encode_image(test_image)

# Create sample history
history = [
    {"role": "user", "content": "What is this?"},
    {"role": "assistant", "content": "This is a test image."}
]

# Create sample generation parameters
input_para = {
    "max_length": 100,
    "temperature": 0.7,
    "top_p": 0.9
}

ARGS = {
    "input_text": "What is shown in this image?",
    "input_image_prompt": encoded_image,
    "history": history,
    "input_para": input_para,
    "image_is_encoded": True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL — 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_masks_and_position_ids_glm Ran
ran; our contract draft was wrong, not the code
THUDM/VisualGLM-6B/model/chat.py
code served (permissive licence) · get_code("775493b10d572a2a")
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

torch.manual_seed(0)

# Construct arguments for get_masks_and_position_ids_glm
seq = torch.tensor([101, 102, 103, 104, 105, 106], dtype=torch.long)
mask_position = 3
context_length = 2

ARGS = {
    "seq": seq,
    "mask_position": mask_position,
    "context_length": context_length,
}
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 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
is_chinese Ran
ran on a synthesized input
THUDM/VisualGLM-6B/model/infer_util.py
code served (permissive licence) · get_code("04cb5cd9927c6c03")
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 Match. 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 re

def is_chinese(text):
    zh_pattern = re.compile(u'[一-龥]+')
    return zh_pattern.search(text)

ARGS = {
    'text': '这是中文文本'
}
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 Match — a Match output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Match 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_text Ran
ran; our contract draft was wrong, not the code
THUDM/VisualGLM-6B/web_demo_hf.py
code served (permissive licence) · get_code("826ceb601fb31250")
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 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 parse_text function

ARGS = {
    "text": """Here is some code:

def hello():
    print('world')


And here is more text with special chars: < > * _ - . ! ( ) $

javascript
console.log('test');


Final line."""
}
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 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
predict Ran
ran on a synthesized input
THUDM/VisualGLM-6B/web_demo_hf.py
code served (permissive licence) · get_code("922434407b7b0339")
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 generator. 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)

# Stand-in model class with stream_chat method
class MockModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def stream_chat(self, tokenizer, image_path, input_text, history, max_length, top_p, temperature):
        # Generator that yields (response, updated_history) tuples
        responses = ["Hello", "How are you", "Goodbye"]
        for response in responses:
            new_history = history + [(input_text, response)]
            yield (response, new_history)

# Stand-in tokenizer
class MockTokenizer:
    def __init__(self):
        self.vocab_size = 1000

# Create instances
model = MockModel()
tokenizer = MockTokenizer()

# Define ARGS dict with all parameters for predict function
ARGS = {
    'input': 'What is this image about?',
    'image_path': '/path/to/image.jpg',
    'chatbot': [],
    'max_length': 256,
    'top_p': 0.9,
    'temperature': 0.7,
    'history': []
}
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 generator — a generator output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a generator 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
process_image Ran
ran on a synthesized input
THUDM/VisualGLM-6B/model/chat.py
code served (permissive licence) · get_code("69186ccf8ef0fe53")
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, 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 torch.nn as nn
from PIL import Image
import numpy as np

torch.manual_seed(0)

class BlipImageEvalProcessor(nn.Module):
    """Stand-in image processor that mimics the required interface."""
    def __init__(self, size):
        super().__init__()
        self.size = size
    
    def __call__(self, image):
        """Process image and return a tensor."""
        # Convert PIL image to tensor
        img_array = np.array(image)
        if len(img_array.shape) == 2:
            img_array = np.stack([img_array] * 3, axis=-1)
        # Resize to (size, size, 3) and convert to tensor
        img_tensor = torch.from_numpy(img_array).float()
        # Transpose to (3, H, W) format
        if len(img_tensor.shape) == 3:
            img_tensor = img_tensor.permute(2, 0, 1)
        return img_tensor

# Create a small test image
test_image = Image.new('RGB', (100, 100), color='red')

# Test case 1: text with embedded image path (local file reference)
text_with_embedded_path = "Here is an image: <img>/tmp/test.jpg</img> in the text"

# Test case 2: simple text without image tag
text_without_image = "Just some regular text without any image tags"

# Test case 3: text with image tag but no path
text_with_empty_tag = "Image here: <img></img> but empty"

# Use the simplest case: text without image and no image parameter
ARGS = {
    'text': text_without_image,
    'image': None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, requests, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple 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
process_response Ran
ran; our contract draft was wrong, not the code
THUDM/VisualGLM-6B/model/chat.py
code served (permissive licence) · get_code("dc21db7cf25bfe72")
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 re

def process_response(response):
    response = response.strip()
    response = response.replace('[[训练时间]]', '2023年')
    punkts = [[',', ','], ['!', '!'], [':', ':'], [';', ';'], ['\\?', '?']]
    for item in punkts:
        response = re.sub('([\\u4e00-\\u9fff])%s' % item[0], '\\1%s' % item[1], response)
        response = re.sub('%s([\\u4e00-\\u9fff])' % item[0], '%s\\1' % item[1], response)
    return response

ARGS = {
    'response': '你好,世界!这是一个测试[[训练时间]]案例:完美;对吗?'
}
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

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 1 the same month, 2 later) and 7 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
parse_text 9 other papers
1 dated earlier, 2 the same month, 6 later
2203.13474 (2022-03)
CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesis
2305.14314 (2023-05)
QLORA: Efficient Finetuning of Quantized LLMs
2305.16355 (2023-05)
PandaGPT: One Model To Instruction-Follow Them All
and 6 more not named here
process_response 9 other papers
1 dated earlier, 8 later
2112.05682 (2021-12)
Self-attention Does Not Need $O(n^2)$ Memory
2310.17631 (2023-10)
JudgeLM: Fine-tuned Large Language Models are Scalable Judges
2024.findings-emnlp.559 (2024 (year only))
A LLM-Based Ranking Method for the Evaluation of Automatic Counter-Narrative Generation
and 6 more not named here
get_masks_and_position_ids_glm 1 other paper
1 dated earlier
2103.10360 (2021-03)
GLM: General Language Model Pretraining with Autoregressive Blank Infilling

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

The recent LLMs like GPT-4 and PaLM-2 have made tremendous progress in solving fundamental math problems like GSM8K by achieving over 90% accuracy. However, their capabilities to solve more challenging math problems which require domain-specific knowledge (i.e. theorem) have yet to be investigated. In this paper, we introduce TheoremQA, the first theorem-driven question-answering dataset designed to evaluate AI models' capabilities to apply theorems to solve challenging science problems. TheoremQA is curated by domain experts containing 800 high-quality questions covering 350 theorems 1 from Math, Physics, EE&CS, and Finance. We evaluate a wide spectrum of 16 large language and code models with different prompting strategies like Chain-of-Thoughts and Program-of-Thoughts. We found that GPT-4's capabilities to solve these problems are unparalleled, achieving an accuracy of 51% with Program-of-Thoughts Prompting. All the existing open-sourced models are below 15%, barely surpassing the random-guess baseline. Given the diversity and broad coverage of TheoremQA, we believe it can be used as a better benchmark to evaluate LLMs' capabilities to solve challenging science problems.

For agents

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

get_harvested_code_for_paper("2305.12524")
get_code_for_paper("2305.12524")
have("2305.12524")

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

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

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

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

Connect an agent — have() is free.