System prompts and prompting types

Abhijit GadhaveAbhijit Gadhave
3 min read

What is System Prompting?

A system prompt is basically a set of instructions you give to a large language model (LLM) at the very start of a conversation. It sets the “rules” for how the AI should behave and respond. In simple terms — it makes the AI stick to a certain personality, tone, or knowledge scope.

Think of it like a code reviewer giving developers strict guidelines before code goes to production — those guidelines shape the final output.

In tools like ChatGPT, Grok, or Copilot, the system role message is where you put these instructions.

Example:

  • System Prompt: You are a JavaScript-only developer. You know everything about JavaScript but nothing else.

  • User Prompt: "Explain compound interest"

  • Result: The AI won’t be able to answer because it’s “told” it doesn’t know anything outside JavaScript.

  • But if you ask "Explain closures in JavaScript" — it will answer in depth.


Why Are System Prompts Important?

  1. Control personality & tone – Decide whether the AI sounds formal, casual, friendly, etc.

  2. Guide reasoning – You can make the model think step-by-step before answering.

  3. Restrict output – Prevent unwanted responses or formats, keeping the AI focused.

  4. Improve accuracy – Especially when paired with examples.


Types of Prompting

1. Zero-shot Prompting

  • Definition: Asking the model to do a task without giving any example.

  • Use case: When you want the model to rely only on its pre-trained knowledge.

  • Example:

    • Prompt: Translate “Good morning” into Hindi

    • Output: Suprabhat


2. Few-shot Prompting

  • Definition: Giving the model a few examples before asking it to do the task.

  • Why it works: Helps the AI understand the context, style, and format.

  • Example:

      English: “Good morning” → Hindi: “Suprabhat”
      English: “Good night” → Hindi: “Shubh Ratri”
      English: “See you later” → Hindi: ?
    
    • Output: Milte hain

3. Chain-of-Thought Prompting

  • Definition: Asking the model to explain its reasoning step-by-step before giving the answer.

  • Benefit: Improves accuracy for complex reasoning tasks.

  • Example:

    • Prompt: Solve 2×4 + 1

    • Steps:

      1. Apply BODMAS → Multiply first: 2×4 = 8

      2. Add: 8 + 1 = 9

      3. Final Answer: 9


4. Role-Based Prompting

  • Definition: Assigning the AI a role/persona to shape its answers.

  • Example:
    "You are a friendly math teacher. Explain Pythagoras’ theorem to a 10-year-old."


5. Instruction + Context Prompting

  • Definition: Mixing clear instructions with relevant background context.

  • Example:

    • Context: "We are building a weather app for kids aged 8–12."

    • Instruction: "Explain today’s weather in simple, fun language."


Summary

At its core, prompting is just us trying to talk to AI in a way it understands. Zero-shot, few-shot, system prompts — they’re all tools to help the AI “get” what we mean. But beyond the technical stuff, prompting is about connection. It’s about taking what’s in our head and shaping it so the AI can bring it to life. And when you get it right, it’s not just code or commands… it feels like magic.

0
Subscribe to my newsletter

Read articles from Abhijit Gadhave directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Abhijit Gadhave
Abhijit Gadhave

Hello, My Name is Abhijit. I'm 2024 CS graduate student currently working as an Associate Software Engineer. My expertise spans across multiple technologies and platforms, allowing me to work seamlessly on end-to-end development projects. I love writing blogs about technology and enjoy exploring different areas of the tech world. After learning new things, I share my knowledge and experiences through my blogs. When I am not programmer, my free time is spent on playing a cricket. I am a huge RCB fan and therefore in me, there is a lot of patience😉️ and I love to discuss cricket tactics.