Prompt Engineering

In office work, chat-based AIs are the dominant AI tools at the moment. With these chat tools, a user asks questions or gives tasks to the AI, which responds based on its learning and understanding of the question. The question or task given to the chat AI, known as the input, is called a prompt and making the prompt understandable to the AI is referred to as prompt engineering.

Prompting becomes easier when one understands how the answer is generated. First, the model tries to understand the meaning of the prompt. Then, it generates a sequence of words when a natural language response is expected. Both the understanding of the prompt and the generation of the answer are based on statistical information, such as the most probable answer. Thus, an answer is never inherently clever or dumb; it is merely the most probable based on the model’s learning and the information one provides in the prompt. With a different prompt, this probable answer changes and prompt engineering is the method used to influence this probability distribution so that the required answer is reached.

Using the right prompts can also be achieved by creating an organization-specific prompt library.

Here is ChatGPT’s response to the following prompt, please note the word ‘likely’ in the answer’s summary.

Prompt: Hello. Please give main principles of GPT prompting. Keep answer short. Provide examples.

ChatGPT:

GPT prompting involves crafting concise, clear instructions or questions to guide the AI model’s responses. Here are the main principles with examples:

Clarity and Specificity: Be clear and specific about what you’re asking. Vague prompts lead to unpredictable results.

Example:
Vague: “Tell me about space.”
Specific: “Provide a summary of the key milestones in human space exploration from 1960 to 2000.”

Contextual Information: Include relevant context that helps the model understand the prompt’s background or the desired detail level.

Example:
Without context: “Explain quantum mechanics.”
With context: “Explain quantum mechanics to a high school student focusing on its principles and real-world applications.”

Intent Indication: Clearly state the intent of your prompt, such as whether you’re seeking information, generating creative content, or solving a problem.

Example:
Informational: “What are the health benefits of regular exercise?”
Creative: “Write a short story about a detective solving a mystery in a futuristic city.”
Problem-solving: “How can I improve the battery life of my Android phone?”

Prompt Length: While being specific, keep the prompt concise to avoid overwhelming the model with unnecessary information.

Example:
Long and detailed: “Given that I’ve recently started running and I’m interested in improving my endurance and speed, and considering I run three times a week, what kind of diet should I follow to enhance my performance?”
Concise: “What diet should a beginner runner follow to improve endurance and speed?”

Use of Examples: When appropriate, providing examples within your prompt can guide the model towards the desired output format or content style.

Example:
Without examples: “Generate ideas for a birthday party.”
With examples: “Generate three unique themes for a child’s birthday party, such as a pirate adventure, space exploration, and jungle safari, including activities for each theme.”

By applying these principles, you can create prompts that are more likely to produce the desired outcome from the GPT model.