Prompt engineering

Prompt engineering is the process of structuring an instruction that can be interpreted and understood by a generative AI model.[1][2] A prompt is natural language text describing the task that an AI should perform.[3]

A prompt for a text-to-text language model can be a query such as "what is Fermat's little theorem?",[4] a command such as "write a poem about leaves falling",[5] or a longer statement including context, instructions,[6] and conversation history. Prompt engineering may involve phrasing a query, specifying a style,[5] providing relevant context[7] or assigning a role to the AI such as "Act as a native French speaker".[8] A prompt may include a few examples for a model to learn from, such as asking the model to complete "maison → house, chat → cat, chien →" (the expected response being dog),[9] an approach called few-shot learning.[10]

When communicating with a text-to-image or a text-to-audio model, a typical prompt is a description of a desired output such as "a high-quality photo of an astronaut riding a horse"[11] or "Lo-fi slow BPM electro chill with organic samples".[12] Prompting a text-to-image model may involve adding, removing, emphasizing and re-ordering words to achieve a desired subject, style,[1] layout, lighting,[13] and aesthetic.

  1. ^ a b Diab, Mohamad; Herrera, Julian; Chernow, Bob (2022-10-28). "Stable Diffusion Prompt Book" (PDF). Retrieved 2023-08-07. Prompt engineering is the process of structuring words that can be interpreted and understood by a text-to-image model. Think of it as the language you need to speak in order to tell an AI model what to draw.
  2. ^ Ziegler, Albert; Berryman, John (17 July 2023). "A developer's guide to prompt engineering and LLMs". The GitHub Blog. Prompt engineering is the art of communicating with a generative AI model.
  3. ^ Radford, Alec; Wu, Jeffrey; Child, Rewon; Luan, David; Amodei, Dario; Sutskever, Ilya (2019). "Language Models are Unsupervised Multitask Learners" (PDF). OpenAI. We demonstrate language models can perform down-stream tasks in a zero-shot setting – without any parameter or architecture modification
  4. ^ "Introducing ChatGPT". OpenAI Blog. 2022-11-30. Retrieved 2023-08-16. what is the fermat's little theorem
  5. ^ a b Robinson, Reid (August 3, 2023). "How to write an effective GPT-3 or GPT-4 prompt". Zapier. Retrieved 2023-08-14. "Basic prompt: 'Write a poem about leaves falling.' Better prompt: 'Write a poem in the style of Edgar Allan Poe about leaves falling.'
  6. ^ Gouws-Stewart, Natasha (June 16, 2023). "The ultimate guide to prompt engineering your GPT-3.5-Turbo model". masterofcode.com.
  7. ^ Greenberg, J., Laura (31 May 2023). "How to Prime and Prompt ChatGPT for More Reliable Contract Drafting Support". contractnerds.com. Retrieved 24 July 2023.
  8. ^ "GPT Best Practices". OpenAI. Retrieved 2023-08-16.
  9. ^ Garg, Shivam; Tsipras, Dimitris; Liang, Percy; Valiant, Gregory (2022). "What Can Transformers Learn In-Context? A Case Study of Simple Function Classes". arXiv:2208.01066 [cs.CL].
  10. ^ Brown, Tom; Mann, Benjamin; Ryder, Nick; Subbiah, Melanie; Kaplan, Jared D.; Dhariwal, Prafulla; Neelakantan, Arvind (2020). "Language models are few-shot learners". Advances in Neural Information Processing Systems. 33: 1877–1901. arXiv:2005.14165.
  11. ^ Heaven, Will Douglas (April 6, 2022). "This horse-riding astronaut is a milestone on AI's long road towards understanding". MIT Technology Review. Retrieved 2023-08-14.
  12. ^ Wiggers, Kyle (2023-06-12). "Meta open sources an AI-powered music generator". TechCrunch. Retrieved 2023-08-15. Next, I gave a more complicated prompt to attempt to throw MusicGen for a loop: "Lo-fi slow BPM electro chill with organic samples."
  13. ^ "How to Write AI Photoshoot Prompts: A Guide for Better Product Photos". claid.ai. June 12, 2023. Retrieved June 12, 2023.

From Wikipedia, the free encyclopedia · View on Wikipedia

Developed by Tubidy