Attention mechanisms

แนวคิดของ Large Language Models (LLMs)

Vidhi Chugh

AI strategist and ethicist

Attention mechanisms

  • ทำความเข้าใจโครงสร้างที่ซับซ้อน
  • มุ่งความสนใจไปที่คำสำคัญ

 

  • อุปมาการอ่านหนังสือ:
    • เบาะแสในนิยายสืบสวน
    • จดจ่อกับเนื้อหาที่เกี่ยวข้อง
    • เน้นข้อมูลนำเข้าที่สำคัญ

หนังสือเล่มหนึ่งที่เปิดอยู่พร้อมแว่นขยาย

แนวคิดของ Large Language Models (LLMs)

Self-attention และ Multi-head attention

Self-attention

  • ประเมินความสำคัญของแต่ละคำ

 

  • จับความสัมพันธ์ระยะไกลในข้อความ

Multi-head attention

  • ต่อยอดจาก self-attention

 

  • แบ่งข้อมูลนำเข้าออกเป็นหลาย head โดยแต่ละ head จดจ่อกับแง่มุมที่ต่างกัน
แนวคิดของ Large Language Models (LLMs)

Attention ในงานปาร์ตี้

  • Attention: Self และ Multi-head

 

  • ตัวอย่าง:
    • การสนทนากลุ่มในงานปาร์ตี้
    • เลือกฟังผู้พูดที่เกี่ยวข้อง
    • กรองเสียงรบกวน
    • จดจ่อกับประเด็นสำคัญ

 

ผู้คนนั่งสนทนาเป็นกลุ่ม

1 Freepik
แนวคิดของ Large Language Models (LLMs)

ปาร์ตี้ดำเนินต่อ

Self-attention

  • จดจ่อกับคำพูดของแต่ละคน
  • ประเมินและเปรียบเทียบความเกี่ยวข้อง
  • ให้น้ำหนักกับสิ่งที่แต่ละคนพูด
  • รวมกันเพื่อความเข้าใจที่ครบถ้วน

Multi-head attention

  • แบ่งความสนใจออกเป็น "หลาย" ช่องทาง
  • จดจ่อกับแง่มุมต่าง ๆ ของการสนทนา
  • อารมณ์ผู้พูด หัวข้อหลัก และหัวข้อย่อยที่เกี่ยวข้อง
  • ประมวลผลแต่ละแง่มุมแล้วรวมเข้าด้วยกัน
แนวคิดของ Large Language Models (LLMs)

ข้อดีของ Multi-head attention

  • "The boy went to the store to buy some groceries, and he found a discount on his favorite cereal."

 

  • Attention: "boy," "store," "groceries," และ "discount"
  • Self-attention: "boy" และ "he" -> บุคคลเดียวกัน
  • Multi-head attention: หลายช่องทาง
    • ตัวละคร ("boy")
    • การกระทำ ("went to the store," "found a discount")
    • สิ่งที่เกี่ยวข้อง ("groceries," "cereal")
แนวคิดของ Large Language Models (LLMs)

มาฝึกกันเถอะ!

แนวคิดของ Large Language Models (LLMs)

Preparing Video For Download...