© Kanohi GmbH 2023

Large Language Models

A practical guide to ChatGPT & Co.

11.4.2023

Business Edition

This course is available for corporate use:

  • Tests & assessments
  • Your branding

    (logo, colors, domain/URL)

  • Customized content
  • Personal certificate issued

From CHF/USD 15.- / User!

Contact info@kanohi.ch

Navigating this course

KeyFunction
esc keySlides overview
f keyFull screen mode
g keyJump to slide

Course content

  1. What LLMs are
  2. How LLMs work
  3. Some LLM use cases
  4. How to use LLMs effectively
  5. The risks of using LLMs

1.1 What are Large Language Models?

person using chatgpt
  • Machine Learning

    („Artificial Intelligence“)

  • Neural network model

    („deep learning“)

1.2 What can LLMs do?

  • Summarize, translate
  • Generate text

    (Chatbots / AI assistants)

  • Sentiment analysis
  • Predict text

    (e.g. for typing assistants)

  • Text classification
  • ...
LLMs can be created for any kind of language!

(programming languages, protein sequences etc.)

In this course we discuss only applications for human language

warning icon

1.3 Types of LLMs

Monomodal: monomodal model
Multimodal: multimodal model

1.4 Some LLM Examples

NameCreated byTypeLicense
GPT-3openai logo OpenAIMonomodalCommercial
GPT-NeoXlogo EleutherAIMonomodalOpen Source
LLaMAlogo MetaMonomodalResearch
GPT-4openai logo OpenAI / microsoft logo MicrosoftMultimodalCommercial

1.5 Access Modes

Direct: direct access via browser
Indirect (via Application): indirect access via application which acesses model via api
LLMs are „hidden“ in more and more software products!

2.1 How LLMs work

NOT a database with stored question / answer pairs!
Neural Network made from artificial neurons
neural network with activations

2.1 How LLMs work 2

Artificial neuron = basic computation unit executing very simple calculations
neural network with activations
Parameters = numbers stored in the neuron, which control the way it computes (3,2,4 and 10 in the example above)

2.2 LLM Training

  • Mostly trained on very large amounts of data downloaded from the internet (=„corpus“)
  • Training task: find a missing word in a sentence (e.g.)
  • Example: „Meanwhile the ______ ran straight to the grandmother's house and knocked at the door.“ ➜ „wolf“

2.2 LLM Training 2

  • Size of parameter data ≪ size of training corpus!
  • ➜ LLMs in almost never store training data „as is“
  • ➜ The output of LLMs is almost always novel!
  • ➜ But in rare cases they do output parts of their training data warning icon

2.3 LLM complexity (examples)

NameCreated by#Param.Training corpus
GPT-3openai logo OpenAI175B499B tokens
GPT-NeoXlogo EleutherAI20B825 GiB
LLaMAlogo Meta65B1400B tokens
GPT-4openai logo OpenAI / microsoft logo Microsoft ??

You Scored:

Ranking:

3.1 Some use cases of LLMs: capabilities

  1. Summarization of texts
  2. Explain texts in simple terms
  3. Rewrite or shorten sentences
  4. Spell check / grammar check
  5. Translate into another language
  6. Text comparison and search

3.2 Some use cases of LLMs: tasks

  1. Write concepts
  2. Write cover letters, emails
  3. Write marketing texts (e.g. blog post)
  4. Write program code
  5. Create configuration files for software
  6. ...

4.1 How to use chatbots

  • „Conversation“ = Series of questions and answers
  • Chatbots remember what you have said before
  • ➜ You can provide detailed specifications of the problem before asking your question
  • ➜ You can ask for corrections, changes and improvements

4.2 Chatbots: Limitations

  • Trained to decline inappropriate requests
  • No knowledge of events after training date
  • Currently limited math capabilities
  • Usually can't tell where their knowlege comes from
  • Sometimes produce boring output
  • Sometimes challenged with complex tasks / problems
  • Forget what was said, after a certain number of words

4.3 Chatbots: Boring output

  1. LLMs are trained on huge amounts of data
  2. ➜ Answers to simple questions correspond to an average of opinions / possible outputs.
  3. ➜ Often boring yawning smiley
Solution: provide detailed question!

4.4 TIP: how to solve complex problems

Let the bot solve the problem in multiple steps!

  1. Ask the bot to structure the problem into subproblems first
  2. Then ask the bot to solve the problem following the list it has created
➜ The chatbot is often able to solve the problem!

4.5 Chatbots: Very long conversations

Examples for the max. token / word count of LLMs:
scroll
ModelTokensWords
ChatGPT4'096∼3'000
GPT-432'768∼25'000
➜ Older parts of the conversation are not considered for the answer!

4.6 TIP: how to have very long conversations

Let the bot summarize old parts!

  1. Copy the old parts of the conversation
  2. Let the chatbot summarize them. Copy the output
  3. Include the summary before your latest input
➜ Answer considers old parts of the conversation!

You Scored:

Ranking:

5. LLMs: What are the risks?

  1. Inaccurate or wrong information
  2. Generic information given to many people
  3. Biased content generated
  4. Harmful content generated
  5. Breach of confidential information
  6. Loss of copyright protection of your work
  7. Output might be protected by copyright
  8. Patent becoming inadmissible

5.1 Inaccurate or wrong information

Database with verified contentdatabase with verified content
Neural Network trained from internet contentmodel trained from internet data
➜ Mistakeserror icon
➜ Hallucinationsghost icon

5.1 Inaccurate or wrong information

error iconMistakes can be subtle!
ghost iconHallucinations might be convincing!

5.2 Generic information given to many people

Same question ➜ same (or similar) answer!
➜ You end up using the same strategies as your competitors!
bored person in front of laptop

5.2 TIP: how to avoid generating generic output

Make your question unique!

  • Add boundary conditions, special requirements...
  • Describe the desired style of the output
➜ Interesting and unique outputs!
happy person in front of laptop

5.3 Biased content generated

bias balance
  • Age
  • Look
  • Gender
  • Race
  • Sexual orientation
warning icon

5.3 TIP: how to correct biases in ouputs

  • Just ask the chatbot to fix it for you!
➜ In many cases the chatbox will improve the answer!

5.4 Harmful content generated

self harm iconAdvice or encouragement for self harm behaviors
rifle iconGraphic material (sexual, violent...)
poison skull iconHarassing, demeaning, and hateful content

5.5 Breach of confidential information

  • Your question is transmitted to the server hosting the LLM! There it can be stored to a database
  • Your inputs might be used as training data for future versions of the LLM (and therefore later revealed to other users)
➜ Never enter confidential information! warning icon

5.5 TIP: how to avoid that your input is used as training data

Avoid giving training signals!

  • Do not click on links in the output (click = useful!)
  • Do not rate ("", "") the output quality of the LLM
➜ Your data is less useful for training! (not 100% safe)
foto of dog training

5.6 Loss of copyright protection of your work

  • U.S. Copyright Office decision: work of AI cannot be protected by copyright
  • ➜ Your work, if mixed with such content, could also lose copyright protection!
➜ AI generated content must be separated from other content and declared as such!
copyright logo orange warning

5.7 Output might be protected by copyright

  • LLMs sometimes create output which resembles (IP-protected: copyright, trademark,...) training data
  • ➜ Your work, if mixed with such content, could violate other peoples intellectual property!
➜ You have to check the generated output for IP-violations (difficult)!
copyright logo orange warning

5.8 Patent becoming inadmissible

  • Inputs to LLM can be used as trainig data and might be output to other users
  • ➜ patent application criterium of novelty not satisfied anymore!
  • ➜ patent might become inadmissible!
➜ Again: never enter confidential information!
copyright logo orange warning

You Scored:

Ranking:

THE END

Thank you for your attention