Skip to content

Examples of Prompts

Updated
17 Sept 2026
2 min read
2 sections
Page 7 of 25
Prompt Engineering Guide
Adapted from Prompting Guide: Examples of Prompts — https://www.promptingguide.ai/introduction/examples

Learning through Examples

The best way to master prompt engineering is by exploring how different prompts lead to different model behaviors. This section provides concrete examples of common tasks and how to structure your prompts for them.

1. Text Summarization

LLMs are exceptionally good at distilling long paragraphs into concise summaries.

Prompt
md
Antibiotics are a type of medication used to treat bacterial infections... [Long Paragraph] ...
Explain the above in one sentence:
Output
md
Antibiotics are medications used to treat bacterial infections by either killing the bacteria or stopping them from reproducing, but they are not effective against viruses and overuse can lead to antibiotic resistance.

2. Information Extraction

You can use prompts to pull specific data points out of unstructured text.

Prompt
md
[Research Paper Paragraph] ... Mention the large language model based product mentioned in the paragraph above:
Output
md
The large language model based product mentioned in the paragraph above is ChatGPT.

3. Question Answering

By providing context and specific instructions, you can improve the factual accuracy of the model's responses.

Prompt
md
Answer the question based on the context below. Keep the answer short and concise. Respond "Unsure about answer" if not sure.
Context: [Technical details about Teplizumab]
Question: What was OKT3 originally sourced from?
Answer:
Output
md
Mice.

4. Text Classification

You can guide the model to use specific labels and formats by providing examples (few-shot prompting).

Prompt
md
Classify the text into neutral, negative or positive.
Text: I think the vacation is okay.
Sentiment: neutral
Text: I think the food was okay.
Sentiment:
Output
md
neutral

5. Conversation & Role Prompting

One of the most powerful techniques is telling the LLM how to behave by assigning it a role.

RoleInstructionResult
Technical"You are an AI research assistant. Your tone is technical and scientific."Responses will be precise, data-heavy, and formal.
Simple"You are a teacher. Explain concepts as if to a primary school student."Responses will use simple analogies and basic vocabulary.

6. Code Generation

LLMs can generate everything from simple scripts to complex database queries.

MySQL Query Generation:

md
"""
Table departments, columns = [DepartmentId, DepartmentName]
Table students, columns = [DepartmentId, StudentId, StudentName]

Create a MySQL query for all students in the Computer Science Department
"""

Output:

sql
SELECT StudentId, StudentName 
FROM students 
WHERE DepartmentId IN (
    SELECT DepartmentId 
    FROM departments 
    WHERE DepartmentName = 'Computer Science'
);

Conclusion

As you've seen, LLMs can perform a vast range of tasks simply through clever instruction. In the next guide, we will dive into Prompting Techniques like Zero-Shot and Few-Shot prompting to further enhance these capabilities.