more notes

pull/19/head
Elvis Saravia 2023-02-06 23:04:41 +00:00
parent 29173d1ed0
commit d22a4e537c
3 changed files with 51 additions and 2 deletions

View File

@ -25,6 +25,7 @@ Announcements:
The following are a set of guides on prompt engineering developed by us. Guides are work in progress. The following are a set of guides on prompt engineering developed by us. Guides are work in progress.
- [Prompts Introduction](/guides/prompts-intro.md) - [Prompts Introduction](/guides/prompts-intro.md)
- [Prompts Basic Usage](/guides/prompts-basic-usage.md)
## Papers ## Papers
#### (Sorted by Release Date) #### (Sorted by Release Date)

View File

@ -0,0 +1,48 @@
## Basic Prompts Usage (WIP)
In the previous guide, we introduced and gave a basic example of a prompt.
In this guide, we will provide more examples of how prompts are used and introduce key concepts that will be important for more the more advanced guides.
Often, the best way to learn concepts is by running through examples. Here are a few examples of how prompt engineering can be used to achieve all types of interesting and different tasks.
## Text Summarization
One of the standard tasks in natural language generation is text summarization. Text summarization can include many different flavors and domains. In fact, one of the most promising applications of language models is the ability to summarize articles and concepts into quick and easy to read summaries. Let's try a basic summarization task using prompts.
Let's say I am interested to learn about antibiotics, I could try a prompt like this:
```
Explain antibiotics
A:
```
Output
```
Antibiotics are a type of medication used to treat bacterial infections. They work by either killing the bacteria or preventing them from reproducing, allowing the bodys immune system to fight off the infection. Antibiotics are usually taken orally in the form of pills, capsules, or liquid solutions, or sometimes administered intravenously. They are not effective against viral infections, and using them inappropriately can lead to antibiotic resistance.
```
Let's just assume that this is too much information and want to summarize it further. In fact, we can instruct the model to summarize to one sentence like so:
```
Antibiotics are a type of medication used to treat bacterial infections. They work by either killing the bacteria or preventing them from reproducing, allowing the bodys immune system to fight off the infection. Antibiotics are usually taken orally in the form of pills, capsules, or liquid solutions, or sometimes administered intravenously. They are not effective against viral infections, and using them inappropriately can lead to antibiotic resistance.
Explain the above in one sentence:
```
Output
```
Antibiotics are medications used to treat bacterial infections by either killing the bacteria or stopping them from reproducing, but they are not effective against viruses and overuse can lead to antibiotic resistance.
```
Without paying too much attention to the accuracy of the output above, which is something we will touch on in a later guide, the model tried to summarize the paragraph in one sentence. You can get clever with the instructions but we will leave that for the learner to practice more.
## Information Extraction
...
## Role-Playing
...
## Reasoning
...

View File

@ -1,3 +1,5 @@
## Prompt Introduction
This guide covers the basics of standard prompts to provide a rough idea on how to use prompts to interact and instruct large language models (LLMs). This guide covers the basics of standard prompts to provide a rough idea on how to use prompts to interact and instruct large language models (LLMs).
All examples are tested with `text-davinci-003` (using OpenAI's playground) unless otherwise specified. It uses the default configurations, e.g., `temperature=0.7` and `top-p=1`. All examples are tested with `text-davinci-003` (using OpenAI's playground) unless otherwise specified. It uses the default configurations, e.g., `temperature=0.7` and `top-p=1`.
@ -6,8 +8,6 @@ Before starting with some basic examples, keep in mind that your results may var
--- ---
## Basic Prompt
You can already achieve a lot with prompts, but the quality of results depends on how much information you provide it. A prompt can contain information like the `instruction` or `question` you are passing to the model and including other details such as `inputs` or `examples`. You can already achieve a lot with prompts, but the quality of results depends on how much information you provide it. A prompt can contain information like the `instruction` or `question` you are passing to the model and including other details such as `inputs` or `examples`.
Here is a basic example of a simple prompt: Here is a basic example of a simple prompt: