Introduction to Prompt Engineering
A foundational guide for NEO LEAGUE: Prompt the Future — empowering students to master the art of prompting and unlock AI’s full creative potential.
What is a prompt
A prompt is a natural language input that instructs a generative AI on the task at hand. These AI models can create a variety of content like stories, conversations, videos, and more. The quality of the output depends on the prompt’s clarity and context, as AI models need accurate details to produce meaningful and precise responses.
Prompt content types
A prompt can include one or more of the following elements:
Input
The input is the core part of a prompt. It tells the model what task to perform or what question to answer. Inputs come in different forms:
Question input
A question input asks the model for an answer, usually in the form of a direct question.
Prompt Example:
Response:
Task Input
A task input asks the model to perform a specific action—like generating ideas, making a list, writing a summary, or offering suggestions.
Prompt Example:
Response:
Entity Input
An entity input is when the prompt gives the model a specific piece of content to act on—like summarizing a paragraph, classifying a sentence, or translating a passage. It’s often paired with clear instructions on what to do with that content.
Prompt Example:
Response:
Completion Input
Prompt Example:
Response:
Context
The context section gives the model helpful background or specific instructions that shape how it responds. You can use context to:
- Direct the model’s behavior.
- Supply relevant information it should refer to.
- Limit the model’s answers to specific data or rules.
Use context when you want to guide the model more clearly or restrict it to the facts you’ve provided.
Prompt Example:
Response:
In this case, the context is the list of marble colors and quantities, and the model uses that information to answer accurately.
Examples
Examples are pairs of inputs and expected outputs you include in your prompt to show the model what kind of response you’re looking for. This technique is especially useful when you want the output to follow a certain format or logic.
Prompt Example:
Response:
By including a few classification examples before the final input, you’re teaching the model how to respond.
References
- Some sections in this guide are paraphrased or inspired by Google’s Gemini API documentation on prompting.
Was this page helpful?