Validace

Vývoj AI systémů s OpenAI API

Francesca Donadoni

Curriculum Manager, DataCamp

Validace

Vývojář testující kód na více obrazovkách

Vývoj AI systémů s OpenAI API

Validace

 

Možné chyby modelu:

  • Chybná interpretace kontextu
  • Zesilování předsudků, pokud jsou trénovací data zaujatá
  • Výstup zastaralých informací
  • Manipulace ke generování škodlivého nebo neetického obsahu
  • Neúmyslné odhalení citlivých informací
Vývoj AI systémů s OpenAI API

Adversariální testování

Diagram znázorňující programátora vkládajícího adversariální vstup do dat a modelu, přičemž model z dat odvozuje výstupy

1 Adapted from https://adversarial-robustness-toolbox.readthedocs.io/en/latest/
Vývoj AI systémů s OpenAI API

Adversariální testování

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
Vývoj AI systémů s OpenAI API

Adversariální testování

print(response.choices[0].message.content)
The sentiment of this movie review is negative.
Vývoj AI systémů s OpenAI API

Adversariální testování

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.
Vývoj AI systémů s OpenAI API

Evaluační knihovny a datové sady

Diagram znázorňující ukázkovou evaluační knihovnu využívající různé datové sady k testování modelu

1 https://github.com/openai/evals
Vývoj AI systémů s OpenAI API

Pojďme procvičovat!

Vývoj AI systémů s OpenAI API

Preparing Video For Download...