SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2412.08819 · 2024

HARP: A challenging human-annotated math reasoning benchmark

arXiv · PDF · Open in the Atlas

Code that ran

9 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; 2 honoured the contract we drafted, 2 violated it and 0 have no contract verdict; 5 failures of our instrument; 1 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/2412.08819.json · badge: /api/ran/2412.08819.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
aadityasingh/harp canonical (classifier label)
classifier basis: census
9 ran · 1 no recorded run
FunctionStatusWhere it lives
apply_fn_to_trie Ran
ran, honoured the contract we drafted
aadityasingh/harp/src/hendrycks_math_duplicate_find.py
code served (permissive licence) · get_code("12c9e8e768b232e8")
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 int; 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

torch.manual_seed(0)

# The function applies fn to a trie structure
# node can be either a list (base case) or a dict (recursive case)
# fn is a callable that processes lists
# flatten is a boolean

# Create a simple trie structure - a nested dict where leaves are lists
trie_node = {
    'a': {
        'b': [1, 2, 3],
        'c': [4, 5]
    },
    'd': {
        'e': [6, 7, 8, 9]
    }
}

# Create a simple function that processes lists
def simple_fn(lst):
    """Function that takes a list and returns a list"""
    return [x * 2 for x in lst]

ARGS = {
    'node': trie_node,
    'fn': simple_fn,
    'flatten': True
}
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 int — 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
clean_latex_whitespace Ran
ran; our contract draft was wrong, not the code
aadityasingh/harp/src/eval/parsing_lib.py
code served (permissive licence) · get_code("6a78fa4ca56faf73")
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 clean_latex_whitespace(text: str) -> str:
    """
    Cleans up the many ways in latex to denote added whitespace

    Specifically, we remove:
    "\\ ", "\\qquad", "\\quad", "~", "\\!"
    """
    text = re.sub('\\\\\\\\', ' ', text)
    text = re.sub('\\\\ ', ' ', text)
    text = re.sub('\\\\;', ' ', text)
    text = re.sub('\\\\qquad', ' ', text)
    text = re.sub('\\\\quad', ' ', text)
    text = re.sub('[^\\\\]~+', ' ', text)
    text = re.sub('^~+', ' ', text)
    text = re.sub('\\\\!', '', text)
    return text.strip()


ARGS = {
    "text": r"x \\ y \quad z \qquad a ~ b \! c"
}
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
extract_answer Ran
ran; our contract draft was wrong, not the code
aadityasingh/harp/src/eval/parsing_lib.py
code served (permissive licence) · get_code("cf5843ce85c71a69")
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
from pyparsing import Char, CharsNotIn, Combine, DelimitedList, Forward, Literal, OneOrMore, Optional, SkipTo, Suppress, Word, ZeroOrMore, nested_expr, one_of, original_text_for, alphanums as ALPHANUMS, nums as NUMS

def get_integer_with_comma_regex() -> Combine:
    comma = ','
    not_num = ~Literal(NUMS)
    digit_first = Word(NUMS, max=3)
    digit_others = Word(NUMS, min=3, max=3)
    sign = Optional(Word('+-', exact=1))
    return Combine(sign + digit_first + OneOrMore(comma + digit_others) + not_num)

def search_for_boxes(input: str) -> list[str]:
    element = original_text_for(nested_expr('{', '}'))
    parser = Literal('\\boxed') + element | Literal('\\mbox') + element
    results = parser.search_string(input)
    return [_[1][1:-1] for _ in results]

def search_for_numbers(input: str) -> list[str]:
    integer = Word('-' + NUMS, NUMS)
    fraction = Combine(Word('-' + NUMS, NUMS) + '/' + Word(NUMS))
    decimal = Combine(Optional(Word('-' + NUMS, NUMS)) + '.' + Word(NUMS))
    scientific = Combine(Word('-' + NUMS, NUMS) + 'e' + Word('-' + NUMS, NUMS))
    latex = Combine(Suppress('$') + SkipTo('$') + Suppress('$'))
    number_with_comma = get_integer_with_comma_regex()
    parser = latex | scientific | fraction | decimal | number_with_comma | integer
    return [_[0] for _ in parser.search_string(input)]

def extract_answer(solution: str, extraction_regexes: list[str] | None=None, extract_policy: str='flex') -> str:
    """
    Extract answer from response.

    Try the following in order:
        1. Given a list of possible regexes `split` for the answer format in the solution,
           search for each and take the text in the group. If there are multiple matches,
           use the shortest one
        2. Look for boxed expressions and return the last
        3. (if extract_policy == "flex"), Return the last numerical value
        4. Return None
    """
    if extraction_regexes is not None:
        solution_split_list = []
        for final_answer_format in extraction_regexes:
            if bool(re.search(final_answer_format, solution, flags=re.DOTALL)):
                solution_split_list.append(re.findall(final_answer_format, solution, flags=re.DOTALL)[-1])
        shortest = None
        if len(solution_split_list) != 0:
            for ans in solution_split_list:
                if shortest is None or len(ans) < len(shortest):
                    shortest = ans
            return shortest
    boxes = search_for_boxes(solution)
    if len(boxes) != 0:
        return boxes[-1]
    if extract_policy == 'flex':
        numbers = search_for_numbers(solution)
        if len(numbers) != 0:
            return numbers[-1]
    return None

ARGS = {
    "solution": "The answer is \\boxed{42} and we found 3.14 in the computation.",
    "extraction_regexes": [r"answer is (\w+)", r"found (\d+\.\d+)"],
    "extract_policy": "flex"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pyparsing — 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
get_max_depth_and_p_inds Ran
ran; our contract draft was wrong, not the code
aadityasingh/harp/src/hendrycks_math_duplicate_find.py
code served (permissive licence) · get_code("f03fa408d8e59ee6")
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

# Build a trie structure (nested dict where leaves are lists)
# A trie node is either a dict with char keys, or a list at the leaf
trie = {
    'a': {
        'b': [1, 2, 3],
        'c': [4, 5]
    },
    'd': {
        'e': [6, 7, 8, 9]
    }
}

# Test string to search in the trie
test_string = "ab"

ARGS = {
    'current': trie,
    's': test_string
}
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
get_starting_with_str Ran
ran, honoured the contract we drafted
aadityasingh/harp/src/hendrycks_math_duplicate_find.py
code served (permissive licence) · get_code("670a283b7c871f80")
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 int; 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.

# First, let's understand what get_starting_with_str does:
# - It takes a `current` parameter (a trie/nested dict structure)
# - It takes an `s` parameter (a string to search for)
# - It traverses the trie by following characters in the string
# - It returns a flattened list of items found in the trie at that path

# We need to construct a valid trie structure and a search string

# Build a simple trie structure
# A trie is a nested dict where keys are characters and values are either
# dicts (intermediate nodes) or lists (leaf nodes with data)

trie = {
    'a': {
        'b': {
            'c': [1, 2, 3]  # leaf with data
        },
        'd': [4, 5]  # leaf with data
    },
    'x': {
        'y': [6, 7, 8, 9]  # leaf with data
    }
}

# Create a search string that exists in the trie
search_string = "ab"

# This will traverse: trie -> trie['a'] -> trie['a']['b']
# And return the flattened contents at that node

ARGS = {
    'current': trie,
    's': search_string
}
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 int — 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
has_numbers Ran
ran, violated the contract we drafted
aadityasingh/harp/src/eval/latex_answer_check.py
code served (permissive licence) · get_code("71ac1255f80e8b94")
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 bool, 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 torch
import numpy as np

ARGS = {
    "input_string": "Hello123World"
}
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 bool, 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
has_structure Ran
ran, violated the contract we drafted
aadityasingh/harp/src/eval/latex_answer_check.py
code served (permissive licence) · get_code("3edeb0b487b12039")
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 bool, 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 torch

torch.manual_seed(0)

# The function has_structure takes a string parameter and checks if it contains
# any of the STRUCTURE_CHARS. We need to provide a valid input_string.

# Test case 1: A string with structure characters
input_string_with_structure = "tensor(x, y) = [1, 2, 3]"

ARGS = {
    "input_string": input_string_with_structure
}
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 bool, 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
remove_prefix_and_suffix Ran
ran; our contract draft was wrong, not the code
aadityasingh/harp/src/eval/parsing_lib.py
code served (permissive licence) · get_code("f43b9dca910cebb4")
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 remove_prefix_and_suffix takes a single string parameter
# and removes whitespace, newlines, and trailing periods from it.
# We need to provide a test string that demonstrates the function's behavior.

ARGS = {
    "string": "  Hello world. \n  "
}
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
sympy_parse Ran
ran; our contract draft was wrong, not the code
aadityasingh/harp/src/eval/latex_answer_check.py
code served (permissive licence) · get_code("62c9d39b633c8fd5")
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 Add. 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 sympy import symbols, cos, sin

ARGS = {
    "input_string": "x**2 + 2*x + 1"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sympy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Add — a Add output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Add 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
count_tokens Not yet run
unverified (harvested, no recorded run)
aadityasingh/harp/src/eval/costs.py
code served (permissive licence) · get_code("da52349b06d44177")
How it ran

no invocation recorded.

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, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 10 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

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

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-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

Math reasoning is becoming an ever increasing area of focus as we scale large language models. However, even the previously-toughest evals like MATH are now close to saturated by frontier models (90.0% for o1-mini and 86.5% for Gemini 1.5 Pro). We introduce HARP, Human Annotated Reasoning Problems (for Math), consisting of 5,409 problems from the US national math competitions (A(J)HSME, AMC, AIME, USA(J)MO). Of these, 4,780 have answers that are automatically check-able (with libraries such as SymPy). These problems range six difficulty levels, with frontier models performing relatively poorly on the hardest bracket of 197 problems (average accuracy 41.1% for o1-mini, and 9.6% for Gemini 1.5 Pro). Our dataset also features multiple choices (for 4,110 problems) and an average of two human-written, ground-truth solutions per problem, offering new avenues of research that we explore briefly. We report evaluations for many frontier models and share some interesting analyses, such as demonstrating that frontier models across families intrinsically scale their inference-time compute for more difficult problems. Finally, we open source all code used for dataset construction (including scraping) and all code for evaluation (including answer checking) to enable future research at: https://github.com/aadityasingh/HARP.

For agents

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

get_harvested_code_for_paper("2412.08819")
get_code_for_paper("2412.08819")
have("2412.08819")

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

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

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

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

Connect an agent — have() is free.