# Zero Shot and Few Shot Prompting

<mark style="color:red;">**Zero-shot prompting**</mark> <mark style="color:red;"></mark><mark style="color:red;">หมายถึงการให้คำสั่ง (prompt)</mark> <mark style="color:red;"></mark><mark style="color:red;">**โดยไม่มีตัวอย่างหรือการสาธิต**</mark> <mark style="color:red;"></mark><mark style="color:red;">ภายในคำสั่งนั้น โมเดลจะต้องทำงานหรือให้คำตอบตามคำสั่งที่ได้รับโดยไม่มีตัวอย่างเพิ่มเติมเพื่อช่วยนำทาง</mark>

> *"จำแนกข้อความเป็นกลาง (neutral), เชิงลบ (negative) หรือเชิงบวก (positive)"*\
> **ข้อความ:** *"ฉันคิดว่าการไปเที่ยวก็โอเคนะ"*\
> **ผลลัพธ์ที่ได้:** ???

**Few-shot Prompting** หมายถึง **การให้คำสั่ง (prompt) พร้อมตัวอย่างบางส่วน** เพื่อช่วยให้โมเดลเข้าใจบริบทและดำเนินการตามคำสั่งได้แม่นยำขึ้น

ต่างจาก **Zero-shot Prompting** ที่ไม่มีตัวอย่างเลย **Few-shot Prompting** จะให้ตัวอย่าง (demonstrations) ก่อนคำถามหรือคำสั่งจริง ซึ่งช่วยให้โมเดลเข้าใจรูปแบบของคำตอบที่ต้องการ

> ตัวอย่าง: ข้อความ: "ฉันมีวันที่ยอดเยี่ยมมาก!" → อารมณ์: บวก\
> ข้อความ: "ฉันรู้สึกแย่มากวันนี้" → อารมณ์: ลบ\
> ข้อความ: "มันเป็นวันธรรมดา ไม่มีอะไรพิเศษ" → อารมณ์: กลาง
>
> ตอนนี้วิเคราะห์อารมณ์ของข้อความต่อไปนี้:\
> ข้อความ: "ฉันตื่นเต้นกับการเดินทางสุดสัปดาห์นี้!"\
> อารมณ์: ???

{% hint style="success" %}
💡 **ข้อดีของ Few-shot Prompting:**\
✔ ช่วยให้โมเดลเข้าใจงานได้ดีขึ้น\
✔ ปรับปรุงความแม่นยำ โดยเฉพาะกับงานที่ซับซ้อน\
✔ ลดโอกาสเกิดข้อผิดพลาดจากการตีความผิดของโมเดล
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tlic.cmu.ac.th/cmu-matthew-ai/prompt/techniques/zero-shot-and-few-shot-prompting.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
