Module Structure
AI doesn't invent books. It predicts the next token.
«AI kitob to'qib chiqarmaydi — u keyingi tokenni taxmin qiladi»Before deciding whether to “give it to AI or do it yourself” — you need to understand how it even assembles an answer. One mechanism: predict the next token based on what came before. Everything follows from this — where it's strong, where it confidently lies, and which tasks you can delegate to it unsupervised.
Hook — about books that don't exist.Mavjud bo'lmagan kitoblar haqida
Zukhra is a Python mentor in Yunusabad. Besides code, she manages the cultural section of the school newspaper. She asks the agent: “write an essay about the Uzbek poetess Zulfiya for children aged 12-14, 800 words, mention 3-4 of her main poetry collections.”
40 seconds later — a smooth text. Five collection titles. All sound plausible. Zukhra checks the Alisher Navoi library catalog — two collections don't exist. The agent invented them. Confidently.
This isn't “AI is stupid.” This isn't “the model broke.” This is Next Token Prediction — that very mechanism that allows the agent to write code smoothly and translate letters to parents. The same mechanism — assembles non-existent collections from plausible words.
To understand NTP — means learning to foresee where the agent is working on well-worn paths, and where it veers into novel territory and starts to lie. Without this, delegating tasks to it is a lottery.
Three skills I'll be checking for
- Break down your tasks (at least 10) into three levels:
Full delegation(agent does, you approve diff) ·Co-creation(agent drafts, you edit) ·Validation(agent checks, you do). - Recognize on the fly, where a task falls into well-worn paths (NTP is strong here — boilerplate, translation, refactoring by example) vs. novel territory (NTP struggles here — rare facts, names, specifics of your project without context).
- Explain to a child or colleague, simply, how an agent assembles an answer — token by token, by probability distribution — without any bullshit about "magic" or "AI thinking."
Mental model — NTP, how an agent assembles an answer.NTP — agent javobni qanday yig'adi
Anthropic, in their "AI Capabilities and Limitations" (lesson 4), define Next Token Prediction. This is the central source for this module. Below is a verbatim quote with translation, then an ASCII visualization of the mechanism, then a table showing where it works and where it struggles.
1. What is NTP — verbatim
«Generative AI is closer to a vastly sophisticated autocomplete than to a search engine. It writes answers word by word based on what tends to follow what. That single property gives you both the fluency and the hallucination.»
2. How it works internally — simply explained
In lesson 5, Anthropic illustrates this through a game: 5 SMS messages → frequency table → each next word is chosen by probabilities. An LLM does the same thing, but instead of a table, it has billions of parameters and a forward pass through a neural network.
The main shift. When the agent writes "collection of poems 'Bahor' 1953" — it didn't retrieve this fact from memory. It generated it token by token, and each token was "plausible in form." "Bahor" is a normal Uzbek word. 1953 is a normal year. This is a valid continuation statistically. Whether such a collection exists in reality — for NTP, that's not a matter of mechanism.
3. Karpathy's metaphor — a zip file with an emoji
«Hi, I'm ChatGPT. I am a 1 TB zip file. My knowledge comes from the internet which I read in its entirety about six months ago and I only remember vaguely. My winning personality was programmed by example by human labelers at OpenAI. You're talking to a zip file. If you stream tokens to it, it will respond with tokens back.»
4. Well-worn paths vs novel territory
Anthropic introduces this distinction in lesson 4 — continuum, not a binary. On the left are tasks the model has seen a million times. On the right is where it's on thin ice and doesn't even know it.
for-loop into a list comprehension (Python idiom, repeated infinitely in the corpus)3.7.2 (the model knows the API “in general terms,” confidently adds a non-existent method)while loop to a 9-year-old child (popular pedagogical task)This isn't a cliff on a specific task. It's a gradient. The same task with CLAUDE.md and Read access to files — moves left on the scale (the agent read it — it now has facts, not guesses). The same task without context — on the right (the agent is guessing). Operator's rule: before delegating to novel territory — give the agent a source of truth in the context (file, document, link). Then it moves onto well-worn paths for your specific task.
5. Smooth prose can wrap a guess
«Hallucination: the plausible continuation isn't always the true one. Confabulation: fills gaps with plausible material rather than flagging them. Misplaced confidence: smooth prose can wrap a guess.»
Connection to Delegation. This smoothly leads to 4D. Anthropic in their AI Capabilities course explicitly state: «Next Token Prediction is the foundation of Discernment. Knowing the output was generated tells you exactly what kind of scrutiny to apply» (lesson 4). Translation: if you understand how it was generated — you understand how how to check it. Delegation = deciding “to hand off or not” based on this understanding.
4D · Delegation — what to hand off, what to keep.Nimani berasan, nimani o'zing qilasan
Anthropic, in their course “AI Fluency: Framework & Foundations,” introduces the 4D framework: Delegation · Description · Discernment · Diligence. This is the first D — making the decision “do it myself / together / hand off”. Below is the verbatim definition + three sub-components + three levels for a Mars mentor.
«Delegation refers to the ability to identify when and how to use AI tools and modalities effectively in creative and problem-solving processes. It involves understanding the capabilities and limitations of various AI technologies and making informed decisions about when to use AI for automation, augmentation, or independent agent-mediated experiences.»
Three sub-components (Anthropic verbatim, translated)
«What am I trying to do?»
Understand your task completely before calling AI. What does a “good result” mean? Which parts require human expertise, and which don't? Without this, you're delegating something you haven't even formulated yourself yet.
«What do you do well?»
Understand capabilities & limitations of a specific tool. For us: Claude Code is strong on code with tool use, weak on fresh facts, doesn't remember between sessions without CLAUDE.md. This is about the NTP map we just drew.
«Ok, here's the plan»
Divide the work: what's you alone, what's with AI, what's AI alone. Use the strengths of each side. Don't “automate everything” — partnership.
Directly from lesson 06 (FW · Delegation), verbatim: «The goal isn't to automate everything, but to create the most effective human-AI partnership for any given task or goal.» In Russian: the goal is not to “remove humans from the process,” but to amplify humans where they are strong, and give to AI where AI is strong. Augmentation, not automation. For a Mars mentor, this means: pedagogical decisions, student assessment, choosing “what we teach today” — that's yours. Boilerplate, translation, refactoring by example — that's AI.
Three levels of delegation for a mentor (how to apply)
We take sub-component 03 (Task Delegation) and break it down into three practical levels. This isn't abstract — this is how you'll label your list of 10 tasks in the exercise.
“do it and show me the diff”
Example: “read
01-circle.py, following the example, do 06-triangle.py ... 10-spiral.py. ≤30 lines, names as in 01”. You do the git diff, approve it.“my plan, your execution”
Example: “come up with 5 loop exercises for 12-year-olds.” The agent throws a framework — you cross out two, rewrite one, then ask to finalize.
“check it, I'll fix it myself”
Example: "read my
lesson-12-loops.md, find (a) syntax errors in code examples, (b) places where the code is more complex than the topic. Don't fix — provide a list." You filter the list — because some findings will be hallucinations themselves.Integration with NTP. The level is not chosen at random. Full — when the task is in well-worn paths and there is a verifiable check (diff, test). Co-creation — when the task requires your pedagogical judgment (this is no longer well-worn). Validation — when the task is in novel territory (your lesson, your specifics), but the agent can help as an extra pair of eyes — provided you filter later.
Now you will see 4 real requests from Zukhra in Claude Code. Write down on paper: on which of the 4 will NTP work correctly? On which will it hallucinate? And how exactly will Zukhra catch the hallucination (if she catches it)? The prediction is made now, the check is 3 minutes below.
Demo — one day of Zukhra in Claude Code.Zuhraning bir kunlik ish kuni
Zukhra, a Python mentor in Yunusabad. Group 7-9 years old (Mars Python juniors). Today — 4 different tasks in the morning. Each falls into its own level of delegation. On the last one — NTP fails; see exactly how she catches it.
10:14 · Full delegation — translating an announcement to parents
Tomorrow is a trip to the park, need to send it to parents in Uzbek. A well-known Claude well-worn path: standard constructions, a million examples in the corpus.
$ claude ✓ CLAUDE.md loaded ~/mars/comms/CLAUDE.md (1,420 tokens) › translate to Uzbek for parents, polite tone, no emojis: "Tomorrow, Saturday at 10:00 AM, departure to Tashkent Park. Gathering at the Yunusabad branch. We will return by 1:00 PM. Bring water and a cap. If the child is not coming — please write by 6:00 PM today." ⠋ Generating… Hurmatli ota-onalar, Ertaga, shanba kuni soat 10:00 da Tashkent Parkga sayohat qilamiz. Yig'ilish — Yunusobod filiali oldida. Soat 13:00 ga qaytamiz. Iltimos, farzandingiz uchun suv va shapka olib keling. Agar farzandingiz bormaydigan bo'lsa, iltimos, bugun soat 18:00 gacha xabar bering. Hurmat bilan, Mars IT School · Yunusobod
What happened: a well-worn path in its purest form — translation between paired languages. Zukhra checks it with her eyes for 30 seconds, sends it. Level — Full. Diff = text, verifiable = an Uzbek parent understands it.
10:18 · Co-creation — 5 loop assignments for a 12-14 group
Zukhra sometimes substitutes for a colleague in the older group. Prepares a block "introduction to for and while».
› come up with 5 loop (for/while) assignments for a 12-14 Python group. level: they know variables, if/else, input. loops — first time. each assignment: title, goal, code skeleton with TODO for the child, expected output. increasing difficulty. ⠋ Drafting… 1. "Counting from 1 to N" — for, range, print 2. "Sum from 1 to N" — for, accumulator 3. "Guess the number" — while, input, break 4. "Multiplication table" — nested for 5. "Sieve of Eratosthenes" — list, for, modulo + code skeletons for each task
What Zukhra does. Opens each skeleton. Assignment 5 (Eratosthenes) — too complex for a first introduction to loops, she discards it. Assignment 2 — renames it to "piggy bank" (the metaphor is clearer). Assignment 3 — the agent in while doesn't have "attempts" — she adds a counter. Then asks to finalize the remaining 4 into .py files.
What happened: a well-worn path for the framework (Python boilerplate, standard tutorials), but pedagogical solution “what suits this age” — that's Zukhra. Level — Co-creation. Without her filter, task 5 would have gone to the kids and ruined the lesson.
10:25 · Validation — lesson plan check
Tomorrow is the “lists” lesson for the Python 7-9 group. I wrote the plan yesterday, and I'd like a second pair of eyes: did I make any mistakes in Python facts, or overload the age group?
› read lesson-08-lists.md. Find: (a) factual errors about Python — syntax, behavior; (b) places where the code is more complex than the lesson topic (we're only doing lists); (c) sections where the variable name is not as in CLAUDE.md (snake_case, Russian words — ok). DO NOT edit the file. Provide a list with quotes. ⠋ Reading lesson-08-lists.md… ⠋ Reading CLAUDE.md… Found: [a-1] line 47: “fruits.append() returns a new list” — this is incorrect. append() modifies on the spot and returns None. [a-2] line 89: “the slice fruits[1:-1] excludes the last and second to last” — incorrect. It only excludes the last. [b-1] line 112: example uses list comprehension — more complex than the lesson topic, postpone. [c-1] line 64: variable fruitList — camelCase, CLAUDE.md requires snake_case. [a-3] line 134: “len() for a string also works via __length__” — this is __len__ (one underscore on each side would be __len__, incorrectly written).
Zukhra doesn't take things at face value. She opens lines 47, 89, 134 — three factual errors are confirmed by her experience. Good. Line 64 — her camelCase, indeed needs fixing. Line 112 — she agrees.
BUT. Zukhra remembers NTP. She asks the agent for a second pass:
› for each found error [a-1..a-3] quote the exact line from my file and from the official Python docs (section and URL). if you don't remember the URL — write "URL: not sure" instead of guessing. ⠋ Re-reading lesson-08-lists.md… [a-1] my file line 47: “fruits.append(x) → returns [...x]” Python docs: data structures · list.append() → URL: not sure (I remember it's in "More on Lists") [a-2] my file line 89: “fruits[1:-1] excludes the last and second to last” Python docs: tutorial · sequence slicing → URL: not sure [a-3] p.134 in the file — NO mention of __length__. I made a mistake in my first answer. My apologies, p.134 — it's an example of range(len(fruits)), not __len__.
Here it is. The third "error" (__length__) — was an agent's hallucination. The quotes from the file for the first two were found (that's true). For the third, the agent admitted when pressed for the source. Level — Validation. Zuhra used the agent as an "extra pair of eyes," but the final filtering was hers.
10:31 · Novel territory — an essay about Zulfiya
That very task from the hook. Zuhra tried it — smooth text, 5 collection titles. Right in Claude Code:
› write an essay about the Uzbek poetess Zulfiya for the cultural section of the school newspaper. 800 words. for children aged 12-14. mention 3-4 of her main poetry collections with years. ⠋ Generating 800 words… Zulfiya Israilova (1915–1996) — the voice of Uzbek poetry of the XX... [...] her collections include: • «Hayot varaqlari» (1932) • «Qizlar qo'shig'i» (1947) • «Bahor nafasi» (1953) • «Onamning kuylari» (1968) • «Xotira» (1985) [...]
Zuhra catches the hallucination in two moves.
- She asks for a source for each title: "for each collection, provide: library catalog or URL. if unsure — write 'unsure'". The agent returns: "Hayot varaqlari — in Alisher Navoi catalog; Qizlar qo'shig'i — yes; Bahor nafasi — unsure; Onamning kuylari — unsure; Xotira — yes".
- She checks the 5 titles in the catalog
natlib.uz(National Library of Uzbekistan). 3 are found, 2 are not. This matches what the agent admitted.
What happened. This is not Validation, this is novel territory without a source in context. NTP confidently generated generated 5 plausible titles, because "title of a collection by an Uzbek poetess from the mid-20th century" is a valid combination of words in form. Of these, 3 are true, 2 are made up. Smooth prose wrapped a guess.
A lesson for Zuhra (and for you): when the task is about specific facts in a narrow domain (names, dates, titles, quotes) — don't delegate it fully. Either give the agent a source (upload a catalog / Wikipedia / PDF), or write the facts yourself, and let the agent just wrap them in text for the target audience.
How it looks for Timur (Python Olympiad 12–14, Chilonzor)
Timur has a group of Olympiad participants. CLAUDE.md from M1 — his is specific: list comprehension, dataclasses is allowed, a comment with the algorithm's complexity (O(n log n)) is required above each task. Today — Validation-task.
The student sent a solution to the problem "prefix sums, find a subarray with sum = K" from olymp.uz. 87 lines. It works on small examples, but gets TLE on a large one. Timur asks an agent to check the correctness and complexity.
› read student-solution.py. check: (1) correctness — are there any logical errors; (2) complexity — estimate O(?) and compare with expected O(n); (3) compliance with CLAUDE.md (O(...) comment at the top, snake_case). [1] correctness: on line 34, the check prefix[j] - prefix[i] == K is logically correct. But the loop on lines 28-40 is a double for loop, which is O(n²), not O(n). [2] complexity: effectively O(n²). Expected for prefix sums is O(n) using a hashmap "have we seen prefix[j]-K before". [3] CLAUDE.md: The comment "# O(...)" at the top is missing. Variables prefSum, nMax — camelCase. [reference] in this repo there are similar solutions: olymp/easy/sum-subarray.py — O(n) using a dict. olymp/medium/two-sum.py — the same pattern.
What Timur received. Correctness confirmed (the agent checked the logic of the branch on line 34), complexity explained with a specific anti-pattern (double for loop on lines 28-40), violations of CLAUDE.md conventions listed, plus links to his own reference solutions in the repo. Timur doesn't take it at face value — he opens olymp/easy/sum-subarray.py it with his own eyes, sees the O(n) variant, and guides the student to it.
Where NTP helped: well-worn path (Big-O analysis, typical prefix sum patterns — a million educational examples in the corpus). Where it could have lied: if the agent had invented a link to a non-existent file in the repo — Timur would have caught it by opening it. A verification step is built in.
Exercise — 3 probes for your own tasks.Uchta probe — o'z vazifalaringga
Adaptation of "The Verification Test" exercise from Anthropic's "AI Capabilities and Limitations" lesson 5 — for Mars mentor tasks. This won't happen hands-free. Allow 20-25 minutes.
Write down 10 real coding/teaching tasks for next week
Not "general tasks" — specific Mars mentor tasks that can be assigned (or not assigned) to claude. If there are fewer than 10 tasks — add typical ones from colleagues' work (checking homework, updating examples, translating materials, scripting for markup).
- Open a notebook / NOTES.md / a sheet of paper. Write in a column 1-10.
- Each task — one phrase, specific: "update
06-snake.pyadd arrows" (not "improve the game"). - Mark ⭐ those that require CLAUDE.md (your stack, your team's conventions), and ☆ those that are cold start ok (translating an announcement — doesn't require it, generic Python boilerplate — doesn't require it).
Next to each task, put Full / Co / Validation / None
This is the application of the NTP × Delegation map to your list. None — is a valid answer for a task where AI isn't needed (for example, “have a 1:1 with a bullied child” — that's not Claude Code, that's you).
- For each of the 10 tasks — one letter in one column: F (Full), C (Co-creation), V (Validation), N (None).
- On the right — one argument phrase: why exactly this level. Apply the well-worn vs novel map from the mental model.
- Check the balance: if you have 9 Full and 1 None — most likely you are over-delegating. If 9 None and 1 Full — most likely you are under-delegating. A healthy spread is usually 3-4 Full, 3-4 Co, 1-2 V, 1-2 N.
Take ONE Full and ONE Co — do both in claude
This is where technique meets reality. CLAUDE.md from M1 should be in the repo — this is the base for the probe.
- Full: open
claudein the correct repo, give the task in one prompt. Wait for the result. Do not edit the prompt along the way — the essence of Full is to get a ready-made result. - Open
git diff(or review new files). Write down: what exactly, where it surprised you (pleasantly or unpleasantly), what you had to edit. - Co-creation: the same thing, but with the first prompt, ask for only the plan (without code). Correct the plan with words. Only after approval — ask for the code.
- Compare the feelings. In which case did you trust the result more and why. In which case did you spend less time.
Before you check yourself — pause for 60 seconds
These answers stay with you — we don't collect them. This is a way to anchor two moments where the module breaks out of "read and forgotten."
Quiz — check yourself in 3 minutes.O'zingni sina — 3 daqiqada
Three apply-questions. Not "recall the definition," but "apply to the situation." If you get even one wrong, go back to the relevant section.
You gave the agent the prompt "write an essay about Zulfiya Isroilova, mention her collections with years." You received 5 collection titles with years. What should you do BEFORE using this list with children?
You have three tasks for today. What level of delegation is suitable for each?
Z1: read 01-circle.py and follow the example 06-triangle.py ... 10-spiral.py (5 files).
Z2: come up with 5 dictionary exercises for a group aged 12-14.
Z3: read your lesson plan lesson-12.md, find places where the code is more complex than the topic.
On which of the three tasks is the NTP mechanism most likely to confidently hallucinate?
while, using an everyday example/init, /memory, /compact, plan mode, sub-agents
What's next — Module 3.Keyingisi — Modul 3
How to ask an agent not to go where it's weak
Now you know what to give to an agent. In M3 — how to formulate a prompt so the agent doesn't veer into novel territory: product / process / performance in one phrase, @-mention files as a source, plan mode when the task requires a codebase overview. The goal is to turn your Co-creation into Full by adding the right context to the prompt.
Attribution and License
This module is adapted by Mars IT School (2026) based on:
— «AI Capabilities and Limitations» — Anthropic Academy, 2026, lessons 4-5 (Next Token Prediction) — verbatim definition and "The Verification Test" exercise.
— «AI Fluency: Framework & Foundations» — Rick Dakan, Joseph Feller, Anthropic, 2025 (CC BY-NC-SA 4.0) — lessons 6-7 (Delegation), three sub-components.
— Andrej Karpathy «How I Use LLMs» (2025) — "1 TB zip file with smiley face" metaphor — fair use for educational purposes.
— Claude Code documentation (claude.com/docs) — work cycle, plan mode, tool use loop.
Our adaptation is CC BY-NC-SA 4.0. You can copy, remix, use in training — with attribution to Mars IT School and retaining the same license.