You are on page 1of 3

1.

Read the following article and describe what you have learned about best practices
for prompt engineering.
Shieh, J. (2023). Best practices for prompt engineering with OpenAI API. Open AI.
https://help.openai.com/en/articles/6654000-best-practices-for-prompt-engineering-with-
openai-api

Per this article best practices to be used in prompt engineering are:


• Be detailed: We must ask very specific questions to make sure that the response given
satisfies the user's desire. We must be specific about the model and use the most
recent version of AI.
• Output format: The output format needs to be specified clearly in the instructions. We
can achieve a better outcome by questioning the AI and making sure the output it
generates meets the needs of the user.
• Zero-Shot/Few Shot: These two models serve as examples of how to engage with AI.
When utilizing Zero-Shot, the user asks questions and gives details, but the AI
receives no examples. When utilizing Few Shot, the user gives the AI examples of the
intended outcome as well as questions.
• Reduce imprecise descriptions: Short descriptions and a few sentences should be used
by the user to prevent the AI model from becoming confused.
• Say what to do: To get a better result it is better to tell the AI model what it should do
instead of telling what it can't do.
• Patterns: Information about the programs and features AI should use should be
supplied by the user. When requesting AI to code, the user must also specify the
language to be used.
• Parameters: We find that the most frequently used parameters to change the model
output are the model and temperature. The model's temperature indicates how
frequently a less likely token is produced. The higher the temperature, the more
random (and usually creative) the output.
2. Read the following resource from Open AI, work in teams to describe the tactics in your
own words, and present to the class.
OpenAI. (2023). Prompt engineering. https://platform.openai.com/docs/guides/prompt-
engineering

This article outlines six methods for utilizing AI models to produce better results:

1. Write clear instructions: The user must ensure all instructions are provided clearly,
including the format and skill level. This will enable the AI model to comprehend the
format that the user is asking for in detail. The length of the output, the coding format,
and the persona the AI model should employ are a few examples we can provide.

2. Provide reference text: By providing a reference text, users can instruct the model how to
respond. The user must give the model the text to refer to and provide instructions to
accomplish this. This approach will guarantee that the model concentrates on user
reference rather than using outside resources.

3. Split complex tasks into simpler subtasks: It is recommended that users break up complex
activities into more manageable subtasks before requesting the AI model to provide input
on complex systems. By doing this, the model will be able to clearly resolve the smaller
jobs and produce outcomes that are more accurate and contain less errors.

4. Give the model time to "think": Instead of rushing AI model to a conclusion, users should
let the AI model figure out a solution on its own. Foor example, rather than asking the AI
to solve an issue user may ask the model to validate the answer. Furthermore, the user
will verify the outcomes by probing the model with queries or inquiring whether any
details were overlooked in the offered answer.

5. Use external tools: If given as part of its input, external sources of information can be
utilized by a model. This can assist the model in producing responses that are more
current and well-informed. For example, if a user asks a question about a specific movie,
it may be useful to add high quality information about the movie (e.g. actors, director,
etc…)
6. Test changes systematically: It's critical to conduct continuous tests on AI models. This
will do a quality check to make sure the output is meeting the requirements and
producing accurate data.

You might also like