Skip to content

[Eval] Adding CoSQL eval#1268

Merged
andrew-openai merged 2 commits into
openai:mainfrom
pybae:main
Jul 4, 2023
Merged

[Eval] Adding CoSQL eval#1268
andrew-openai merged 2 commits into
openai:mainfrom
pybae:main

Conversation

@pybae
Copy link
Copy Markdown
Contributor

@pybae pybae commented Jun 30, 2023

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 be 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 it 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. Starting April 10, the minimum eval count is 15 samples, we hope this makes it easier to create and contribute evals.

Also, please note that we're using Git LFS for storing the JSON files, so please make sure that you move the JSON file to Git LFS before submitting a PR. Details on how to use Git LFS are available here.

Eval details 📑

Eval name

CoSQL

Eval description

CoSQL is a dataset for cross-domain Conversational text-to-SQL systems. It is the dialogue version of the Spider task, which is an eval already present in this repo: here

To illustrate, as opposed to Spider SQL, where the task is to generate SQL given a single question:

Q: How many singers do we have?
A: SELECT count(*) FROM singer

CoSQL simulates a real-world conversation, where a user would be talking to a SQL expert, who would then write SQL to retrieve data for them. ex:

Q: Which cartoon aired first?
A: SELECT title  FROM cartoon ORDER BY original_air_date LIMIT 1

Q: What was the last cartoon to air?
A: SELECT title  FROM cartoon ORDER BY original_air_date desc LIMIT 1

Q: What channel was it on?

and the ideal answer being:

A: SELECT channel FROM cartoon ORDER BY original_air_date desc LIMIT 1

As illustrated, the model needs to not only be able to reason about provided SQL tables and schemas (which are provided in the prompts as system input), but also be able to reference and understand the previous question-answer pairs.

What makes this a useful eval?

Being able to generate semantically and logically correct SQL is an exciting application of GPT with many immediate use-cases.

Doing so in a conversational context is more difficult and tests the model's ability to reason about prior questions and answers, similar to what you would expect from a domain expert (e.g, SQL expert).

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:

  • 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.
  • Contains failures where a human can do the task, but either GPT-4 or GPT-3.5-Turbo could not.
  • 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.
  • Include at least 15 high-quality examples.

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

Eval structure 🏗️

Your eval should

  • Check that your data is in evals/registry/data/{name}
  • Check that your YAML is registered at evals/registry/evals/{name}.yaml
  • 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).

  • 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 commits on the merged pull request.

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

Limited availability acknowledgment

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 the 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.

  • 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 be granted.

Submit eval

  • I have filled out all required fields of this form
  • I have used Git LFS for the Eval JSON data
  • (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:

View evals in JSON

Eval

{"input": [{"role": "system", "content": "TASK: Answer the following question with syntactically correct SQLite SQL. The SQL should be correct and be in context of the previous question-answer pairs.\nTable Cartoon, columns = [*,id,Title,Directed_by,Written_by,Original_air_date,Production_code,Channel]\nTable TV_Channel, columns = [*,id,series_name,Country,Language,Content,Pixel_aspect_ratio_PAR,Hight_definition_TV,Pay_per_view_PPV,Package_Option]\nTable TV_series, columns = [*,id,Episode,Air_Date,Rating,Share,18_49_Rating_Share,Viewers_m,Weekly_Rank,Channel]\nForeign_keys = [TV_series.Channel = TV_Channel.id,Cartoon.Channel = TV_Channel.id]\n"}, {"role": "system", "content": "Q: Can you please tell me the language used on the least number of TV Channels?"}, {"role": "system", "content": "A: SELECT LANGUAGE FROM TV_Channel GROUP BY LANGUAGE ORDER BY count ( * )  ASC LIMIT 1"}, {"role": "system", "content": "Q: What language is used on the most number of TV channels?"}, {"role": "system", "content": "A: SELECT LANGUAGE FROM TV_Channel GROUP BY LANGUAGE ORDER BY count ( * )  desc LIMIT 1"}, {"role": "user", "content": "Q: What is the most common content of those TV channels?"}], "ideal": ["A: SELECT content from tv_channel group by content order by count ( * )  desc limit 1"]}
{"input": [{"role": "system", "content": "TASK: Answer the following question with syntactically correct SQLite SQL. The SQL should be correct and be in context of the previous question-answer pairs.\nTable Addresses, columns = [*,address_id,line_1,line_2,line_3,city,zip_postcode,state_province_county,country,other_address_details]\nTable Courses, columns = [*,course_id,course_name,course_description,other_details]\nTable Degree_Programs, columns = [*,degree_program_id,department_id,degree_summary_name,degree_summary_description,other_details]\nTable Departments, columns = [*,department_id,department_name,department_description,other_details]\nTable Sections, columns = [*,section_id,course_id,section_name,section_description,other_details]\nTable Semesters, columns = [*,semester_id,semester_name,semester_description,other_details]\nTable Student_Enrolment, columns = [*,student_enrolment_id,degree_program_id,semester_id,student_id,other_details]\nTable Student_Enrolment_Courses, columns = [*,student_course_id,course_id,student_enrolment_id]\nTable Students, columns = [*,student_id,current_address_id,permanent_address_id,first_name,middle_name,last_name,cell_mobile_number,email_address,ssn,date_first_registered,date_left,other_student_details]\nTable Transcript_Contents, columns = [*,student_course_id,transcript_id]\nTable Transcripts, columns = [*,transcript_id,transcript_date,other_details]\nForeign_keys = [Degree_Programs.department_id = Departments.department_id,Sections.course_id = Courses.course_id,Students.permanent_address_id = Addresses.address_id,Students.current_address_id = Addresses.address_id,Student_Enrolment.student_id = Students.student_id,Student_Enrolment.semester_id = Semesters.semester_id,Student_Enrolment.degree_program_id = Degree_Programs.degree_program_id,Student_Enrolment_Courses.student_enrolment_id = Student_Enrolment.student_enrolment_id,Student_Enrolment_Courses.course_id = Courses.course_id,Transcript_Contents.transcript_id = Transcripts.transcript_id,Transcript_Contents.student_course_id = Student_Enrolment_Courses.student_course_id]\n"}, {"role": "system", "content": "Q: Could you tell me the last names of all the students who live in the state of North Carolina?"}, {"role": "system", "content": "A: SELECT T1.last_name FROM Students AS T1 JOIN Addresses AS T2 ON T1.current_address_id   =   T2.address_id WHERE T2.state_province_county   =   'NorthCarolina'"}, {"role": "system", "content": "Q: What about their first names?"}, {"role": "system", "content": "A: SELECT T1.first_name FROM Students AS T1 JOIN Addresses AS T2 ON T1.current_address_id   =   T2.address_id WHERE T2.state_province_county   =   'NorthCarolina'"}, {"role": "user", "content": "Q: What are the last names of the students who live in North Carolina but have not registered in any degree program?"}], "ideal": ["A: SELECT T1.last_name FROM Students AS T1 JOIN Addresses AS T2 ON T1.current_address_id   =   T2.address_id WHERE T2.state_province_county   =   'NorthCarolina' EXCEPT SELECT DISTINCT T3.last_name FROM Students AS T3 JOIN Student_Enrolment AS T4 ON T3.student_id   =   T4.student_id"]}
{"input": [{"role": "system", "content": "TASK: Answer the following question with syntactically correct SQLite SQL. The SQL should be correct and be in context of the previous question-answer pairs.\nTable Addresses, columns = [*,address_id,line_1,line_2,line_3,city,zip_postcode,state_province_county,country,other_address_details]\nTable Courses, columns = [*,course_id,course_name,course_description,other_details]\nTable Degree_Programs, columns = [*,degree_program_id,department_id,degree_summary_name,degree_summary_description,other_details]\nTable Departments, columns = [*,department_id,department_name,department_description,other_details]\nTable Sections, columns = [*,section_id,course_id,section_name,section_description,other_details]\nTable Semesters, columns = [*,semester_id,semester_name,semester_description,other_details]\nTable Student_Enrolment, columns = [*,student_enrolment_id,degree_program_id,semester_id,student_id,other_details]\nTable Student_Enrolment_Courses, columns = [*,student_course_id,course_id,student_enrolment_id]\nTable Students, columns = [*,student_id,current_address_id,permanent_address_id,first_name,middle_name,last_name,cell_mobile_number,email_address,ssn,date_first_registered,date_left,other_student_details]\nTable Transcript_Contents, columns = [*,student_course_id,transcript_id]\nTable Transcripts, columns = [*,transcript_id,transcript_date,other_details]\nForeign_keys = [Degree_Programs.department_id = Departments.department_id,Sections.course_id = Courses.course_id,Students.permanent_address_id = Addresses.address_id,Students.current_address_id = Addresses.address_id,Student_Enrolment.student_id = Students.student_id,Student_Enrolment.semester_id = Semesters.semester_id,Student_Enrolment.degree_program_id = Degree_Programs.degree_program_id,Student_Enrolment_Courses.student_enrolment_id = Student_Enrolment.student_enrolment_id,Student_Enrolment_Courses.course_id = Courses.course_id,Transcript_Contents.transcript_id = Transcripts.transcript_id,Transcript_Contents.student_course_id = Student_Enrolment_Courses.student_course_id]\n"}, {"role": "system", "content": "Q: What is the full name of the department that has the substring computer in its name?"}, {"role": "system", "content": "A: SELECT department_name FROM Departments WHERE department_name LIKE '%computer%'"}, {"role": "system", "content": "Q: What's the description of that department?"}, {"role": "system", "content": "A: SELECT department_description FROM Departments WHERE department_name LIKE '%computer%'"}, {"role": "user", "content": "Q: What is that department's id?"}], "ideal": ["A: SELECT department_id FROM Departments WHERE department_name LIKE '%computer%'"]}
{"input": [{"role": "system", "content": "TASK: Answer the following question with syntactically correct SQLite SQL. The SQL should be correct and be in context of the previous question-answer pairs.\nTable singer, columns = [*,Singer_ID,Name,Birth_Year,Net_Worth_Millions,Citizenship]\nTable song, columns = [*,Song_ID,Title,Singer_ID,Sales,Highest_Position]\nForeign_keys = [song.Singer_ID = singer.Singer_ID]\n"}, {"role": "system", "content": "Q: What are the names of the singers who were born in either 1948 or 1949?"}, {"role": "system", "content": "A: SELECT Name FROM singer WHERE Birth_Year   =   1948 OR Birth_Year   =   1949"}, {"role": "system", "content": "Q: What is their citizenship?"}, {"role": "system", "content": "A: SELECT Citizenship FROM singer WHERE Birth_Year   =   1948 OR Birth_Year   =   1949"}, {"role": "user", "content": "Q: Of the singers that were born in 1948 or 1949, which had the highest net worth?"}], "ideal": ["A: SELECT name FROM singer WHERE Birth_Year   =   1948 OR Birth_Year   =   1949 order by Net_Worth_Millions desc limit 1"]}
{"input": [{"role": "system", "content": "TASK: Answer the following question with syntactically correct SQLite SQL. The SQL should be correct and be in context of the previous question-answer pairs.\nTable Has_Pet, columns = [*,StuID,PetID]\nTable Pets, columns = [*,PetID,PetType,pet_age,weight]\nTable Student, columns = [*,StuID,LName,Fname,Age,Sex,Major,Advisor,city_code]\nForeign_keys = [Has_Pet.StuID = Student.StuID,Has_Pet.PetID = Pets.PetID]\n"}, {"role": "system", "content": "Q: Hey can you tell me the average age for cats?"}, {"role": "system", "content": "A: SELECT avg ( pet_age )  FROM pets WHERE PetType  =  'cat'"}, {"role": "system", "content": "Q: What about for dogs?"}, {"role": "system", "content": "A: SELECT avg ( pet_age )  FROM pets WHERE PetType  =  'dog'"}, {"role": "user", "content": "Q: Thanks! Now what's the maximum age for dogs?"}], "ideal": ["A: SELECT max ( pet_age )  FROM pets WHERE PetType  =  'dog'"]}

@pybae
Copy link
Copy Markdown
Contributor Author

pybae commented Jun 30, 2023

note: running the eval on GPT-3.5-turbo, leads to an accuracy of 0.78 as of now:

[2023-06-30 12:26:16,890] [oaieval.py:177] Final report:
[2023-06-30 12:26:16,890] [oaieval.py:179] counts/Correct: 78
[2023-06-30 12:26:16,890] [oaieval.py:179] counts/Incorrect: 21
[2023-06-30 12:26:16,890] [oaieval.py:179] counts/__invalid__: 1
[2023-06-30 12:26:16,890] [oaieval.py:179] score: 0.78

if gpt-4 gets above the 0.9 requirement, it's possible to prune the dataset to harder questions, since as of now, there are a few questions which are not contextually dependent, e.g:

{
	"input": [{
		"role": "system",
		"content": "TASK: Answer the following question with syntactically correct SQLite SQL. The SQL should be correct and be in context of the previous question-answer pairs.\nTable singer, columns = [*,Singer_ID,Name,Birth_Year,Net_Worth_Millions,Citizenship]\nTable song, columns = [*,Song_ID,Title,Singer_ID,Sales,Highest_Position]\nForeign_keys = [song.Singer_ID = singer.Singer_ID]\n"
	}, {
		"role": "system",
		"content": "Q: What are the names of the singers who were born in either 1948 or 1949?"
	}, {
		"role": "system",
		"content": "A: SELECT Name FROM singer WHERE Birth_Year   =   1948 OR Birth_Year   =   1949"
	}, {
		"role": "system",
		"content": "Q: What is their citizenship?"
	}, {
		"role": "system",
		"content": "A: SELECT Citizenship FROM singer WHERE Birth_Year   =   1948 OR Birth_Year   =   1949"
	}, {
		"role": "user",
		"content": "Q: Of the singers that were born in 1948 or 1949, which had the highest net worth?"
	}],
	"ideal": ["A: SELECT name FROM singer WHERE Birth_Year   =   1948 OR Birth_Year   =   1949 order by Net_Worth_Millions desc limit 1"]
}

@usama-openai
Copy link
Copy Markdown
Collaborator

Thanks for the contribution. I've got a little confusion regarding the following sample:

{
  "input":[
    {
      "role":"system",
      "content":"TASK: Answer the following question with syntactically correct SQLite SQL. The SQL should be correct and be in context of the previous question-answer pairs.\nTable car_makers, columns = [*,Id,Maker,FullName,Country]\nTable car_names, columns = [*,MakeId,Model,Make]\nTable cars_data, columns = [*,Id,MPG,Cylinders,Edispl,Horsepower,Weight,Accelerate,Year]\nTable continents, columns = [*,ContId,Continent]\nTable countries, columns = [*,CountryId,CountryName,Continent]\nTable model_list, columns = [*,ModelId,Maker,Model]\nForeign_keys = [countries.Continent = continents.ContId,car_makers.Country = countries.CountryId,model_list.Maker = car_makers.Id,car_names.Model = model_list.Model,cars_data.Id = car_names.MakeId]\n"
    },
    {
      "role":"system",
      "content":"Q: tell me the FullName of the maker amc"
    },
    {
      "role":"system",
      "content":"A: SELECT Fullname FROM car_makers WHERE maker  =  \"amc\""
    },
    {
      "role":"system",
      "content":"Q: Tell me CountryName for Countryid  1, 2, and 3."
    },
    {
      "role":"system",
      "content":"A: SELECT countryname FROM countries WHERE countryid = 1 or countryid = 2 or countryid = 3 ) "
    },
    {
      "role":"user",
      "content":"Q: Tell me the model id made by amc..."
    }
  ],
  "ideal":[
    "A: SELECT modelid FROM model_list WHERE model  =  \"amc\""
  ]
}

The question is Tell me the model id made by amc which means amc is the maker and "content":"A: SELECT Fullname FROM car_makers WHERE maker  =  \"amc\"" also suggests that amc is the maker, but the ideal answer is SELECT modelid FROM model_list WHERE model  =  \"amc\"", which suggests that amc is the model of the car. The correct answer should be either SELECT ModelId FROM model_list WHERE Maker = "amc" or SELECT ModelId FROM model_list WHERE Maker = (SELECT Id FROM car_makers WHERE Maker = "amc").

Can you clarify this?

@pybae
Copy link
Copy Markdown
Contributor Author

pybae commented Jul 3, 2023

Thanks for the review @usama-openai and pointing out this example.
Below are the schemas for car_makers and model_list:

CREATE TABLE "car_makers" ( 
	"Id" INTEGER PRIMARY KEY, 
	"Maker" TEXT, 
	"FullName" TEXT, 
	"Country" TEXT,
	FOREIGN KEY (Country) REFERENCES countries(CountryId)
);


CREATE TABLE "model_list" ( 
	"ModelId" INTEGER PRIMARY KEY, 
	"Maker" INTEGER, 
	"Model" TEXT UNIQUE,
	FOREIGN KEY (Maker) REFERENCES car_makers (Id)
);

and the dbs themselves used for testing:

>>> import sqlite3
>>> conn = sqlite3.connect("car_1.sqlite")
>>> c = conn.cursor()
>>> e = c.execute("SELECT * from model_list")
>>> c.execute("SELECT * from model_list").fetchall()
[(1, 1, 'amc'), (2, 2, 'audi'), (3, 3, 'bmw'), (4, 4, 'buick'), (5, 4, 'cadillac'), (6, 5, 'capri'), (7, 4, 'chevrolet'), (8, 6, 'chrysler'), (9, 7, 'citroen'), (10, 8, 'datsun'), (11, 6, 'dodge'), (12, 9, 'fiat'), (13, 5, 'ford'), (14, 10, 'hi'), (15, 11, 'honda'), (16, 12, 'mazda'), (17, 13, 'mercedes'), (18, 13, 'mercedes-benz'), (19, 5, 'mercury'), (20, 8, 'nissan'), (21, 4, 'oldsmobile'), (22, 14, 'opel'), (23, 15, 'peugeot'), (24, 6, 'plymouth'), (25, 4, 'pontiac'), (26, 16, 'renault'), (27, 17, 'saab'), (28, 18, 'subaru'), (29, 19, 'toyota'), (30, 20, 'triumph'), (31, 2, 'volkswagen'), (32, 21, 'volvo'), (33, 22, 'kia'), (34, 23, 'hyundai'), (35, 6, 'jeep'), (36, 19, 'scion')]
>>> c.execute("SELECT * from car_makers").fetchall()
[(1, 'amc', 'American Motor Company', '1'), (2, 'volkswagen', 'Volkswagen', '2'), (3, 'bmw', 'BMW', '2'), (4, 'gm', 'General Motors', '1'), (5, 'ford', 'Ford Motor Company', '1'), (6, 'chrysler', 'Chrysler', '1'), (7, 'citroen', 'Citroen', '3'), (8, 'nissan', 'Nissan Motors', '4'), (9, 'fiat', 'Fiat', '5'), (11, 'honda', 'Honda', '4'), (12, 'mazda', 'Mazda', '4'), (13, 'daimler benz', 'Daimler Benz', '2'), (14, 'opel', 'Opel', '2'), (15, 'peugeaut', 'Peugeaut', '3'), (16, 'renault', 'Renault', '3'), (17, 'saab', 'Saab', '6'), (18, 'subaru', 'Subaru', '4'), (19, 'toyota', 'Toyota', '4'), (20, 'triumph', 'Triumph', '7'), (21, 'volvo', 'Volvo', '6'), (22, 'kia', 'Kia Motors', '8'), (23, 'hyundai', 'Hyundai', '8')]

so though the current "ideal" query works as-is for the above data, it would fail if model_list has another entry referencing AMC, i.e:

(37, 1, 'amc-model-2')

i've taken your second suggestion into account and updated the ideal to be:

SELECT ModelId FROM model_list WHERE Maker = (SELECT Id FROM car_makers WHERE Maker = "amc")

which should be derivable from the provided Foreign_keys information in the prompt as well.

ptal!

Copy link
Copy Markdown
Collaborator

@usama-openai usama-openai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR looks in good shape now. I'm approving this PR.

@andrew-openai andrew-openai merged commit be0a135 into openai:main Jul 4, 2023
@usama-openai
Copy link
Copy Markdown
Collaborator

You should see GPT-4 API access enabled in your account in the next few days.

@pybae
Copy link
Copy Markdown
Contributor Author

pybae commented Jul 4, 2023

Thank you @usama-openai !

arbreton pushed a commit to arbreton/evals that referenced this pull request Jul 8, 2023
# 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 be 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 it 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. **Starting April 10, the minimum
eval count is 15 samples, we hope this makes it easier to create and
contribute evals.**

Also, please note that we're using **Git LFS** for storing the JSON
files, so please make sure that you move the JSON file to Git LFS before
submitting a PR. Details on how to use Git LFS are available
[here](https://git-lfs.com).

## Eval details 📑

### Eval name

CoSQL

### Eval description

[CoSQL](https://yale-lily.github.io/cosql) is a dataset for cross-domain
Conversational text-to-SQL systems. It is the dialogue version of the
[Spider](https://yale-lily.github.io/spider) task, which is an eval
already present in this repo:
[here](https://github.com/openai/evals/blob/main/evals/registry/evals/sql.yaml)

To illustrate, as opposed to Spider SQL, where the task is to generate
SQL given a single question:
```
Q: How many singers do we have?
A: SELECT count(*) FROM singer
```

CoSQL simulates a real-world conversation, where a user would be talking
to a SQL expert, who would then write SQL to retrieve data for them. ex:
```
Q: Which cartoon aired first?
A: SELECT title  FROM cartoon ORDER BY original_air_date LIMIT 1

Q: What was the last cartoon to air?
A: SELECT title  FROM cartoon ORDER BY original_air_date desc LIMIT 1

Q: What channel was it on?
```

and the ideal answer being:
```
A: SELECT channel FROM cartoon ORDER BY original_air_date desc LIMIT 1
```

As illustrated, the model needs to not only be able to reason about
provided SQL tables and schemas (which are provided in the prompts as
system input), but also be able to reference and understand the previous
question-answer pairs.

### What makes this a useful eval?

Being able to generate semantically and logically correct SQL is an
exciting application of GPT with many immediate use-cases.

Doing so in a conversational context is more difficult and tests the
model's ability to reason about prior questions and answers, similar to
what you would expect from a domain expert (e.g, SQL expert).

## 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 15 high-quality examples.**

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}.yaml`
- [X] Ensure you have the right to use the data you submit via this eval
  - CoSQL is under the [CC-4 license](https://yale-lily.github.io/cosql)

(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 commits on 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 acknowledgment

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 the 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 be
granted.

### Submit eval

- [X] I have filled out all required fields of this form
- [X] I have used **Git LFS** for the Eval JSON data
- [X] (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": "TASK: Answer the following
question with syntactically correct SQLite SQL. The SQL should be
correct and be in context of the previous question-answer pairs.\nTable
Cartoon, columns =
[*,id,Title,Directed_by,Written_by,Original_air_date,Production_code,Channel]\nTable
TV_Channel, columns =
[*,id,series_name,Country,Language,Content,Pixel_aspect_ratio_PAR,Hight_definition_TV,Pay_per_view_PPV,Package_Option]\nTable
TV_series, columns =
[*,id,Episode,Air_Date,Rating,Share,18_49_Rating_Share,Viewers_m,Weekly_Rank,Channel]\nForeign_keys
= [TV_series.Channel = TV_Channel.id,Cartoon.Channel =
TV_Channel.id]\n"}, {"role": "system", "content": "Q: Can you please
tell me the language used on the least number of TV Channels?"},
{"role": "system", "content": "A: SELECT LANGUAGE FROM TV_Channel GROUP
BY LANGUAGE ORDER BY count ( * ) ASC LIMIT 1"}, {"role": "system",
"content": "Q: What language is used on the most number of TV
channels?"}, {"role": "system", "content": "A: SELECT LANGUAGE FROM
TV_Channel GROUP BY LANGUAGE ORDER BY count ( * ) desc LIMIT 1"},
{"role": "user", "content": "Q: What is the most common content of those
TV channels?"}], "ideal": ["A: SELECT content from tv_channel group by
content order by count ( * ) desc limit 1"]}
{"input": [{"role": "system", "content": "TASK: Answer the following
question with syntactically correct SQLite SQL. The SQL should be
correct and be in context of the previous question-answer pairs.\nTable
Addresses, columns =
[*,address_id,line_1,line_2,line_3,city,zip_postcode,state_province_county,country,other_address_details]\nTable
Courses, columns =
[*,course_id,course_name,course_description,other_details]\nTable
Degree_Programs, columns =
[*,degree_program_id,department_id,degree_summary_name,degree_summary_description,other_details]\nTable
Departments, columns =
[*,department_id,department_name,department_description,other_details]\nTable
Sections, columns =
[*,section_id,course_id,section_name,section_description,other_details]\nTable
Semesters, columns =
[*,semester_id,semester_name,semester_description,other_details]\nTable
Student_Enrolment, columns =
[*,student_enrolment_id,degree_program_id,semester_id,student_id,other_details]\nTable
Student_Enrolment_Courses, columns =
[*,student_course_id,course_id,student_enrolment_id]\nTable Students,
columns =
[*,student_id,current_address_id,permanent_address_id,first_name,middle_name,last_name,cell_mobile_number,email_address,ssn,date_first_registered,date_left,other_student_details]\nTable
Transcript_Contents, columns =
[*,student_course_id,transcript_id]\nTable Transcripts, columns =
[*,transcript_id,transcript_date,other_details]\nForeign_keys =
[Degree_Programs.department_id =
Departments.department_id,Sections.course_id =
Courses.course_id,Students.permanent_address_id =
Addresses.address_id,Students.current_address_id =
Addresses.address_id,Student_Enrolment.student_id =
Students.student_id,Student_Enrolment.semester_id =
Semesters.semester_id,Student_Enrolment.degree_program_id =
Degree_Programs.degree_program_id,Student_Enrolment_Courses.student_enrolment_id
=
Student_Enrolment.student_enrolment_id,Student_Enrolment_Courses.course_id
= Courses.course_id,Transcript_Contents.transcript_id =
Transcripts.transcript_id,Transcript_Contents.student_course_id =
Student_Enrolment_Courses.student_course_id]\n"}, {"role": "system",
"content": "Q: Could you tell me the last names of all the students who
live in the state of North Carolina?"}, {"role": "system", "content":
"A: SELECT T1.last_name FROM Students AS T1 JOIN Addresses AS T2 ON
T1.current_address_id = T2.address_id WHERE T2.state_province_county =
'NorthCarolina'"}, {"role": "system", "content": "Q: What about their
first names?"}, {"role": "system", "content": "A: SELECT T1.first_name
FROM Students AS T1 JOIN Addresses AS T2 ON T1.current_address_id =
T2.address_id WHERE T2.state_province_county = 'NorthCarolina'"},
{"role": "user", "content": "Q: What are the last names of the students
who live in North Carolina but have not registered in any degree
program?"}], "ideal": ["A: SELECT T1.last_name FROM Students AS T1 JOIN
Addresses AS T2 ON T1.current_address_id = T2.address_id WHERE
T2.state_province_county = 'NorthCarolina' EXCEPT SELECT DISTINCT
T3.last_name FROM Students AS T3 JOIN Student_Enrolment AS T4 ON
T3.student_id = T4.student_id"]}
{"input": [{"role": "system", "content": "TASK: Answer the following
question with syntactically correct SQLite SQL. The SQL should be
correct and be in context of the previous question-answer pairs.\nTable
Addresses, columns =
[*,address_id,line_1,line_2,line_3,city,zip_postcode,state_province_county,country,other_address_details]\nTable
Courses, columns =
[*,course_id,course_name,course_description,other_details]\nTable
Degree_Programs, columns =
[*,degree_program_id,department_id,degree_summary_name,degree_summary_description,other_details]\nTable
Departments, columns =
[*,department_id,department_name,department_description,other_details]\nTable
Sections, columns =
[*,section_id,course_id,section_name,section_description,other_details]\nTable
Semesters, columns =
[*,semester_id,semester_name,semester_description,other_details]\nTable
Student_Enrolment, columns =
[*,student_enrolment_id,degree_program_id,semester_id,student_id,other_details]\nTable
Student_Enrolment_Courses, columns =
[*,student_course_id,course_id,student_enrolment_id]\nTable Students,
columns =
[*,student_id,current_address_id,permanent_address_id,first_name,middle_name,last_name,cell_mobile_number,email_address,ssn,date_first_registered,date_left,other_student_details]\nTable
Transcript_Contents, columns =
[*,student_course_id,transcript_id]\nTable Transcripts, columns =
[*,transcript_id,transcript_date,other_details]\nForeign_keys =
[Degree_Programs.department_id =
Departments.department_id,Sections.course_id =
Courses.course_id,Students.permanent_address_id =
Addresses.address_id,Students.current_address_id =
Addresses.address_id,Student_Enrolment.student_id =
Students.student_id,Student_Enrolment.semester_id =
Semesters.semester_id,Student_Enrolment.degree_program_id =
Degree_Programs.degree_program_id,Student_Enrolment_Courses.student_enrolment_id
=
Student_Enrolment.student_enrolment_id,Student_Enrolment_Courses.course_id
= Courses.course_id,Transcript_Contents.transcript_id =
Transcripts.transcript_id,Transcript_Contents.student_course_id =
Student_Enrolment_Courses.student_course_id]\n"}, {"role": "system",
"content": "Q: What is the full name of the department that has the
substring computer in its name?"}, {"role": "system", "content": "A:
SELECT department_name FROM Departments WHERE department_name LIKE
'%computer%'"}, {"role": "system", "content": "Q: What's the description
of that department?"}, {"role": "system", "content": "A: SELECT
department_description FROM Departments WHERE department_name LIKE
'%computer%'"}, {"role": "user", "content": "Q: What is that
department's id?"}], "ideal": ["A: SELECT department_id FROM Departments
WHERE department_name LIKE '%computer%'"]}
{"input": [{"role": "system", "content": "TASK: Answer the following
question with syntactically correct SQLite SQL. The SQL should be
correct and be in context of the previous question-answer pairs.\nTable
singer, columns =
[*,Singer_ID,Name,Birth_Year,Net_Worth_Millions,Citizenship]\nTable
song, columns =
[*,Song_ID,Title,Singer_ID,Sales,Highest_Position]\nForeign_keys =
[song.Singer_ID = singer.Singer_ID]\n"}, {"role": "system", "content":
"Q: What are the names of the singers who were born in either 1948 or
1949?"}, {"role": "system", "content": "A: SELECT Name FROM singer WHERE
Birth_Year = 1948 OR Birth_Year = 1949"}, {"role": "system", "content":
"Q: What is their citizenship?"}, {"role": "system", "content": "A:
SELECT Citizenship FROM singer WHERE Birth_Year = 1948 OR Birth_Year =
1949"}, {"role": "user", "content": "Q: Of the singers that were born in
1948 or 1949, which had the highest net worth?"}], "ideal": ["A: SELECT
name FROM singer WHERE Birth_Year = 1948 OR Birth_Year = 1949 order by
Net_Worth_Millions desc limit 1"]}
{"input": [{"role": "system", "content": "TASK: Answer the following
question with syntactically correct SQLite SQL. The SQL should be
correct and be in context of the previous question-answer pairs.\nTable
Has_Pet, columns = [*,StuID,PetID]\nTable Pets, columns =
[*,PetID,PetType,pet_age,weight]\nTable Student, columns =
[*,StuID,LName,Fname,Age,Sex,Major,Advisor,city_code]\nForeign_keys =
[Has_Pet.StuID = Student.StuID,Has_Pet.PetID = Pets.PetID]\n"}, {"role":
"system", "content": "Q: Hey can you tell me the average age for
cats?"}, {"role": "system", "content": "A: SELECT avg ( pet_age ) FROM
pets WHERE PetType = 'cat'"}, {"role": "system", "content": "Q: What
about for dogs?"}, {"role": "system", "content": "A: SELECT avg (
pet_age ) FROM pets WHERE PetType = 'dog'"}, {"role": "user", "content":
"Q: Thanks! Now what's the maximum age for dogs?"}], "ideal": ["A:
SELECT max ( pet_age ) FROM pets WHERE PetType = 'dog'"]}
  ```
</details>
pgarbacki pushed a commit to fw-ai-external/evals that referenced this pull request Jul 22, 2023
# 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 be 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 it 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. **Starting April 10, the minimum
eval count is 15 samples, we hope this makes it easier to create and
contribute evals.**

Also, please note that we're using **Git LFS** for storing the JSON
files, so please make sure that you move the JSON file to Git LFS before
submitting a PR. Details on how to use Git LFS are available
[here](https://git-lfs.com).

## Eval details 📑

### Eval name

CoSQL

### Eval description

[CoSQL](https://yale-lily.github.io/cosql) is a dataset for cross-domain
Conversational text-to-SQL systems. It is the dialogue version of the
[Spider](https://yale-lily.github.io/spider) task, which is an eval
already present in this repo:
[here](https://github.com/openai/evals/blob/main/evals/registry/evals/sql.yaml)

To illustrate, as opposed to Spider SQL, where the task is to generate
SQL given a single question:
```
Q: How many singers do we have?
A: SELECT count(*) FROM singer
```

CoSQL simulates a real-world conversation, where a user would be talking
to a SQL expert, who would then write SQL to retrieve data for them. ex:
```
Q: Which cartoon aired first?
A: SELECT title  FROM cartoon ORDER BY original_air_date LIMIT 1

Q: What was the last cartoon to air?
A: SELECT title  FROM cartoon ORDER BY original_air_date desc LIMIT 1

Q: What channel was it on?
```

and the ideal answer being:
```
A: SELECT channel FROM cartoon ORDER BY original_air_date desc LIMIT 1
```

As illustrated, the model needs to not only be able to reason about
provided SQL tables and schemas (which are provided in the prompts as
system input), but also be able to reference and understand the previous
question-answer pairs.

### What makes this a useful eval?

Being able to generate semantically and logically correct SQL is an
exciting application of GPT with many immediate use-cases.

Doing so in a conversational context is more difficult and tests the
model's ability to reason about prior questions and answers, similar to
what you would expect from a domain expert (e.g, SQL expert).

## 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 15 high-quality examples.**

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}.yaml`
- [X] Ensure you have the right to use the data you submit via this eval
  - CoSQL is under the [CC-4 license](https://yale-lily.github.io/cosql)

(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 commits on 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 acknowledgment

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 the 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 be
granted.

### Submit eval

- [X] I have filled out all required fields of this form
- [X] I have used **Git LFS** for the Eval JSON data
- [X] (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": "TASK: Answer the following
question with syntactically correct SQLite SQL. The SQL should be
correct and be in context of the previous question-answer pairs.\nTable
Cartoon, columns =
[*,id,Title,Directed_by,Written_by,Original_air_date,Production_code,Channel]\nTable
TV_Channel, columns =
[*,id,series_name,Country,Language,Content,Pixel_aspect_ratio_PAR,Hight_definition_TV,Pay_per_view_PPV,Package_Option]\nTable
TV_series, columns =
[*,id,Episode,Air_Date,Rating,Share,18_49_Rating_Share,Viewers_m,Weekly_Rank,Channel]\nForeign_keys
= [TV_series.Channel = TV_Channel.id,Cartoon.Channel =
TV_Channel.id]\n"}, {"role": "system", "content": "Q: Can you please
tell me the language used on the least number of TV Channels?"},
{"role": "system", "content": "A: SELECT LANGUAGE FROM TV_Channel GROUP
BY LANGUAGE ORDER BY count ( * ) ASC LIMIT 1"}, {"role": "system",
"content": "Q: What language is used on the most number of TV
channels?"}, {"role": "system", "content": "A: SELECT LANGUAGE FROM
TV_Channel GROUP BY LANGUAGE ORDER BY count ( * ) desc LIMIT 1"},
{"role": "user", "content": "Q: What is the most common content of those
TV channels?"}], "ideal": ["A: SELECT content from tv_channel group by
content order by count ( * ) desc limit 1"]}
{"input": [{"role": "system", "content": "TASK: Answer the following
question with syntactically correct SQLite SQL. The SQL should be
correct and be in context of the previous question-answer pairs.\nTable
Addresses, columns =
[*,address_id,line_1,line_2,line_3,city,zip_postcode,state_province_county,country,other_address_details]\nTable
Courses, columns =
[*,course_id,course_name,course_description,other_details]\nTable
Degree_Programs, columns =
[*,degree_program_id,department_id,degree_summary_name,degree_summary_description,other_details]\nTable
Departments, columns =
[*,department_id,department_name,department_description,other_details]\nTable
Sections, columns =
[*,section_id,course_id,section_name,section_description,other_details]\nTable
Semesters, columns =
[*,semester_id,semester_name,semester_description,other_details]\nTable
Student_Enrolment, columns =
[*,student_enrolment_id,degree_program_id,semester_id,student_id,other_details]\nTable
Student_Enrolment_Courses, columns =
[*,student_course_id,course_id,student_enrolment_id]\nTable Students,
columns =
[*,student_id,current_address_id,permanent_address_id,first_name,middle_name,last_name,cell_mobile_number,email_address,ssn,date_first_registered,date_left,other_student_details]\nTable
Transcript_Contents, columns =
[*,student_course_id,transcript_id]\nTable Transcripts, columns =
[*,transcript_id,transcript_date,other_details]\nForeign_keys =
[Degree_Programs.department_id =
Departments.department_id,Sections.course_id =
Courses.course_id,Students.permanent_address_id =
Addresses.address_id,Students.current_address_id =
Addresses.address_id,Student_Enrolment.student_id =
Students.student_id,Student_Enrolment.semester_id =
Semesters.semester_id,Student_Enrolment.degree_program_id =
Degree_Programs.degree_program_id,Student_Enrolment_Courses.student_enrolment_id
=
Student_Enrolment.student_enrolment_id,Student_Enrolment_Courses.course_id
= Courses.course_id,Transcript_Contents.transcript_id =
Transcripts.transcript_id,Transcript_Contents.student_course_id =
Student_Enrolment_Courses.student_course_id]\n"}, {"role": "system",
"content": "Q: Could you tell me the last names of all the students who
live in the state of North Carolina?"}, {"role": "system", "content":
"A: SELECT T1.last_name FROM Students AS T1 JOIN Addresses AS T2 ON
T1.current_address_id = T2.address_id WHERE T2.state_province_county =
'NorthCarolina'"}, {"role": "system", "content": "Q: What about their
first names?"}, {"role": "system", "content": "A: SELECT T1.first_name
FROM Students AS T1 JOIN Addresses AS T2 ON T1.current_address_id =
T2.address_id WHERE T2.state_province_county = 'NorthCarolina'"},
{"role": "user", "content": "Q: What are the last names of the students
who live in North Carolina but have not registered in any degree
program?"}], "ideal": ["A: SELECT T1.last_name FROM Students AS T1 JOIN
Addresses AS T2 ON T1.current_address_id = T2.address_id WHERE
T2.state_province_county = 'NorthCarolina' EXCEPT SELECT DISTINCT
T3.last_name FROM Students AS T3 JOIN Student_Enrolment AS T4 ON
T3.student_id = T4.student_id"]}
{"input": [{"role": "system", "content": "TASK: Answer the following
question with syntactically correct SQLite SQL. The SQL should be
correct and be in context of the previous question-answer pairs.\nTable
Addresses, columns =
[*,address_id,line_1,line_2,line_3,city,zip_postcode,state_province_county,country,other_address_details]\nTable
Courses, columns =
[*,course_id,course_name,course_description,other_details]\nTable
Degree_Programs, columns =
[*,degree_program_id,department_id,degree_summary_name,degree_summary_description,other_details]\nTable
Departments, columns =
[*,department_id,department_name,department_description,other_details]\nTable
Sections, columns =
[*,section_id,course_id,section_name,section_description,other_details]\nTable
Semesters, columns =
[*,semester_id,semester_name,semester_description,other_details]\nTable
Student_Enrolment, columns =
[*,student_enrolment_id,degree_program_id,semester_id,student_id,other_details]\nTable
Student_Enrolment_Courses, columns =
[*,student_course_id,course_id,student_enrolment_id]\nTable Students,
columns =
[*,student_id,current_address_id,permanent_address_id,first_name,middle_name,last_name,cell_mobile_number,email_address,ssn,date_first_registered,date_left,other_student_details]\nTable
Transcript_Contents, columns =
[*,student_course_id,transcript_id]\nTable Transcripts, columns =
[*,transcript_id,transcript_date,other_details]\nForeign_keys =
[Degree_Programs.department_id =
Departments.department_id,Sections.course_id =
Courses.course_id,Students.permanent_address_id =
Addresses.address_id,Students.current_address_id =
Addresses.address_id,Student_Enrolment.student_id =
Students.student_id,Student_Enrolment.semester_id =
Semesters.semester_id,Student_Enrolment.degree_program_id =
Degree_Programs.degree_program_id,Student_Enrolment_Courses.student_enrolment_id
=
Student_Enrolment.student_enrolment_id,Student_Enrolment_Courses.course_id
= Courses.course_id,Transcript_Contents.transcript_id =
Transcripts.transcript_id,Transcript_Contents.student_course_id =
Student_Enrolment_Courses.student_course_id]\n"}, {"role": "system",
"content": "Q: What is the full name of the department that has the
substring computer in its name?"}, {"role": "system", "content": "A:
SELECT department_name FROM Departments WHERE department_name LIKE
'%computer%'"}, {"role": "system", "content": "Q: What's the description
of that department?"}, {"role": "system", "content": "A: SELECT
department_description FROM Departments WHERE department_name LIKE
'%computer%'"}, {"role": "user", "content": "Q: What is that
department's id?"}], "ideal": ["A: SELECT department_id FROM Departments
WHERE department_name LIKE '%computer%'"]}
{"input": [{"role": "system", "content": "TASK: Answer the following
question with syntactically correct SQLite SQL. The SQL should be
correct and be in context of the previous question-answer pairs.\nTable
singer, columns =
[*,Singer_ID,Name,Birth_Year,Net_Worth_Millions,Citizenship]\nTable
song, columns =
[*,Song_ID,Title,Singer_ID,Sales,Highest_Position]\nForeign_keys =
[song.Singer_ID = singer.Singer_ID]\n"}, {"role": "system", "content":
"Q: What are the names of the singers who were born in either 1948 or
1949?"}, {"role": "system", "content": "A: SELECT Name FROM singer WHERE
Birth_Year = 1948 OR Birth_Year = 1949"}, {"role": "system", "content":
"Q: What is their citizenship?"}, {"role": "system", "content": "A:
SELECT Citizenship FROM singer WHERE Birth_Year = 1948 OR Birth_Year =
1949"}, {"role": "user", "content": "Q: Of the singers that were born in
1948 or 1949, which had the highest net worth?"}], "ideal": ["A: SELECT
name FROM singer WHERE Birth_Year = 1948 OR Birth_Year = 1949 order by
Net_Worth_Millions desc limit 1"]}
{"input": [{"role": "system", "content": "TASK: Answer the following
question with syntactically correct SQLite SQL. The SQL should be
correct and be in context of the previous question-answer pairs.\nTable
Has_Pet, columns = [*,StuID,PetID]\nTable Pets, columns =
[*,PetID,PetType,pet_age,weight]\nTable Student, columns =
[*,StuID,LName,Fname,Age,Sex,Major,Advisor,city_code]\nForeign_keys =
[Has_Pet.StuID = Student.StuID,Has_Pet.PetID = Pets.PetID]\n"}, {"role":
"system", "content": "Q: Hey can you tell me the average age for
cats?"}, {"role": "system", "content": "A: SELECT avg ( pet_age ) FROM
pets WHERE PetType = 'cat'"}, {"role": "system", "content": "Q: What
about for dogs?"}, {"role": "system", "content": "A: SELECT avg (
pet_age ) FROM pets WHERE PetType = 'dog'"}, {"role": "user", "content":
"Q: Thanks! Now what's the maximum age for dogs?"}], "ideal": ["A:
SELECT max ( pet_age ) FROM pets WHERE PetType = 'dog'"]}
  ```
</details>
jacobbieker pushed a commit to withmartian/-ARCHIVED--router-evals that referenced this pull request Jan 9, 2024
# 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 be 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 it 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. **Starting April 10, the minimum
eval count is 15 samples, we hope this makes it easier to create and
contribute evals.**

Also, please note that we're using **Git LFS** for storing the JSON
files, so please make sure that you move the JSON file to Git LFS before
submitting a PR. Details on how to use Git LFS are available
[here](https://git-lfs.com).

## Eval details 📑

### Eval name

CoSQL

### Eval description

[CoSQL](https://yale-lily.github.io/cosql) is a dataset for cross-domain
Conversational text-to-SQL systems. It is the dialogue version of the
[Spider](https://yale-lily.github.io/spider) task, which is an eval
already present in this repo:
[here](https://github.com/openai/evals/blob/main/evals/registry/evals/sql.yaml)

To illustrate, as opposed to Spider SQL, where the task is to generate
SQL given a single question:
```
Q: How many singers do we have?
A: SELECT count(*) FROM singer
```

CoSQL simulates a real-world conversation, where a user would be talking
to a SQL expert, who would then write SQL to retrieve data for them. ex:
```
Q: Which cartoon aired first?
A: SELECT title  FROM cartoon ORDER BY original_air_date LIMIT 1

Q: What was the last cartoon to air?
A: SELECT title  FROM cartoon ORDER BY original_air_date desc LIMIT 1

Q: What channel was it on?
```

and the ideal answer being:
```
A: SELECT channel FROM cartoon ORDER BY original_air_date desc LIMIT 1
```

As illustrated, the model needs to not only be able to reason about
provided SQL tables and schemas (which are provided in the prompts as
system input), but also be able to reference and understand the previous
question-answer pairs.

### What makes this a useful eval?

Being able to generate semantically and logically correct SQL is an
exciting application of GPT with many immediate use-cases.

Doing so in a conversational context is more difficult and tests the
model's ability to reason about prior questions and answers, similar to
what you would expect from a domain expert (e.g, SQL expert).

## 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 15 high-quality examples.**

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}.yaml`
- [X] Ensure you have the right to use the data you submit via this eval
  - CoSQL is under the [CC-4 license](https://yale-lily.github.io/cosql)

(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 commits on 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 acknowledgment

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 the 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 be
granted.

### Submit eval

- [X] I have filled out all required fields of this form
- [X] I have used **Git LFS** for the Eval JSON data
- [X] (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": "TASK: Answer the following
question with syntactically correct SQLite SQL. The SQL should be
correct and be in context of the previous question-answer pairs.\nTable
Cartoon, columns =
[*,id,Title,Directed_by,Written_by,Original_air_date,Production_code,Channel]\nTable
TV_Channel, columns =
[*,id,series_name,Country,Language,Content,Pixel_aspect_ratio_PAR,Hight_definition_TV,Pay_per_view_PPV,Package_Option]\nTable
TV_series, columns =
[*,id,Episode,Air_Date,Rating,Share,18_49_Rating_Share,Viewers_m,Weekly_Rank,Channel]\nForeign_keys
= [TV_series.Channel = TV_Channel.id,Cartoon.Channel =
TV_Channel.id]\n"}, {"role": "system", "content": "Q: Can you please
tell me the language used on the least number of TV Channels?"},
{"role": "system", "content": "A: SELECT LANGUAGE FROM TV_Channel GROUP
BY LANGUAGE ORDER BY count ( * ) ASC LIMIT 1"}, {"role": "system",
"content": "Q: What language is used on the most number of TV
channels?"}, {"role": "system", "content": "A: SELECT LANGUAGE FROM
TV_Channel GROUP BY LANGUAGE ORDER BY count ( * ) desc LIMIT 1"},
{"role": "user", "content": "Q: What is the most common content of those
TV channels?"}], "ideal": ["A: SELECT content from tv_channel group by
content order by count ( * ) desc limit 1"]}
{"input": [{"role": "system", "content": "TASK: Answer the following
question with syntactically correct SQLite SQL. The SQL should be
correct and be in context of the previous question-answer pairs.\nTable
Addresses, columns =
[*,address_id,line_1,line_2,line_3,city,zip_postcode,state_province_county,country,other_address_details]\nTable
Courses, columns =
[*,course_id,course_name,course_description,other_details]\nTable
Degree_Programs, columns =
[*,degree_program_id,department_id,degree_summary_name,degree_summary_description,other_details]\nTable
Departments, columns =
[*,department_id,department_name,department_description,other_details]\nTable
Sections, columns =
[*,section_id,course_id,section_name,section_description,other_details]\nTable
Semesters, columns =
[*,semester_id,semester_name,semester_description,other_details]\nTable
Student_Enrolment, columns =
[*,student_enrolment_id,degree_program_id,semester_id,student_id,other_details]\nTable
Student_Enrolment_Courses, columns =
[*,student_course_id,course_id,student_enrolment_id]\nTable Students,
columns =
[*,student_id,current_address_id,permanent_address_id,first_name,middle_name,last_name,cell_mobile_number,email_address,ssn,date_first_registered,date_left,other_student_details]\nTable
Transcript_Contents, columns =
[*,student_course_id,transcript_id]\nTable Transcripts, columns =
[*,transcript_id,transcript_date,other_details]\nForeign_keys =
[Degree_Programs.department_id =
Departments.department_id,Sections.course_id =
Courses.course_id,Students.permanent_address_id =
Addresses.address_id,Students.current_address_id =
Addresses.address_id,Student_Enrolment.student_id =
Students.student_id,Student_Enrolment.semester_id =
Semesters.semester_id,Student_Enrolment.degree_program_id =
Degree_Programs.degree_program_id,Student_Enrolment_Courses.student_enrolment_id
=
Student_Enrolment.student_enrolment_id,Student_Enrolment_Courses.course_id
= Courses.course_id,Transcript_Contents.transcript_id =
Transcripts.transcript_id,Transcript_Contents.student_course_id =
Student_Enrolment_Courses.student_course_id]\n"}, {"role": "system",
"content": "Q: Could you tell me the last names of all the students who
live in the state of North Carolina?"}, {"role": "system", "content":
"A: SELECT T1.last_name FROM Students AS T1 JOIN Addresses AS T2 ON
T1.current_address_id = T2.address_id WHERE T2.state_province_county =
'NorthCarolina'"}, {"role": "system", "content": "Q: What about their
first names?"}, {"role": "system", "content": "A: SELECT T1.first_name
FROM Students AS T1 JOIN Addresses AS T2 ON T1.current_address_id =
T2.address_id WHERE T2.state_province_county = 'NorthCarolina'"},
{"role": "user", "content": "Q: What are the last names of the students
who live in North Carolina but have not registered in any degree
program?"}], "ideal": ["A: SELECT T1.last_name FROM Students AS T1 JOIN
Addresses AS T2 ON T1.current_address_id = T2.address_id WHERE
T2.state_province_county = 'NorthCarolina' EXCEPT SELECT DISTINCT
T3.last_name FROM Students AS T3 JOIN Student_Enrolment AS T4 ON
T3.student_id = T4.student_id"]}
{"input": [{"role": "system", "content": "TASK: Answer the following
question with syntactically correct SQLite SQL. The SQL should be
correct and be in context of the previous question-answer pairs.\nTable
Addresses, columns =
[*,address_id,line_1,line_2,line_3,city,zip_postcode,state_province_county,country,other_address_details]\nTable
Courses, columns =
[*,course_id,course_name,course_description,other_details]\nTable
Degree_Programs, columns =
[*,degree_program_id,department_id,degree_summary_name,degree_summary_description,other_details]\nTable
Departments, columns =
[*,department_id,department_name,department_description,other_details]\nTable
Sections, columns =
[*,section_id,course_id,section_name,section_description,other_details]\nTable
Semesters, columns =
[*,semester_id,semester_name,semester_description,other_details]\nTable
Student_Enrolment, columns =
[*,student_enrolment_id,degree_program_id,semester_id,student_id,other_details]\nTable
Student_Enrolment_Courses, columns =
[*,student_course_id,course_id,student_enrolment_id]\nTable Students,
columns =
[*,student_id,current_address_id,permanent_address_id,first_name,middle_name,last_name,cell_mobile_number,email_address,ssn,date_first_registered,date_left,other_student_details]\nTable
Transcript_Contents, columns =
[*,student_course_id,transcript_id]\nTable Transcripts, columns =
[*,transcript_id,transcript_date,other_details]\nForeign_keys =
[Degree_Programs.department_id =
Departments.department_id,Sections.course_id =
Courses.course_id,Students.permanent_address_id =
Addresses.address_id,Students.current_address_id =
Addresses.address_id,Student_Enrolment.student_id =
Students.student_id,Student_Enrolment.semester_id =
Semesters.semester_id,Student_Enrolment.degree_program_id =
Degree_Programs.degree_program_id,Student_Enrolment_Courses.student_enrolment_id
=
Student_Enrolment.student_enrolment_id,Student_Enrolment_Courses.course_id
= Courses.course_id,Transcript_Contents.transcript_id =
Transcripts.transcript_id,Transcript_Contents.student_course_id =
Student_Enrolment_Courses.student_course_id]\n"}, {"role": "system",
"content": "Q: What is the full name of the department that has the
substring computer in its name?"}, {"role": "system", "content": "A:
SELECT department_name FROM Departments WHERE department_name LIKE
'%computer%'"}, {"role": "system", "content": "Q: What's the description
of that department?"}, {"role": "system", "content": "A: SELECT
department_description FROM Departments WHERE department_name LIKE
'%computer%'"}, {"role": "user", "content": "Q: What is that
department's id?"}], "ideal": ["A: SELECT department_id FROM Departments
WHERE department_name LIKE '%computer%'"]}
{"input": [{"role": "system", "content": "TASK: Answer the following
question with syntactically correct SQLite SQL. The SQL should be
correct and be in context of the previous question-answer pairs.\nTable
singer, columns =
[*,Singer_ID,Name,Birth_Year,Net_Worth_Millions,Citizenship]\nTable
song, columns =
[*,Song_ID,Title,Singer_ID,Sales,Highest_Position]\nForeign_keys =
[song.Singer_ID = singer.Singer_ID]\n"}, {"role": "system", "content":
"Q: What are the names of the singers who were born in either 1948 or
1949?"}, {"role": "system", "content": "A: SELECT Name FROM singer WHERE
Birth_Year = 1948 OR Birth_Year = 1949"}, {"role": "system", "content":
"Q: What is their citizenship?"}, {"role": "system", "content": "A:
SELECT Citizenship FROM singer WHERE Birth_Year = 1948 OR Birth_Year =
1949"}, {"role": "user", "content": "Q: Of the singers that were born in
1948 or 1949, which had the highest net worth?"}], "ideal": ["A: SELECT
name FROM singer WHERE Birth_Year = 1948 OR Birth_Year = 1949 order by
Net_Worth_Millions desc limit 1"]}
{"input": [{"role": "system", "content": "TASK: Answer the following
question with syntactically correct SQLite SQL. The SQL should be
correct and be in context of the previous question-answer pairs.\nTable
Has_Pet, columns = [*,StuID,PetID]\nTable Pets, columns =
[*,PetID,PetType,pet_age,weight]\nTable Student, columns =
[*,StuID,LName,Fname,Age,Sex,Major,Advisor,city_code]\nForeign_keys =
[Has_Pet.StuID = Student.StuID,Has_Pet.PetID = Pets.PetID]\n"}, {"role":
"system", "content": "Q: Hey can you tell me the average age for
cats?"}, {"role": "system", "content": "A: SELECT avg ( pet_age ) FROM
pets WHERE PetType = 'cat'"}, {"role": "system", "content": "Q: What
about for dogs?"}, {"role": "system", "content": "A: SELECT avg (
pet_age ) FROM pets WHERE PetType = 'dog'"}, {"role": "user", "content":
"Q: Thanks! Now what's the maximum age for dogs?"}], "ideal": ["A:
SELECT max ( pet_age ) FROM pets WHERE PetType = 'dog'"]}
  ```
</details>
Linmj-Judy pushed a commit to TablewareBox/evals that referenced this pull request Feb 27, 2024
# 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 be 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 it 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. **Starting April 10, the minimum
eval count is 15 samples, we hope this makes it easier to create and
contribute evals.**

Also, please note that we're using **Git LFS** for storing the JSON
files, so please make sure that you move the JSON file to Git LFS before
submitting a PR. Details on how to use Git LFS are available
[here](https://git-lfs.com).

## Eval details 📑

### Eval name

CoSQL

### Eval description

[CoSQL](https://yale-lily.github.io/cosql) is a dataset for cross-domain
Conversational text-to-SQL systems. It is the dialogue version of the
[Spider](https://yale-lily.github.io/spider) task, which is an eval
already present in this repo:
[here](https://github.com/openai/evals/blob/main/evals/registry/evals/sql.yaml)

To illustrate, as opposed to Spider SQL, where the task is to generate
SQL given a single question:
```
Q: How many singers do we have?
A: SELECT count(*) FROM singer
```

CoSQL simulates a real-world conversation, where a user would be talking
to a SQL expert, who would then write SQL to retrieve data for them. ex:
```
Q: Which cartoon aired first?
A: SELECT title  FROM cartoon ORDER BY original_air_date LIMIT 1

Q: What was the last cartoon to air?
A: SELECT title  FROM cartoon ORDER BY original_air_date desc LIMIT 1

Q: What channel was it on?
```

and the ideal answer being:
```
A: SELECT channel FROM cartoon ORDER BY original_air_date desc LIMIT 1
```

As illustrated, the model needs to not only be able to reason about
provided SQL tables and schemas (which are provided in the prompts as
system input), but also be able to reference and understand the previous
question-answer pairs.

### What makes this a useful eval?

Being able to generate semantically and logically correct SQL is an
exciting application of GPT with many immediate use-cases.

Doing so in a conversational context is more difficult and tests the
model's ability to reason about prior questions and answers, similar to
what you would expect from a domain expert (e.g, SQL expert).

## 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 15 high-quality examples.**

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}.yaml`
- [X] Ensure you have the right to use the data you submit via this eval
  - CoSQL is under the [CC-4 license](https://yale-lily.github.io/cosql)

(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 commits on 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 acknowledgment

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 the 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 be
granted.

### Submit eval

- [X] I have filled out all required fields of this form
- [X] I have used **Git LFS** for the Eval JSON data
- [X] (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": "TASK: Answer the following
question with syntactically correct SQLite SQL. The SQL should be
correct and be in context of the previous question-answer pairs.\nTable
Cartoon, columns =
[*,id,Title,Directed_by,Written_by,Original_air_date,Production_code,Channel]\nTable
TV_Channel, columns =
[*,id,series_name,Country,Language,Content,Pixel_aspect_ratio_PAR,Hight_definition_TV,Pay_per_view_PPV,Package_Option]\nTable
TV_series, columns =
[*,id,Episode,Air_Date,Rating,Share,18_49_Rating_Share,Viewers_m,Weekly_Rank,Channel]\nForeign_keys
= [TV_series.Channel = TV_Channel.id,Cartoon.Channel =
TV_Channel.id]\n"}, {"role": "system", "content": "Q: Can you please
tell me the language used on the least number of TV Channels?"},
{"role": "system", "content": "A: SELECT LANGUAGE FROM TV_Channel GROUP
BY LANGUAGE ORDER BY count ( * ) ASC LIMIT 1"}, {"role": "system",
"content": "Q: What language is used on the most number of TV
channels?"}, {"role": "system", "content": "A: SELECT LANGUAGE FROM
TV_Channel GROUP BY LANGUAGE ORDER BY count ( * ) desc LIMIT 1"},
{"role": "user", "content": "Q: What is the most common content of those
TV channels?"}], "ideal": ["A: SELECT content from tv_channel group by
content order by count ( * ) desc limit 1"]}
{"input": [{"role": "system", "content": "TASK: Answer the following
question with syntactically correct SQLite SQL. The SQL should be
correct and be in context of the previous question-answer pairs.\nTable
Addresses, columns =
[*,address_id,line_1,line_2,line_3,city,zip_postcode,state_province_county,country,other_address_details]\nTable
Courses, columns =
[*,course_id,course_name,course_description,other_details]\nTable
Degree_Programs, columns =
[*,degree_program_id,department_id,degree_summary_name,degree_summary_description,other_details]\nTable
Departments, columns =
[*,department_id,department_name,department_description,other_details]\nTable
Sections, columns =
[*,section_id,course_id,section_name,section_description,other_details]\nTable
Semesters, columns =
[*,semester_id,semester_name,semester_description,other_details]\nTable
Student_Enrolment, columns =
[*,student_enrolment_id,degree_program_id,semester_id,student_id,other_details]\nTable
Student_Enrolment_Courses, columns =
[*,student_course_id,course_id,student_enrolment_id]\nTable Students,
columns =
[*,student_id,current_address_id,permanent_address_id,first_name,middle_name,last_name,cell_mobile_number,email_address,ssn,date_first_registered,date_left,other_student_details]\nTable
Transcript_Contents, columns =
[*,student_course_id,transcript_id]\nTable Transcripts, columns =
[*,transcript_id,transcript_date,other_details]\nForeign_keys =
[Degree_Programs.department_id =
Departments.department_id,Sections.course_id =
Courses.course_id,Students.permanent_address_id =
Addresses.address_id,Students.current_address_id =
Addresses.address_id,Student_Enrolment.student_id =
Students.student_id,Student_Enrolment.semester_id =
Semesters.semester_id,Student_Enrolment.degree_program_id =
Degree_Programs.degree_program_id,Student_Enrolment_Courses.student_enrolment_id
=
Student_Enrolment.student_enrolment_id,Student_Enrolment_Courses.course_id
= Courses.course_id,Transcript_Contents.transcript_id =
Transcripts.transcript_id,Transcript_Contents.student_course_id =
Student_Enrolment_Courses.student_course_id]\n"}, {"role": "system",
"content": "Q: Could you tell me the last names of all the students who
live in the state of North Carolina?"}, {"role": "system", "content":
"A: SELECT T1.last_name FROM Students AS T1 JOIN Addresses AS T2 ON
T1.current_address_id = T2.address_id WHERE T2.state_province_county =
'NorthCarolina'"}, {"role": "system", "content": "Q: What about their
first names?"}, {"role": "system", "content": "A: SELECT T1.first_name
FROM Students AS T1 JOIN Addresses AS T2 ON T1.current_address_id =
T2.address_id WHERE T2.state_province_county = 'NorthCarolina'"},
{"role": "user", "content": "Q: What are the last names of the students
who live in North Carolina but have not registered in any degree
program?"}], "ideal": ["A: SELECT T1.last_name FROM Students AS T1 JOIN
Addresses AS T2 ON T1.current_address_id = T2.address_id WHERE
T2.state_province_county = 'NorthCarolina' EXCEPT SELECT DISTINCT
T3.last_name FROM Students AS T3 JOIN Student_Enrolment AS T4 ON
T3.student_id = T4.student_id"]}
{"input": [{"role": "system", "content": "TASK: Answer the following
question with syntactically correct SQLite SQL. The SQL should be
correct and be in context of the previous question-answer pairs.\nTable
Addresses, columns =
[*,address_id,line_1,line_2,line_3,city,zip_postcode,state_province_county,country,other_address_details]\nTable
Courses, columns =
[*,course_id,course_name,course_description,other_details]\nTable
Degree_Programs, columns =
[*,degree_program_id,department_id,degree_summary_name,degree_summary_description,other_details]\nTable
Departments, columns =
[*,department_id,department_name,department_description,other_details]\nTable
Sections, columns =
[*,section_id,course_id,section_name,section_description,other_details]\nTable
Semesters, columns =
[*,semester_id,semester_name,semester_description,other_details]\nTable
Student_Enrolment, columns =
[*,student_enrolment_id,degree_program_id,semester_id,student_id,other_details]\nTable
Student_Enrolment_Courses, columns =
[*,student_course_id,course_id,student_enrolment_id]\nTable Students,
columns =
[*,student_id,current_address_id,permanent_address_id,first_name,middle_name,last_name,cell_mobile_number,email_address,ssn,date_first_registered,date_left,other_student_details]\nTable
Transcript_Contents, columns =
[*,student_course_id,transcript_id]\nTable Transcripts, columns =
[*,transcript_id,transcript_date,other_details]\nForeign_keys =
[Degree_Programs.department_id =
Departments.department_id,Sections.course_id =
Courses.course_id,Students.permanent_address_id =
Addresses.address_id,Students.current_address_id =
Addresses.address_id,Student_Enrolment.student_id =
Students.student_id,Student_Enrolment.semester_id =
Semesters.semester_id,Student_Enrolment.degree_program_id =
Degree_Programs.degree_program_id,Student_Enrolment_Courses.student_enrolment_id
=
Student_Enrolment.student_enrolment_id,Student_Enrolment_Courses.course_id
= Courses.course_id,Transcript_Contents.transcript_id =
Transcripts.transcript_id,Transcript_Contents.student_course_id =
Student_Enrolment_Courses.student_course_id]\n"}, {"role": "system",
"content": "Q: What is the full name of the department that has the
substring computer in its name?"}, {"role": "system", "content": "A:
SELECT department_name FROM Departments WHERE department_name LIKE
'%computer%'"}, {"role": "system", "content": "Q: What's the description
of that department?"}, {"role": "system", "content": "A: SELECT
department_description FROM Departments WHERE department_name LIKE
'%computer%'"}, {"role": "user", "content": "Q: What is that
department's id?"}], "ideal": ["A: SELECT department_id FROM Departments
WHERE department_name LIKE '%computer%'"]}
{"input": [{"role": "system", "content": "TASK: Answer the following
question with syntactically correct SQLite SQL. The SQL should be
correct and be in context of the previous question-answer pairs.\nTable
singer, columns =
[*,Singer_ID,Name,Birth_Year,Net_Worth_Millions,Citizenship]\nTable
song, columns =
[*,Song_ID,Title,Singer_ID,Sales,Highest_Position]\nForeign_keys =
[song.Singer_ID = singer.Singer_ID]\n"}, {"role": "system", "content":
"Q: What are the names of the singers who were born in either 1948 or
1949?"}, {"role": "system", "content": "A: SELECT Name FROM singer WHERE
Birth_Year = 1948 OR Birth_Year = 1949"}, {"role": "system", "content":
"Q: What is their citizenship?"}, {"role": "system", "content": "A:
SELECT Citizenship FROM singer WHERE Birth_Year = 1948 OR Birth_Year =
1949"}, {"role": "user", "content": "Q: Of the singers that were born in
1948 or 1949, which had the highest net worth?"}], "ideal": ["A: SELECT
name FROM singer WHERE Birth_Year = 1948 OR Birth_Year = 1949 order by
Net_Worth_Millions desc limit 1"]}
{"input": [{"role": "system", "content": "TASK: Answer the following
question with syntactically correct SQLite SQL. The SQL should be
correct and be in context of the previous question-answer pairs.\nTable
Has_Pet, columns = [*,StuID,PetID]\nTable Pets, columns =
[*,PetID,PetType,pet_age,weight]\nTable Student, columns =
[*,StuID,LName,Fname,Age,Sex,Major,Advisor,city_code]\nForeign_keys =
[Has_Pet.StuID = Student.StuID,Has_Pet.PetID = Pets.PetID]\n"}, {"role":
"system", "content": "Q: Hey can you tell me the average age for
cats?"}, {"role": "system", "content": "A: SELECT avg ( pet_age ) FROM
pets WHERE PetType = 'cat'"}, {"role": "system", "content": "Q: What
about for dogs?"}, {"role": "system", "content": "A: SELECT avg (
pet_age ) FROM pets WHERE PetType = 'dog'"}, {"role": "user", "content":
"Q: Thanks! Now what's the maximum age for dogs?"}], "ideal": ["A:
SELECT max ( pet_age ) FROM pets WHERE PetType = 'dog'"]}
  ```
</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants