You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: PromptEngineering_orinignal.md
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -12,30 +12,30 @@
12
12
13
13
Prompt engineering involves designing, creating, and optimizing prompts for the purpose of extracting accurate, consistent, and fair outputs from large language models (LLMs).
14
14
15
-
> The aforementioned is also applicable to other large generative models, such text-to-image synthesizers. For the sake of brevity, we will temporarily focus on language models.
15
+
> The aforementioned is also applicable to other large generative models, such as text-to-image synthesizers. For the sake of brevity, we will temporarily focus on language models.
16
16
17
17
18
18
LLMs are trained on vast amounts of text data, allowing them to encode a substantial amount of factual information about the world. Their popularity has surged in recent years due to their ability to generate human-like text, making them ideal for chatbots, virtual assistants, and similar applications. However, it is essential to note that without appropriate prompt engineering, the generated outputs can be unpredictable and potentially result in harmful consequences.
19
19
20
20
The goal of prompt engineering is to identify an appropriate prompt to be given to LLMs, in such a way that they generate responses that can effectively solve our specified complex tasks.
21
21
22
-
A prompt can take on any form of sentence such as statements, instructions, questions, or even paragraph, as long as it inspires the imagination of LLMs and guides them to explore a variety of topics and tasks.
22
+
A prompt can take on any form of sentence such as statements, instructions, questions, or even paragraphs, as long as it inspires the imagination of LLMs and guides them to explore a variety of topics and tasks.
23
23
24
24
> For the sake of making it easier for beginners to understand, we will temporarily set aside the concept of soft prompts.**
25
25
26
26
After receiving various types of prompts, LLMs have the ability to generate a diverse range of output formats, including completed sentences, question-answers, translations, conversational scripts, and other text generation, all of which have wide-ranging applications and great creative potential.
27
27
28
28
Depending on the knowledge and experience acquired from vast amounts of language data during training, LLMs are not just used for chatbot conversations, but also highly effective problem solvers.
29
29
30
-
### 💥 Hightlight: To enhance the problem-solving ability of LLMs, high-quality prompts are crucial.
30
+
### 💥 Highlight: To enhance the problem-solving ability of LLMs, high-quality prompts are crucial.
31
31
32
32
<imgwidth="200%"src="./figures/hr.gif" />
33
33
34
34
## Design Principle and Framework
35
35
A good prompt is one that is specific and provides enough context for LLMs to be able to generate a response that is relevant to the task.
36
36
37
37
### Design principle
38
-
By following design principle, you can improve the quality and accuracy of the LLM’s responses and enhance the overall user experience.
38
+
By following design principles, you can improve the quality and accuracy of the LLM’s responses and enhance the overall user experience.
39
39
40
40
-**Be clear and specific**: The prompt should clearly state the task or question that the model is expected to answer. Avoid ambiguity or vagueness in the prompt as this can lead to unclear or irrelevant responses.
41
41
-**Provide context**: The prompt should provide enough context for the model to understand the task and generate a relevant response. This can include relevant background information, examples, or constraints.
@@ -52,7 +52,7 @@ By following design principle, you can improve the quality and accuracy of the L
52
52
We propose a framework for prompt design that consists of five key components: context, instructions, relevance, constraints, and demonstration. This standardized structure can help streamline prompt design and ensure that a consistent process is followed, resulting in more effective prompts.
53
53
54
54
- 🕐**Context**:
55
-
- Context is key when designing a prompt. Make sure to provide enough background information surrounding to the designated task so that the model can understands the situation and generate text that is relevant and accurate.
55
+
- Context is key when designing a prompt. Make sure to provide enough background information surrounding to the designated task so that the model can understand the situation and generate text that is relevant and accurate.
56
56
57
57
- 🕜**Instruction**:
58
58
- Instruction is crucial as it guides the model on what to do and what is expected of it. It is important to be clear, concise and specific. When dealing with complex reasoning tasks, consider breaking the tasks down into smaller, more manageable steps to help the model understand the task at hand.
@@ -61,10 +61,10 @@ We propose a framework for prompt design that consists of five key components: c
61
61
- Relevance is essential when specific information needs to be referenced. This information could be links to relevant articles or data, or specific input provided by the user. By utilizing this specific information, the model can tailor its output to be personalized, reliable, and consistent with the user's needs.
62
62
63
63
- 🕝**Constraint**:
64
-
- Constraint is helpful as guiding LLMs on what it can and cannot do, ultimately leading to more accurate results. This may involve specifying the format of the output, the type of language to be used, or even the length of the output. Additionally, specifying the difficulty level and style can further refine the output.
64
+
- Constraint is helpful in guiding LLMs on what they can and cannot do, ultimately leading to more accurate results. This may involve specifying the format of the output, the type of language to be used, or even the length of the output. Additionally, specifying the difficulty level and style can further refine the output.
65
65
66
66
- 🕒**Demonstration**:
67
-
- Demonstration is valuable as it allow LLMs to understand what is expected through examples, particularly when instructions alone cannot effectively convey specific details and accuracy. By offering examples of input and output pairs, LLMs can automatically identify patterns and then generate text that is aligned with the user's expectations.
67
+
- Demonstration is valuable as it allows LLMs to understand what is expected through examples, particularly when instructions alone cannot effectively convey specific details and accuracy. By offering examples of input and output pairs, LLMs can automatically identify patterns and then generate text that is aligned with the user's expectations.
68
68
69
69
## 💥 Based on the complexity and characteristics of the task, you can select a few components from them to form your prompt.
70
70
@@ -80,7 +80,7 @@ At the beginning of the prompt, we can directly write the content to express the
80
80
81
81
```[Relevance]: To help you develop your story, please review the following articles: "The Power of Uncovering Hidden Talents" and "The Importance of Character Development in Fiction Writing." These articles will provide you with relevant insights and ideas for your story.```
82
82
83
-
```[Constraint]: Your story must be written in third person point of view and should be appropriate for a general audience. Additionally, ensure that the story has a positive and inspiring tone.```
83
+
```[Constraint]: Your story must be written in the third person point of view and should be appropriate for a general audience. Additionally, ensure that the story has a positive and inspiring tone.```
0 commit comments