Validare

Dezvoltarea sistemelor AI cu OpenAI API

Francesca Donadoni

Curriculum Manager, DataCamp

Validare

Un dezvoltator testând cod pe mai multe ecrane

Dezvoltarea sistemelor AI cu OpenAI API

Validare

 

Erori potențiale ale modelului:

  • Interpretare greșită a contextului
  • Amplificarea prejudecăților din datele de antrenament
  • Furnizarea de informații depășite
  • Manipulare pentru generarea de conținut dăunător sau neetic
  • Dezvăluirea neintenționată a informațiilor sensibile
Dezvoltarea sistemelor AI cu OpenAI API

Testare adversarială

O diagramă cu un programator care injectează date adversariale în date și model, iar modelul efectuează inferențe pe baza datelor

1 Adapted from https://adversarial-robustness-toolbox.readthedocs.io/en/latest/
Dezvoltarea sistemelor AI cu OpenAI API

Testare adversarială

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
Dezvoltarea sistemelor AI cu OpenAI API

Testare adversarială

print(response.choices[0].message.content)
The sentiment of this movie review is negative.
Dezvoltarea sistemelor AI cu OpenAI API

Testare adversarială

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.
Dezvoltarea sistemelor AI cu OpenAI API

Biblioteci și seturi de date pentru evaluare

O diagramă care prezintă o bibliotecă de evaluare utilizând diverse seturi de date pentru a testa un model

1 https://github.com/openai/evals
Dezvoltarea sistemelor AI cu OpenAI API

Să exersăm!

Dezvoltarea sistemelor AI cu OpenAI API

Preparing Video For Download...