prompt engineering
-
What is prompt engineering in computer science?
In computer science, prompt engineering is the process of designing inputs for generative artificial intelligence (AI) models to deliver useful, accurate, and relevant responses. These AI models, known as large language models (LLMs), can generate text, images, and other content based on the data they were trained on.
Natural language processing (NLP) models analyze how computers process language similarly to humans. Prompt engineering aims to extract the optimal output from the model. It is an iterative process that may require repeated prompting to secure the desired result.
2 Britannica SourcesCreated from Britannica articles using AI. AI can make mistakes, so verify using Britannica articles. -
Why are prompts important when working with AI language models?
Prompts are important in AI language models because they are the inputs that guide generative AI models like ChatGPT to produce relevant and accurate responses. These models respond in natural language to prompts, which can be questions, requests, or tasks.
Prompt engineering is an iterative process that may require refining prompts to get the desired result. Techniques such as direct prompting, example-based prompting, and chain-of-thought prompting can improve results. Optimizing prompts can improve results and save money by reducing the number of prompts needed.
1 Britannica SourceCreated from Britannica articles using AI. AI can make mistakes, so verify using Britannica articles. -
How does changing the wording of a prompt affect an AI's response?
The wording of a prompt significantly impacts an AI's response by guiding its focus and influencing the relevance, accuracy, and usefulness of the output. Prompt engineering involves designing inputs for generative AI models to get the best results.
Different techniques include direct prompting, example-based prompting, and chain-of-thought prompting. To improve results with prompt engineering, users may capitalize or repeat important words or phrases; exaggerate, such as by using hyperbole; or try various synonyms. The process may require repeated prompting to secure the desired result.
2 Britannica SourcesCreated from Britannica articles using AI. AI can make mistakes, so verify using Britannica articles. -
What strategies can be used to create effective prompts for AI?
Prompt engineering involves designing inputs for generative AI models to get useful, accurate, and relevant responses. Effective strategies include direct prompting, where the model receives instructions without examples. Assigning a role to the model can improve this technique.
Example-based prompting gives the model one or more examples to follow, which can be structured to produce patterned output. Chain-of-thought prompting provides examples that detail the steps to achieve an answer; adding "Let's think step-by-step" can improve accuracy.
To improve results, users may capitalize or repeat important words, use hyperbole, or try synonyms. Because models like Google Gemini can access current information, strategies may vary depending on the model.
2 Britannica SourcesCreated from Britannica articles using AI. AI can make mistakes, so verify using Britannica articles. -
How is prompt engineering useful in real-life applications?
Prompt engineering is useful in real-life applications because it optimizes the output from generative artificial intelligence (AI) models like ChatGPT and Google Gemini. It involves designing inputs that lead to useful, accurate, and relevant responses from these models.
Techniques such as direct prompting, example-based prompting, and chain-of-thought prompting can improve results. In practice, prompt engineering is an iterative process that may require repeated prompting to achieve the desired outcome. Industries use it in voice-operated GPS systems, customer service chatbots, and language translation programs. Businesses also apply it to understand and improve service to consumers by auto-completing search queries and monitoring social media.
2 Britannica SourcesCreated from Britannica articles using AI. AI can make mistakes, so verify using Britannica articles. -
What challenges do people face when designing prompts for advanced AI systems?
Prompt engineering involves challenges in designing inputs for generative AI models to get useful, accurate, and relevant responses. It's an iterative process that may need repeated prompting to get the desired result. Users may capitalize or repeat important words or phrases; exaggerate, such as by using hyperbole; or try various synonyms. Different strategies may be needed based on the model being used.
Some research has found that generative AI models can optimize their own prompts better than humans can, outperforming human-designed prompts by a significant margin.
1 Britannica SourceCreated from Britannica articles using AI. AI can make mistakes, so verify using Britannica articles.
prompt engineering, process of designing inputs for generative artificial intelligence (AI) models to deliver useful, accurate, and relevant responses.
Prompt engineering is used with generative AI models called large language models (LLMs), such as OpenAIâs ChatGPT and Google Gemini. Generative AI models are machine learning models that can generate text, images, and other content based on data they were trained on, and they can respond to prompts given to them in natural languageâhow a user naturally speaks or writesârather than in code. Models can return responses based on prompts, which are requests, questions, or tasks given by the user that can be as short as a single word. Users must often employ prompt engineering to optimize the output they receive from such models.
There are many techniques and types of prompt engineering, including these commonly used ones:
- Direct prompting, or zero-shot prompting, gives the model an instruction without providing examples. Users may improve upon this technique by assigning the model a âroleâ for it to emulate; for instance, a user looking to generate a new recipe idea may tell the model that it is an award-winning chef.
- Example-based prompting, which includes one-, few-, and multi-shot prompting, provides the model with one or more examples the user would like it to follow. This type of prompt can be structured so that the model outputs text that follows the same pattern as the one it has been given. For instance, the user may input the prompt âIce cream is a delicious dessert. An example of a sentence that uses âice creamâ is âIce cream tastes delicious in the summer.â A cheese puff is a crispy snack. An example of a sentence that uses âcheese puffâ is:â
- Chain-of-thought prompting gives the model examples that lay out the steps in which an answer was achieved. Zero-shot chain-of-thought prompting includes adding the instruction âLetâs think step-by-stepâ to a prompt in order to gain a more accurate answer. The combination of prompting techniques has the model include the intermediate steps that it followed in order to output its final response.
To improve results with prompt engineering, users may capitalize or repeat important words or phrases; exaggerate, such as by using hyperbole; or try various synonyms. Users may employ different strategies based on the model they are working with. For example, those creating prompts to improve Google Gemini must take into account that the model can acquire updated information from a Google search, while ChatGPT cannot.
Prompt engineering is an iterative process: it may require repeated prompting to secure the desired result. Well-engineered prompts can lead to improved results and may save money in the long run, as users may input fewer prompts when results show repeated improvement.
âCommand, we need you to plot a course through this turbulence and locate the source of the anomaly. Use all available data and your expertise to guide us through this challenging situation.â âprompt generated by an LLM to do grade-school math in a VMware study
While prompt engineering relies on the user to design prompts for the model, some research has shown that generative AI models can optimize their own prompts better than humans can. Google DeepMind researcher Chengrun Yang and colleagues found that prompts optimized by models âoutperform[ed] human designed promptsâŠby a significant margin, sometimes over 50%.â Similarly, researchers at the cloud computing company VMware found that common human prompting techniques, such as chain-of-thought, sometimes hurt the modelâs performance rather than improving it, while they found that prompts optimized by the model almost always performed better. Sometimes, however, model-optimized prompting leads to surprising results, such as when a model created a prompt using language that referred to the science-fiction TV series Star Trek.


" height="20" alt="HEW Logo">