1 of 35

ChatGPT Registration and Prompting

Ευγενία Γκίνη – Φωτόπουλος Ευάγγελος

Τμήμα Μηχανικών Πληροφορικής και Υπολογιστών

Πανεπιστήμιο Δυτικής Αττικής

2 of 35

Introduction to ChatGPT

01

ChatGPT 3.5 & Chat GPT 4

3 of 35

The First Launch �30 Νοεμβρίου 2022

4 of 35

1.000.000

Ένα εκατομμύριο χρήστες την 1η εβδομάδα

5 of 35

1.600.000.000

Μέσος όρος μηνιαίας επισκεψιμότητας

6 of 35

GPT Initials

Generative

Pre-trained

Transformer

Το μοντέλο παράγει σχετικές μεταξύ τους και με συνοχή προτάσεις με αρχικό ερέθισμα δικά μας prompts

Το μοντέλο έχει εκπαιδευτεί με τεράστιου όγκου δεδομένα, προτού προσαρμοστεί λειτουργικά σε συγκεκριμένα έργα

Τα μοντέλα GPT είναι μεγάλα νευρωνικά δίκτυα που δημιουργούν κείμενο βασισμένο στα μοτίβα της προ-εκπαίδευσης, σύμφωνα με την Αρχιτεκτονική Transformer (Vaswani et al.,2017)

7 of 35

Getting Started

8 of 35

Getting Started

9 of 35

Getting Started

10 of 35

Getting Started

11 of 35

GPT 3.5 VS GPT 4

GPT 3.5

GPT 4

Γρήγορο και ιδανικό μοντέλο

για απλές

«δοκιμασίες»

Ιδανικό μοντέλο για

δημιουργικούς και

πολύπλοκους συλλογισμούς

12 of 35

GPT 3.5 VS GPT 4

GPT 3.5

GPT 4

  • Δωρεάν!!
  • Ιδανικό μοντέλο για απλές και μικρές εργασίες
  • Δεν θα δείτε ποτέ να εμφανίζεται το μήνυμα:�”Chat GPT is at capacity”
  • Γρήγορες API απαντήσεις
  • Προτεραιότητα σε πρόσβαση σε νέα χαρακτηριστικά

13 of 35

GPT for Google

Plugin: �

14 of 35

GPT for Google

Η μηχανή αναζήτησης τώρα εμφανίζει ταυτόχρονα αποτελέσματα από ιστοσελίδες αλλά και από το Chat GPT

15 of 35

API for ChatGPT

Υπάρχει η δυνατότητα χρήσης του ChatGPT σε εφαρμογές μέσω του API που παρέχει η OpenAI.

Η χρήση παρέχεται μέσω κλειδιών που δίνονται στους χρήστες που το επιθυμούν, ενώ η χρέωση εξαρτάται από τον αριθμό των tokens που χρησιμοποιούνται.

import openai

openai.api_key="sk-T9rtzQpmxzpbT0lpmhm5XXXXXXX"

# list models

models = openai.Model.list()

model_names = [m.id for m in models.data]

model_names.sort()

# print the first model's id

#print(model_names)

# create a prompt

prompt = ("explain quantum physics in a short paragraph")

print("Prompt : "+prompt)

# create a chat completion

chat_completion = openai.ChatCompletion.create(model="gpt-4", messages=[{"role": "user", "content": prompt}])

# print the chat completion

print("Answer: \n"+chat_completion.choices[0].message.content)

16 of 35

GPT και Εκπαίδευση

Projects

Καθορίζοντας μέθοδο διδασκαλίας το GPT μπορεί να οργανώσει ένα πρωτότυπο project, δίνοντας:

  • Τίτλο
  • Σκοπό
  • Θεωρητικό Υπόβαθρο
  • Οδηγίες και συμβουλές που αφορούν στα διαφορετικά στάδια του project�

17 of 35

GPT και Εκπαίδευση-Projects

18 of 35

Prompting!

To Chat GPT είναι εκπληκτικό εργαλείο που με κατάλληλες γνώσεις και έξυπνους ορισμούς μπορεί να γίνει ιδανικό εργαλείο στα χέρια του εκπαιδευτικού…

19 of 35

02

PROMPTING

Πώς οι διαφορετικές ερωτήσεις παράγουν διαφορετικά αποτελέσματα

20 of 35

Τι είναι ένα prompt?

  • Με τον όρο prompt (προτροπή) εννοούμε το κείμενο που παρέχει ένας χρήστης, το οποίο χρησιμεύει ως σημείο εκκίνησης, ώστε να δημιουργηθεί μία έξοδος
  • Σημαντικότατος παράγοντας που επηρεάζει την έξοδο που παράγει το ChatGPT
  • Η δομή και η μορφή έκφρασης ενός prompt καθορίζει την ποιότητα της απάντησης
  • Οι αποτελεσματικές προτροπές μπορούν να βοηθήσουν το ChatGPT να παράγει ακριβές, σαφές και σχετικό με την προτροπή κείμενο εξόδου

21 of 35

Αναμενόμενες εργασίες στο ChatGPT

Το ChatGPT μπορεί να χρησιμοποιηθεί σε μία ευρεία κλίμακα εφαρμογών, οι οποίες περιλαμβάνουν:

  • Περίληψη (π.χ. περίληψη κειμένων ή κριτικών χρηστών)
  • Εξαγωγή Συμπερασμάτων (π.χ. ταξινόμηση συναισθημάτων, εξαγωγή κοινού θεμάτος)
  • Μετασχηματισμός κειμένου (π.χ. μετάφραση, διόρθωση ορθογραφίας ή/και γραμματικής)
  • Επέκταση (π.χ. αυτόματη σύνταξη μηνυμάτων ηλεκτρονικού ταχυδρομείου, δημιουργία ενός κειμένου ή μαθήματος)

22 of 35

Prompt Engineering

  • Σύγχρονος όρος (~2021)
  • Είναι η διαδικασία σχηματισμού ερωτήσεων, οι οποίες έχουν σκοπό να καθοδηγήσουν το μοντέλο Τεχνητής Νοημοσύνης (ΑΙ), ώστε να παράξει τα επιθυμητά αποτελέσματα
  • Είναι η «τέχνη» της δημιουργίας ερωτήσεων ή προβλημάτων, τα οποία θα δοθούν ως είσοδος στο ΑΙ
  • Ορισμένες βασικές αρχές περιλαμβάνουν:
    • Κατανόηση του μοντέλου AI
    • Σαφήνεια και εξειδίκευση
    • Πλαισίωση με κατάλληλα συμφραζόμενα (contextual framing)
    • Καθορισμός της επιθυμητής μορφής εξόδου
    • Πειραματισμός

23 of 35

Τεχνικές Prompt Engineering (1)

Υπάρχουν διαφορετικές κατηγοριοποιήσεις των τεχνικών του Prompt Engineering, ωστόσο οι τεχνικές αυτές περιλαμβάνουν:

  • Explicit Instruction: Αυτή η μέθοδος βασίζεται στη ρητή δήλωση της μορφής εξόδου που επιθυμεί κανείς από το GPT-3. Στο σύστημα δίνονται λεπτομερείς οδηγίες μαζί με την προτροπή.�Παράδειγμα: “Translate the following English text to French: 'I love going to the park.'"
  • Setting as a Test/QA: Η εργασία διαμορφώνεται σαν να επρόκειτο για ένα τεστ ή μια ερώτηση κουίζ προς απάντηση. Αυτή η προσέγγιση έχει διαπιστωθεί ότι κάνει το σύστημα πιο ακριβείς τις απαντήσεις.�Παράδειγμα: "Question: What is the capital of Australia? Answer: ______«
  • Giving Context/Details: Σε αυτή τη μέθοδο, παρέχονται πρόσθετες σχετικές πληροφορίες στο σύστημα για να καθοδηγήσει την απάντησή του. �Παράδειγμα: "As an expert historian who specializes in medieval Europe, explain the significance of the Magna Carta."

24 of 35

Τεχνικές Prompt Engineering (2)

Υπάρχουν διαφορετικές κατηγοριοποιήσεις των τεχνικών του Prompt Engineering, ωστόσο οι τεχνικές αυτές περιλαμβάνουν:

  • Few-shot Learning: Η τεχνική αυτή περιλαμβάνει την παροχή στο μοντέλο αρκετών παραδειγμάτων της επιθυμητής μορφής εισόδου-εξόδου, τα οποία μπορεί στη συνέχεια να χρησιμοποιήσει για να καθορίσει τους κανόνες για τη δημιουργία της απαιτούμενης εξόδου για μια νέα είσοδο.�Παράδειγμα: "Translate the following English phrases to French: � a: 'Good morning' -> 'Bonjour’ � b: 'Thank you' -> 'Merci’ � c: 'I miss you' -> _______"
  • Chain-of-thought prompting: Δημιουργούνται τεχνητοί διάλογοι μεταξύ ενός "χρήστη" και μιας "τεχνητής νοημοσύνης" στους οποίους η τεχνητή νοημοσύνη παρέχει την επιθυμητή απάντηση. Αυτό μπορεί να βοηθήσει το μοντέλο να κατανοήσει καλύτερα το πλαίσιο και να ανταποκριθεί σωστά.�Παράδειγμα: User: "Tell me about the theory of relativity."� AI: (Gives explanation)� User: "Who first proposed this theory?"

25 of 35

Προκλήσεις Prompt Engineering

Παρά τις εντυπωσιακές δυνατότητες που παρουσιάζουν τα γλωσσικά μοντέλα μεγάλης κλίμακας (LLMs), παρουσιάζουν επίσης και αρκετές προκλήσεις:

  • Αβεβαιότητα: Τα μοντέλα αυτά είναι πιθανοτικά, δηλαδή παράγουν απαντήσεις με βάση τα πρότυπα που έχουν μάθει, αλλά η ακριβής έξοδος μπορεί να είναι απρόβλεπτη.
  • Ευαισθησία στην προτροπή: Τα μοντέλα είναι ευαίσθητα στη διατύπωση και τη δομή των προτροπών. Μια μικρή αλλαγή μπορεί να οδηγήσει σε αρκετά διαφορετικό αποτέλεσμα.
  • Έλλειψη συμφραζόμενων: Ενώ αυτά τα μοντέλα μπορούν να παράγουν κείμενο που μοιάζει με ανθρώπινο κείμενο, δεν κατανοούν πραγματικά το περιεχόμενο. Αυτό μπορεί να οδηγήσει σε ακατάλληλες ή ανούσιες απαντήσεις.
  • Μεροληψίες: Τα μοντέλα μπορεί επίσης να αντανακλούν τις μεροληψίες που υπάρχουν στα δεδομένα πάνω στα οποία εκπαιδεύτηκαν, γεγονός που μπορεί να επηρεάσει την ποιότητα και τη δικαιοσύνη των απαντήσεις.

26 of 35

Παραδείγματα χρήσης

27 of 35

—ChatGPT 3.5

“Quantum physics, also known as quantum mechanics, is a fundamental branch of physics that describes the behavior of matter and energy at the smallest scales, such as atoms and subatomic particles. It introduces the concept of quantization, where properties like energy levels and angular momentum are quantized into discrete values. Quantum mechanics challenges our classical intuition, featuring phenomena like superposition, where particles can exist in multiple states simultaneously, and entanglement, where the properties of particles become interconnected regardless of distance. It's the foundation for understanding the behavior of particles in the quantum world, driving technological advancements and reshaping our understanding of reality itself.”

Prompt: explain quantum physics in a short paragraph

28 of 35

—ChatGPT 3.5

“Quantum physics is like a magical world where tiny things, like atoms and particles, don't follow the same rules as the big things we see every day. Instead of moving in straight lines, they can pop in and out of different places, and sometimes they act like both waves and particles at the same time! It's super strange and hard to understand, but scientists use it to make amazing things like computers and lasers. So, think of quantum physics as a mysterious and wondrous adventure into the tiniest parts of our world.”

Prompt: explain quantum physics in a short paragraph as if I was a 10-year-old

29 of 35

—ChatGPT 3.5

“Quantum physics, also known as quantum mechanics, is a fundamental branch of physics that describes the behavior of particles at the smallest scales. It's a mathematical framework that combines wave-like and particle-like properties, offering a probabilistic understanding of nature. Quantum mechanics challenges our classical intuition, introducing concepts like superposition, where particles can exist in multiple states simultaneously, and entanglement, where particles can instantaneously influence each other's properties regardless of distance. It has led to revolutionary technologies like quantum computers and underpins our understanding of the microscopic world, governing everything from atoms and molecules to the fundamental forces of the universe.”

Prompt: explain quantum physics in a short paragraph as if I was a physicist with a doctorate in quantum physics

30 of 35

—ChatGPT 4

“Quantum physics, also known as quantum mechanics or quantum theory, is a branch of physics that explores the behavior of very small particles, typically on the atomic and subatomic scale. Unlike classical physics, which can predict the behavior of larger objects with precision, quantum physics introduces concepts of probability, superposition (where particles can exist in multiple states simultaneously), and entanglement (where particles become interconnected in ways such that the state of one particle instantly affects the state of another, regardless of distance). These counterintuitive phenomena challenge our everyday understanding of reality but are essential to explaining the behavior of the universe at its most fundamental level.”

Prompt: explain quantum physics in a short paragraph

31 of 35

—ChatGPT 3.5

“Η κβαντική φυσική είναι ένα πεδίο της φυσικής που εξετάζει τη συμπεριφορά των σωματιδίων και των ενεργειών σε πολύ μικρές κλίμακες, κοντά στο επίπεδο των κβαντικών. Σε αυτό το πεδίο, οι κλασικοί νόμοι της φυσικής συχνά αντικαθίστανται από πιο περίεργους και προβληματικούς κβαντικούς νόμους. Η κβαντική φυσική μελετά τα φαινόμενα όπως η κυματομηχανική, η αρχή της αβεβαιότητας, το άτομο, τον πυρήνα, τα σωματίδια και τα κβαντικά πεδία. Αυτή η περιοχή έχει οδηγήσει σε πολλές εκπληκτικές ανακαλύψεις και εφαρμογές, όπως οι κβαντικοί υπολογιστές και η κβαντική τηλεπόρτα, ανοίγοντας νέες διαστάσεις στην κατανόηση της φύσης.”

Prompt: περίγραψέ μου την κβαντική φυσική σε μία σύντομη παράγραφο

32 of 35

—ChatGPT 3.5

“Η κβαντική φυσική είναι ένας τρόπος που οι επιστήμονες χρησιμοποιούν για να καταλάβουν τον κόσμο σε πολύ μικρά κομμάτια, πολύ μικρότερα από ό,τι μπορούμε να δούμε με τα μάτια μας. Σε αυτόν τον κόσμο, τα πράγματα συμπεριφέρονται διαφορετικά από αυτό που συνηθίζουμε να βλέπουμε στην καθημερινή μας ζωή. Για παράδειγμα, σε αυτόν τον κόσμο, μπορεί να υπάρχει κάτι που λέγεται "κβάντουμ" και μπορεί να είναι ταυτόχρονα και εκεί και όχι εκεί, κάτι που ακούγεται περίεργο!

Η κβαντική φυσική μας βοηθάει να καταλάβουμε τον κόσμο σε πολύ μικρή κλίμακα και να κάνουμε προβλέψεις για το πώς συμπεριφέρονται τα πράγματα όταν είναι πολύ, πολύ μικρά. Είναι σαν ένα παιχνίδι μυστηρίου που βοηθάει τους επιστήμονες να ανακαλύπτουν τα μυστικά του σύμπαντος σε έναν μικρό, αλλά συναρπαστικό κόσμο!”

Prompt: περίγραψέ μου την κβαντική φυσική σε μία σύντομη παράγραφο σα να ήμουν ένα 10χρονο παιδί

33 of 35

—ChatGPT 3.5

“Of course! I'd be happy to explain quantum physics in easy-to-understand terms for a preliminary school audience. Quantum physics is a fascinating and complex field, but we can break it down into simple concepts.

Okay, imagine you have a box, and inside that box, there's a tiny, invisible world that's very different from the one we see around us every day. This world is called the quantum world. In the quantum world, things are very strange compared to our everyday experiences.

  1. Tiny Particles: First, imagine everything in the quantum world is incredibly tiny. We're talking about particles like electrons, which are even smaller than the tiniest speck of dust you can imagine.

  • Wave-Particle Duality: These tiny particles can act like both waves and particles. This is similar to how waves in the ocean can sometimes look like smooth ripples and other times like crashing waves. So, in the quantum world, electrons can be like waves or particles depending on how we observe them.

  • Uncertainty Principle: One of the weirdest things about quantum physics is the uncertainty principle. It tells us that we can't know everything about a particle's position and speed at the same time. It's like trying to catch a firefly in the dark – as soon as you try to measure its position, it moves, and you can't be sure where it is and how fast it's moving at the same time.

  • Quantum Jumping: In the quantum world, particles don't move smoothly from one place to another like a car driving down the street. Instead, they make these tiny jumps, almost like they're teleporting from one spot to another. This is known as quantum jumping.

  • Superposition: Another strange idea in quantum physics is superposition. This means that a quantum particle, like an electron, can exist in multiple states at once. It's a bit like a superhero being in two places at the same time!

  • Entanglement: Lastly, there's something called entanglement. Imagine you have two particles that are so connected that no matter how far apart they are, what you do to one instantly affects the other. It's like having two magical magnets that always behave the same way, no matter how far apart you take them.

In summary, quantum physics is like a magical and mysterious world that's hidden inside the tiniest particles. It's full of surprises and doesn't follow the same rules as the world we see every day. While it might seem strange and confusing, scientists use quantum physics to understand the very building blocks of our universe, and it's a big part of how our modern technology, like computers and smartphones, works. So, even though it's a bit mind-boggling, it's also incredibly cool!”

(advanced) Prompt: I want you to act as a physics teacher in a preliminary school. Your job is to explain quantum physics in easy-to-understand terms.

34 of 35

Βιβλιογραφία

  • Vaswani, A. (2017, June 12). Attention is all you need. arXiv.org. https://arxiv.org/abs/1706.03762
  • White, J. (2023, February 21). A Prompt Pattern Catalog to Enhance Prompt Engineering with ChatGPT. arXiv.org. https://arxiv.org/abs/2302.11382
  • Short, C. E., & Short, J. C. (2023). The artificially intelligent entrepreneur: ChatGPT, prompt engineering, and entrepreneurial rhetoric creation. Journal of Business Venturing Insights, 19, e00388. https://doi.org/10.1016/j.jbvi.2023.e00388
  • Liu, Y. (2023, May 23). Jailbreaking ChatGPT via Prompt Engineering: An empirical study. arXiv.org. https://arxiv.org/abs/2305.13860
  • Yang, Z. (2023, March 20). MM-REACT: Prompting ChatGPT for multimodal reasoning and action. arXiv.org. https://arxiv.org/abs/2303.11381
  • West C. (2023). The Secrets of ChatGPT Prompt Engineering for Non-Developers. E-book

35 of 35

Ευχαριστούμε

Απορίες?