0Pricing
Prompt Engineering & LLM Optimization for Developers · บทเรียน

ระบบป้อนกลับโดยมีมนุษย์ร่วมในกระบวนการ

ออกแบบและนำระบบที่ผสานความคิดเห็นจากมนุษย์มาใช้ เพื่อปรับปรุงประสิทธิภาพของ LLM อย่างต่อเนื่องและแก้ไขข้อผิดพลาด

ระบบป้อนกลับโดยมีมนุษย์ร่วมในกระบวนการ เป็นบทเรียน Prompt Engineering & LLM Optimization for Developers ฟรีบน CoddyKit นี่คือบทเรียนที่ 2 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน Prompt Engineering & LLM Optimization for Developers และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส Prompt Engineering & LLM Optimization for Developers มีบทเรียนทั้งหมด 4 บทเรียน

บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ

What is Human-in-the-Loop?

When working with Large Language Models (LLMs), sometimes their outputs aren't quite right. This is where Human-in-the-Loop (HITL) systems come in.

HITL means humans actively review, correct, or provide feedback on an LLM's output. This feedback then helps the model learn and improve over time, making it smarter and more reliable.

Why Humans Help LLMs

Even powerful LLMs have limitations. They can:

  • Hallucinate: Make up facts.
  • Be biased: Reflect biases from their training data.
  • Lack up-to-date info: Not know about recent events.
  • Misunderstand complex requests: Struggle with nuanced instructions.

Human oversight helps catch and fix these issues, ensuring higher quality and safer outputs.

How HITL Systems Work

A typical HITL system involves a few key parts:

  1. LLM Generation: The model creates an output.
  2. Human Review: A person evaluates the output.
  3. Feedback Collection: The human's judgment is captured.
  4. Model Improvement: This feedback is used to refine the LLM, either by adjusting prompts or fine-tuning the model itself.

It's a continuous cycle of creation, evaluation, and learning.

Two Ways to Give Feedback

Human feedback can be broadly categorized into two types:

  • Explicit Feedback: Direct ratings or corrections from users or annotators. Think "thumbs up/down" or editing a generated text.
  • Implicit Feedback: Inferred from user behavior without direct input. For example, how long a user spends on a response or if they click on certain links.

Both types are valuable for different reasons!

Getting Direct Feedback

Explicit feedback is clear and intentional. Common ways to collect it include:

  • Thumbs Up/Down: Simple binary feedback on response quality.
  • Star Ratings: A more granular scale (e.g., 1-5 stars).
  • Direct Edits: Users correcting or rewriting parts of the LLM's output.
  • Annotator Labels: Expert human annotators tagging specific issues like factual errors or toxicity.

This data directly tells you what worked and what didn't.

Learning from User Behavior

Implicit feedback is less direct but still powerful. It's about observing how users interact with LLM outputs:

  • Session Duration: Users spending more time on a response might indicate engagement.
  • Click-Through Rates: If an LLM suggests links, clicks show relevance.
  • Search Refinements: If a user immediately rephrases their query, the initial response might have been poor.
  • Copying Text: Users copying output might find it useful.

Analyzing these behaviors can reveal subtle preferences and issues.

Capturing Feedback in Code

Let's imagine a basic way to capture explicit feedback (like a "thumbs up" or "thumbs down") after an LLM generates a response. This simple Python code shows how you might structure the collection of feedback.

It doesn't call an LLM, but focuses on the feedback part.

def collect_feedback(llm_output: str, user_rating: str):
    """
    Simulates collecting feedback for an LLM output.
    In a real system, this would store to a database.
    """
    feedback_data = {
        "output": llm_output,
        "rating": user_rating, # e.g., "good", "bad", "neutral"
        "timestamp": "2023-10-27T10:30:00Z" # For simplicity
    }
    print(f"Feedback recorded: {feedback_data}")
    # In a real app, you'd save this to a database or log file.

if __name__ == "__main__":
    generated_text = "The capital of France is Paris."
    print(f"LLM output: '{generated_text}'")

    # Simulate user giving feedback
    user_choice = input("Was this output good or bad? (good/bad): ")
    collect_feedback(generated_text, user_choice)

    generated_text_2 = "The sun revolves around the Earth."
    print(f"\nLLM output: '{generated_text_2}'")
    user_choice_2 = input("Was this output good or bad? (good/bad): ")
    collect_feedback(generated_text_2, user_choice_2)

Turning Feedback into Growth

Once feedback is collected, it's not just stored; it's used to make the LLM better:

  • Prompt Refinement: If many users rate an output as "bad" for a specific prompt, you can adjust the prompt to be clearer or more specific.
  • Data for Fine-tuning: High-quality human-corrected data can be used to fine-tune the LLM, teaching it directly from good examples.
  • Reinforcement Learning from Human Feedback (RLHF): Feedback can be used to train a reward model, which then guides the LLM to generate preferred outputs.

This closes the loop and improves performance.

Hurdles in Human-in-the-Loop

While HITL is powerful, it comes with challenges:

  • Scalability: Manually reviewing every LLM output for a large application is impossible.
  • Cost: Human annotators or user feedback mechanisms can be expensive to build and maintain.
  • Bias in Feedback: Human reviewers can also introduce their own biases, which might then be reinforced in the model.
  • Subjectivity: What one person considers a "good" response, another might not.

Careful design is needed to overcome these.

Understanding HITL

You've learned about Human-in-the-Loop systems. Let's test your understanding!

Recap: HITL for Better LLMs

In this lesson, we explored Human-in-the-Loop (HITL) systems. We learned that HITL integrates human judgment to continuously improve LLM performance by addressing limitations like hallucinations and biases.

You now understand the components of a HITL system, the difference between explicit and implicit feedback, and how this feedback drives model improvement. You also saw a simple code example for collecting feedback and are aware of the challenges involved.

Keep exploring how to build robust LLM applications!

คำถามที่พบบ่อย

บทเรียน “ระบบป้อนกลับโดยมีมนุษย์ร่วมในกระบวนการ” ฟรีหรือไม่

ใช่ — ข้อความเต็มของ “ระบบป้อนกลับโดยมีมนุษย์ร่วมในกระบวนการ” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส Prompt Engineering & LLM Optimization for Developers ให้อัปเกรดเป็น CoddyKit PRO คอร์ส Prompt Engineering & LLM Optimization for Developers มีบทเรียนทั้งหมด 4 บทเรียน

คุณจะเรียนรู้อะไรในบทเรียน “ระบบป้อนกลับโดยมีมนุษย์ร่วมในกระบวนการ”

ออกแบบและนำระบบที่ผสานความคิดเห็นจากมนุษย์มาใช้ เพื่อปรับปรุงประสิทธิภาพของ LLM อย่างต่อเนื่องและแก้ไขข้อผิดพลาด คุณปฏิบัติ Prompt Engineering & LLM Optimization for Developers ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน

คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน Prompt Engineering & LLM Optimization for Developers หรือไม่

ไม่จำเป็นต้องมีประสบการณ์มาก่อน Prompt Engineering & LLM Optimization for Developers บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 2 จากทั้งหมด 4 บทเรียน

บทเรียน “ระบบป้อนกลับโดยมีมนุษย์ร่วมในกระบวนการ” ใช้เวลานานแค่ไหน

บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย

ฉันเขียนและรันโค้ดในบทเรียน Prompt Engineering & LLM Optimization for Developers นี้ได้ไหม

ได้ บทเรียน Prompt Engineering & LLM Optimization for Developers ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ

บทเรียนทั้งหมดในหลักสูตรนี้

  1. ตัวชี้วัดและเกณฑ์มาตรฐานการประเมิน LLM
  2. ระบบป้อนกลับโดยมีมนุษย์ร่วมในกระบวนการ
  3. การแทรกพรอมต์และแนวทางปฏิบัติด้านความปลอดภัย
  4. การตรวจจับและลดการหลอนของโมเดล
← กลับไปที่ Prompt Engineering & LLM Optimization for Developers