SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2307.02762 · 2023

PRD: Peer Rank and Discussion Improve Large Language Model based Evaluations

arXiv · PDF · Open in the Atlas

Code that ran

9 of 13 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; 3 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 5 failures of our instrument; 4 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/2307.02762.json · badge: /api/ran/2307.02762.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
bcdnlp/prd canonical (classifier label)
classifier basis: census
9 ran · 4 no recorded run
FunctionStatusWhere it lives
get_eval Ran
ran; our contract draft was wrong, not the code
bcdnlp/prd/peer_rank/eval_bard_review.py
code served (permissive licence) · get_code("f296a758b3b2f6d2")
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 logging
import time
from unittest.mock import Mock, MagicMock

# Set up logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)

# Create a mock model that has a predict method
# The function calls model.predict(content, temperature=..., max_output_tokens=..., top_k=..., top_p=...)
# and expects response.text to exist
mock_response = Mock()
mock_response.text = "This is a sample model response."

mock_model = Mock()
mock_model.predict = Mock(return_value=mock_response)

# Make the mock model available globally as 'model' since the function references it
import sys
current_module = sys.modules[__name__]
current_module.model = mock_model

# Define arguments for get_eval function
ARGS = {
    'sys_prompt': 'You are a helpful assistant.',
    'user_prompt': 'Please explain machine learning in simple terms.'
}
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
get_json_list Ran
ran; our contract draft was wrong, not the code
bcdnlp/prd/human_annotation/generate_mturk_input.py
code served (permissive licence) · get_code("e5264b01e60f3d3d")
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
from pathlib import Path

# Create a temporary JSONL file with sample data
temp_dir = tempfile.mkdtemp()
temp_file = Path(temp_dir) / "test.jsonl"

# Write sample JSON lines to the file
sample_data = [
    {"id": 1, "text": "hello world"},
    {"id": 2, "text": "foo bar"},
    {"id": 3, "text": "test data"}
]

with open(temp_file, 'w') as f:
    for item in sample_data:
        f.write(json.dumps(item) + '\n')

ARGS = {
    "file_path": str(temp_file)
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_review_jsons Ran
ran; our contract draft was wrong, not the code
bcdnlp/prd/human_annotation/generate_mturk_input.py
code served (permissive licence) · get_code("b012cf9e1a1a190c")
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 2, 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
from pathlib import Path

# Create temporary directory and files for testing
temp_dir = tempfile.mkdtemp()
review_dir = temp_dir

# Create mock answer files
answer_file1 = Path(temp_dir) / "answer_model_a.txt"
answer_file2 = Path(temp_dir) / "answer_model_b.txt"
answer_file1.write_text("dummy")
answer_file2.write_text("dummy")

answer_file_list = [str(answer_file1), str(answer_file2)]

# Create mock review files that match the expected naming pattern
review_file_path = Path(review_dir) / "answer_model_a-vs-answer_model_b-gpt-4-reviewer.jsonl"
review_data = [
    {"reviewer": "gpt-4", "score": 8, "comment": "Good response"},
    {"reviewer": "gpt-4", "score": 7, "comment": "Acceptable response"}
]
with open(review_file_path, 'w') as f:
    for item in review_data:
        f.write(json.dumps(item) + '\n')

ARGS = {
    "review_dir": str(review_dir),
    "answer_file_list": answer_file_list
}
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 2, 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
history_formatting Ran
ran; our contract draft was wrong, not the code
bcdnlp/prd/peer_discussion/utils.py
code served (permissive licence) · get_code("dfd1c0fa50d644f7")
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

# Set seed for reproducibility
torch.manual_seed(0)

# Define config as a global since result_extraction uses it
config = {'add_prompt_each_turn': False}

def result_extraction(text):
    try:
        if config['add_prompt_each_turn']:
            text = text.split('\n\n[System]')[0]
        preference = int(text.strip().split('\n')[-1].strip())
        return preference
    except Exception as e:
        print(e)
        return -1

# Create sample history list
history = [
    "System prompt here",
    "Background information here",
    "Reviewer A response 1\n5",
    "Reviewer B response 1\n7",
    "Reviewer A response 2\n6",
    "Reviewer B response 2\n8"
]

# Create reviewers list
reviewers = ["reviewer_a", "reviewer_b"]

ARGS = {
    'history': history,
    'reviewers': reviewers
}
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
parse_score Ran
ran, violated the contract we drafted
bcdnlp/prd/peer_rank/eval_bard_review.py
code served (permissive licence) · get_code("8049b382893c73dd")
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 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 logging

logger = logging.getLogger(__name__)

def parse_score(review):
    try:
        score_pair = review.split('\n')[0]
        score_pair = score_pair.replace(',', ' ')
        sp = score_pair.split(' ')
        if len(sp) == 2:
            return [float(sp[0]), float(sp[1])]
        else:
            raise Exception('Invalid score pair.')
    except Exception as e:
        logger.error(f'{e}\nContent: {review}\nYou must manually fix the score pair.')
        return [-1, -1]

# Valid review string with score pair on first line
review_valid = "8.5 9.2\nThis is a great product with excellent quality."

ARGS = {
    "review": review_valid
}
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 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
parse_three_class_score Ran
ran, honoured the contract we drafted
bcdnlp/prd/peer_rank/eval_bard_review.py
code served (permissive licence) · get_code("2155c3b1b19d8ab9")
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 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 logging

logger = logging.getLogger(__name__)

def parse_three_class_score(review):
    try:
        score = int(review.strip().split('\n')[-1].strip())
        return score
    except Exception as e:
        logger.error(f'{e}\nContent: {review}\nYou must manually fix the score pair.')
        return -1

# Setup code
ARGS = {
    "review": "This is a great product.\nVery satisfied with the quality.\n5"
}
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 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
prompt_formatting Ran
ran; our contract draft was wrong, not the code
bcdnlp/prd/peer_discussion/openai_api.py
code served (permissive licence) · get_code("6561343e8ca358e0")
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

torch.manual_seed(0)

# Analyze the function:
# - Takes 'history' parameter
# - history[0] is used as system content (a string)
# - history[1:] is iterated over with enumerate
# - Even indices (0, 2, 4...) become 'user' role
# - Odd indices (1, 3, 5...) become 'assistant' role
# - All elements should be strings (content field)

history = [
    "You are a helpful assistant.",
    "What is the capital of France?",
    "The capital of France is Paris.",
    "Tell me more about Paris.",
    "Paris is the largest city in France and is known for the Eiffel Tower."
]

ARGS = {
    'history': 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 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
result_extraction Ran
ran, honoured the contract we drafted
bcdnlp/prd/peer_discussion/reviews_lfqa.py
code served (permissive licence) · get_code("6eb61a17cbd928fc")
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

torch.manual_seed(0)

# The function takes a single parameter 'text' which is a string
# It attempts to:
# 1. Strip whitespace from the text
# 2. Split by newline and take the last element
# 3. Strip whitespace from that element
# 4. Convert to integer
# 5. Return the integer, or -1 on exception

# Valid test case: a multi-line string with an integer on the last line
text_input = "Some content\nMore content\n42"

ARGS = {
    "text": text_input
}
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
result_extraction Ran
ran, honoured the contract we drafted
bcdnlp/prd/peer_discussion/utils.py
code served (permissive licence) · get_code("acbd88de103b84d2")
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; 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

# Define a global config dict that the function references
config = {
    'add_prompt_each_turn': True
}

# Create test text with the expected format
# The function extracts the last line as an integer preference
test_text = """Some response content here
More content
5"""

# Alternative test case with system prompt that should be stripped
test_text_with_prompt = """Some response content here

[System] This is a system message
3"""

# Test case without the prompt (when add_prompt_each_turn is False)
test_text_no_prompt = """Another response
10"""

# Create ARGS dict with a valid text input
# Using the simple case that should successfully return 5
ARGS = {
    'text': test_text
}
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 int, ndim 0, dtype family int — no output shape is stated: observe_signature.py could not observe it (read:RecursionError)
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
add_prompt_each_turn_lfqa Not yet run
unverified (harvested, no recorded run)
bcdnlp/prd/peer_discussion/prompt_generation.py
code served (permissive licence) · get_code("249a13545ead89d5")
How it ran

no invocation recorded.

call Not yet run
unverified (harvested, no recorded run)
bcdnlp/prd/peer_discussion/openai_api.py
code served (permissive licence) · get_code("306d213aec7cb87f")
How it ran

no invocation recorded.

prompt_discuss_generation_lfqa Not yet run
unverified (harvested, no recorded run)
bcdnlp/prd/peer_discussion/prompt_generation.py
code served (permissive licence) · get_code("6e921e9df603b55a")
How it ran

no invocation recorded.

prompt_review_generation_lfqa Not yet run
unverified (harvested, no recorded run)
bcdnlp/prd/peer_discussion/prompt_generation.py
code served (permissive licence) · get_code("73ecb69ec08eb250")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 2 later) and 11 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_score 7 other papers
2 dated earlier, 5 later
2305.12031 (2023-05)
Clinical Camel: An Open Expert-Level Medical Language Model with Dialogue-Based Knowledge Encoding
2305.14314 (2023-05)
QLORA: Efficient Finetuning of Quantized LLMs
2308.03279 (2023-08)
UniversalNER: TARGETED DISTILLATION FROM LARGE LANGUAGE MODELS FOR OPEN NAMED ENTITY RECOGNITION
and 4 more not named here
parse_three_class_score 2 other papers
1 dated earlier, 1 later
2305.14314 (2023-05)
QLORA: Efficient Finetuning of Quantized LLMs
2312.00374 (2023-12)
The Philosopher's Stone: Trojaning Plugins of Large Language Models

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

Nowadays, the quality of responses generated by different modern large language models (LLMs) is hard to evaluate and compare automatically. Recent studies suggest and predominantly use LLMs for reference-free evaluation of open-ended question answering. More specifically, they use the recognized "strongest" LLM as the evaluator, which conducts pairwise comparisons of candidate models' answers and provides a ranking score. However, this intuitive method has multiple problems, such as bringing in self-enhancement (favoring its own answers) and positional bias. We draw insights and lessons from the educational domain (Cho & MacArthur, 2011; Walsh, 2014) to improve LLM-based evaluations. Specifically, we propose (1) the peer rank (PR) algorithm that takes into account each peer LLM's pairwise preferences of all answer pairs, and outputs a final ranking of models; and (2) peer discussion (PD), where we prompt two LLMs to discuss and try to reach a mutual agreement on the preferences of two answers. We conduct experiments on two benchmark datasets. We find that our approaches achieve higher accuracy and align better with human judgments. Interestingly, PR can induce a relatively accurate self-ranking of models under the anonymous setting, where each model's name is unrevealed. Our work provides space to explore evaluating models that are hard to compare for humans.

For agents

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

get_harvested_code_for_paper("2307.02762")
get_code_for_paper("2307.02762")
have("2307.02762")

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

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

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

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

Connect an agent — have() is free.