AI Learning Roadmap — Part 1
AI Learning Roadmap — Part 1
Foundation Level
- LLM
An LLM (Large Language Model) is an AI system trained on very large amounts of text (books, websites, code, and licensed data) to learn patterns in language.
When you give it a prompt, it predicts the next token based on context, then the next one, and so on, until it forms a complete response.
It’s similar to autocomplete on your phone, but far more advanced and able to work across long passages of text and many different tasks.
Example
You type: “The capital of France is…”
LLM predicts: “Paris” because that completion has very high probability based on learned patterns.
You type: “Write a poem about cats”
LLM generates a poem by predicting one token at a time.
2. Token
Text is broken into small pieces called tokens. Tokens are not exactly words — they can be whole words, parts of words, or symbols, depending on the model’s tokenizer.
When you send text to an AI API, it counts tokens, not characters.
Example (varies by model):
"Hello" → 1 token
"understanding" → may be split into multiple tokens
Punctuation like "!" can also be a token
Most AI APIs price usage based on the number of tokens processed (input + output).
If you send 1,000 tokens and receive 500 tokens back, you are billed for 1,500 tokens.
3. Prompt Engineering
Prompt engineering is how you write instructions to the AI. The quality of your prompt can significantly change the quality and format of the response.
Examples:
Bad prompt
Summarize this: The weather today was sunny with a high of 75 degrees.
Good prompt
Summarize the weather in exactly 2 sentences, including temperature and sky conditions.
This forces the model to follow clearer rules.
Few-Shot Prompting
Even better prompt with an example (few-shot prompting):
> Summarize weather in 2 sentences.
> Example Input: “Morning rain expected. High 60°F.”
> Example Output: “Rain is expected in the morning with a high of 60°F.”
Now summarize:
The weather today was sunny with a high of 75 degrees. It was a beautiful day.
Providing an example helps the model match the structure you want.
Common Prompt Engineering Techniques
- Be specific about what you want
- Give examples of good outputs
- Ask for a specific format (JSON, bullet points, tables, etc.)
- State what not to do
- Break complex tasks into steps
Example:
A company needs to extract customer names from support emails.
Bad prompt:
Extract names
Good prompt:
Extract only the customer’s full name from this email.
If no name exists, respond “NO_NAME”.
Email: “Hi, I’m John Smith and I need help with my account.”
Result: More consistent and accurate extraction.
4. Parameters
Key Terms: Temperature, Top-p, Max Tokens
These parameters don’t change what the model knows. They change how it selects the next token when generating text.
a. Temperature
Temperature controls how much the model favors the most likely tokens versus less likely ones.
- Low temperature (near 0) → more predictable outputs
- Higher temperature → more varied outputs
Note: Lower temperature does not guarantee factual answers. It only reduces variation.
Example:
Prompt: “Write a short story about a dragon”
Low temperature → similar story each time
Higher temperature → different story each time
b. Max Tokens
Max tokens sets a hard limit on how long the response can be.
- Lower value → shorter response
- Higher value → allows longer response (until the model finishes or hits the limit)
Example:
User: “Tell me about climate change”
Max Tokens: 50 Response: “Climate change refers to long-term shifts in global temperatures and weather patterns caused primarily by human activities.” (Short answer)
Max Tokens: 500 Response: “Climate change is the long-term shift in Earth’s temperature and weather patterns… [much longer detailed response]”
c. Top-p (Nucleus Sampling)
Top-p (0 to 1) limits the model to choosing the next word from the most likely options, based on probability.
- Lower top-p → narrower choices → more focused output
- Higher top-p → wider choices → more diverse output
Top-p and temperature often work together to control variation. Different tasks need different settings. Customer support (factual) = low temperature. Marketing copy (creative) = high temperature.