跳到正文
DEV Community· technonotes-hacker·· 3 小時前AI 評分25

AI Agent 是甚麼?Aii Eye - 2

AI - What is AI Agent ? Aii Eye - 2

AI 導讀

文章以 Claude、ChatGPT 和 Gemini 為例,介紹提示詞工程中控制模型回應的不同方法。

正文

technonotes-hacker

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 ?

來源:DEV Community · dev.to