DISCRIMINATIVE AI:
- Discriminative AI actually discriminate the input between cat or dog image
- It tells about the sentiment of a sentence, whether it is a positive or negative
GENERATIVE AI:
- On the other hand, Gen AI generates the content (text, image, audio, video)
- It has the capability of discriminative AI too, otherwise it can’t produce the things which is not known by it
- NLP, Computer Vision, Speech Recognition are the main three domains of Gen AI
- In NLP we deal with Textual data, in Computer Vision we deal with images and video (moving pictures), whereas audio signals are studied in Speech Recognition
There are numerous models in each of the above mentioned fields of AI, listing very few but the most famous of those
Text Generation
- ChatGPT 3.5/4 (OpenAI)
- Bard (Google)
Image Generation
- Dall-E3 (OpenAI)
- Stable Diffusion (Diffusion or Latent Models) [Stability AI]
Music Generation
Video Generation
LLM Large Language Models are:
- Studied under NLP
- LLMs are a Special type of Neural Network
- Also called GPT (Generative Pre-Trained Transformer)
- Parameters are actually neurons
- There were 176B Neurons in GPT 3 and had the IQ level of 155 [equivalent to a human’s IQ]
- The next version which is free right now is GPT 3.5 by OpenAI
- Claude is another LLM (GPT)
- GPT 4 (IQ level is 10x times better than GPT 3, imagine how it will grow within 10 years)
- Llama-2 is an Open source LLM developed by Meta
- Mistral is also an Open source LLM (GPT)
HOW DO LLMS WORK ?
- They work on the principles of Tokenization
- Which is the process of breaking down the input text into smaller units called tokens, which are actually words, phrases, or even characters
- Parameter is just a neuron
- Billions of neurons are there in a GPT
- Learning capacity is directly proportional to number of neurons that means a GPT with a large number of neurons will have the corresponding larger capacity
- Approximately 3-4 tokens makes a sentence
- GPT model processes the Tokens
- GPTs can process and understand Limited number of tokens
- Tokens are the vocabulary of GPT
- It can generate content from within its vocabulary
- LLMs are actually GPTs
HOW LLMS GENERATE TEXT?
- LLMs are trained with a dataset and produces the next word with the help of already trained data, like it read the previous words and checks the vocabulary to generate the next words
- For example: Orange is a bright
- Think and reply if we can use COLOR or FRUIT
- [here the last word is bright which is associated with color only] (color)
- Likewise in this example, Orange is a tasty (fruit is the best suitable)
CHANCE CALCULATION
- GPT reads all the previous words, and calculates the chance of which word has most higher chance among all
- Tokens are the units of text used by language models LLMs (GPTs), they can be as short as a single character, a word or a phrase
- Context window of a LLM
- GPT 3.5 - the context window is 4000 tokens, more than that can not be processed by GPT 3.5
- Token is just a fancy name of word
PROMPT:
- Prompt is just like an input (instruction/question) to the GPT
- You have to use the limited number of tokens in prompts and produce the best possible outcome, that is called prompt engineering
PROMPT ENGINEERING:
- It is actually an engineering like how to ask from GPTs to get the best answers that are required
- Wise is one who knows what to ask (Prompt Engineer)
- Important is how to ask
- Imagine GPT is an old man
- You have to ask something from this old man, so you have to be careful about how and what to ask for getting your desired output
- 1. Context:
- 2. Short - to the point:
- 3. Output:
ANATOMY (INGREDIENTS OF A PROMPT):
A prompt is designed by following the below ingredients:
- Simulate persona (act as a python programmer)
- Task (you have to do this, that)
- Steps to complete the task (tell the steps that you have already done, or what you have to follow the steps, very detailed description at minute level)
- Context/constraints (Limitations, you have to use only this, that)
- Goal (Desired Output)
- Format the Output (string, table, JSON)
IMPORTANT TIPS:
- You should know the Server cost - token cost to win a project (Freelancing Tip)
- It will be a deal breaker or maker
- Read more lectures, articles, blogs to learn to the prompt engineering before the next lecture
- Next lecture will be about the advanced prompt engineering
- Co-pilots are another big thing from which you can earn in AI along with ChatBots
- Critical thinking is very important to build and earn in AI
- How to know the token cost ?
- Costing model
- Client requirement
- Disclaimer: cost estimation will be the estimation at the end of the day, you have to pay from pocket if you lock the cost, like make it flexible and tell your client that it can vary as per the code usage on Cloud or Server.