From 8eb90065f795137a77e16f31874086e9510dfdc0 Mon Sep 17 00:00:00 2001 From: Elvis Saravia Date: Mon, 6 Feb 2023 22:30:31 +0000 Subject: [PATCH] add first guide --- README.md | 6 ++++++ guides/prompts-intro.md | 48 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 guides/prompts-intro.md diff --git a/README.md b/README.md index 324b61b..2e1a8fd 100644 --- a/README.md +++ b/README.md @@ -14,12 +14,18 @@ Announcements: ## Table of Contents +- [Guides](#guides) - [Papers](#papers) - [Tools & Libraries](#tools--libraries) - [Datasets](#datasets) - [Blog, Guides, Tutorials and Other Readings](#blog-guides-tutorials-and-other-readings) +## Guides +The following are a set of guides on prompt engineering. + +- [Prompts Introduction](/guides/prompts-intro.md) + ## Papers #### (Sorted by Release Date) diff --git a/guides/prompts-intro.md b/guides/prompts-intro.md new file mode 100644 index 0000000..f59714e --- /dev/null +++ b/guides/prompts-intro.md @@ -0,0 +1,48 @@ +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`. + +Before starting with some basic examples, keep in mind that your results may vary depending on the version of LLM you are using. + +--- + +## 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`. + +Here is a basic example of a simple prompt: + +``` +The sky is +``` + +Output: +``` +blue + +The sky is blue on a clear day. On a cloudy day, the sky may be gray or white. +``` + +As you can see, the language model outputs a continuation of strings that make sense give the context `"The sky is"`. The output might be unexpected or far from the task we want to accomplish. + +This basic example also highlights the necessity to provide more context or instructions on what specifically we want to achieve. + +Let's try to improve it a bit: + +``` +Complete the sentence: + +The sky is +``` + +Output + +``` + so beautiful today. +``` + +Is that better? Well, we told the model to complete the sentence so the result looks a lot better as it follows exactly what we told it to do ("complete the sentence") . This approach of instructing the model to perform a task is what's referred to as **prompt engineering**. + +The example above is a basic illustration of what's possible with LLMs today. Today's LLMs are able to perform all kinds of advanced tasks that range from text summarization to mathematical reasoning to code generation. + +We will cover more of these capabilities in this guide but also cover other areas of interest such as advanced prompting techniques and research topics around prompt engineering. \ No newline at end of file