Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up cot_instructions placeholder #216

Merged
merged 2 commits into from
Aug 30, 2024
Merged

Clean up cot_instructions placeholder #216

merged 2 commits into from
Aug 30, 2024

Conversation

wongjingping
Copy link
Collaborator

@wongjingping wongjingping commented Aug 30, 2024

Changes

  • Replaced cot_instructions with table_aliases. We prefer to leave cot_instructions as an experimental field.
  • Users can insert table_aliases into their prompts more easily now by just directly sticking the placeholder {table_aliases} inside their prompt, without having to pass a combination of cli args + prompt changes + code changes.
  • Rename join_hints to join_str to better match the variable name

Testing

We ran the following on gpu-inference

./run_model_cot.sh defog/sqlcoder-8b-dare-ties

Results:

Question File Accuracy
instruct_basic_postgres.csv 92.50%
instruct_advanced_postgres.csv 81.25%
questions_gen_postgres.csv 83.81%

These are the same compared to when run on the main branch, and differences from our sota results are likely due to the different gpu hardware/setup.

…thin cot_instructions, which we prefer to leave as an experimental field

- Rename join_hints to join_str to better match the variable name
@wongjingping wongjingping changed the title Clean up tableO Clean up cot_instructions placeholder Aug 30, 2024
@wendy-aw
Copy link
Contributor

Thank you for cleaning it up!

@rishsriv
Copy link
Member

rishsriv commented Aug 30, 2024

To clarify the PR a bit, does this always lead to the creation of table aliases as a default - regardless of the CLI params that a user uses? :)

@wendy-aw
Copy link
Contributor

Would we also need the table_alias field in generating the prompt in all other runners?

@rishsriv
Copy link
Member

Would we also need the table_alias field in generating the prompt in all other runners?

Don't think we need to – performance for all generalist models decreased significantly after adding the table_alias field, so decided to intentionally not put it in!

@wongjingping
Copy link
Collaborator Author

wongjingping commented Aug 30, 2024

To clarify the PR a bit, does this always lead to the creation of table aliases as a default - regardless of the CLI params that a user uses? :)

Yep that's right! The user can control that option directly within the prompt by just putting/omitting the placeholder

@wongjingping
Copy link
Collaborator Author

wongjingping commented Aug 30, 2024

Would we also need the table_alias field in generating the prompt in all other runners?

Oh good point, I think we'll minimally need to add it to our api_runner.py for parity with our current setup. Just added it and the performance bumped back up:

Question File Accuracy
instruct_basic_postgres.csv 97.50%
instruct_advanced_postgres.csv 84.38%
questions_gen_postgres.csv 88.10%

On a separate note, I think we can potentially refactor generate_prompt to just take in a pd.Series instead of explicitly listing everything out so we don't have to update all the runners each time we add a new prompt placeholder. Alternatively we can try to consolidate the common code in all the runners so we don't have to update all the runners everywhere.

@wendy-aw
Copy link
Contributor

just take in a pd.Series instead of explicitly listing everything out so we don't have to update all the runners each time
Oh this is a good idea!
Anw the rest looks good to me!

Copy link
Member

@rishsriv rishsriv left a comment

Choose a reason for hiding this comment

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

Thanks for making the fix for the API runner!

@rishsriv rishsriv merged commit cec44fe into main Aug 30, 2024
2 checks passed
@rishsriv rishsriv deleted the jp/cot branch August 30, 2024 09:32
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