What is the best AI?
107 – What is the best AI chatbot, image, sound, video code, generator or logical reasoner?
Practical advise on how to choose the correct chatbot and prompt it correctly.
Intro: In this tutorial you will learn how to prompt correctly and select LLM models. The in depth details will be covered in class.
By [Author] | [Date] | ~ [Read time]
Table of Contents
Overview
Obtaining the desired output from a LLM depends on many factors. The factors that you can control are
the Prompt and the LLM model that you will use.
Creating an ideal prompt
Ask AI to improve your prompt.
Improve the following prompt:
Act as a AP Biology Instructor. Explain in detail how cellular respiration occurs.
After that ask me 5 questions to ensure that I have understood the main concepts of AP Biology.
Ask me questions until you are 97% sure you have understood my requirements and can provide the results requested.
The AI will respond with a properly formatted prompt that you can adjust it to your requirements.
You can also use the [Study] or [Research] buttons if they are available to you.
A good summary of what kind of prompts you can write and prompting examples can be found here:
https://www.promptingguide.ai/introduction/examples
A good prompt will have the following features
1. Task : Start with an action verb.
2. Context: User background, what success looks like, and environment or conditions of user.
3. Examples: Provide examples of the best or real results. It learns very fast through examples.
4. Persona: Act like a ______. (Also add person famous for that).
5. Format: Tell the AI the right output format you want the answer in.
6. Tone: Specify the desired tone, whether casual, formal, enthusiastic, or specific feelings, guiding the LLM to match the writing style.
7. Refine: Give the LLM a chance to understand what you want and also give it a way out to say what it does not know
Below we give examples of using the 7 ideas discussed above.
1. Task: Always start with an action verb and clearly articulate your end goal.
Use verbs like “generate,” “give,” “write,” “analyze,” etc., to clearly define the task.
Example: “Generate a three-month training program.”
2. Context: Include relevant background information to give enough detail without overwhelming the model. The model does not know what you did before you asked the question.
Ask yourself:
What’s the user’s background?
What does success look like?
What environment are they in?
Example: “I am a 70kg male looking to put on five kilograms of muscle mass over the next three months.”
3. Exemplars: Provide examples or frameworks to improve the quality of the output.
Example: “Rewrite this bullet point using the structure: I accomplished X by Y, resulting in Z.”
4. Persona: Define who you want the LLM to emulate (e.g., a recruiter, physical therapist).
Example: “You are a senior product marketing manager at Apple.”
5. Format: Visualize the desired end result and specify the format (e.g., bullet points, tables).
Example: “Output a table with headers: Original feedback, Team responsible, and Priority.”
6. Tone: Specify the tone of voice to match the desired output (e.g., casual, formal).
Example: “Use clear and concise language and write in a confident yet friendly tone.”
7. Refine: Ask the LLM to ask you questions and refine and improve the concept and let it say IDK (I Don’t Know) for things it is unsure about. This reduces some hallucinations.
Example: Think carefully and ask me questions until you are 97% certain that you can answer my question with utmost confidence. If you do not know something say IDK and pose it as an opinion.
Combine All the Components in a Comprehensive Prompt
Example 1: “You are a high school student preparing a presentation on how LLMs are used in everyday life. Create a slide deck with an overview, 3-4 examples of LLM applications, and a section on ethical concerns. Keep the tone informative and engaging. Before you give the final result
think carefully about the task and ask me questions until you are 97% certain that you can perform the task with utmost confidence. If you do not know something say IDK and pose it as an opinion”
Selecting an LLM Model
To chose a model consider the following factors. Here are some of the most important factors you should consider and the questions you should ask
What has the model been trained on – Internet, Code, Medical
Do you need a Text Only model or a Multi-Modal Model (i.e. Includes Images, Sound, Video etc.)
Is it a foundation model (trained from scratch) or a distilled model (model taught by another model) or a quantized model (accuracy reduced to fit into the size of the computer)
What is its architecture (not necessary but good to know) . Example of architectures.
How much does it cost in terms of tokens. Example of tokens.
Number of Parameters (in Billions) is a common way to classify LLM power. Typically a higher parameter means more powerful model. They can be categorized into two main types: trainable parameters and hyperparameters.
Trainable Parameters
- Weights: These are numerical values that determine the importance of specific inputs. Higher weights mean the input is more relevant to the model’s output.
- Biases: These are constant values added to the input signals. They help the model activate neurons even when weighted inputs are low, allowing for more flexibility in learning.
Hyperparameters
Hyperparameters are external settings that guide the model’s learning process and output behavior. Key hyperparameters include:
- Temperature: Controls the randomness of the output. A lower temperature results in more predictable text, while a higher temperature allows for more creative responses.
- Max Tokens: Sets a limit on the number of tokens (words or characters) the model can generate, affecting the length of the output.
- Top-p (Nucleus Sampling): Determines the cumulative probability threshold for word selection. A higher value allows for more diverse outputs, while a lower value focuses on more probable words.
- Context Window: Refers to the number of preceding tokens the model considers when generating the next word, impacting how much historical context is used.
You can adjust some parameters and tailor the LLM to your needs. You should refer to the Model Card when evaluating models.
Examples of Model Cards HF,
Below are three places you can grab and review LLM models.
Verifying the results
Putting everything together
The best models can be found at the following locations and you can compare and contrast the models in the playground by giving them the same token.
Your prompts are public and viewable by everyone. You should not put any identification information in there!