StampyAI / stampy-chat

Conversational chatbot to answer questions about AI Safety & Alignment based on information retrieved from the Alignment Research Dataset
https://chat.stampy.ai
MIT License
12 stars 5 forks source link

Prompt Eng #50

Closed FraserLee closed 11 months ago

FraserLee commented 12 months ago

Prompt Engineering Workflow

As I had said previously, our prompt is a function - not a template. Certain parameters like what goes in a system vs a user prompt, how we delineate sources, where to break messages, how to handle history, etc - it's too much weight to be cleanly represented with anything but code. That said, this process should be fairly simple and straightforwards even to non-technical people:

  1. Edit the function construct_prompt in api/chat.py
  2. cd api
  3. run pipenv run python3 prompteng/prompteng.py
  4. open the google sheet
  5. click file->import. Click upload. Drag and drop the file api/prompteng/data/answers.csv
  6. press cmd + a. Click format->wrapping->wrap. Adjust column widths to preference.

Possible future improvements

Would love some feedback around this one before I merge!

FraserLee commented 12 months ago

https://docs.google.com/spreadsheets/d/1kUb6Mtn1fXLd_iRHEOOnFjpyv0TA5I2Q-R1PtAG7ARw/edit?usp=sharing

cvarrichio commented 11 months ago

Just so that we don't duplicate, I'm nearly done with https://github.com/StampyAI/stampy-chat/issues/6. I should push something within a few days.

ccstan99 commented 11 months ago

@cvarrichio This PR mostly sets up a means to easily benchmarked / test new prompts and generates the output to a CSV file. Fraser's looking for feedback on it. If you're able to play around with this new setup, it might speed up your own testing and refinement process as well.

cvarrichio commented 11 months ago

I'm pretty sure this is exactly what I've been working on. Pausing for now.

ccstan99 commented 11 months ago

@cvarrichio Shoot, you're right! I remember that you wanted to work on prompt engineering and now I remember mentioning that having the testing in place would make that work faster. I see that I even wrote it down on our planning docs, but Fraser wasn't as the meeting so probably didn't catch that. So sorry for the confusion.

FYI, I added some specific things to try for prompt engineering #3, which hopefully be much easier to try with these changes.

FraserLee commented 11 months ago

Ah sorry for stepping on your toes there, I thought you were more working on #2. If you have any improvements to my version feel free to open a second PR on top!