100% found this document useful (1 vote)
202 views31 pages

LLM - A Introduction To Generative AI

The document introduces a new short lecture series focusing on generative AI, its applications, and the skills needed to use this technology; it will cover practical content on using generative AI to generate answers, explanations, ideas, and complete tasks as well as how generative AI will evolve in the future.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
202 views31 pages

LLM - A Introduction To Generative AI

The document introduces a new short lecture series focusing on generative AI, its applications, and the skills needed to use this technology; it will cover practical content on using generative AI to generate answers, explanations, ideas, and complete tasks as well as how generative AI will evolve in the future.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

LLM Module A

Introduction to Generative AI

AI and Society
- Generative AI

Prof Yu Chien Siang


[email protected]
This new short lecture modularised series will focus on generative AI, its applications, and
the skills needed to use this technology to solve problems. Students will learn about the
different types of generative AI, including text generation, image generation, and music cum
audio generation.

It covers practical content on how to use generative AI to generate answers, explain issues
clearly and comprehensively, develop new ideas and implementation plans, create realistic
content, solve problems creatively, and get things done quickly. The concluding section
Skills for explains how generative AI will evolve in the near future, towards AGI. Hence, it is key to
Future Jobs learn how to control and exploit this new kind of AI power.

Some specific examples of how the course will help you:

• how to use generative AI to generate insights, analytics, explanations and also creative ideas that can be used to
solve problems.

• how to use generative AI to automate tasks, which can free up time for other activities.

• use generative AI to generate realistic content, which can be used to create prototypes or presentations.

• understand the shortfalls of generative AI outputs, and thus, use AI carefully.


Added Short Lectures on Latest AI
6 of about 1 hr each
• A) Next Gen AI is Generative
• B) The New AI Economy using GPT
• C) Prompt Engineering Part 1
• Recess Week

• D) The Challenges of Generative AI


• E) Prompt Engineering Part 2
• F) The Future of AI will be Amazing
End of Course Final Test, 60 MCQ Questions
LLM Module A
Next Gen AI is Generative
◦ Background on its emergence
◦ Introduction to GPT(Generative Pretrained Transformer)
◦ LLM (Large Language Model)
◦ What is the breakthrough? Why revolutionary?
◦ What can be generated? Sound, Images, Video and Robots
◦ Beyond ChatGPT (other LLMs)
ChatGPT Sudden Emergence

• On November 30, 2022, OpenAI launched a


conversational chatbot by the name of ChatGPT.
ChatGPT was built using a variety of highly
complex machine-learning models that were
trained on millions of text-based data points to
emulate human conversation.
It can do just about anything you want.
ChatGPT can create art, music, sales letters, and
legal documents. It can code better and faster
than most humans. It can create feats of
engineering that look almost “out of this world.”
ChatGPT Sudden Emergence
• Many companies joined in e.g. Google
with BARD, Microsoft partnered OpenAI’s
ChatGPT using the new GPT4. A host of
service offerings e.g. Perplexity AI, and
almost every Chinese Internet giant e.g.
Baidu, Tencent joined in the AI Gold Rush.
• Progress in the AI field surpasses Moore's
law. About 6 to 8 months a new
generation.
• Fastest success. Never happened before.
ChatGPT Sudden IPhone moment.
Emergence

• Easy to understand that AI will usher in sweeping societal


changes that will affect the way we travel, work, receive
healthcare, and shop. In short, AI will fundamentally change
everything.
• Companies will perish, if they lack an AI strategy.

• The future machine that predicts and now the knowledge


automation machine that can learn, plan, strategise and get
things done. Things that could take weeks, now done in
minutes or seconds.
AI Economy will be a powerful force for growth
• Fortune reported that A.I. will be a force for
economic empowerment..." and make a lot of
people rich."

Billionaire Mark Cuban said “The world’s first trillionaires


are going to come from somebody who masters AI.”

• Experts predict that the AI


economy is poised to be worth
anywhere from $15 trillion… to
$150 trillion by 2030.
What is GPT –Generative Pretrained Transformer

- Large Language Model


- Neural Network
- Text predictor
- Agent
- Universal approximator
- Artificial intelligence Writing
assistant
- Chatbot
- Generative AI Simulator
- Content generator
In any case, you just type or talk; Buddy chat interface, no need to learn how a software
operates, don't have to navigate menus, drop-down selections etc Be a citizen
programmer yourself, solve all kinds of problems. Just describing them in English.
Size of LLMs growing larger
and larger
• Why?
• More and more powerful and accurate.
• Operate as a service, cost a lot to train and hence
users must subscribe to the LLM.

• ChatGPT i.e. GPT3.5 (Turbo) – 170 Billion


parameters, is the target for open source LLMs to
surpass.
• GPT4 (1000xlarger) is the most advanced and
largest. Unclear how this is constructed, but it is a
Mixture of Experts system. So far, the most
powerful available (paid model).

• Llama2 has 40% more training data.


The beginning of Language Model doing many things – Flan T5
(google)
ChatGPT Contenders

Who Else? ❑ Character AI


❑ Founded by former engineers of Google’s LaMDA
❑ Claude2 by Anthropic
❑ Founded by former researchers from OpenAI ❑ Perplexity.ai
❑ Recent investment of $300M by Google ❑ Like Bard, search and give concise
❑ Gemini by DeepMind, merged with Google output. API is paid.
❑ Multi-modal from design (some fake demos) ❑ Ernie 4 Bot by Baidu (100 million users)
❑ Gemini models: Nano, Pro, Ultra ❑ China’s Baidu launched ChatGPT-style bot to match
❑ Pro = GPT3.5 GPT4 and Vision models
❑ Free API
❑ ChatGPT Plus (paid version, US$20 per month)
❑ Bard2 (Gemini Pro) by Google ❑ 24-layer transformer model with 1.5 billion
❑ ChatGPT’s biggest competitor, designed to parameters.
be more efficient. Copilot support ❑ Access during peak times, faster response times and
❑ Answer questions and search the internet to priority access to new features and improvements
inform its responses
❑ No official API
Smaller and greener would be
better for operations and cost
• This is the latest in R&D, to invent new ways to train
more, more accurate but keep the model size as small
as possible. PHI-2 is great example and has Mixture of
Experts model as well (MOE).
• If smaller, it runs faster.
• If very small and embedded, robots can be super smart!

• Too large, too costly to train and to maintain. Break into


smaller models that are linked up together using
Mixture of Experts. What will GPT5, 6 etc. be like?
• Are we running out of data to train? What is enough?

• Green AI requires less usage of electrical power.


Demo

• POE.COM –
uses
multiple LLM
in 1 site.
• https://poe.com/
History of GPTs
Inventing Transformers created the base
• Transformers are a type of AI that have been shown to be very
effective for natural language processing tasks, such as text
generation, translation, and question answering. They quickly
became new AI models that are super large and can thus
understand and generate text in a human-like way.
• Its attention mechanism allows them to learn long-range
dependencies between words in a sentence. This makes them very
well-suited for tasks that require understanding the context of a
sentence, such as text generation.
• First introduced in the paper "Attention is All You Need" by
Vaswani et al. (2017). Since then, they have become the baseline
architecture for models such as GPT-3, T5 etc. These models have Replacing older AI methods for:
achieved impressive results on a variety of tasks, including • Forecasting
generating realistic and coherent text, translating languages, and • NLP data recognition from
answering questions in an informative way.
relationship to entities and
• Previous AI image, audio
recognition.
Transformers: Pros and Cons
Applicable to all GPTs

• Advantages of transformers:
• Can learn long-range dependencies between words in a sentence.
• Very efficient, do its work in parallel paths.
• Can be fine-tuned for specific tasks, making them very versatile.
Disadvantages of transformers:
• Computationally expensive to train.
• Difficult to understand and interpret. This is known as Explainability.
• Not always able to generate text that is logically correct or factually
accurate.
Definitions
Foundation Models
Pre-trained base models, trained on a massive dataset of text and code, e.g. everything is on the Internet.
This allows them to learn the statistical relationships between words and concepts, images etc and can
thus do super human tasks.

LLM: Large Language Models


It’s a Foundation Model (very very large e.g. 175 billion parameters) for text, and can be used to generate
text, translate languages, write different kinds of creative content, and answer your questions in an
informative way.

Token: A chunk of text that the model reads or generates. A token is typically not a word; it
could be a smaller unit, like a character or a part of a word, or a larger one like a whole
phrase. Measurement for output, e.g. 50 tokens /sec. Roughly, one token = 0.7 x word.
Definitions
Finetuning
Adjusting the parameters of a pre-trained language model to improve its performance on a specific
task, just by updating a small subset.
Temperature
Parameter that controls the level of creativity in the text that the model generates. A higher
temperature results in more creative text, while a lower temperature results in more accurate text.
Prompting (Prompt Engineering)
Using large language models to generate creative text formats by providing them with a prompt
that describes the desired output. E.g. Prompt: Write a poem about a flower that is dying.
Context (size is important, how many Kbytes e.g. 2K or 8K)
refers to the information that is provided to the model as input, which it uses to generate its
output. Context can include a wide range of information, such as the text of a conversation, the
user’s previous interactions with the model, or any other relevant information that can help the
model understand the user’s intent and generate an appropriate response.

Narrow AI
Conventional AI that does just one task. But now, new models can do multiple tasks.

AGI (Artificial General Intelligence)


Hypothetical type of artificial intelligence that would have the ability to learn and perform any
intellectual task that a human being can.
Dumb or Smart?
a "stochastic parrot" is a large language
model that is good at generating
convincing language, but does not actually
understand the meaning of the language it
is processing.
Super impressive but is still stupid.

Or
• AGI – Artificial General Intelligence Going to end
the world…
• https://youtu.be/Mqg3aTGNxZ0 It

• 'Sparks of AGI' - Bombshell GPT-4 Paper

• so smart that we cannot tell that it is not


human.
On the Hugging Face Hub, you can find both
Huggingface LLM Stack vanilla language models and enhanced
language models fine-tuned on instructions.
What can be generated?
Marketing:
1. Blog posts based on keywords and the desired length
2. Product descriptions based on data about its features and benefits
3. Social media posts
4. Media campaigns (example, ads)

All business units:


5. Reports like regional sales reports

Media:
6. Automated article generation for regular events like sports matches

Text Summarization
7. Creating newsletters
8. Summarizing internal company documents

Education and Research


9. Educational material and MCQ
10. Facilitating the review of literature in research contexts, and much more
Demos:
• Bard could be better, analyse an image

• Bing Chat (Edge) – check facts


Where to get the LLM models?
• Huggingface has them. (open source ones)
• https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard
• MMLU stands for "Mixed Multi-Lingual Understanding". It is a benchmark used to evaluate the performance of natural
language processing (NLP) models on a variety of tasks, including understanding and generating text in multiple languages.
The MMLU benchmark is based on a dataset of 14,000 multiple-choice questions spanning 57 subjects.
• https://huggingface.co/concedo/Vicuzard-30B-Uncensored MMLU=58.2 (June23)
• https://huggingface.co/stabilityai/FreeWilly2 MMLU=68.8, Avg=71.4 (24July23)
• https://huggingface.co/mlabonne/NeuralBeagle14-7B-GGUF MMLU=64.55, Avg=74.74 (17Jan24)

• ChatGPT achieved an accuracy of 78.5% on the MMLU benchmark


• GPT-4 achieved a state-of-the-art accuracy of 86.4% on the MMLU benchmark.

• Types of models: quantised (faster like got compressed, via TheBloke in different bits)
• Names: animals e.g. llama, alpaca, dolphin, orca etc.
Open Source versus Closed Source LLM
• Open source and closed source refer to the availability of the source code of a software
program. Open source software is software whose source code is made available to the
public, allowing anyone to view, modify, and distribute the code. Closed source software,
on the other hand, is software whose source code is not made available to the public and is
typically owned by a company or individual.
• In the context of large language models (LLMs), an open source LLM would be one whose
code and training data are publicly available, allowing anyone to view, modify, and use the
model. A closed source LLM would be one whose code and training data are not publicly
available and are typically owned by a company or individual.
• The commercial usage of open source and closed source LLMs can vary. Open source LLMs
can be used by anyone for any purpose, including commercial purposes, as long as the
terms of the open source license are followed. Closed source LLMs, on the other hand, are
typically only available for commercial use through licensing agreements with the owner of
the model.
• E.g. Meta’s LLama2 is free until customer number reaches 700 million accounts (for
companies).
Debate about open source developing faster
• According to a leaked memo from a Google employee, the company’s
advantage in artificial intelligence is shrinking quickly due to the rapid
developments being made by open source developers. The memo warns
that while Google and other big tech companies have been focused on their
rivalry with each other, they have neglected the growing community of
programmers and companies that rely on publicly available AI code and
models to create smaller but more efficient projects.
• The Google employee wrote that open source developers are “lapping” big
tech companies in terms of the quality of their AI models, and that the gap is
closing astonishingly quickly.
• Some experts and industry analysts agree with this assessment, with OpenAI
founder Andrej Karpathy writing on Twitter that the surge of small AI
companies competing with tech giants is starting to massively shake up the
industry.
• Leaked Google engineer memo warns that Big Tech could lose AI race to the
little guys (nbcnews.com)
28
Robots are coming
• LLMs can be used to give robots the ability to understand natural language
instructions, which can make them more versatile and easier to use.
• Latest developments in robots that are driven by LLMs:
• Google AI researchers have unveiled RoboCat, a self learning artificial intelligence model that is
built on the Gato general agent. It is a self-improving AI agent that learns to perform a variety
of tasks across different arms, and then self-generates new training data to improve its
technique. Can pick up a new task with as few as 100 demonstrations because it draws from a
large and diverse dataset. https://www.youtube.com/watch?v=RrfD1NxFN-o
• OpenAI has revealed their self learning agent that used video data from humans to
learn various Minecraft tasks.
• https://www.youtube.com/watch?v=HaaZ8ss-HP4 Deepmind Mobile Aloha doing housework.
• https://www.youtube.com/watch?v=gyURDZB7imo Tesla Optimus folding clothes
• https://www.facebook.com/parentips/videos/teach-kids-to-fold-clothes-with-a-diy-folding-
board/801417770748603/ Human folding clothes
• A team of researchers at the University of California, Berkeley has developed a robot that can
learn to perform tasks by watching humans. The robot, called REAPR, uses an LLM to learn the
sequences of actions that humans take to perform tasks. REAPR is still under development, but
it has the potential to make robots more autonomous and adaptable.
• A company called Intuition Robotics has developed a robot called Moxi that can provide
companionship and assistance to elderly people. Moxi uses an LLM to understand natural
language instructions and to generate conversation. Moxi is still under development, but it has
the potential to make a positive impact on the lives of elderly people.
Robots are coming
• https://www.youtube.com/watch?v=6OB7r4gUh74
• DARPA Subterranean Challenge Final Event Wrap-Up, Sep 21, 2021
• The Subterranean (SubT) Challenge was a Defense Advanced Research
Projects Agency (DARPA) program to develop innovative technologies that
can augment underground operations.
• Explored new approaches to rapidly map, navigate, search, and
exploit complex underground environments such as human-made
tunnel systems, urban underground, and natural cave networks.
These difficult settings present challenges for military and civilian first
responders; hazards vary drastically across terrain that can change
over time, making it too risky for personnel to enter.
Conclusion
• IMF job impact 40% https://www.imf.org/en/Blogs/Articles/2024/01/14/ai-will-transform-the-global-
economy-lets-make-sure-it-benefits-humanity
• Massive job loss is not immediate.
• When will it start… already started, and will accelerate quickly.
• Covid crisis will pressure all companies to go digital much faster, e.g. cosmetics manufacturing, schools,
banking services.
• Is it old wine in new bottle; like global warming, globalisation etc, that we have experienced before?
• How will AI make its greatest impact?
• Changes to world order, nature of our economy, how we will live, our hopes and aspiration for the future etc.
• Who will benefit most?
• The various Internet giants
• You! As you have seen the future.

• Will there be an AI winter, yet again?


• What else is important?
• AI Cyber and data security

You might also like