File size: 2,663 Bytes
98e8615
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Math VLM-Based Evaluation (VLM-as-Judge)

Evaluates a generated mathematical solution by asking **Gemini-2.5-Pro** to compare it against the ground-truth solution. This folder provides the exact evaluation prompt; run it through any Gemini access path (Google AI Studio, Gemini API, Vertex AI, or your own client).

A single prompt (`evaluation_prompt.txt`) is used across all math subtasks (AIME, MATH-500, GSM8K, OmniMath) and for **both image and video** generations.

## Evaluation Protocol

1. Take `evaluation_prompt.txt` and substitute the `{solution_text}` placeholder with the ground-truth solution text for the problem being evaluated.
2. Send one user message to `gemini-2.5-pro` containing:
   - **The filled-in prompt** (text)
   - **The generated output** to evaluate — the generated solution image, or the generated video (the prompt instructs Gemini to watch the whole video / read all visible work)

The ground truth is provided as text inside the prompt; only the generated solution is attached as media.

## Evaluation Criteria

Gemini judges three binary dimensions:

| Metric | Meaning |
|--------|---------|
| `INTERMEDIATE_CORRECT` | 1 if the intermediate reasoning/steps/methodology match the ground truth (minor notation differences OK), else 0 |
| `FINAL_CORRECT` | 1 if the final answer matches the ground truth (equivalent forms like `1/2 = 0.5` count), else 0 |
| `ACTION_REFLECTION` | 1 if the solution shows self-checking / reconsidering / trying multiple approaches, else 0 |

Note `INTERMEDIATE_CORRECT` and `FINAL_CORRECT` are independent — a solution can reach the right answer through flawed steps (`FINAL_CORRECT=1`, `INTERMEDIATE_CORRECT=0`) or vice-versa.

## Response Format

The prompt instructs Gemini to reply in a fixed structured format:

```
INTERMEDIATE_CORRECT: <0 or 1>
FINAL_CORRECT: <0 or 1>
ACTION_REFLECTION: <0 or 1>
EXPLANATION: <detailed per-dimension explanation>
```

Parse the scores line-by-line. The prompt includes five few-shot examples covering correct/incorrect and reflective/non-reflective cases.

## Metrics

`FINAL_CORRECT` is the primary accuracy metric. For a set of generations, report:

```
accuracy = (# of outputs with FINAL_CORRECT = 1) / (total # of outputs)
```

`INTERMEDIATE_CORRECT` and `ACTION_REFLECTION` give process-level diagnostic signal.

## Note

This is the canonical prompt used by `math_evaluation.py` / `omni_math_evaluation.py` (handles both image and video). The per-model evaluation wrappers (`math_evaluation_gpt_image_1.5.py`, `_openai.py`, `_qwen_image.py`, etc.) use lightly-trimmed image-only variants of this same prompt with the identical three metrics.