- Notifications
You must be signed in to change notification settings - Fork327
Chain-of-Verification - Prompt Engineering#29
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered byReviewNB |
Ankush-lastmile commentedFeb 16, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Hi@MKhalusova! Would love a review for this recipe. Thanks! |
Uh oh!
There was an error while loading.Please reload this page.
@@ -0,0 +1,470 @@ | |||
{ |
MKhalusovaFeb 19, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Line #2. import openai
As this is an open source ai cookbook, let's illustrate this technique with anopen source model. From the readme, I can see that these models should be supported:
- https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1
- https://huggingface.co/chat?model=meta-llama/Llama-2-70b-chat-hf
Reply viaReviewNB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I've updated the model usage to use TheMixtral-8x7B-Instruct-v0.1, thanks for the suggestion!
@@ -0,0 +1,470 @@ | |||
{ |
MKhalusovaFeb 19, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
It would be helpful to explain the config a little bit here. At least its essential components. Maybe add some advice on the structure/content of the prompts?
Reply viaReviewNB
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Added a description and links
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
@@ -0,0 +1,470 @@ | |||
{ |
MKhalusovaFeb 19, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Line #3. verification_question = "Where was this coding language developed: {{entity}}?"
How do we choose the verification question?
Reply viaReviewNB
Uh oh!
There was an error while loading.Please reload this page.
MKhalusova commentedFeb 19, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
A really interesting prompting technique! Thanks for adding! I left some feedback on the notebook, mainly - let's switch to an open source model (I saw that Mistral and Llama are supported), and remove unnecessary TODOs. In order to publish the notebook, a few more steps are needed:
|
Once you address this feedback, I'll be able to check if the notebook renders and runs correctly, and if it does, we should be able to merge. |
Chain-of-Verification is a prompt engineering technique to reduce hallucinations from LLMs!Research Paper (Meta AI):https://arxiv.org/pdf/2309.11495.pdfThis recipe uses AIConfig - an open-source config-based framework for building generative AI applications.https://github.com/lastmile-ai/aiconfig/tree/main
Ankush-lastmile commentedFeb 21, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
|
Hi@MKhalusova! Thanks for the review and the detailed comments. I've gone ahead and addressed your comments, as well as made the necessary changes you've requested. It would be great if you could take another look. Thanks! |
HuggingFaceDocBuilderDev commentedFeb 21, 2024
The docs for this PR livehere. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
@@ -0,0 +1,490 @@ | |||
{ |
MKhalusovaFeb 21, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
@@ -0,0 +1,490 @@ | |||
{ |
MKhalusovaFeb 21, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This paragraph can be much shorter:
The next code cell sets up a 'CoVe prompt template' within a structure known as AIConfig. AIConfig is a data format to organize prompt templates and specific model settings. To create a config you can either:
* Generate it using theAIConfig Vscode Extension, or
* Download the confighere and load it with:
config = AIConfigRuntime.load('cove_template_config.json')
.
Reply viaReviewNB
@@ -0,0 +1,490 @@ | |||
{ |
MKhalusovaFeb 21, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Line #7. "baseline_prompt": "Name 20 programming languages that were developed in the United States. Include the developer name in parantheses.",
minor, typo: it should be "parentheses"
Reply viaReviewNB
@@ -0,0 +1,490 @@ | |||
{ |
MKhalusovaFeb 21, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Line #1. # verification_question = "Where was {{entity}} born?"
I think you can remove this comment
Reply viaReviewNB
@@ -0,0 +1,490 @@ | |||
{ |
MKhalusovaFeb 21, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Line #10. verification_completion = await config.run("verification", params, options=inference_options)
I'm getting an error on this line:
UnwrapError: CalledResult.unwrap()
on anErr
value: "Missing API key 'OPENAI_API_KEY' in environment"
Reply viaReviewNB
@@ -0,0 +1,490 @@ | |||
{ |
MKhalusovaFeb 21, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Line #5. # Display with Markdown
There seems to be an issue rendering this output. Let's switch to a simple print.
Reply viaReviewNB
MKhalusova commentedFeb 21, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Thank you for iterating on the cookbook notebook! I found a few typos and minor issues, but there's also an important one - the notebook throws an error: Let's make sure it runs smoothly without errors. |
Chain-of-Verification - Prompt Engineering
Chain-of-Verification is a prompt engineering technique to reduce hallucinations from LLMs!
Research Paper (Meta AI):https://arxiv.org/pdf/2309.11495.pdf
This recipe uses AIConfig - an open-source config-based framework for building generative AI applications.
https://github.com/lastmile-ai/aiconfig/tree/main