Home/Developer Tools/coder_reviewer_reranking
coder_reviewer_reranking logo

coder_reviewer_reranking

archived
facebookresearch/coder_reviewer_reranking

Official code for paper on Coder Reviewer Reranking in Code Generation

GraphCanon updated 2w · GitHub synced 2w

45 stars9 forksLast push 3y Python Other

Decision brief

coder_reviewer_reranking is specialized for reranking generated code snippets based on predefined criteria to improve their quality and reliability.

Good fit when

  • When you need to refine and enhance the output from initial code generation models, such as the OpenAI codex API.
  • In cases where specific benchmarks like HumanEval, MBPP, or custom datasets are crucial for evaluating generated code quality.

Avoid when

  • When using a different Python version than 3.8.13 as it might result in compatibility issues.
  • If real-time code generation is required, given the setup intricacies and specific dependencies that may affect quick turnaround times.
Requirements:
Min 4 GB RAM; Specifically relies on installing pyminifier which might necessitate reverting setuptools to an older version (57.5.0).; Involves the use of torch==1.12.1, requiring a distribution compatible with your hardware.

Observed Jul 17, 2026 · Source: enrich:decision_facts

Verify the decision

Maintenance and security

Full trust report
Maintenance
Archived (1267d since push)
As of 2w
Provenance
Not a fork · Organization account
As of 2w
Security (OSV)
85 low (85 low)
As of 1mo

Public GitHub metadata and optional OSV scans. Signals, not a guarantee. Trust methodology.

Install

pip install coder_reviewer_reranking
PyPI

Similar tools

Same-category neighbours. No typed graph edges are catalogued for this tool yet.

Evidence and technical details

Sourced facts, taxonomy, compatibility claims, README excerpt, and machine-readable endpoints.

Overview

Provides tools and data sets to rerank generated codes based on specific criteria such as humaneval, MBPP, Spider, and NL2BASH.

Capability facts

Languages
python

Source: github.language · Aug 5, 2026

Categories

Compatibility

Sourced claims from the README excerpt - not unsourced marketing copy.

Python runtimePython

Source: README excerpt (regex_v1, Aug 5, 2026)

1. All experiments are run with `python==3.8.13`.
Source link

Tags

README

Coder Reviewer Reranking for Code Generation

Official code release for the paper Coder Reviewer Reranking for Code Generation.

Setup

Downloading data and cached outputs

  1. For convenience, we include data used for this project in dataset.zip. You need to download and unzip this file before using this repo. These include
  • HumanEval. We also include the prompt used in the CodeT paper
  • MBPP, which includes both the sanitized version and the initial version.
  • Spider includes the evaluation script and the data. We also include the cached outputs from executing the groundtruth SQL queries.
  • NL2BASH
  1. Samples and precomputed execution results can be found in samples.zip

Installing software environment

  1. All experiments are run with python==3.8.13.
  2. Install pyminifier from source. Installing pyminifier requires reverting setup tools to an older version (pip install setuptools==57.5.0). For other issues of installing pyminifier, checkout their issues for potential fixes.
  3. Install torch==1.12.1. You should install a distribution that matches your hardware environment
  4. Install the other packages by
pip install -r requirements.txt

Usage

Running the selector with released outputs

  1. We release samples obtained from the OpenAI codex API in samples.zip. Unzipping this file, you should see a folder with the below structure
samples
├── codex-cushman
│   ├── codet_humaneval
│   └── mbpp_sanitized
├── codex001
└── codex002

We will go over the code/commands you need to collect these samples in a later section. 2. Run the following script to compare different reranking methods.

model="codex002"
dataset="mbpp_sanitized"
outdir="result_db"
python sample_selectors.py --model ${model} \
    --num_samples_end 25 \
    --num_samples_gap 5 \
    --data_path samples \
    --out_dir ${outdir} \
    --dataset ${dataset} \
    --num_procs 10 \
    --num_bootstraps 50 \
    --temperature 0.4 \
    --verbose\
  1. We have included the execution results of all generated samples in the samples.zip. If you want to execute the generated programs yourself, you can run the following command. Typically, we leverage aggressive multiprocessing to speed up this process. You can change the number of processes by modifying nprocs. Modify the model and dataset arguments to execute other models and datasets.
model="codex002"
dataset="codet_humaneval"
nprocs=25
torchrun --nproc_per_node=${nprocs} multi_exec.py --temperature 0.4 --world_size 25 --dataset ${dataset} --in_data_path samples/${model} --batch_size 4 --num_seeds 25 --num_samples 5 --num_prompts 0

The outputs will look like and a dictionary object containing the result will be saved into result_db

sum_logprob 0.5587 0.01
avg_logprob 0.5832 0.01
avg_reverse_logprob 0.5626 0.01
random 0.5562 0.01
sumreverselogprob-ensemble#0.5 0.6152 0.01
avgreverselogprob-ensemble#0.5 0.5963 0.01
executability-sum_logprob 0.5976 0.01
executability-avg_logprob 0.6049 0.01
executability-avg_reverse_logprob 0.5952 0.01
executability-random 0.5881 0.01
executability-sumreverselogprob-ensemble#0.5 0.6440 0.01
executability-avgreverselogprob-ensemble#0.5 0.6159 0.01
mbr_exec 0.6389 0.01
oracle 0.7891 0.01

Collecting Samples

  1. the below example command collects 125 (5x25) samples for zeroshot humaneval with codex002. explore collect*.py for collecting samples on other datasets. These scripts collect

For agents

This page has a .md twin and JSON over the API.

Was this helpful?

Anonymous feedback helps us improve pages and translations.