Walidacja

Tworzenie systemów AI z OpenAI API

Francesca Donadoni

Curriculum Manager, DataCamp

Walidacja

Programista testujący kod na wielu ekranach

Tworzenie systemów AI z OpenAI API

Walidacja

 

Możliwe błędy modelu:

  • Błędna interpretacja kontekstu
  • Wzmacnianie uprzedzeń z danych treningowych
  • Generowanie nieaktualnych informacji
  • Manipulacja w celu tworzenia szkodliwych treści
  • Niezamierzone ujawnianie poufnych informacji
Tworzenie systemów AI z OpenAI API

Testowanie adversarialne

Diagram przedstawiający programistę wprowadzającego dane adversarialne do danych i modelu, a model wnioskujący na ich podstawie

1 Adapted from https://adversarial-robustness-toolbox.readthedocs.io/en/latest/
Tworzenie systemów AI z OpenAI API

Testowanie adversarialne

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
Tworzenie systemów AI z OpenAI API

Testowanie adversarialne

print(response.choices[0].message.content)
The sentiment of this movie review is negative.
Tworzenie systemów AI z OpenAI API

Testowanie adversarialne

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.
Tworzenie systemów AI z OpenAI API

Biblioteki i zbiory danych do ewaluacji

Diagram przedstawiający przykładową bibliotekę ewaluacyjną korzystającą z różnych zbiorów danych do testowania modelu

1 https://github.com/openai/evals
Tworzenie systemów AI z OpenAI API

Czas na ćwiczenia!

Tworzenie systemów AI z OpenAI API

Preparing Video For Download...