Skip to content

Commit

Permalink
Diagrammatical Reasoning Logic [~35%] (openai#341)
Browse files Browse the repository at this point in the history
# Thank you for contributing an eval! ♥️

🚨 Please make sure your PR follows these guidelines, __failure to follow
the guidelines below will result in the PR being closed automatically__.
Note that even if the criteria are met, that does not guarantee the PR
will be merged nor GPT-4 access granted. 🚨

__PLEASE READ THIS__:

In order for a PR to be merged, it must fail on GPT-4. We are aware that
right now, users do not have access, so you will not be able to tell if
the eval fails or not. Please run your eval with GPT-3.5-Turbo, but keep
in mind as we run the eval, if GPT-4 gets higher than 90% on the eval,
we will likely reject since GPT-4 is already capable of completing the
task.

We plan to roll out a way for users submitting evals to see the eval
performance on GPT-4 soon. Stay tuned! Until then, you will not be able
to see the eval performance on GPT-4. We encourage partial PR's with
~5-10 example that we can then run the evals on and share the results
with you so you know how your eval does with GPT-4 before writing all
100 examples.

## Eval details 📑
### Diagrammatical Reasoning Logic

### Eval description

This eval is similar to diagrammatic reasoning tests you can find
online. I wrote some code to procedurally generate test questions and
have adapted it in order to make it GPT friendly. I am interested to see
how GPT performs given an image prompt of a question instead of the text
representation below.

<img width="600" alt="Screenshot 2023-03-20 at 08 04 59"
src="https://user-images.githubusercontent.com/8216039/226280873-e9fc420e-1a31-4253-a9eb-4e6cff8dde5b.png">
<img width="600" alt="Screenshot 2023-03-20 at 08 07 20"
src="https://user-images.githubusercontent.com/8216039/226281240-7e660640-f64d-43a3-85bf-5c80db6c334b.png">

An example problem:

Definition of each operator and what it does:
Operator, Effect
C Changes size and shading of all figures
D Changes shape of all figures
E Changes 1st figure (see examples)

Examples of these operators on some made up sequences:
Input, Process, Output
| small dark circle | | small dark triangle | - C - | large light circle
| | large light triangle |
| small dark triangle | | large dark triangle | | small dark triangle |
| small dark triangle | - D - | small light circle | | large dark circle
| | small light circle | | small dark circle |
| large dark circle | | large dark triangle | - E - | small dark
triangle | | large dark triangle |

Question:
| small dark triangle | | large light circle | | small dark circle | - D
- ?

Possible Answers:
A - | small dark circle | | large light triangle | | large dark triangle
|
B - | small dark circle | | large light triangle | | small dark triangle
|
C - | small dark circle | | large light triangle | | large light
triangle | | small dark triangle |
D - | large dark circle | | large light triangle | | large dark triangle
|

Answer:
B

Explanation: The answer is B, this is due to the fact that the operation
applied to the original sequence of small dark triangle, large light
circle and small dark circle is D which changes the shape of all the
figures. Therefore the final result will be small dark circle, large
light triangle, small dark triangle where only the shape characteristic
for each figure has changed.

### What makes this a useful eval?

This eval tests multiple aspects of General Intelligence. An example is
having to infer what an operation is doing without being told
explicitly. GPT also needs to work out how to apply this operation
generically instead of considering just the example sequences. There are
harder questions in the dataset that use multiple operators in sequence.
It also tests technical vocabulary and sequence logic. This is a
particularly challenging task even for humans and requires focus.

## Criteria for a good eval ✅

Below are some of the criteria we look for in a good eval. In general,
we are seeking cases where the model does not do a good job despite
being capable of generating a good response (note that there are some
things large language models cannot do, so those would not make good
evals).

Your eval should be:

- [x] Thematically consistent: The eval should be thematically
consistent. We'd like to see a number of prompts all demonstrating some
particular failure mode. For example, we can create an eval on cases
where the model fails to reason about the physical world.
- [x] Contains failures where a human can do the task, but either GPT-4
or GPT-3.5-Turbo could not.
- [x] Includes good signal around what is the right behavior. This means
either a correct answer for `Basic` evals or the `Fact` Model-graded
eval, or an exhaustive rubric for evaluating answers for the `Criteria`
Model-graded eval.
- [x] Include at least 100 high quality examples (it is okay to only
contribute 5-10 meaningful examples and have us test them with GPT-4
before adding all 100)

If there is anything else that makes your eval worth including, please
document it below.

## Eval structure 🏗️

Your eval should
- [x] Check that your data is in `evals/registry/data/{name}`
- [x] Check that your yaml is registered at
`evals/registry/evals/{name}.jsonl`
- [x] Ensure you have the right to use the data you submit via this eval

(For now, we will only be approving evals that use one of the existing
eval classes. You may still write custom eval classes for your own
cases, and we may consider merging them in the future.)

## Final checklist 👀

### Submission agreement

By contributing to Evals, you are agreeing to make your evaluation logic
and data under the same MIT license as this repository. You must have
adequate rights to upload any data used in an Eval. OpenAI reserves the
right to use this data in future service improvements to our product.
Contributions to OpenAI Evals will be subject to our usual Usage
Policies (https://platform.openai.com/docs/usage-policies).

- [x] I agree that my submission will be made available under an MIT
license and complies with OpenAI's usage policies.

### Email address validation

If your submission is accepted, we will be granting GPT-4 access to a
limited number of contributors. Access will be given to the email
address associated with the merged pull request.

- [x] I acknowledge that GPT-4 access will only be granted, if
applicable, to the email address used for my merged pull request.

### Limited availability acknowledgement

We know that you might be excited to contribute to OpenAI's mission,
help improve our models, and gain access to GPT-4. However, due to the
requirements mentioned above and high volume of submissions, we will not
be able to accept all submissions and thus not grant everyone who opens
a PR GPT-4 access. We know this is disappointing, but we hope to set the
right expectation before you open this PR.

- [x] I understand that opening a PR, even if it meets the requirements
above, does not guarantee the PR will be merged nor GPT-4 access
granted.

### Submit eval

- [x] I have filled out all required fields in the evals PR form
- [ ] (Ignore if not submitting code) I have run `pip install
pre-commit; pre-commit install` and have verified that `black`, `isort`,
and `autoflake` are running when I commit and push

Failure to fill out all required fields will result in the PR being
closed.

### Eval JSON data 

Since we are using Git LFS, we are asking eval submitters to add in as
many Eval Samples (at least 5) from their contribution here:

<details>
  <summary>View evals in JSON</summary>

  ### Eval
  ```jsonl
{"input": [{"role": "system", "content": "\n In the following logic
puzzle, you are given a set of operators that may be used. There are
also some examples of these operators in use. Work out the sequence that
replaces '?', choose from the possible answers. In order to solve this
problem correctly, you must consider the logical operators. If there are
multiple operators applied you must they apply them left to right. In
some cases the operator effect is not explicitly defined and you will
need to work it out. You MUST NOT PROVIDE AN EXPLANATION with words you
only MUST ONLY REPLY WITH A SINGLE LETTER, for example 'A', 'B', 'C', or
'D'.\n "}, {"role": "user", "content": "Definition of each operator and
what it does:\nOperator, Effect\nP Changes 1st figure (see examples)\nQ
Changes shading and shape of all figures\nR Changes 3rd figure (see
examples)\nS Deletes small light figures\n\nExamples of these operators
on some made up sequences:\nInput, Process, Output\n| small light circle
| | small light circle | | large dark circle | - P - | large light
circle | | small light circle | | large dark circle |\n| small light
circle | | small light triangle | - Q - | small dark triangle | | small
dark circle |\n| small dark circle | | large light triangle | | large
dark circle | - R - | small dark circle | | large light triangle | |
large light circle |\n| small light circle | | large dark triangle | - S
- | large dark triangle |\n\nQuestion:\n| small dark triangle | | small
dark circle | | small dark triangle | - R - ?\n\nPossible Answers:\nA -
| large dark circle | | large dark triangle | | small light triangle
|\nB - | small dark triangle | | small dark circle | | small light
triangle | | small light triangle |\nC - | small light triangle | |
small dark circle | | small dark triangle |\nD - | small dark triangle |
| small dark circle | | small light triangle |\n\n"}], "ideal": ["D"]}
{"input": [{"role": "system", "content": "\n In the following logic
puzzle, you are given a set of operators that may be used. There are
also some examples of these operators in use. Work out the sequence that
replaces '?', choose from the possible answers. In order to solve this
problem correctly, you must consider the logical operators. If there are
multiple operators applied you must they apply them left to right. In
some cases the operator effect is not explicitly defined and you will
need to work it out. You MUST NOT PROVIDE AN EXPLANATION with words you
only MUST ONLY REPLY WITH A SINGLE LETTER, for example 'A', 'B', 'C', or
'D'.\n "}, {"role": "user", "content": "\n\nDefinition of each operator
and what it does:\nOperator, Effect\nO Duplicates circles\nP Changes
shading and shape of all figures\n\nExamples of these operators on some
made up sequences:\nInput, Process, Output\n| large light circle | |
large light triangle | - O - | large light circle | | large light circle
| | large light triangle |\n| small dark triangle | | large dark
triangle | - P - | small light circle | | large light circle |\n| small
light triangle | | small dark triangle | - P - | small dark circle | |
small light circle |\n\nQuestion:\n| small dark triangle | | large dark
triangle | | large dark triangle | | small light circle | - O -
?\n\nPossible Answers:\nA - | large dark circle | | small dark circle |
| small dark circle | | large light triangle | | large light triangle
|\nB - | small dark triangle | | large dark triangle | | large dark
triangle | | small light circle | | small light circle |\nC - | small
dark triangle | | large dark triangle | | small light circle | | small
light circle |\nD - | small dark triangle | | large dark triangle | |
large dark triangle | | large light circle | | large light circle
|\n\n"}], "ideal": ["B"]}
{"input": [{"role": "system", "content": "\n In the following logic
puzzle, you are given a set of operators that may be used. There are
also some examples of these operators in use. Work out the sequence that
replaces '?', choose from the possible answers. In order to solve this
problem correctly, you must consider the logical operators. If there are
multiple operators applied you must they apply them left to right. In
some cases the operator effect is not explicitly defined and you will
need to work it out. You MUST NOT PROVIDE AN EXPLANATION with words you
only MUST ONLY REPLY WITH A SINGLE LETTER, for example 'A', 'B', 'C', or
'D'.\n "}, {"role": "user", "content": "\n\nDefinition of each operator
and what it does:\nOperator, Effect\nB Duplicates 1st figure\nC
Duplicates small triangles\n\nExamples of these operators on some made
up sequences:\nInput, Process, Output\n| small light triangle | | small
light circle | | large dark triangle | - B - | small light triangle | |
small light triangle | | small light circle | | large dark triangle |\n|
large light triangle | | small light triangle | - C - | large light
triangle | | small light triangle | | small light triangle |\n| small
dark triangle | | small dark triangle | | large light circle | | large
dark triangle | - C - | small dark triangle | | small dark triangle | |
small dark triangle | | small dark triangle | | large light circle | |
large dark triangle |\n\nQuestion:\n| large light circle | | large dark
circle | | small light circle | | small light triangle | - C -
?\n\nPossible Answers:\nA - | large dark circle | | large light circle |
| small dark circle | | small dark triangle | | small dark triangle |\nB
- | large light circle | | large dark circle | | small light circle | |
small light triangle | | large dark triangle |\nC - | large light circle
| | large dark circle | | small light circle | | small light triangle |
| small light triangle |\nD - | large dark circle | | large dark circle
| | small dark circle | | small dark triangle | | small dark triangle
|\n\n"}], "ideal": ["C"]}
{"input": [{"role": "system", "content": "\n In the following logic
puzzle, you are given a set of operators that may be used. There are
also some examples of these operators in use. Work out the sequence that
replaces '?', choose from the possible answers. In order to solve this
problem correctly, you must consider the logical operators. If there are
multiple operators applied you must they apply them left to right. In
some cases the operator effect is not explicitly defined and you will
need to work it out. You MUST NOT PROVIDE AN EXPLANATION with words you
only MUST ONLY REPLY WITH A SINGLE LETTER, for example 'A', 'B', 'C', or
'D'.\n "}, {"role": "user", "content": "\n\nDefinition of each operator
and what it does:\nOperator, Effect\nB Changes 1st figure (see
examples)\nC Changes shading and shape of 1st figure\nD Deletes 4th
figure\nE Deletes large triangles\n\nExamples of these operators on some
made up sequences:\nInput, Process, Output\n| small dark circle | |
large light triangle | - B - | large dark triangle | | large light
triangle |\n| large light circle | | large dark circle | | small dark
circle | - C - | large dark triangle | | large dark circle | | small
dark circle |\n\n\n\nQuestion:\n? - C - | large dark circle | | small
light circle |\n\nPossible Answers:\nA - | small light circle | | large
light triangle |\nB - | large dark triangle | | small light circle |\nC
- | large light triangle | | small light circle |\nD - | large light
triangle | | small dark triangle |\n\n"}], "ideal": ["C"]}
{"input": [{"role": "system", "content": "\n In the following logic
puzzle, you are given a set of operators that may be used. There are
also some examples of these operators in use. Work out the sequence that
replaces '?', choose from the possible answers. In order to solve this
problem correctly, you must consider the logical operators. If there are
multiple operators applied you must they apply them left to right. In
some cases the operator effect is not explicitly defined and you will
need to work it out. You MUST NOT PROVIDE AN EXPLANATION with words you
only MUST ONLY REPLY WITH A SINGLE LETTER, for example 'A', 'B', 'C', or
'D'.\n "}, {"role": "user", "content": "\n\nDefinition of each operator
and what it does:\nOperator, Effect\nB Changes size and shading of 1st
figure\nC Changes shading of 1st figure\nD Changes size and shape of 2nd
figure\n\nExamples of these operators on some made up sequences:\nInput,
Process, Output\n| large light circle | | large light circle | | small
light triangle | - B - | small dark circle | | large light circle | |
small light triangle |\n| large dark circle | | large light circle | |
small dark circle | | large light triangle | - C - | large light circle
| | large light circle | | small dark circle | | large light triangle
|\n| small dark triangle | | small dark triangle | | small light circle
| - D - | small dark triangle | | large dark circle | | small light
circle |\n\nQuestion:\n? - D - - B - | small dark triangle | | small
dark triangle | | large light triangle | | large dark triangle
|\n\nPossible Answers:\nA - | large light triangle | | large dark circle
| | large light triangle | | small dark triangle |\nB - | large light
triangle | | large dark circle | | large light triangle | | large dark
triangle |\nC - | large dark circle | | large light triangle | | large
light triangle | | large dark triangle |\nD - | large light triangle | |
large light triangle | | large dark circle | | large dark circle | |
large light triangle | | large light triangle | | large dark triangle |
| large dark triangle |\n\n"}], "ideal": ["B"]}
{"input": [{"role": "system", "content": "\n In the following logic
puzzle, you are given a set of operators that may be used. There are
also some examples of these operators in use. Work out the sequence that
replaces '?', choose from the possible answers. In order to solve this
problem correctly, you must consider the logical operators. If there are
multiple operators applied you must they apply them left to right. In
some cases the operator effect is not explicitly defined and you will
need to work it out. You MUST NOT PROVIDE AN EXPLANATION with words you
only MUST ONLY REPLY WITH A SINGLE LETTER, for example 'A', 'B', 'C', or
'D'.\n "}, {"role": "user", "content": "\n\nDefinition of each operator
and what it does:\nOperator, Effect\nB Changes dark figures (see
examples)\nC Changes size and shading of 1st figure\n\nExamples of these
operators on some made up sequences:\nInput, Process, Output\n| large
light circle | | small dark circle | | large light triangle | | small
light circle | - B - | large light circle | | small light triangle | |
large light triangle | | small light circle |\n| small dark circle | |
large light circle | - C - | large light circle | | large light circle
|\n\nQuestion:\n? - B - - C - | small dark triangle | | small light
triangle | | large light circle |\n\nPossible Answers:\nA - | small
light circle | | small dark circle | | large light circle |\nB - | large
dark circle | | large light circle |\nC - | large dark circle | | small
dark circle | | large light circle |\nD - | large light circle | | small
dark circle | | large light circle |\n\n"}], "ideal": ["C"]}
{"input": [{"role": "system", "content": "\n In the following logic
puzzle, you are given a set of operators that may be used. There are
also some examples of these operators in use. Work out the sequence that
replaces '?', choose from the possible answers. In order to solve this
problem correctly, you must consider the logical operators. If there are
multiple operators applied you must they apply them left to right. In
some cases the operator effect is not explicitly defined and you will
need to work it out. You MUST NOT PROVIDE AN EXPLANATION with words you
only MUST ONLY REPLY WITH A SINGLE LETTER, for example 'A', 'B', 'C', or
'D'.\n "}, {"role": "user", "content": "\n\nDefinition of each operator
and what it does:\nOperator, Effect\nA Changes 1st figure (see
examples)\nB Swaps figures (see examples)\nC Changes size and shape of
large figures\nD Duplicates 4th figure\n\nExamples of these operators on
some made up sequences:\nInput, Process, Output\n| large dark circle | |
small dark circle | - A - | small light circle | | small dark circle
|\n| large light triangle | | large light circle | | large dark circle |
- B - | large light triangle | | large dark circle | | large light
circle |\n| large light circle | | large dark triangle | - C - | small
light triangle | | small dark circle |\n| small light triangle | | large
dark circle | | large dark triangle | | small dark circle | - D - |
small light triangle | | large dark circle | | large dark triangle | |
small dark circle | | small dark circle |\n\nQuestion:\n? - D - - C - -
D - | small light circle | | small light circle | | small light circle |
| small light circle | | small light circle | | small light circle
|\n\nPossible Answers:\nA - | small light circle | | large light
triangle | | small light triangle | | large light triangle |\nB - |
small light circle | | large light triangle | | large light triangle | |
small light circle |\nC - | small light circle | | large light triangle
| | small light circle | | large light triangle |\nD - | small light
circle | | large light triangle | | large light circle | | large light
triangle |\n\n"}], "ideal": ["C"]}
  ```
</details>
  • Loading branch information
FreddieN committed Mar 22, 2023
1 parent e83f0ba commit 1a48737
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions evals/registry/data/diagrammatic_logic/samples.jsonl
Git LFS file not shown
8 changes: 8 additions & 0 deletions evals/registry/evals/diagrammatic_logic.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
diagrammatic_logic:
id: diagrammatic_logic.dev.v2
metrics: [accuracy]

diagrammatic_logic.dev.v2:
class: evals.elsuite.basic.match:Match
args:
samples_jsonl: diagrammatic_logic/samples.jsonl

0 comments on commit 1a48737

Please sign in to comment.