RisingCoder Full course โ†’
Day 1Day 2Day 3Day 4
๐Ÿค–
STUDENT NOTES ยท DAY 17 OF 24

How AI Actually Works ๐Ÿค–

ChatGPT feels like magic. Today you learn the trick โ€” and it's simpler (and cooler) than you think.

1The one big trick: guess the next word

๐Ÿ
Py: An LLM plays one game, billions of times: "given this text, what word probably comes next?" Guess, add it, guess again. That's it. That's the whole magic.

Play the LLM! What comes next?

Once upon a ___

The model gives every word a probability โ€” then usually picks a likely one.

2Words for your new world

๐Ÿ—ฃ๏ธ Prompt โ€” the text YOU send in.   ๐Ÿงฉ Token โ€” a chunk of text (โ‰ˆ part of a word) โ€” models read and bill in tokens.   ๐ŸŒก๏ธ Temperature โ€” low = safe and predictable, high = creative and wild.

๐Ÿฆ‰
Professor Hoot: Better prompt โ†’ better answer. "Explain loops" is okay; "Explain loops to a 10-year-old using cricket" is chef's kiss. ๐ŸคŒ

3Talking to an LLM from Python

๐Ÿค–
Bittu: Same requests.get idea as the weather API โ€” different URL, smarter replies. You already have this skill!

4The warning label โš ๏ธ

๐Ÿž
Bugly: LLMs sometimes state WRONG things very confidently. It's called hallucination โ€” my proudest collaboration.
๐Ÿ
Py: They generate plausible text, not verified facts. Always double-check numbers, names and citations. Trust, but verify!

5Quick quiz! ๐Ÿง 

At its core, an LLMโ€ฆ
๐Ÿ’ก Predict โ†’ append โ†’ repeat, at massive scale. Simple trick, astonishing results.
Turning temperature UP makes answersโ€ฆ
๐Ÿ’ก Low temp = safe librarian. High temp = wild poet. Choose per task!

6Your mission ๐Ÿš€

Mission 1: Ask the same question to the class AI at temperature 0 and 1.5 โ€” compare the answers.
Mission 2: Craft a prompt that explains dictionaries using a cricket analogy. Refine it twice.
Mission 3: Catch the AI hallucinating: ask about a fake event and watch it improvise. Screenshot it!

Day 17 done โ€” the magician's trick is yours! ๐ŸŽฉ

Next: build your own AI chatbot with memory.

Go to Day 18: Build a Chatbot โ†’

๐ŸŽฎ Or test yourself in the Python Arcade โ†’