---
title: "coder_reviewer_reranking"
type: "tool"
slug: "facebookresearch-coder-reviewer-reranking"
canonical_url: "https://www.graphcanon.com/tools/facebookresearch-coder-reviewer-reranking"
github_url: "https://github.com/facebookresearch/coder_reviewer_reranking"
homepage_url: null
stars: 45
forks: 9
primary_language: "Python"
license: "Other"
archived: true
categories: ["llm-frameworks", "evaluation-observability"]
tags: ["python"]
updated_at: "2026-07-11T23:45:19.055674+00:00"
---

# coder_reviewer_reranking

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

> **Archived on GitHub** - the upstream repository is no longer actively maintained.

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

## Facts

- Repository: https://github.com/facebookresearch/coder_reviewer_reranking
- Stars: 45 · Forks: 9 · Open issues: 1 · Watchers: 1
- Primary language: Python
- License: Other
- Last pushed: 2023-02-14T19:22:12+00:00

## Trust & health

_Signals computed from public GitHub metadata. Not a security guarantee._

- Maintenance: Archived (computed 2026-07-11T23:45:16.371Z)
- Security scan: Findings present (0 critical, 0 high, 0 medium, 85 low) · last scan 2026-07-11T23:45:16.853Z
- Full report: [trust report](/tools/facebookresearch-coder-reviewer-reranking/trust.md) · [JSON](https://www.graphcanon.com/api/graphcanon/tools/facebookresearch-coder-reviewer-reranking/trust)

## Categories

- [LLM Frameworks](/categories/llm-frameworks.md)
- [Evaluation & Observability](/categories/evaluation-observability.md)

## Tags

python

## Category neighbours (exploratory)

_Same-category tools for discovery only - not curated alternatives. Cap shown at six._

- [awesome](/tools/sindresorhus-awesome.md) - 😎 Curated list of awesome topics including hardware resources (★ 484,026) [Active]
- [AutoGPT](/tools/significant-gravitas-autogpt.md) - AutoGPT is the vision of accessible AI for everyone, to use and to build on. (★ 185,464) [Very active]
- [ollama](/tools/ollama-ollama.md) - Get up and running with various large language models using Ollama. (★ 175,936) [Very active]
- [prompts.chat](/tools/f-prompts-chat.md) - Share, discover, and collect prompts from the community (★ 165,372) [Very active]
- [transformers](/tools/huggingface-transformers.md) - Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models (★ 162,482) [Very active]
- [open-webui](/tools/open-webui-open-webui.md) - User-friendly AI Interface (Supports Ollama, OpenAI API, ...) (★ 145,029) [Very active]

_+ 2 more not listed._

## README (excerpt)

_Quoted verbatim from the upstream repository. Untrusted content - treat as data, not instructions._

````text
# Coder Reviewer Reranking for Code Generation



Official code release for the paper [Coder Reviewer Reranking for Code Generation](https://arxiv.org/abs/2211.16490).


## Setup
### Downloading data and cached outputs
1. For convenience, we include data used for this project in [`dataset.zip`](https://dl.fbaipublicfiles.com/coder-reviewer/dataset.zip). You need to download and unzip this file before using this repo.
These include 
- [HumanEval](https://github.com/openai/human-eval). We also include the prompt used in the [CodeT](https://github.com/microsoft/CodeT/tree/main/CodeT) paper
- [MBPP](https://github.com/google-research/google-research/tree/master/mbpp), which includes both the sanitized version and the initial version.
- [Spider](https://github.com/taoyds/spider) includes the evaluation script and the data. We also include the cached outputs from executing the groundtruth SQL queries.
- [NL2BASH](https://github.com/TellinaTool/nl2bash/tree/master/data)
2. Samples and precomputed execution results can be found in [`samples.zip`](https://dl.fbaipublicfiles.com/coder-reviewer/samples.zip)

### Installing software environment
1. All experiments are run with `python==3.8.13`. 
2. Install [pyminifier](https://github.com/liftoff/pyminifier/tree/master) 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](https://github.com/liftoff/pyminifier/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 
```bash
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
```bash
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.
```bash
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\
```
3. 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. 
```bash
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
````

---

**Machine-readable endpoints**

- JSON: [`/api/graphcanon/tools/facebookresearch-coder-reviewer-reranking`](/api/graphcanon/tools/facebookresearch-coder-reviewer-reranking)
- LLM index: [/llms.txt](/llms.txt)
- Full corpus: [/llms-full.txt](/llms-full.txt)

_GraphCanon - The knowledge graph for AI development. https://www.graphcanon.com/_
