Skip to content

Commit 3e03a2b

Browse files
committed
updated prompt engineering
1 parent 5418fbe commit 3e03a2b

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

11_Prompt_Engineering/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,33 @@
77
- Implement a web search plugin
88

99
## What is a prompt
10+
11+
A prompt is an input or instruction provided to an Artificial Intelligence (AI) model to direct its behavior and produce the desired results. The quality and specificity of the prompt are crucial in obtaining precise and relevant outputs. A well-designed prompt can ensure that the AI model generates the desired information or completes the intended task effectively. Some typical prompts include summarization, question answering, text classification, and code generation.
12+
1013
## What is prompt engineering
14+
15+
Prompt engineering is the iterative process of designing, evaluating, and optimizing prompts to produce consistently accurate responses from language models for a particular problem domain. It involves designing and refining the prompts given to an AI model to achieve the desired outputs. Prompt engineers experiment with various prompts, test their effectiveness, and refine them to improve performance. Performance is measured using predefined metrics such as accuracy, relevance, and user satisfaction to assess the impact of prompt engineering.
16+
1117
## General anatomy of a prompt
1218
Instruction, context, input, output indicator
19+
1320
## Zero-shot prompting
21+
22+
Zero-shot prompting is what we would consider the “default”. This is when we provide no examples of inputs/expected outputs to the model to work with. We’re leaving it up to the model to decipher what is needed and how to output it from the instructions.
23+
1424
## Few-shot prompting
25+
26+
Few-shot prompting provides examples to guide the model to the desired output.
27+
1528
## RAG
29+
30+
GPT language models can be fine-tuned to achieve several common tasks such as sentiment analysis and named entity recognition. These tasks generally don't require additional background knowledge.
31+
32+
The RAG pattern facilitates bringing private proprietary knowledge to the model so that it can perform Question Answering over this content. Remember that Large Language Models are indexed only on public information.
33+
Because the RAG technique accesses external knowledge sources to complete tasks, it enables more factual consistency, improves the reliability of the generated responses, and helps to mitigate the problem of "hallucination".
34+
35+
In some cases, the RAG process involves a technique called vectorization on the proprietary data. The user prompt is compared to the vector store and only the most relevant/matching pieces of information are returned and stuffed into prompt for the LLM to reason over and provide an answer. The next set of demos will go into this further.
36+
1637
## Chain of thought
1738
## ReAct
1839

0 commit comments

Comments
 (0)