# GPQA

[GPQA](https://arxiv.org/pdf/2311.12022) is an evaluation dataset consisting of graduate-level multiple-choice questions in subdomains of physics, chemistry, and biology.

This implementation is based on [simple-eval](https://github.com/openai/simple-evals/blob/main/gpqa_eval.py)'s implementation. This script evaluates on the GPQA-Diamond subset.

<!-- Contributors: Automatically Generated -->
Contributed by [@jjallaire](https://github.com/jjallaire)
<!-- /Contributors: Automatically Generated -->

<!-- Usage: Automatically Generated -->
## Usage

### Installation

There are two ways of using Inspect Evals, from pypi as a dependency of your own project and as a standalone checked out GitHub repository.

If you are using it from pypi, install the package and its dependencies via:

```bash
pip install inspect-evals
```

If you are using Inspect Evals in its repository, start by installing the necessary dependencies with:

```bash
uv sync
```

### Running evaluations

Now you can start evaluating models. For simplicity's sake, this section assumes you are using Inspect Evals from the standalone repo. If that's not the case and you are not using `uv` to manage dependencies in your own project, you can use the same commands with `uv run` dropped.

```bash
uv run inspect eval inspect_evals/gpqa_diamond --model openai/gpt-5-nano
```

You can also import tasks as normal Python objects and run them from python:

```python
from inspect_ai import eval
from inspect_evals.gpqa import gpqa_diamond
eval(gpqa_diamond)
```

After running evaluations, you can view their logs using the `inspect view` command:

```bash
uv run inspect view
```

For VS Code, you can also download [Inspect AI extension for viewing logs](https://inspect.ai-safety-institute.org.uk/log-viewer.html).

If you don't want to specify the `--model` each time you run an evaluation, create a `.env` configuration file in your working directory that defines the `INSPECT_EVAL_MODEL` environment variable along with your API key. For example:

```bash
INSPECT_EVAL_MODEL=anthropic/claude-opus-4-1-20250805
ANTHROPIC_API_KEY=<anthropic-api-key>
```
<!-- /Usage: Automatically Generated -->

<!-- Options: Automatically Generated -->
## Options

You can control a variety of options from the command line. For example:

```bash
uv run inspect eval inspect_evals/gpqa_diamond --limit 10
uv run inspect eval inspect_evals/gpqa_diamond --max-connections 10
uv run inspect eval inspect_evals/gpqa_diamond --temperature 0.5
```

See `uv run inspect eval --help` for all available options.
<!-- /Options: Automatically Generated -->

<!-- Parameters: Automatically Generated -->
## Parameters

### `gpqa_diamond`

- `cot` (bool): Whether to use chain-of-thought reasoning (default True). (default: `True`)
- `epochs` (int): Number of epochs to run (default 4). (default: `4`)
- `high_level_domain` (str | list[str] | None): Optional high-level domain(s) to filter by. One of "Biology", "Chemistry", or "Physics", or a list of these. If None, all domains are included. (default: `None`)
- `subdomain` (str | list[str] | None): Optional subdomain(s) to filter by (e.g. "Genetics" or "Quantum Mechanics", or a list of these). If None, all subdomains are included. (default: `None`)
<!-- /Parameters: Automatically Generated -->

## Dataset

Here is an example prompt from the dataset (after it has been further processed by Inspect):

>Answer the following multiple choice question. The entire content of your response should be of the following format: 'ANSWER: $LETTER' (without quotes) where LETTER is one of A,B,C,D.
>
>Two quantum states with energies E1 and E2 have a lifetime of 10^-9 sec and 10^-8 sec, respectively. We want to clearly distinguish these two energy levels. Which one of the following options could be their energy difference so that they can be clearly resolved?
>
>A) 10^-4 eV  
>B) 10^-11 eV  
>C) 10^-8 eV  
>D) 10^-9 eV  

The model is then tasked to pick the correct answer choice.

## Scoring

A simple accuracy is calculated over the datapoints.

## Evaluation Report

Results on the full GPQA-Diamond dataset (198 samples, 1 epoch):

| Model | Provider | Accuracy | Stderr | Time |
| ----- | -------- | -------- | ------ | ---- |
| gpt-5.1-2025-11-13 | OpenAI | 0.652 | 0.034 | 2m 6s |
| claude-sonnet-4-5-20250929 | Anthropic | 0.717 | 0.032 | 4m 49s |
| gemini-3-pro-preview | Google | 0.929 | 0.018 | 70m |

**Notes:**

- GPT 5.1 and Anthropic completed the evaluation.
- Gemini 3 Pro completed 197/198 samples after 70 minutes.
- Human expert baseline from the paper is 69.7% accuracy
- Results generated December 2025

## Changelog

### [2-B] - 2026-03-11

- Add dataset subsetting support via the `high_level_domain` and `subdomain` task parameters.

### [2-A] - 2026-02-16

- Migrate version to new scheme. See [#907](https://github.com/UKGovernmentBEIS/inspect_evals/pull/907).
