|
1 | 1 | # gpt-resolve |
2 | 2 | Can GPT solve Brazilian university entrance exams? |
3 | 3 |
|
4 | | -This project is a simple implementation of how to use LLMs to solve challenging Brazilian university entrance exams. |
| 4 | +This project is an implementation of how to use LLMs to solve challenging Brazilian university entrance exams. |
5 | 5 |
|
6 | | -We'll use `o1-preview`, which is the best OpenAI model so far with reasoning capabilities, and `gpt-4o` to describe the exam images so that `o1-preview` can solve them (as it does not have image capabilities yet). Results are saved as txt files with LaTeX formatting, and you can optionally convert them to a nice PDF or using some LaTeX editor. |
| 6 | +We'll use `o1-preview`, which is the best OpenAI model so far with reasoning capabilities, and `gpt-4o` to describe the exam images so that `o1-preview` can solve them on question at a time (as it does not have image capabilities yet). Results are saved as txt files with LaTeX formatting, and you can optionally convert them to a nice PDF or using some LaTeX editor. |
7 | 7 |
|
8 | | -The first exam to be solved is the ITA (Instituto Tecnológico de Aeronáutica) exam for admissions in 2025, which is considered one of the most challenging exams in Brazil. This exam currently has two phases: the first one is a multiple choice test and a second one with a 4-hour essay test with 10 questions. The project will start by solving the second phase of the Math section, which is the essay test. This is particularly interesting because (i) the exam happened very recently on the 5th of November 2024 and (ii) the essay test requires a deep understanding of the subjects and the ability to write the answer step by step, which we'll evaluate as well. |
| 8 | +The first exam to be solved is the ITA (Instituto Tecnológico de Aeronáutica) exam for admissions in 2025, which is considered one of the most challenging exams in Brazil. The project will start by solving the second phase of the Math section, which is the essay test. This is particularly interesting because (i) the exam happened very recently on the 5th of November 2024 and (ii) the essay test requires a deep understanding of the subjects and the ability to write the answer step by step, which we'll evaluate as well. See more details in the in-progress [report](exams/ita_2025/report.md). |
9 | 9 |
|
10 | 10 | After the first exam is solved, the project will try to solve the multiple choice test for Math and expand to other sections and eventually other exams. Feel free to contribute with ideas and implementations of other exams! |
11 | 11 |
|
12 | 12 | Table of exams to be solved: |
13 | 13 |
|
14 | | -| Exam | Phase | Section | Type | Model | Status | Score | |
15 | | -|------|-------|---------|------|-------|--------|-------| |
16 | | -| ITA | 2025 | Math | Essay | o1-preview | 🚧 In Progress | - | |
| 14 | +| Exam | Year | Model | Status | Score | Report | |
| 15 | +|------|------|-------|--------|-------|--------| |
| 16 | +| ITA | 2025 | o1-preview | 🚧 In Progress | - | [Report](exams/ita_2025/report.md) | |
17 | 17 |
|
18 | | -## How to use |
19 | | -So far, with just one exam, you just need to run `python src/resolve.py`. It will process a `exam_path` and it will save the results in the subfolder `solutions` as `.txt` files, one for each question. Make sure to set your env var `OPENAI_API_KEY` in the `.env` file. See section [Convert to LaTeX PDF](#convert-to-latex-pdf) to see how to convert the `.txt` files to a PDF. |
| 18 | +### Installation and How to use |
20 | 19 |
|
21 | | -## Convert to LaTeX PDF |
22 | | -🚧 In Progress... |
| 20 | +```bash |
| 21 | +pip install gpt-resolve |
| 22 | +``` |
| 23 | + |
| 24 | +`gpt-resolve` provides a simple CLI with two main commands: `resolve` for solving exam questions and `compile-solutions` for generating PDFs from the solutions. |
| 25 | + |
| 26 | +### Solve exams |
| 27 | + |
| 28 | +To generate solutions for an exam: |
| 29 | +- save the exam images in the exam folder `exam_path`, one question per image file |
| 30 | +- run `gpt-resolve resolve -p exam_path` and grab a coffee while it runs. |
| 31 | + |
| 32 | +See `gpt-resolve resolve --help` for more details about solving only a subset of questions or controlling token usage. |
| 33 | + |
| 34 | + |
| 35 | +### Compile solutions into a single PDF |
| 36 | + |
| 37 | +Once you have the solutions in your exam folder `exam_path`, you can compile them into a single PDF: |
| 38 | +- run `gpt-resolve compile-solutions -p exam_path --title "Your Exam Title"` |
| 39 | + |
| 40 | +For that command to work, you'll need a LaTeX distribution in your system. See some guidelines [here](https://www.tug.org/texlive/) (MacTeX for MacOS was used to start this project). |
| 41 | + |
| 42 | +## Troubleshooting |
| 43 | + |
| 44 | +Sometimes, it was observed that the output from `o1-preview` produced invalid LaTeX code when nesting display math environments (such as `\[...\]` and `\begin{align*} ... \end{align*}` together). The current prompt for `o1-preview` adds an instruction to avoid this, which works most of the time. If that happens, you can try to solve the question again by running `gpt-resolve resolve -p exam_path -q <question_number>`, or making more adjustments to the prompt, or fixing the output LaTeX code manually. |
23 | 45 |
|
24 | 46 | ## Contributing |
25 | 47 |
|
|
0 commit comments