🚀
Introduction
Prompt Examples
Article Header Backdrop
Engineering

Examples of Prompts 📝

Explore various real-world examples of how to use prompts for tasks like summarization, extraction, classification, and code generation.

Mar 20268 min read
🌍
References & Disclaimer

This content is adapted from Prompting Guide: Examples of Prompts. It has been curated and organized for educational purposes on this portfolio. No copyright infringement is intended.

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

Antibiotics are a type of medication used to treat bacterial infections... [Long Paragraph] ... 
 
Explain the above in one sentence:

Output

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

[Research Paper Paragraph] ... Mention the large language model based product mentioned in the paragraph above:

Output

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

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

Mice.

4. Text Classification

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

🏷️

Prompt

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

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:

"""
Table departments, columns = [DepartmentId, DepartmentName]
Table students, columns = [DepartmentId, StudentId, StudentName]
 
Create a MySQL query for all students in the Computer Science Department
"""

Output:

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.

© 2026 Driptanil Datta. All rights reserved.

Software Developer & Engineer

Disclaimer:The content provided on this blog is for educational and informational purposes only. While I strive for accuracy, all information is provided "as is" without any warranties of completeness, reliability, or accuracy. Any action you take upon the information found on this website is strictly at your own risk.

Copyright & IP:Certain technical content, interview questions, and datasets are curated from external educational sources to provide a centralized learning resource. Respect for original authorship is maintained; no copyright infringement is intended. All trademarks, logos, and brand names are the property of their respective owners.

System Operational

Built with Love ❤️ | Last updated: Mar 16 2026