Jump to content

Prompt engineering: Difference between revisions

Line 26: Line 26:
==Text-to-text models==
==Text-to-text models==


Prompt engineering is not limited to text-to-image generation and has found a fitting application in AI-generated art. Various templates and "recipes" have been created to optimize the process of providing the most effective textual inputs to the model. OpenAI has published such "recipes" for their language model that can be adapted to different downstream tasks, including grammar correction, text summarization, answering questions, generating product names, and functioning as a chatbot. <ref name="”2”"></ref>
Prompt engineering is not limited to [[text-to-image generation]] and has found a fitting application in [[AI-generated art]]. Various [[templates]] and "[[recipes]]" have been created to optimize the process of providing the most effective textual inputs to the model. OpenAI has published such "recipes" for their language model that can be adapted to different downstream tasks, including [[grammar correction]], [[text summarization]], [[answering questions]], [[generating product names]], and functioning as a [[chatbot]]. <ref name="”2”"></ref>


In language models like [[GPT]], the output quality is influenced by a combination of prompt design, sample data, and temperature (a parameter that controls the “creativity” of the responses). Furthermore, to properly design a prompt the user has to have a good understanding of the problem, good grammar skill, and produce many iterations. <ref name="”9”">Shynkarenka, V (2020). Hacking Hacker News frontpage with GPT-3. Vasili Shunkarenka. https://vasilishynkarenka.com/gpt-3/</ref>
In [[language models]] like [[GPT]], the output quality is influenced by a combination of [[prompt design]], [[sample data]], and [[temperature]] (a [[parameter]] that controls the “[[creativity]]” of the responses). Furthermore, to properly design a prompt, the user has to have a good understanding of the problem, good grammar skill, and produce many iterations. <ref name="”9”">Shynkarenka, V (2020). Hacking Hacker News frontpage with GPT-3. Vasili Shunkarenka. https://vasilishynkarenka.com/gpt-3/</ref>


Therefore, to create a good prompt it’s necessary to be attentive to the following elements:
Therefore, to create a good prompt, it’s necessary to be attentive to the following elements:


*'''The problem:''' the user needs to know clearly what he wants the generative model to do and its context. <ref name="”9”"></ref><ref name="”10”">Robinson, R (2023). How to Write an Effective GPT-3 or GPT-4 Prompt- Zapier. https://zapier.com/blog/gpt-prompt/</ref> For example, the AI can change the writing style of the output ("write a professional but friendly email" or "write a formal executive summary."). <ref name="”10”"></ref> Since the AI understands natural language, the user can think of the generative model as a human assistant. Therefore, thinking “how would I describe the problem to my assistant who haven’t done this task before?” may provide some help in defining clearly the problem and context. <ref name="”9”"></ref>
*'''The problem:''' the user needs to know clearly what he wants the generative model to do and its context. <ref name="”9”"></ref><ref name="”10”">Robinson, R (2023). How to Write an Effective GPT-3 or GPT-4 Prompt- Zapier. https://zapier.com/blog/gpt-prompt/</ref> For example, the AI can change the writing style of the output ("write a professional but friendly email" or "write a formal executive summary."). <ref name="”10”"></ref> Since the AI understands natural language, the user can think of the generative model as a human assistant. Therefore, thinking “how would I describe the problem to my assistant who haven’t done this task before?” may provide some help in defining clearly the problem and context. <ref name="”9”"></ref>