C.W.K.
Stream
Lesson 02 of 09 · published

LLM 에서 evaluation 이 뜻하는 것

~22 min · evals, definitions, fundamentals

Level 0Guesser
0 XP0/55 lessons0/10 achievements
0/150 XP to next level150 XP to go0% complete

Eval 은 testing 이 아니야 — benchmark 도 아니야

'eval' 한 단어 아래 세 가지 활동이 겹쳐 있어서 사람들이 서로 딴 얘기 하게 돼. 셋을 헷갈리면 매번 잘못된 도구를 고르게 돼.

  • Testing코드가 시킨 대로 동작하는가? 에 답해. input/output 이 deterministic. assert add(2, 3) == 5 는 pass 아니면 fail.
  • Benchmarking이 모델이 공개 dataset 에서 다른 모델 대비 어떻게 ranking 되는가? 에 답해. 모델 선택엔 유용, product quality 엔 무관.
  • Evaluation내 system 이 내 user 의 input 같은 input 에 대해 좋은 output 을 내는가? 에 답해. output 은 non-deterministic, 'good' 은 contextual, user 는 계속 골대를 옮겨.

LLM eval 이 실제로 측정하는 것

eval 은 네 가지 재료를 측정으로 합쳐:

  1. Test dataset — 실제 workload 닮은 input + 선택적 reference 답.
  2. System under test — prompt, model, retrieval pipeline, tool loop, multi-agent system, 또는 그 조합.
  3. Grader — output 이 acceptable 한지 결정하는 함수. exact-match, regex, embedding similarity, LLM judge, Python validator, 인간 rater 다 가능.
  4. Reporting layer — 숫자를 의사결정으로 바꾸는 dashboard / CI gate / notebook.
원칙: Eval 은 가장 약한 재료만큼만 honest 해. 완벽한 grader + junk dataset = 아무것도 측정 안 함. 완벽한 dataset + 엉성한 grader = 엉성한 grader 측정.

Online vs offline eval

Offline eval 은 deploy 전 고정된 dataset 위에서 돌아. CI/CD 라고 생각하면 돼. 명백한 regression 막아줘. Online eval 은 deploy 후 실제 traffic — production log sampling, A/B 비교, 사용자 feedback, telemetry — 위에서 돌아. offline dataset 이 대표하지 못하는 걸 잡아. 둘 다 필요해. offline 만 하는 팀은 drift 에 눈이 먼 거고, online 만 하는 팀은 user 가 불평할 때까지 regression 에 눈이 먼 거야.

Code

eval 의 해부 — 의사 코드·python
# The four ingredients in their simplest form.
def run_eval(system, dataset, grader):
    results = []
    for case in dataset:
        output = system(case["input"])
        score, reason = grader(output, case.get("reference"))
        results.append({"input": case["input"], "output": output, "score": score, "reason": reason})
    return summarize(results)


def summarize(results):
    pass_rate = sum(r["score"] >= 1.0 for r in results) / len(results)
    avg = sum(r["score"] for r in results) / len(results)
    return {"pass_rate": pass_rate, "avg_score": avg, "n": len(results)}
Grader 셋, 측정 철학 셋·python
def exact_match_grader(output, reference):
    score = 1.0 if output.strip() == reference.strip() else 0.0
    return score, f"exact match: {score==1.0}"


def contains_grader(output, reference):
    score = 1.0 if reference.lower() in output.lower() else 0.0
    return score, f"reference appears in output: {score==1.0}"


def llm_judge_grader(output, reference, judge_model):
    prompt = f"Output: {output}\nReference: {reference}\nIs the output factually consistent with the reference? Reply 'yes' or 'no' followed by one sentence."
    verdict = judge_model.complete(prompt).lower()
    score = 1.0 if verdict.startswith("yes") else 0.0
    return score, verdict

External links

Exercise

지난 한 달 동안 팀에서 'eval' 이라고 부른 것 세 개 적어. 각각 Testing / Benchmarking / 진짜 Evaluation 으로 분류하고, 그 사람이 실제로 원했던 게 뭔지 한 문장씩 써.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.