SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2511.18760 · ICML · 2026

HERMES: Towards Efficient and Verifiable Mathematical Reasoning in LLMs

Farzan Farnia, Jiacheng Sun, Haoli Bai, Zijin Feng, Shen Xin, Azim Ospanov

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, 2 violated it and 0 have no contract verdict; 8 failures of our instrument; 0 no recorded run), measured 2026-11-23; 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/2511.18760.json · badge: /api/ran/2511.18760.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
aziksh-ospanov/HERMES canonical (classifier label)
classifier basis: census
10 ran · 0 no recorded run
FunctionStatusWhere it lives
call_scheduler Ran
ran; our contract draft was wrong, not the code
aziksh-ospanov/HERMES/utils.py
code served (permissive licence) · get_code("47f1f1e0c743c78f")
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 3, 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 typing import List, Any

torch.manual_seed(0)

class MockRequest:
    def __init__(self, request_id: int, result: torch.Tensor):
        self.request_id = request_id
        self.result = result

class MockScheduler:
    def __init__(self):
        self.request_counter = 0
        self.requests = {}
    
    def submit_all_request(self, scheduler_input: Any) -> List[int]:
        # Simulate submitting requests and return list of request IDs
        num_requests = len(scheduler_input) if isinstance(scheduler_input, list) else 2
        request_ids = []
        for i in range(num_requests):
            request_id = self.request_counter
            self.requests[request_id] = torch.randn(2, 4)
            request_ids.append(request_id)
            self.request_counter += 1
        return request_ids
    
    def get_all_request_outputs(self, request_id_list: List[int]) -> List[torch.Tensor]:
        # Retrieve outputs for all submitted requests
        outputs = []
        for request_id in request_id_list:
            if request_id in self.requests:
                outputs.append(self.requests[request_id])
        return outputs

# Create scheduler input (can be a list of tensors or similar)
scheduler_input = [torch.randn(2, 4), torch.randn(2, 4)]

# Create scheduler instance
scheduler = MockScheduler()

ARGS = {
    "scheduler_input": scheduler_input,
    "scheduler": scheduler
}
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 list, ndim 3, 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
extract_local_model_output Ran
ran; our contract draft was wrong, not the code
aziksh-ospanov/HERMES/utils/models.py
code served (permissive licence) · get_code("2759e9544307b4fb")
How it ran

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

import torch
import torch.nn as nn

torch.manual_seed(0)

class TextOutput:
    def __init__(self, text):
        self.text = text

class RequestOutput:
    def __init__(self, text):
        self.outputs = [TextOutput(text)]

outputs = [
    RequestOutput("The quick brown fox"),
    RequestOutput("jumps over the lazy dog")
]

ARGS = {
    "outputs": outputs
}
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 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
is_deepseek_endpoint Ran
ran, violated the contract we drafted
aziksh-ospanov/HERMES/models/llm_client.py
code served (permissive licence) · get_code("a53e6fa33bc0f732")
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
from typing import Optional

# Test cases for is_deepseek_endpoint function
# The function takes base_url (Optional[str]) and checks if it contains 'api.deepseek.com'

ARGS = {
    "base_url": "https://api.deepseek.com/v1"
}
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
llm_settings_from_config Ran
ran; our contract draft was wrong, not the code
aziksh-ospanov/HERMES/models/auxiliary_llm.py
code served (permissive licence) · get_code("8bb58cb2cdfa9f7d")
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 typing import Any, Mapping

torch.manual_seed(0)

# Construct a valid config dict that matches the function's expectations
cfg = {
    'model_path': '/path/to/model',
    'api_key': 'test-api-key-123',
    'base_url': 'https://api.example.com',
    'port': 8000,
    'api_mode': 'openai',
    'model_args': {
        'temperature': 0.5,
        'max_tokens': 4096,
        'top_p': 0.9,
        'timeout': 60
    }
}

ARGS = {
    'cfg': cfg
}
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
looks_like_full_url Ran
ran, violated the contract we drafted
aziksh-ospanov/HERMES/models/llm_client.py
code served (permissive licence) · get_code("f81a71bd89187804")
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
from typing import Optional

# Set seed for reproducibility
torch.manual_seed(0)

# Test case 1: Valid HTTPS URL
base_url_1 = "https://example.com"

# Test case 2: Valid HTTP URL
base_url_2 = "http://example.com/"

# Test case 3: URL with common typo (https// instead of https://)
base_url_3 = "https//example.com"

# Test case 4: URL with common typo (http// instead of http://)
base_url_4 = "http//example.com"

# Test case 5: URL with trailing slash
base_url_5 = "https://example.com/"

# Test case 6: Non-URL string (no scheme)
base_url_6 = "example.com"

# Test case 7: Empty string
base_url_7 = ""

# Test case 8: None value
base_url_8 = None

# Test case 9: URL with whitespace
base_url_9 = "  https://example.com  "

# Test case 10: Just a scheme without domain
base_url_10 = "https://"

# Define ARGS as a dict mapping the parameter to a test value
ARGS = {
    "base_url": "https://example.com"
}
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
md_to_html Ran
ran; our contract draft was wrong, not the code
aziksh-ospanov/HERMES/render_readme_pdf.py
code served (permissive licence) · get_code("bb74e5f2f4b39ba4")
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 markdown

# Create a markdown module instance (or use the markdown module directly)
markdown_mod = markdown

# Create sample markdown text with various features
md_text = """# Hello World

This is a **bold** statement with `code`.

## Section 2

Here's a list:
- Item 1
- Item 2

| Column A | Column B |
|----------|----------|
| A1       | B1       |
| A2       | B2       |


print("Hello")


> A quote here
"""

# Base URI for the HTML document
base_uri = "https://example.com/"

ARGS = {
    "markdown_mod": markdown_mod,
    "md_text": md_text,
    "base_uri": base_uri,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
markdown — 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
normalize_base_url Ran
ran; our contract draft was wrong, not the code
aziksh-ospanov/HERMES/models/llm_client.py
code served (permissive licence) · get_code("1a185fd5ba9d831e")
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)

ARGS = {
    "base_url": "https//example.com/"
}
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
timeout_handler Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
aziksh-ospanov/HERMES/multithread_support.py
code served (permissive licence) · get_code("7c727b0f05d1a52a")
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 int, ndim 0, dtype family int, 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 multiprocessing as mp
import torch
import torch.nn as nn

torch.manual_seed(0)

# Define a simple function that completes quickly
def fast_function(x, y):
    return x + y

# Define a function that takes longer than timeout
def slow_function(x, y):
    import time
    time.sleep(5)
    return x + y

# Use the fast function for valid execution
ARGS = {
    "func": fast_function,
    "args": (5, 3),
    "kwargs": {},
    "timeout_duration": 1,
    "default": None
}
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 int, ndim 0, dtype family int, 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
timeout_handler Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
aziksh-ospanov/HERMES/utils.py
code served (permissive licence) · get_code("deaa4d18cf20a245")
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 int, ndim 0, dtype family int, 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 torch.nn as nn
import concurrent.futures as cf

torch.manual_seed(0)

# Define a simple function that completes successfully
def sample_fn(x, y=10):
    return x + y

# Define a function that times out
def slow_fn():
    import time
    time.sleep(10)
    return "done"

# Define a function that uses tensors
def tensor_fn(tensor):
    return tensor * 2

# Create sample tensors
sample_tensor = torch.randn(2, 4)

ARGS = {
    "fn": sample_fn,
    "args": (5,),
    "kwargs": {"y": 15},
    "timeout_duration": 5,
    "default": None
}
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 int, ndim 0, dtype family int, 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
trace Ran
ran; our contract draft was wrong, not the code
aziksh-ospanov/HERMES/multithread_support.py
code served (permissive licence) · get_code("4b110f7f2fb2a56d")
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
from loguru import logger

def trace(func):
    @logger.catch()
    def wrapper(*args, **kwargs):
        result = func(*args, **kwargs)
        logger.info(f'Called function {func.__name__} with args {args} and kwargs {kwargs}.')
        logger.info(f'Returned {result}.')
        return result
    return wrapper

# Define a simple test function to decorate
def simple_add(a, b):
    return a + b

# Construct the ARGS dict
ARGS = {
    'func': simple_add
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
loguru, 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

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

Informal mathematics has been central to modern large language model (LLM) reasoning, offering flexibility and efficient construction of arguments. However, purely informal reasoning is prone to logical gaps and subtle errors that are difficult to detect and correct. In contrast, formal theorem proving provides rigorous, verifiable mathematical reasoning, where each inference step is checked by a trusted compiler, but lacks the exploratory freedom of informal problem-solving. This mismatch leaves current LLM-based math agents without a principled way to combine the strengths of both paradigms. In this work, we introduce Hermes, the first tool-assisted agent that explicitly interleaves informal reasoning with formally verified proofs in Lean. The framework performs intermediate formal checking to prevent reasoning drift and a memory module for proof continuity across multi-step reasoning chains, enabling both exploration and verification. We evaluate Hermes on four challenging mathematical reasoning benchmarks using LLMs of varying parameter scales, from small models to state-of-the-art systems. Across all settings, Hermes reliably improves the reasoning accuracy of base models while substantially reducing reasoning token usage and computational cost compared to reward-based approaches. On difficult datasets such as AIME and HARDMath2, Hermes@1 achieves up to a 40% accuracy improvement while using 80% fewer total inference FLOPs. When scaled at test time, Hermes@5 boosts accuracy further by 20%. The implementation and codebase are publicly available at https: //github.com/aziksh-ospanov/HERMES.

For agents

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

get_harvested_code_for_paper("2511.18760")
get_code_for_paper("2511.18760")
have("2511.18760")

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

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

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

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

Connect an agent — have() is free.