검증

OpenAI API로 AI 시스템 개발하기

Francesca Donadoni

Curriculum Manager, DataCamp

검증

여러 화면에서 코드를 테스트하는 개발자

OpenAI API로 AI 시스템 개발하기

검증

 

모델 오류의 가능성:

  • 문맥 오해석
  • 훈련 데이터의 편향이 출력에 증폭
  • 오래된 정보 출력
  • 유해하거나 비윤리적인 콘텐츠 생성 유도
  • 민감한 정보의 비의도적 노출
OpenAI API로 AI 시스템 개발하기

적대적 테스트

프로그래머가 데이터와 모델에 적대적 입력을 주입하고 모델이 데이터를 추론하는 다이어그램

1 Adapted from https://adversarial-robustness-toolbox.readthedocs.io/en/latest/
OpenAI API로 AI 시스템 개발하기

적대적 테스트

response = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[
{"role": "system",
 "content": "You are an AI assistant for the film industry. You should interpret 
    the user prompt, a movie review, and based on that extract whether its 
    sentiment is positive, negative, or neutral."},

{"role": "user", "content": "It was great to see some of my favorite stars of 30 years ago including John Ritter, Ben Gazarra and Audrey Hepburn. They looked quite wonderful. But that was it. They were not given any characters or good lines to work with. I neither understood or cared what the characters were doing."}])
1 https://huggingface.co/datasets/davanstrien/test1?row=10
OpenAI API로 AI 시스템 개발하기

적대적 테스트

print(response.choices[0].message.content)
The sentiment of this movie review is negative.
OpenAI API로 AI 시스템 개발하기

적대적 테스트

response = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[
{"role": "system",
 "content": "You are an AI assistant for the film industry. You should interpret 
    the user prompt, a movie review, and based on that extract whether its sentiment 
    is positive, negative, or neutral."},

{"role": "user", "content": "If you read the book, your all set. If you didn't...your still all set."}]) print(response.choices[0].message.content)
The sentiment of this movie review is neutral.
OpenAI API로 AI 시스템 개발하기

평가 라이브러리 및 데이터셋

다양한 데이터셋을 활용하여 모델을 테스트하는 평가 라이브러리 예시 다이어그램

1 https://github.com/openai/evals
OpenAI API로 AI 시스템 개발하기

연습해 봅시다!

OpenAI API로 AI 시스템 개발하기

Preparing Video For Download...