Prompt: Difference between revisions

27 bytes added ,  3 February 2023
no edit summary
No edit summary
No edit summary
Line 1: Line 1:
[[File:0. chat-email-copy Blusteak.png|thumb|Figure 1. Example of a prompt on ChatGPT. Source: Blusteak.]]
[[File:0. chat-email-copy Blusteak.png|thumb|Figure 1. Example of a prompt on ChatGPT. Source: Blusteak.]]


A [[prompt]] or an [[artificial intelligence]] ([[AI]]) prompt is a [[natural language]] set of instructions, a text, that functions as [[input]] for an [[AI generator]]. <ref name="”1”">Ana. B (2022). Design your AI Art generator prompt using ChatGPT. Towards AI. https://pub.towardsai.net/design-your-ai-art-generator-prompt-using-chatgpt-7a3dfddf6f76</ref> Simply, it is a phrase or individual keywords used in tools like [[ChatGPT]] (figure 1), a [[text-to-text generator]], or in [[text-to-image generator]]s like [[DALL-E]]. After the input, the [[AI model]] tries to interpret it and generates a response. <ref name="”2”">Schmid, S (2022).ChatGPT: How to write the perfect prompts. Neuroflash. https://neuroflash.com/chatgpt-how-to-write-the-perfect-prompts/</ref>
A [[prompt]] or an [[artificial intelligence]] ([[AI]]) prompt is a [[natural language]] set of instructions, a text, that functions as [[input]] for an [[AI generator]]. <ref name="”1”">Ana. B (2022). Design your AI Art generator prompt using ChatGPT. Towards AI. https://pub.towardsai.net/design-your-ai-art-generator-prompt-using-chatgpt-7a3dfddf6f76</ref> Simply, it is a phrase or individual keywords used in tools like [[ChatGPT]] (figure 1), a [[text-to-text]] generator, or in [[text-to-image]] generators like [[DALL-E]]. After the input, the [[AI model]] tries to interpret it and generates a response. <ref name="”2”">Schmid, S (2022).ChatGPT: How to write the perfect prompts. Neuroflash. https://neuroflash.com/chatgpt-how-to-write-the-perfect-prompts/</ref>


It's relevant that prompts are written in a way that the generative model will understand since there is a direct relation between prompt quality and its output. <ref name="”1”"></ref> <ref name="”2”"></ref> For example, to obtain high-quality art it is necessary to provide adequate prompts with curated keywords. <ref name="”1”"></ref>
It's relevant that prompts are written in a way that the generative [[model]] will understand since there is a direct relation between prompt quality and its output. <ref name="”1”"></ref> <ref name="”2”"></ref> For example, to obtain high-quality art it is necessary to provide adequate prompts with curated keywords. <ref name="”1”"></ref>


[[Prompt design]] has become a relevant field of study and experimentation since it plays an essential role in the generation quality. Prompt design or [[Prompt engineering|engineering]] is the adjustment of the textual input for the model to better understand the intentions of the user and produce higher-quality results. <ref name="”3”">Hao, Y, Chi, Z, Dong, L and Wei, F (2022). Optimizing prompts for pext-to-image generation. arXiv:2212.09611v1</ref> Indeed, according to Hao et al. (2022), "empirical observations also confirm that common user input is often insufficient to produce aesthetically pleasing images with current models." <ref name="”3”"></ref> These improvements can be achieved in all forms of AI generative systems, creating better stories, summaries, images, or videos. <ref name="”1”"></ref> <ref name="”4”">Bouchard, L (2022). Prompting explained: How to talk to ChatGPT. Louis Bouchard. https://www.louisbouchard.ai/prompting-explained/</ref>
[[Prompt design]] has become a relevant field of study and experimentation since it plays an essential role in the generation quality. Prompt design or [[Prompt engineering|engineering]] is the adjustment of the textual input for the model to better understand the intentions of the user and produce higher-quality results. <ref name="”3”">Hao, Y, Chi, Z, Dong, L and Wei, F (2022). Optimizing prompts for text-to-image generation. arXiv:2212.09611v1</ref> Indeed, according to Hao et al. (2022), "empirical observations also confirm that common user input is often insufficient to produce aesthetically pleasing images with current models." <ref name="”3”"></ref> These improvements can be achieved in all forms of AI generative systems, creating better stories, summaries, images, or videos. <ref name="”1”"></ref> <ref name="”4”">Bouchard, L (2022). Prompting explained: How to talk to ChatGPT. Louis Bouchard. https://www.louisbouchard.ai/prompting-explained/</ref>


Julia Turc, the author of the article “Crafting Prompts for Text-to-Image Models”, argues that prompting “is the newest and most extreme form of transfer learning: a mechanism that allows previously-trained model weights to be reused in a novel context.” She further expounds that “each request for an image can be seen as a new task to be accomplished by a model that was pre-trained on a vast amount of data. In a way, prompting has democratized transfer learning, but has not yet made it effortless. Writing effective prompts can require as much work as picking up a new hobby.“ <ref name="”5”">Turc, J (2022). Crafting prompts for text-to-image models. Towards Data Science. https://towardsdatascience.com/the-future-of-crafting-prompts-for-text-to-image-models-fc7d9614cb65 </ref>
Julia Turc, the author of the article “Crafting Prompts for Text-to-Image Models”, argues that prompting “is the newest and most extreme form of [[transfer learning]]: a mechanism that allows previously-trained model [[weight]]s to be reused in a novel context.” She further expounds that “each request for an image can be seen as a new task to be accomplished by a model that was pre-trained on a vast amount of data. In a way, prompting has democratized transfer learning, but has not yet made it effortless. Writing effective prompts can require as much work as picking up a new hobby.“ <ref name="”5”">Turc, J (2022). Crafting prompts for text-to-image models. Towards Data Science. https://towardsdatascience.com/the-future-of-crafting-prompts-for-text-to-image-models-fc7d9614cb65 </ref>


==Prompting overview==
==Prompting overview==
Line 15: Line 15:
[[ChatGPT]] is a model trained using [[Reinforcement Learning]] that interacts with the user conversationally, responding to the text input.
[[ChatGPT]] is a model trained using [[Reinforcement Learning]] that interacts with the user conversationally, responding to the text input.


For a text-to-text model, there are some general guidelines for a good prompt:
For a [[text-to-text model]], there are some general guidelines for a good prompt:


*Precision and clarity by avoiding long sentences with many subpoints. Easy-to-understand shorter sentences are preferable.
*Precision and clarity by avoiding long sentences with many subpoints. Easy-to-understand shorter sentences are preferable.
Line 27: Line 27:
[[File:1. Word cloud prompt.png|thumb|Figure 3. Frequent keywords used in Midjourney. Source: Towards Data Science.]]
[[File:1. Word cloud prompt.png|thumb|Figure 3. Frequent keywords used in Midjourney. Source: Towards Data Science.]]


[[Stable Diffusion]], [[DALL-E]], [[Midjourney]], and other text-to-image systems rely on written descriptions to generate images using algorithms to convert the text into an image. <ref name="”7”">Arunk89 (2023). How to write great prompts for AI text-to-image generators. Turbo Future. https://turbofuture.com/internet/How-to-write-great-prompts-for-AI-text-to-image-generator </ref> <ref name="”8”">ZMO.AI (2022). How do AI text-to-image generators work? ZMO.AI. https://www.zmo.ai/how-do-ai-text-to-image-generators-work/ </ref> These system can even produce images according to a specific style like (i.e. photograph, watercolor, illustration, etc.) or artist. <ref name="”8”"></ref>
[[Stable Diffusion]], [[DALL-E]], [[Midjourney]], and other [[text-to-image]] systems rely on written descriptions to generate images using algorithms to convert the text into an image. <ref name="”7”">Arunk89 (2023). How to write great prompts for AI text-to-image generators. Turbo Future. https://turbofuture.com/internet/How-to-write-great-prompts-for-AI-text-to-image-generator </ref> <ref name="”8”">ZMO.AI (2022). How do AI text-to-image generators work? ZMO.AI. https://www.zmo.ai/how-do-ai-text-to-image-generators-work/ </ref> These system can even produce images according to a specific style like (i.e. photograph, watercolor, illustration, etc.) or artist. <ref name="”8”"></ref>


In general, a good prompt for image generation (figure 2) should have in its structure:
In general, a good prompt for image generation (figure 2) should have in its structure:
Line 40: Line 40:


==Prompt engineering==
==Prompt engineering==
 
[[Prompt design]] or [[prompt engineering]] is the practice of discovering the prompt that gets the best result from the AI system. <ref name="”4”"></ref> The development of prompts requires human intuition with results that can look arbitrary. <ref name="”9”">Pavlichenko, N, Zhdanov, F and Ustalov, D (2022). Best prompts for text-to-image models and how to find them. arXiv:2209.11711v2</ref> Manual prompt engineering is laborious, it may be infeasible in some situations, and the prompt results may vary between various model versions. <ref name="”3”"></ref> However, there have been developments in automated prompt generation which rephrases the input, making it more model-friendly. <ref name="”5”"></ref>
Prompt design or prompt engineering is the practice of discovering the prompt that gets the best result from the AI system. <ref name="”4”"></ref> The development of prompts requires human intuition with results that can look arbitrary. <ref name="”9”">Pavlichenko, N, Zhdanov, F and Ustalov, D (2022). Best prompts for text-to-image models and how to find them. arXiv:2209.11711v2</ref> Manual prompt engineering is laborious, it may be infeasible in some situations, and the prompt results may vary between various model versions. <ref name="”3”"></ref> However, there have been developments in automated prompt generation which rephrases the input, making it more model-friendly. <ref name="”5”"></ref>


A list of prompts for beginners is [https://mpost.io/top-50-text-to-image-prompts-for-ai-art-generators-midjourney-and-dall-e/ available] as well as a compilation of the best [https://mpost.io/best-10-ai-prompt-guides-and-tutorials-for-text-to-image-models-midjourney-stable-diffusion-dall-e/ prompt guides and tutorials].
A list of prompts for beginners is [https://mpost.io/top-50-text-to-image-prompts-for-ai-art-generators-midjourney-and-dall-e/ available] as well as a compilation of the best [https://mpost.io/best-10-ai-prompt-guides-and-tutorials-for-text-to-image-models-midjourney-stable-diffusion-dall-e/ prompt guides and tutorials].