วันพฤหัสบดีที่ 4 มิถุนายน พ.ศ. 2569

Good LLM Prompt Structure

New style (ตามคู่มือของ OpenAI): เป็นใบมอบหมายงานที่ประกอบด้วย 5 หัวข้อดังนี้

1.บอกหน้าตางานที่เสร็จ ไม่ใช่ขั้นตอนซึ่งควรอธิบายเฉพาะ้นตอนที่สำคัญจริงๆ เช่น ให้บอกไปเลยว่า ต้องการรายงาน 1 หน้าที่บอกได้ว่าสาขาไหนควรเพิ่มstockเดือนหน้า

2.ให้บริบทเฉพาะที่ต้องการเปลี่ยนคำตอบ (context engineering) เช่น คนเตรียมfolderที่มีราคาสินค้า ตัวอย่างโพสต์ที่ยอดขายดี และโทนภาษาของแบรนด์ แล้วสั่ง AI ให้ทำโพสต์สำหรับสัปดาห์นี้

3.ตั้งกฏเหล็ก 1-2 ข้อแทนการควบคุมทุกขั้นตอน เช่น ห้ามแก้ตัวเลขงบที่อนุมัติแล้ว ห้ามลบไฟล์ให้ย้ายได้อย่างเดียว ห้ามเกินงบที่ระบุ ประเภทไฟล์รายงานที่ต้องการ

4.สั่ง AI เสนอแผนให้เราอนุมัติก่อนลงมือ โดยสั่งว่า ก่อนลงมือให้สรุปแผนเป็นข้อๆแล้วรอผมยืนยัน 

5.สั่งให้ตรวจงานตัวเองก่อนส่ง โดยสั่งให้กลับไปเทียบผลงานกับข้อมูลที่ป้อนให้ เช่น ตรวจทุกตัวเลขกับไฟล์ต้นฉบับแล้วรายงานจุดที่ไม่ตรง คนคอยตรวจเฉพาะจุดเหล่านั้นพอ

Old style:

"RCTCFEC"

1. Role / Persona

Establish who the AI should act as to give it the right mindset and tone. 
  • Example: "You are an expert digital marketer..."
2. Context
Provide background information, the target audience, and the current situation. 
  • Example: "...launching a new SaaS tool aimed at freelance designers. My audience struggles with client interruptions." 
3. Task
Clearly state exactly what you want the AI to do. 
  • Example: "Write a 400-word LinkedIn post promoting the launch."
4. Constraints
Set the boundaries, rules, or things the AI must avoid to keep it on track. 
  • Example: "Keep the tone encouraging, avoid overly technical jargon, and don't make the reader feel guilty."
5. Format & Output Requirements
Specify how the final answer should look or be organized (e.g., word count, bullet points, or structure). 
  • Example: "Structure it with a catchy hook in the first paragraph, three main bullet points for benefits, and a clear call-to-action."
6. Examples (Optional but highly recommended)
Provide one or two examples of input and ideal output so the AI can mimic the exact style you want.
7.Cross-source synthesis (กรณีใช้ RAG เช่น upload file เพิ่มเข้าไปให้วิเคราะห์)
Compare your results with my uploaded document to ensure that ...(our strength aligns with market's demand)