SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2309.17272 · 2023

Enhancing Large Language Models in Coding Through Multi-Perspective Self-Consistency

arXiv · PDF · Open in the Atlas

Code that ran

8 of 14 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 0 have no contract verdict; 8 failures of our instrument; 6 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2309.17272.json · badge: /api/ran/2309.17272.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
skpig/MPSC canonical (classifier label)
classifier basis: census
8 ran · 6 no recorded run
FunctionStatusWhere it lives
check_spec_with_test_cases Ran
ran; our contract draft was wrong, not the code
skpig/MPSC/src/_execution.py
code served (permissive licence) · get_code("662ac9159f885532")
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 Optional, Dict, List

# Define test cases as a list of dictionaries with 'input' and 'output' keys
test_cases = [
    {
        'input': '(5, 3)',
        'output': '8'
    },
    {
        'input': '(10, 2)',
        'output': '12'
    }
]

# Define a simple spec (can be a string or callable)
spec = "def add(a, b): return a + b"

# Define preconditions function
def preconditions(*args):
    pass

# Define postconditions function
def postconditions(*args):
    pass

# Construct ARGS dictionary
ARGS = {
    'task_id': 'test_task_001',
    'prompt': 'Test prompt for specification validation',
    'spec': spec,
    'test_cases': test_cases,
    'timeout': 5.0,
    'multi_args': 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 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
check_with_specs_and_casual_inputs Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
skpig/MPSC/src/_execution.py
code served (permissive licence) · get_code("d51f1b0260e83cc7")
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

torch.manual_seed(0)

# Since the function body is incomplete, we need to construct reasonable arguments
# based on the function signature and the context clues from the helper functions.

# casual_inputs should be a list of test cases
casual_inputs = [
    (5, 3),  # simple test case 1
    (10, 7),  # simple test case 2
]

# entry_point is a string representing the function name to call
entry_point = "sample_function"

# task_id - identifier for the task
task_id = "task_001"

# prompt - the original problem description
prompt = "Solve this problem"

# solution - the solution code
solution = """
def sample_function(a, b):
    return a + b
"""

# spec - specification/requirements dict
spec = {
    "description": "Add two numbers",
    "constraints": ["a > 0", "b > 0"],
    "returns": "sum of a and b"
}

# timeout - timeout in seconds
timeout = 5.0

# multi_args - whether the entry point takes multiple arguments
multi_args = True

ARGS = {
    "task_id": task_id,
    "prompt": prompt,
    "solution": solution,
    "spec": spec,
    "casual_inputs": casual_inputs,
    "entry_point": entry_point,
    "timeout": timeout,
    "multi_args": multi_args,
}
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
extend_ispassed Ran
ran; our contract draft was wrong, not the code
skpig/MPSC/src/evaluation.py
code served (permissive licence) · get_code("6e48435bd779492a")
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

# Analyze the function:
# - ispassed: dict where keys are task_ids, values are dicts where keys are completion strings
# - completions: list of dicts, each with 'task_id' and 'completions' (a list of strings)
# The function iterates through completions and updates ispassed

# Create sample data structures
ispassed = {
    'task_1': {'completion_a': 1, 'completion_b': 0},
    'task_2': {'completion_x': 1},
}

completions = [
    {
        'task_id': 'task_1',
        'completions': ['completion_a', 'completion_c', 'completion_d']
    },
    {
        'task_id': 'task_2',
        'completions': ['completion_x', 'completion_y']
    },
    {
        'task_id': 'task_3',
        'completions': ['completion_p', 'completion_q']
    }
]

# Add missing task_ids to ispassed to avoid KeyError
ispassed['task_3'] = {}

ARGS = {
    'ispassed': ispassed,
    'completions': completions,
}
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
extend_sorted Ran
ran; our contract draft was wrong, not the code
skpig/MPSC/src/evaluation.py
code served (permissive licence) · get_code("cc9fb7f50eed473a")
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.

# Analyzing the function, I need to understand what it expects:
# - code_sorted: a dict mapping task_id to lists of tuples (solution, score)
# - completions: a list of dicts, each with 'task_id' and 'completions' keys
# - rd: boolean flag for rounding

# Building test data structures

code_sorted = {
    'task_1': [('solution_a', 0.8567), ('solution_b', 0.5123)],
    'task_2': [('solution_c', 0.9234)],
}

completions = [
    {
        'task_id': 'task_1',
        'completions': ['solution_a', 'solution_b', 'solution_d']
    },
    {
        'task_id': 'task_2',
        'completions': ['solution_c', 'solution_e']
    },
    {
        'task_id': 'task_3',
        'completions': ['solution_f', 'solution_g']
    },
]

ARGS = {
    'code_sorted': code_sorted,
    'completions': completions,
    'rd': True,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
load_jsonl Ran
ran; our contract draft was wrong, not the code
skpig/MPSC/src/utils.py
code served (permissive licence) · get_code("9eb10383a49b0d9a")
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 json
import tempfile
import os

# Create a temporary JSONL file with valid JSON lines
with tempfile.NamedTemporaryFile(mode='w', suffix='.jsonl', delete=False) as f:
    temp_filename = f.name
    f.write(json.dumps({"key1": "value1", "key2": 42}) + '\n')
    f.write(json.dumps({"key1": "value2", "key2": 43}) + '\n')
    f.write(json.dumps({"key1": "value3", "key2": 44}) + '\n')

ARGS = {
    'filename': temp_filename
}
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
load_pickle Ran
ran; our contract draft was wrong, not the code
skpig/MPSC/src/utils.py
code served (permissive licence) · get_code("570ad34bd1af44a8")
How it ran

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

import pickle
import tempfile
import os

# Create a temporary file with pickled data
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test.pkl")

# Create some sample data to pickle
sample_data = {
    "key1": "value1",
    "key2": [1, 2, 3],
    "key3": {"nested": "dict"}
}

# Write the pickled data to the temporary file
with open(temp_file, 'wb') as f:
    pickle.dump(sample_data, f)

ARGS = {
    "filename": temp_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
merge_completion_and_prompt Ran
ran; our contract draft was wrong, not the code
skpig/MPSC/src/evaluation.py
code served (permissive licence) · get_code("54b4162aedf9341b")
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 numpy as np

# Construct completions list
completions = [
    {
        'task_id': 'task_001',
        'completions': [
            '    return x + 1\n',
            '    return x * 2\n'
        ]
    },
    {
        'task_id': 'task_002',
        'completions': [
            '    return y - 1\n'
        ]
    }
]

# Construct prompts list
prompts = [
    {
        'task_id': 'task_001',
        'prompt': 'def add_one(x):\n',
        'test': 'assert add_one(5) == 6\n',
        'plus_test': 'assert add_one(5) == 6 and add_one(0) == 1\n',
        'entry_point': 'add_one'
    },
    {
        'task_id': 'task_002',
        'prompt': 'def subtract_one(y):\n',
        'test': 'assert subtract_one(5) == 4\n',
        'plus_test': 'assert subtract_one(5) == 4 and subtract_one(1) == 0\n',
        'entry_point': 'subtract_one'
    }
]

ARGS = {
    'completions': completions,
    'prompts': prompts,
    'isplus': False
}
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 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
pass_at_K_by_task Ran
ran; our contract draft was wrong, not the code
skpig/MPSC/src/_evaluation.py
code served (permissive licence) · get_code("087bb497861f2052")
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 numpy as np
from collections import defaultdict

# Create sample results data structure
# The function expects a list of dicts with 'task_id' and 'passed' keys
results = [
    {'task_id': 'task_1', 'passed': True},
    {'task_id': 'task_1', 'passed': False},
    {'task_id': 'task_1', 'passed': True},
    {'task_id': 'task_2', 'passed': True},
    {'task_id': 'task_2', 'passed': True},
    {'task_id': 'task_3', 'passed': False},
]

k = 2

ARGS = {
    'results': results,
    'k': k,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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
check_correctness_with_test_cases Not yet run
unverified (harvested, no recorded run)
skpig/MPSC/src/_execution.py
code served (permissive licence) · get_code("2b1a510149e7802e")
How it ran

no invocation recorded.

get_result_of_sorted_solutions Not yet run
unverified (harvested, no recorded run)
skpig/MPSC/src/_evaluation.py
code served (permissive licence) · get_code("4eeec614744ccbf7")
How it ran

no invocation recorded.

pass_at_K Not yet run
unverified (harvested, no recorded run)
skpig/MPSC/src/_evaluation.py
code served (permissive licence) · get_code("13947e62b70c4cc0")
How it ran

no invocation recorded.

postconditions Not yet run
unverified (harvested, no recorded run)
skpig/MPSC/src/exemplars/3.py
code served (permissive licence) · get_code("167df5063944caeb")
How it ran

no invocation recorded.

process_fn Not yet run
unverified (harvested, no recorded run)
skpig/MPSC/src/graph.py
code served (permissive licence) · get_code("c8d414f3e3e34df2")
How it ran

no invocation recorded.

run Not yet run
unverified (harvested, no recorded run)
skpig/MPSC/MPSC/graph.py
code served (permissive licence) · get_code("a65e35f50c46f055")
How it ran

no invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 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 13 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
load_pickle 10 other papers
7 dated earlier, 2 later, 1 same year, order not determinable
2001.09099 (2020-01)
TVR: A Large-Scale Dataset for Video-Subtitle Moment Retrieval
2107.06383 (2021-07)
How Much Can CLIP Benefit Vision-and-Language Tasks?
2023.findings-emnlp.644 (2023 (year only))
VIP5: Towards Multimodal Foundation Models for Recommendation
and 7 more not named here

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

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Large language models (LLMs) have exhibited remarkable ability in code generation. However, generating the correct solution in a single attempt still remains a challenge. Prior works utilize verification properties in software engineering to verify and re-rank solutions in a majority voting manner. But the assumption behind them that generated verification properties have better qualities than solutions may not always hold. In this paper, we treat them equally as different perspectives of LLMs' reasoning processes. We propose the Multi-Perspective Self-Consistency (MPSC) framework incorporating both inter- and intra-consistency across outputs from multiple perspectives. Specifically, we prompt LLMs to generate diverse outputs from three perspectives, Solution, Specification and Test case, constructing a 3-partite graph. With two measure functions of consistency, we embed both inter- and intra-consistency information into the graph. The optimal choice of solutions is then determined based on analysis in the graph. MPSC significantly boosts performance of foundation models (ChatGPT in this paper) on various benchmarks, including HumanEval (+15.91%), MBPP (+6.43%) and CodeContests (+9.37%), even surpassing GPT-4.

For agents

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

get_harvested_code_for_paper("2309.17272")
get_code_for_paper("2309.17272")
have("2309.17272")

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

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

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

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

Connect an agent — have() is free.