AINoon Lesson 2

Get Ready for AINoon!

Thanks

  • To the host for the great venue!
  • To our sponsors

Administrivia

  • Fire escapes
  • Toilets
  • Cleaning up after ourselves
  • WiFi

Demystifying AI

How generative AI works and how that informs how to best use it

How does a chatbot generate text?

Where do LLM weights come from?

  • Weights start as random numbers
  • Weights are updated by a process called pre-training:
    • Uses millions of training examples from general sources, like the internet and books
    • E.g. Leave-one-word-out examples:
      The Beatles were a ____ from Englandband
    • For each example, weights are updated slightly to get closer to the right answer - like tuning a dial
    • This trains the LLM in language patterns AND general knowledge
  • Extra training based on human feedback makes chatbots respond better to questions and instructions
    • E.g. Chatbot gives 5 answers and human picks the best

You now understand what GPT stands for!

Generative The model generates text (or other content)
Pre-trained Pre-trained on many examples from general sources
Transformer The kind of neural network architecture used

What does this teach us about using GenAI?

  • The generation process is not magic, just simple maths!
  • We know how AI works, but no-one truly knows why it works
    • The billions of calculations across neurons are too complex
  • AI doesn’t “think” with logic - it’s predicting the best answer based on its training sources
    • People say AI sometimes “hallucinates” wrong answers - but every response is generated the same way
    • It generates answers that sound right - and it’s surprising so many actually are right!
  • It doesn’t train during your chats
    • It “remembers” by including chat history in the prompt
    • Even “memory” features just include past chats in the prompt
    • Public chatbots may use your chats to train later models

GenAI Strengths and Limitations

Key Strengths

  • Generates text that looks similar to what a human would write
  • Reads lots of text really fast
  • Surprisingly good responses to a wide variety of tasks

Key Limitations

  • Everything is a hallucination - but it’s correct surprisingly often
  • It might not always “pay attention” to everything in the prompt
  • It might not consistently give the same answer
  • Different models (or model versions) can give very different responses to the same prompt

Tutorial Objective

Make your own chatbot to answer questions based on information in a document

Testing a Chatbot

Either you test your chatbot, or your users will!

  • Ask a list of questions you want it to answer
  • Amend instructions or sources to improve answers
  • Ask each question multiple times to check it consistently gives the right answer
  • Re-test all questions after any change
    • Changes to instructions, knowledge, or model
    • Using a system to automate testing helps!
  • Test edge cases - How does it respond to off-topic questions?

Homework

  1. Make a list of questions you want your chatbot to be able to answer
    • Feel free to use a different source document!
  2. Ask each question and note whether it was correct
  3. For questions it got wrong, modify the source to help it get the right answer
  4. Test it again!
    • Is it right more often?
    • Is it wrong for any questions it got right before?

Extra: Learn more about how LLMs work with a brief explainer or a deeper dive (more maths) from 3Blue1Brown.