Posts

Day 5 Internship Study Material

Day 5 – Prompt Engineering

Info! Prompt Engineering is the skill of writing clear instructions for an AI model. Better prompts give better answers.
Table of Contents

What is Prompt Engineering?

Prompt Engineering is the skill of writing clear instructions for an AI model.

The instructions you give to an AI are called prompts.

Think of AI like a very smart assistant. If you give confusing instructions, you may get confusing results. If you give clear instructions, you usually get better results.

Simple Example

Weak Prompt


Tell me about dogs.

The AI may give a very general answer.

Better Prompt


Explain dogs to an 11-year-old student in 5 simple points.

The AI now knows:

  1. Who the audience is
  2. How much detail to give
  3. How to format the answer

Why Prompt Engineering is Important

Prompt Engineering helps us:

  1. Get better answers
  2. Save time
  3. Generate useful content
  4. Build AI applications
  5. Create chatbots and assistants
Success! It is one of the most important skills in modern AI.

Lecture 1 Topics

Role Prompting

Role Prompting means telling the AI who it should act like. This helps the AI understand the style and expertise needed.

Example 1


Act as a science teacher and explain gravity.

The AI will respond like a teacher.

Example 2


Act as a doctor and explain why exercise is important.

Example 3


Act as a chef and suggest a healthy breakfast.

Why Role Prompting Works

It gives AI a specific identity. This helps the AI:

  1. Choose the right tone
  2. Use appropriate knowledge
  3. Give more focused answers

Structured Prompting

Structured Prompting means organizing instructions clearly. Instead of asking randomly, we provide details.

Basic Structure


Role
Task
Audience
Output Format

Example


You are a teacher.

Explain the solar system.

Audience: 11-year-old students.

Format:
1. Simple language
2. Five points
3. One example

Comparison

Type Prompt
Unstructured Tell me about planets.
Structured You are a science teacher. Explain planets to a class 6 student. Use: Simple language, Five points, One example

The second prompt usually gives a better answer.

Lecture 2 Topics

Improving AI Responses

You can improve AI responses by giving better instructions.

Tips for Better Prompts

  1. Be Specific
    Bad: Write a story.
    Good: Write a 200-word story about a brave village boy who saves his farm.
  2. Define the Audience
    Bad: Explain AI.
    Good: Explain AI to an 11-year-old student using simple language.
  3. Specify Format
    Bad: Tell me about India.
    Good: Tell me about India in 5 bullet points.
  4. Give Examples
    Example: Translate English to Hindi. Example: Hello = Namaste. Now translate: Good Morning

Examples often improve results.

Temperature Basics

Temperature controls creativity in AI responses. Think of it as a creativity level.

Temperature Result Useful For
Low = 0.2 More accurate, More consistent, Less creative Coding, Mathematics, Facts
High = 1.0 More creative, More varied, Sometimes less predictable Stories, Poetry, Brainstorming

Easy Analogy

Imagine asking students to draw a tree.

Low temperature: Most students draw similar trees.

High temperature: Students draw many different and creative trees.

Token Basics

A token is a small piece of text processed by AI. Tokens can be words, parts of words, or punctuation.

Example

Sentence: I love Python. May be broken into several tokens.

Warning!
More tokens mean longer answers, more processing, and higher API usage cost. Many AI platforms charge based on tokens.

Real-Life Example

If an AI model allows 1000 tokens, the response length is limited to roughly that amount.

Simple Summary

Topic Meaning
Prompt Instruction given to AI
Prompt Engineering Writing better AI instructions
Role Prompting Giving AI a role
Structured Prompting Organizing instructions clearly
Temperature Controls creativity
Token Small unit of text used by AI

Daily Assignment

Assignment 1: Create 5 Different Prompts
  1. Explain cricket to a child.
  2. Act as a doctor and explain healthy eating.
  3. Write a short story about a farmer.
  4. Summarize a news article in 5 points.
  5. Create a study plan for exams.
Assignment 2: Compare Outputs

Choose one topic. Example:


Tell me about space.

    

Then improve it:


You are a science teacher.

Explain space to an 11-year-old student.

Use simple language and 5 bullet points.

    

Compare both outputs and write which one is better.

Assignment 3: Create a Chatbot Personality Prompt

Example:


You are StudyBot.

You are a friendly tutor for school students.

Rules:
- Use simple language.
- Be polite.
- Give examples.
- Encourage learning.

    

Try creating your own chatbot personality.

Homework

  1. What is a prompt?
  2. What is Prompt Engineering?
  3. What is Role Prompting?
  4. What is Structured Prompting?
  5. What does temperature control?
  6. What is a token?
  7. Why are good prompts important?

Post a Comment