ITB 2023 - Chatgpt Box! AI All The Things - Scott Steinbeck.pdf

ortussolutions 63 views 40 slides Sep 04, 2024
Slide 1
Slide 1 of 40
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40

About This Presentation

Ortus and the CFML Community have developed ChatGPT Box in response to the AI explosion. This session explores ChatGPT Box's purpose, problem-solving capabilities, and the reasoning behind using AI. It covers the training process and underlying science. The talk highlights how ChatGPT Box 1.0.0 ...


Slide Content

Session
ChatGPT Box
LED BY
SCOTT STEINBECK

SCOTT STEINBECK
SPEAKER AT ITB2023
●Software Engineer
●15+ Year of experience
●Father
●Hardware Tinkerer
●Coding on my free time
●Overcommitting myself
●Automating everything
●IOT Development
●Teaching Coding/Electronics
●Contributing to open source
Hobbies

BREIF HISTORY
Thanks to our sponsors

●Traditional language models (e.g., n-gram models) had limitations:
○Explosion of state space (curse of dimensionality) and sparsity led to inconsistent
output resembling gibberish.
○Inability to handle novel phrases and lack of coherence in the generated text.
Pre-2000's:

●Advancements in training neural networks by Geoffrey Hinton:
○Deep neural networks alleviated some language model problems.
○Nuanced arbitrary concepts were represented in a finite space, but output lacked
coherence relative to the input sequence.
Mid-2000's:

●Rise of Long Short-Term Memory (LSTM) networks:
○LSTMs enabled processing of arbitrary length sequences.
○Dynamic alteration of internal state improved language model performance
significantly.
Early-2010's:

●Introduction of Transformer Networks with the "Attention Is All You Need" paper by
Google:
○Transformers revolutionized natural language processing, achieving tasks like
language translation at human-level or better.
○Attention mechanisms and parallel processing allowed the model to analyze the entire
input simultaneously.
Late-2010's:

●Emergence of Generative Pre-Trained (GPT) models, notably GPT-3:
○Large language models could be trained on massive data without specific agendas.
○Fine-tuning for specific tasks led to state-of-the-art results via text interaction.
2020's
1 petabyte
of training
data

DIGGING IN
Thanks to our sponsors

AI UNDER THE HOOD
AI, or Artificial Intelligence, is a broad
field that encompasses the
development of intelligent systems
capable of performing tasks that
typically require human intelligence.

This works by combining rule-based
modeling of human language—with
statistical, machine learning, and deep
learning models

Natural Language Processing Tasks
Natural Language Understanding (NLU)
deals with the ability of computers to understand
human language.
Natural Language Generation (NLG)
●data to text - text is generated to explain or describe a
structured record or unstructured perceptual input;
●text to text - typically involves fusing information from
multiple linguistic sources into a single coherent
summary;
●dialogue - text is generated as part of an interactive
conversation with one or more human participants.

Machine Learning
●ML techniques play a key
role in AI by enabling
systems to automatically
learn from experience,
adapt to new data, and
improve their
performance over time.

●ML algorithms are used in
various AI applications,
including computer vision,
speech recognition,
recommendation systems,
and, importantly, NLP
tasks.
Machine Learning to Play Hill Climb Racing

Deep Learning
●DL has revolutionized ML
by enabling models to
automatically learn more
abstract and nuanced
features from raw data.

●DL help NLP to understand
natural language, enabling
them to capture
contextual dependencies
and learn complex
representations.
Deep Learning to car attribute classification

WHAT IS AN LLM
Practical AI
A large language model is a
prediction engine that takes a
sequence of words and tries
to predict the most likely
sequence to come after that
sequence.

It does this by assigning a
probability to likely next
sequences and then samples
from those to choose one.

The process repeats until
some stopping criteria is met.
APPLICATIONS AND INFRASTRUCTURE USING ARTIFICIAL INTELLIGENCE TODAY

HOW AI LEARNS NEW ABILITIES
Practical AI
As LLMs are scaled they hit a series of critical scales at which new abilities are suddenly “unlocked”. LLMs are
not directly trained to have these abilities, and they appear in rapid and unpredictable ways as if emerging out
of thin air.

Applications of Large Language Models
Practical AI

ASKING AI A
QUESTION
Thanks to our sponsors

TOKENIZATION
CHATGPT
What are some common mistakes to avoid when writing code?
Tokens can be words, subwords, or characters, depending
on the specific tokenization scheme used.

INPUT ANALYSIS
CHATGPT
1.Informational Questions:
●"What is the capital of France?"
●"Can you explain the concept of relativity?"
2.Procedural Questions:
●"What are the steps to install a software program?"
3.Comparison Questions:
●"Compare the advantages of iOS and Android."
4.Opinion Questions:
●“Do you think technology is making us more connected or disconnected?"
5.Problem-Solving Questions:
●"How can I optimize my website's loading speed?"
6.Request for Advice:
●"Which programming language should I learn as a beginner?"
7.Request for Explanation:
●"What is the significance of the Pythagorean theorem?"
What are some common mistakes to avoid when writing code?

Understanding the Question
CHATGPT
1.Neural Networks turn
tokens into dense vectors
(word embeddings)
●This adds context and
captures complex
relationships between
words
What are some common mistakes to avoid when writing code?
Vectors with shorter distances between them usually share common contexts in
the corpus. This allows us to find distances between words

|cat - dog| = 1.20
|cat - cow| = 1.48


"cat" is closer to "dog" than it is to the "cow".
Monday Vector

What Vector

Retrieval/Integration of Knowledge
CHATGPT
_ _ _ _ mistakes _ avoid _ writing code?

Generating the Answer
CHATGPT
_ _ _ _ mistakes _ avoid _ writing code?
Common mistakes to avoid when writing code include:
●Poor code organization and lack of proper indentation.
●Inefficient algorithms or data structures that result in slow performance.
●Lack of proper error handling and exception management.
●Insufficient comments and documentation, making the code difficult to understand and maintain.
●Failure to validate input data, leading to potential security vulnerabilities.
●Hardcoding values instead of using constants or configuration files.
●Ignoring code style conventions, making the codebase inconsistent and harder to read.
●Neglecting to handle edge cases and unexpected scenarios.
●Not using version control, resulting in difficulties in tracking changes and collaborating with
others.
●Overcomplicating solutions instead of keeping the code simple and maintainable.

PROMPT
ENGINEERING
Thanks to our sponsors

WHAT IS A PROMPT
CHATGPT
A prompt, sometimes referred to as context, is the text provided to a model before it begins
generating output. It guides the model to explore a particular area of what it has learned so that the
output is relevant to your goals.
Prompts are the secret sauce of chat agents

MORE DETAILED PROMPTS
CHATGPT
Responses are only as detailed as
focused as the question that is asked.
You can see we explain to the bot the
various roles we get a more concise
answer:
●Give the bot a role
●Give some context on the user
●Give some dynamic data we want
the bot to have access to
●and then guidance on how the bot
should respond.
CHAT GPT IS EXCEPTIONALLY
GOOD AT UNDERSTANDING
MARKDOWN & JSON

GIVING CHATGPT JSON AND ASKING QUESTIONS
CHATGPT

CRAFTING YOUR OWN PROMPTS
CHATGPT
if you were helping a user book
a trip, you could:
●Ask the user their dates and
destination.
●Behind the scenes, search for
flights and hotels.
●Embed the flight and hotel
search results in the hidden
context.
●Also embed the company’s
travel policy in the hidden
context.

CONTEXT PROMPTING https://prompts.chat/

CHATGPT

ONE SHOT PROMPTING
CHATGPT
These types of prompts provide the AI model with one example of what you expect the output
to be. The basic steps are:

Give a quick explanation of what you need,
add a question-answer pair or a template as an example

FEW SHOT PROMPTING
CHATGPT
Large language models are
few-shot learners, meaning that
they can learn a new task by
being provided just a few
examples.

The basic steps are:

Give a quick explanation of
what you need,
add a few question-answer
pairs or templates as an
example.

FEW SHOT PROMPTING
CHATGPT
Large language models are
few-shot learners, meaning that
they can learn a new task by
being provided just a few
examples.

The basic steps are:

Give a quick explanation of
what you need,
add a few question-answer
pairs or templates as an
example.

CHAIN OF THOUGHT PROMPTING
CHATGPT

AUGMENTING
LARGE LANGUAGE
MODELS
Thanks to our sponsors

EXPANDING LLM FUNCTIONALITY
CHATGPT

PROMPT TEMPLATES
CHATGPT

DOCUMENT LOADERS
CHATGPT

VECTOR DATABASES
CHATGPT
Full-text search VS Semantic search

AGENTS
CHATGPT
Build your own chat that
pulls in other services

attach calculator tool for
questions regarding
calculations

TOOLS/UTILS
CHATGPT https://muze.one/
https://www.dailybot.com/

CHATGPT
THANK YOU