Dev.to AI ๐Ÿค– Ai ๐Ÿ‘ 0 ๐Ÿ“– 2 min read

AI - What is AI Agent ? Aii Eye - 2

Prompt Engineering One more level of controlling a model is "Prompt Engineering". We will see 3 different Engines or Systems. Claude / ChatGPT / Gemini. Also we are going to use GROQ --> Its a service provider.

AI - What is AI Agent ? Aii Eye - 2

Prompt Engineering

  • One more level of controlling a model is "Prompt Engineering".
  • We will see 3 different Engines or Systems. Claude / ChatGPT / Gemini.
  • Also we are going to use GROQ --> Its a service provider.

Types

Zero Shot Prompting
One Shot Prompting
System Prompting
Role Prompting
Contextual Prompting
Self Consistency
Tree of Thoughts

Zero Shot Prompting

  • Only Query , No prompt.
  • Eg., Give me Summation of All even numbers from 0 to 50.

Claude:

Gemini:

ChatGPT:

  • Answer is same but the derived way is different for each entity.

Another way --> One Shot Prompting

Claude:

Gemini:

ChatGPT:

  • One example --> One Shot
  • One or example --> Few Shot ( multiple queries we can ask )

System Prompting

  • It mainly identifies the,
Model Role , Rules , Tone & Output format for the entire conversation.

  • Whatever YOU SAY ,IT WILL DO.

Claude:

Gemini:

ChatGPT:

  • Eg., In Audit or in Research Agent , etc we can use.

เฎ’เฎฐเฏ เฎจเฎฒเฏเฎฒ SYSTEM PROMPT เฎ‡เฎชเฏเฎชเฎŸเฎฟเฎคเฏเฎคเฎพเฎฉเฏ เฎ‡เฎฐเฏเฎ•เฏเฎ•เฎฃเฏเฎฎเฏ

1. Role / Identity --> who the model is ?
2. Context --> Product , audience , Background
3. Rules / Constraints --> what to do & what not to do ?
4. Output Format --> Length , structure
5. Fallback --> What to do when its unsure
6. Examples

Role Prompting

  • Most important word used is " Act as ... ".
  • Its like PERSONA.

What is the difference between System & Role Prompting

  • System Prompt --> Instruction given to entire machine , also its a FIRST INSTRUCTION.Also RULES should be given , How the model should respond and what all the boundary condition it as. ( เฎคเฏ†เฎฐเฎฟเฎฏเฎฒเฎฉเฏเฎฉเฎพ เฎคเฏ†เฎฐเฎฟเฎฏเฎฒเฎฉเฏเฎฉเฏ เฎšเฏŠเฎฒเฏเฎฒเฎฟเฎŸเฏ ) Eg., Give the output as JSON.
  • Role Prompting --> Inside each condition , we can have a role. You will have a persona.

Contextual Prompting

  • Prompt --> Idea given to the model.
  • Query --> User Question.
  • Eg., Tomorrow is a exam , prepare AI questions in such a way to pass the exam.

Claude:

Gemini:

ChatGPT:

Self Consistency

  • You are going do : Solve step by step : 5 Different ways.
  • Eg., เฎšเฏ†เฎฉเฏเฎฉเฏˆเฎฏเฎฟเฎฒเฏ เฎฎเฎดเฏˆ เฎตเฎฐเฏเฎฎเฎพ เฎตเฎฐเฎพเฎคเฎพ --> It may get different ways of answer , but it will give the most consistence answer as output.
  • Why 5 is taken ? Why not 4 ? I need to chose one particular answer , in EVEN numbers 2 will be unique and another 2 will be unique , if its 5 then any one VOTE will be more.
  • To make decisions you need ODD number of values.

Tree of Thoughts

  • Eg., I have a problem , try in 3 different ways.

AI Response

Notes

  • Zed Editor.
  • Setting the instruction to the machine --> System Prompting

TBD

  • claude opus and sonnet difference ?
  • Neon ?
  • Self - Consistency ?
๐Ÿ“ฐ Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes โ€” full credit and traffic to the original publisher.