<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Learn AI with Arasu]]></title><description><![CDATA[Learn AI with Arasu]]></description><link>https://learn-ai-with-arasu.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sat, 28 Nov 2026 01:10:34 GMT</lastBuildDate><atom:link href="https://learn-ai-with-arasu.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[AI From the Ground Up: Machine Learning, Deep Learning and LLMs Explained]]></title><description><![CDATA[Every idea explained twice: once properly, and once so a child can follow. With diagrams, animations and a glossary.]]></description><link>https://learn-ai-with-arasu.hashnode.dev/ai-from-the-ground-up-machine-learning-deep-learning-and-llms-explained</link><guid isPermaLink="true">https://learn-ai-with-arasu.hashnode.dev/ai-from-the-ground-up-machine-learning-deep-learning-and-llms-explained</guid><category><![CDATA[Artificial Intelligence]]></category><category><![CDATA[Machine Learning]]></category><category><![CDATA[Deep Learning]]></category><category><![CDATA[llm]]></category><category><![CDATA[generative ai]]></category><dc:creator><![CDATA[arasupathi k]]></dc:creator><pubDate>Thu, 26 Nov 2026 15:25:18 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6b08205feff825bae3f3e201/ad0c6606-4719-4172-b333-3231f6b55e6c.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>I work as an Oracle database administrator, and I am learning AI from the ground up. This blog is my notebook. Every idea in this post is explained twice: once properly, and once with an example simple enough for a child.</em></p>
<p>Artificial intelligence is now part of everyday work, yet the vocabulary around it is confusing. People say AI, machine learning, deep learning, generative AI and LLM as if they were the same thing. They are not.</p>
<p>This post is one complete map of the basics. By the end you should be able to explain what each term means, how a model actually learns, how a chatbot produces its answers, and what the common jargon refers to. No maths or programming background is needed.</p>
<p>Look for the <strong>Explain it to a child</strong> boxes and the <em>For a child</em> notes. If a seven-year-old can follow the example, the idea is clear.</p>
<h2>1. What is artificial intelligence?</h2>
<p><strong>Artificial Intelligence (AI)</strong> is the field of building computer systems that perform tasks we normally associate with human intelligence: recognising images, understanding speech, translating languages, making predictions, planning, or writing text.</p>
<blockquote>
<p><strong>Explain it to a child:</strong> A calculator only does exactly what you press. AI is more like a helper that has practised a lot. Show it a photo and it can say "that is a cat", because it has already looked at thousands of cat photos.</p>
</blockquote>
<p>The name comes from John McCarthy's proposal for a research workshop held at Dartmouth College in 1956. Since then the field has followed two broad approaches:</p>
<ul>
<li><strong>Rule-based (symbolic) AI.</strong> Humans write the knowledge down as explicit rules: <em>if the temperature is above 38°C and the patient has a cough, then...</em> The expert systems of the 1980s worked this way. They are easy to audit, but they break when the real world does not fit the rules.</li>
<li><strong>Learning-based AI.</strong> Instead of writing the rules, we show the system many examples and let it find the patterns. This is machine learning, and it is behind almost every AI product you use today.</li>
</ul>
<blockquote>
<p><strong>Explain it to a child:</strong> Rule-based AI is like being handed a rule book: "if it has stripes and it roars, it is a tiger." Learning-based AI is like visiting the zoo so many times that you simply know a tiger when you see one, even a tiger you have never met.</p>
</blockquote>
<p>Two more terms you will hear:</p>
<ul>
<li><strong>Narrow AI</strong> is built for one kind of task, such as detecting fraud or recommending films. Most AI systems in use today are narrow. LLMs are more general, because one model can handle many different language tasks.</li>
<li><strong>Artificial General Intelligence (AGI)</strong> is a hypothetical system that could match human ability across most intellectual tasks. Whether and when it will arrive is an open debate.</li>
</ul>
<blockquote>
<p><strong>Explain it to a child:</strong> Narrow AI is a friend who is a champion at chess but cannot ride a bicycle or tell a joke. AGI would be a friend who can learn anything you can learn. Whether anyone can build that friend is still an open question.</p>
</blockquote>
<h3>A very short history</h3>
<table>
<thead>
<tr>
<th>Year</th>
<th>Milestone</th>
</tr>
</thead>
<tbody><tr>
<td>1950</td>
<td>Alan Turing proposes the "imitation game", later called the Turing test</td>
</tr>
<tr>
<td>1956</td>
<td>The Dartmouth workshop establishes artificial intelligence as a research field</td>
</tr>
<tr>
<td>1980s</td>
<td>Expert systems in industry; backpropagation is popularised (1986)</td>
</tr>
<tr>
<td>1997</td>
<td>IBM's Deep Blue beats world chess champion Garry Kasparov</td>
</tr>
<tr>
<td>2012</td>
<td>AlexNet wins the ImageNet competition; the deep learning era begins</td>
</tr>
<tr>
<td>2017</td>
<td>The transformer architecture is published in the paper "Attention Is All You Need"</td>
</tr>
<tr>
<td>2022</td>
<td>ChatGPT brings large language models to the general public</td>
</tr>
</tbody></table>
<h2>2. The big picture: how the terms fit together</h2>
<p>The five most common terms are not competitors. Each one sits inside the previous one.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6b08205feff825bae3f3e201/d970f317-bdcc-42eb-be7c-7acdb6524d7d.png" alt="Nested diagram showing LLMs inside generative AI, inside deep learning, inside machine learning, inside AI" style="display:block;margin:0 auto" />

<p>So every LLM is a deep learning model, every deep learning model is machine learning, and all of it is AI. The reverse is not true: a fraud-detection model is AI and machine learning, but it is not an LLM.</p>
<blockquote>
<p><strong>Explain it to a child:</strong> Every puppy is a dog, and every dog is an animal. But not every animal is a dog, and not every dog is a puppy. In the same way, every LLM is deep learning and all deep learning is AI, but plenty of AI is not an LLM.</p>
</blockquote>
<p>This picture shows how the terms are used today, and it has edge cases. Some early text generators did not use deep learning, and some language models are built to classify text instead of generating it.</p>
<h3>Where you already meet AI</h3>
<table>
<thead>
<tr>
<th>Everyday example</th>
<th>What is behind it</th>
</tr>
</thead>
<tbody><tr>
<td>Email spam filter</td>
<td>Machine learning (classification)</td>
</tr>
<tr>
<td>Travel-time estimate in a maps app</td>
<td>Machine learning (prediction from traffic data)</td>
</tr>
<tr>
<td>"Recommended for you" in shopping and video apps</td>
<td>Machine learning (recommender systems)</td>
</tr>
<tr>
<td>Fraud alert from your bank</td>
<td>Machine learning (classification and anomaly detection)</td>
</tr>
<tr>
<td>Face unlock and photo search on your phone</td>
<td>Deep learning (computer vision)</td>
</tr>
<tr>
<td>Voice typing and voice assistants</td>
<td>Deep learning (speech recognition)</td>
</tr>
<tr>
<td>Chat assistants such as ChatGPT, Claude and Gemini</td>
<td>Large language models</td>
</tr>
<tr>
<td>Image generators</td>
<td>Generative AI (mostly diffusion models)</td>
</tr>
</tbody></table>
<h2>3. Machine learning: learning from examples</h2>
<p><strong>Machine Learning (ML)</strong> is the part of AI where a system improves at a task by learning from data, without being given explicit rules.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6b08205feff825bae3f3e201/1dd23a45-057d-46ae-927b-4fd0cb54a300.png" alt="Diagram comparing traditional programming, where rules and data produce answers, with machine learning, where data and answers produce the rules" style="display:block;margin:0 auto" />

<p>Take a spam filter. In traditional programming you would write rules such as <em>block any mail containing "lottery"</em>, and spammers would get around them within a week. In machine learning you collect thousands of mails already marked as spam or not spam, and the training process works out the rules by itself. Those learned rules are what we call a <strong>model</strong>.</p>
<blockquote>
<p><strong>Explain it to a child:</strong> Nobody gave you a rule book for spotting dogs. You saw many dogs, and each time someone said "dog". Soon you could point at a dog you had never seen before. Machine learning is a computer learning the same way: from many examples, not from rules.</p>
</blockquote>
<h3>The three main types of machine learning</h3>
<table>
<thead>
<tr>
<th>Type</th>
<th>How it learns</th>
<th>Typical uses</th>
<th>For a child</th>
</tr>
</thead>
<tbody><tr>
<td><strong>Supervised learning</strong></td>
<td>From examples that come with the correct answer (labels)</td>
<td>Spam detection, price prediction, medical image classification</td>
<td>Flash cards with the answer written on the back</td>
</tr>
<tr>
<td><strong>Unsupervised learning</strong></td>
<td>From data with no labels, by finding structure on its own</td>
<td>Customer segmentation, anomaly detection</td>
<td>Sorting a box of mixed building blocks into piles, with nobody telling you how</td>
</tr>
<tr>
<td><strong>Reinforcement learning</strong></td>
<td>By trial and error, receiving rewards or penalties</td>
<td>Game playing, robotics, control systems</td>
<td>Teaching a puppy tricks with treats</td>
</tr>
</tbody></table>
<p>There is also <strong>self-supervised learning</strong>, where the labels come from the data itself. Hide the next word of a sentence and ask the model to predict it: the hidden word is the label. This is how LLMs are trained, and it matters because it needs no human labelling.</p>
<blockquote>
<p><strong>Explain it to a child:</strong> It is a fill-in-the-blank game that you can mark yourself. Cover the last word of "The sky is blue", make a guess, then lift your hand and check.</p>
</blockquote>
<h3>Core vocabulary</h3>
<p>Imagine teaching a child to name fruits from a picture album. That one story explains every term below.</p>
<ul>
<li><strong>Dataset</strong> - the collection of examples used for learning. <em>For a child: the whole album of fruit pictures.</em></li>
<li><strong>Features</strong> - the input values describing each example (for a house: area, location, age). <em>For a child: the colour, shape and size of each fruit.</em></li>
<li><strong>Label</strong> - the correct answer for an example (the house price). <em>For a child: the name written under each picture.</em></li>
<li><strong>Model</strong> - the mathematical function that maps inputs to outputs. <em>For a child: the fruit-naming skill in your head.</em></li>
<li><strong>Parameters (weights)</strong> - the numbers inside the model that training adjusts. <em>For a child: the little hints you have worked out, such as "long and yellow is probably a banana".</em></li>
<li><strong>Training</strong> - the process of adjusting the parameters using data. <em>For a child: practising with the album until you get most names right.</em></li>
<li><strong>Inference</strong> - using the trained model to make predictions on new data. <em>For a child: naming the fruit in a picture you have never seen.</em></li>
<li><strong>Training, validation and test sets</strong> - the data is split so the model is tuned on one part and judged on data it has never seen. <em>For a child: practice sheets, a mock test, and the real exam with new questions.</em></li>
<li><strong>Overfitting</strong> - the model memorises the training data and performs badly on new data. <em>For a child: memorising the answers to last year's test, then getting stuck when the numbers change.</em></li>
<li><strong>Underfitting</strong> - the model is too simple to capture the pattern at all. <em>For a child: calling every fruit an apple.</em></li>
</ul>
<p>Classical ML algorithms such as linear regression, decision trees, random forests and gradient boosting are still the workhorses for tabular business data. Not every problem needs a neural network.</p>
<h3>How do we know a model is good?</h3>
<p>A model is judged on the <strong>test set</strong>, data it never saw during training. For a yes/no task such as spam detection, the common measures are:</p>
<ul>
<li><strong>Accuracy</strong> - the share of all predictions that are correct.</li>
<li><strong>Precision</strong> - of the mails the model flagged as spam, the share that really were spam.</li>
<li><strong>Recall</strong> - of all the real spam mails, the share the model caught.</li>
</ul>
<p>Accuracy alone can mislead. If only 1 payment in 100 is fraudulent, a model that always answers "not fraud" is 99% accurate and completely useless, because its recall is zero.</p>
<blockquote>
<p><strong>Explain it to a child:</strong> You are counting red cars from the window. <strong>Precision</strong>: when you shout "red car!", how often is the car really red? <strong>Recall</strong>: of all the red cars that went past, how many did you spot? If you shout "red car!" at every single car, you never miss one, but you are wrong most of the time.</p>
</blockquote>
<p>For LLMs there is often no single correct answer, so quality is measured with <strong>benchmarks</strong> (standard sets of test questions) and with human review.</p>
<h2>4. Deep learning and neural networks</h2>
<p><strong>Deep Learning (DL)</strong> is machine learning that uses <strong>artificial neural networks</strong> with many layers. It is the technique behind modern image recognition, speech recognition, translation and modern chatbots.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6b08205feff825bae3f3e201/345d899d-f422-449d-be36-d9eff6f7397c.png" alt="Diagram of a simple neural network with an input layer, two hidden layers and an output layer" style="display:block;margin:0 auto" />

<p>The building blocks:</p>
<ul>
<li>A <strong>neuron</strong> is a tiny calculation. It takes several numbers in, multiplies each by a <strong>weight</strong>, adds them up together with a <strong>bias</strong>, and passes the result through an <strong>activation function</strong> that decides how strongly the neuron fires.</li>
<li>Neurons are arranged in <strong>layers</strong>. The input layer receives the data, the hidden layers transform it step by step, and the output layer gives the prediction.</li>
<li><strong>Deep</strong> simply means many hidden layers. Early layers learn simple patterns (edges in an image), later layers combine them into complex ones (eyes, faces, objects).</li>
</ul>
<blockquote>
<p><strong>Explain it to a child:</strong> Picture rows of children guessing what is in a drawing. The first row can only spot lines and dots. They whisper to the second row, who spot shapes: circles and triangles. The third row spots parts: ears, whiskers, a tail. The last child puts it all together and shouts "cat!". Each row is a layer.</p>
</blockquote>
<p><strong>Why activation functions matter.</strong> They make the network non-linear. Without them, any number of layers collapses into one linear (straight-line) function, so adding depth would add nothing. A widely used one, <strong>ReLU</strong>, outputs 0 for negative inputs and passes positive inputs through unchanged.</p>
<blockquote>
<p><strong>Explain it to a child:</strong> A <strong>weight</strong> is how much you trust each friend's advice. When you pick a team, you listen more to the friend who is usually right. An <strong>activation function</strong> is like a tap: it stays shut until you turn it past a certain point, and after that it lets more water through the more you turn.</p>
</blockquote>
<p>Watch one pass through a small network. The numbers flow from left to right, layer by layer, and the strongest output is the answer:</p>
<img src="https://cdn.hashnode.com/uploads/covers/6b08205feff825bae3f3e201/36495e30-5a45-40db-836f-f3bb9e29f342.gif" alt="Animation: numbers passing through a small neural network, layer by layer, ending in the answer cat for a cat photo and dog for a dog photo" style="display:block;margin:0 auto" />

<p>No single neuron is intelligent. The capability comes from millions or billions of weights being set to the right values, and nobody sets them by hand. They are learned.</p>
<h3>How a neural network learns</h3>
<img src="https://cdn.hashnode.com/uploads/covers/6b08205feff825bae3f3e201/2712551f-d206-452b-9265-059d7fb36c08.png" alt="Diagram of the training loop: forward pass, loss, backpropagation, gradient descent, repeated" style="display:block;margin:0 auto" />

<p>Training starts with random weights, so the first predictions are nonsense. Then the same four steps repeat:</p>
<ol>
<li><strong>Forward pass.</strong> Feed an example through the network and get a prediction.</li>
<li><strong>Loss.</strong> A <strong>loss function</strong> turns the difference between the prediction and the correct answer into a single number. Bigger number, worse prediction.</li>
<li><strong>Backpropagation.</strong> Working backwards through the layers, the algorithm calculates how much each weight contributed to the error. These values are called <strong>gradients</strong>.</li>
<li><strong>Gradient descent.</strong> Every weight is adjusted slightly in the direction that reduces the loss.</li>
</ol>
<blockquote>
<p><strong>Explain it to a child:</strong> You are throwing a ball into a basket. You throw (forward pass). You see how far you missed (loss). You work out what went wrong: too hard? too far left? (backpropagation). On the next throw you change a little (gradient descent). After a hundred throws, you rarely miss.</p>
</blockquote>
<p>A few related terms:</p>
<ul>
<li><strong>Learning rate</strong> - how big each adjustment is. Too large and training becomes unstable; too small and it takes forever. <em>For a child: how much you change your throw after a miss. Change too much and you overshoot the other way; change too little and you are there all day.</em></li>
<li><strong>Batch</strong> - the small group of examples processed in one step. <em>For a child: practising with a handful of flash cards, checking how you did, then taking the next handful.</em></li>
<li><strong>Epoch</strong> - one full pass over the whole training dataset. <em>For a child: going through the whole pack of flash cards once.</em></li>
<li><strong>Hyperparameters</strong> - settings chosen by people before training (learning rate, number of layers, batch size), as opposed to parameters, which the model learns. <em>For a child: the practice plan your coach sets, such as how long and how often. The skill itself you build on your own.</em></li>
<li><strong>GPU</strong> - a processor that performs huge numbers of simple calculations in parallel. Training neural networks is exactly that kind of work, which is why GPUs matter so much in AI. <em>For a child: a hundred friends each doing one small sum at the same moment, where one child alone would do them one after another.</em></li>
</ul>
<h3>A worked example: learning one weight</h3>
<blockquote>
<p><strong>Explain it to a child:</strong> It is the "guess my rule" game. I think of a secret rule. You say 1, I say 3. You say 2, I say 6. You guess "times 1", see that your answers are too small, and try a bigger number. Each guess lands closer, until you reach "times 3".</p>
</blockquote>
<p>Suppose the correct rule is <em>output = 3 × input</em>, but the model does not know that. It has a single weight, <strong>w</strong>, and predicts <em>w × input</em>. We give it three examples: 1 → 3, 2 → 6 and 3 → 9. The loss is the average of the squared errors, and the learning rate is 0.05.</p>
<p>The weight starts at 0, so every prediction is 0 and the loss is large. Each training step then applies the same rule:</p>
<p><strong>new weight = old weight − (learning rate × gradient)</strong></p>
<p>The <strong>gradient</strong> says which way to move the weight and how strongly. For this loss it is the average of <em>2 × input × (prediction − correct answer)</em> over the three examples. At w = 0 that is (2 ÷ 3) × (1 × (0 − 3) + 2 × (0 − 6) + 3 × (0 − 9)) = −28, so the new weight is 0 − (0.05 × −28) = 1.40.</p>
<table>
<thead>
<tr>
<th>Step</th>
<th>Weight w</th>
<th>Gradient</th>
<th>Prediction for input 2 (correct: 6)</th>
<th>Loss</th>
</tr>
</thead>
<tbody><tr>
<td>0</td>
<td>0.00</td>
<td>−28.00</td>
<td>0.00</td>
<td>42.00</td>
</tr>
<tr>
<td>1</td>
<td>1.40</td>
<td>−14.93</td>
<td>2.80</td>
<td>11.95</td>
</tr>
<tr>
<td>2</td>
<td>2.15</td>
<td>−7.96</td>
<td>4.29</td>
<td>3.40</td>
</tr>
<tr>
<td>3</td>
<td>2.54</td>
<td>−4.25</td>
<td>5.09</td>
<td>0.97</td>
</tr>
<tr>
<td>4</td>
<td>2.76</td>
<td>−2.27</td>
<td>5.51</td>
<td>0.27</td>
</tr>
<tr>
<td>5</td>
<td>2.87</td>
<td>−1.21</td>
<td>5.74</td>
<td>0.08</td>
</tr>
</tbody></table>
<p>A negative gradient means the weight is too small, so each step pushes it up. As the weight gets close to 3, the gradient shrinks and the steps become smaller. After 10 steps the weight is 2.99, and it keeps closing in on 3.</p>
<p>Here are the same ten steps as an animation. On the left, the model's line turns until it passes through the examples. On the right, the same weight rolls down the loss curve:</p>
<img src="https://cdn.hashnode.com/uploads/covers/6b08205feff825bae3f3e201/5b1ad3cc-d27b-41bf-9ff1-2020f16a3495.gif" alt="Animation of gradient descent: the model's line turns to fit three examples while a ball rolls down the loss curve towards w = 3" style="display:block;margin:0 auto" />

<blockquote>
<p><strong>Explain it to a child:</strong> You are walking down a hill in thick fog. You cannot see the bottom, but your feet can feel which way the ground slopes. You take a step downhill, feel again, and take another. The slope under your feet is the gradient, and the bottom of the hill is the smallest loss.</p>
</blockquote>
<p>Nobody told the model the rule. It found the rule by repeatedly reducing its own error. A real neural network does exactly this, with billions of weights instead of one and enormous numbers of examples instead of three.</p>
<p><strong>Optional: try it yourself.</strong> If you have Python installed, these few lines print the same weights, gradients and losses as the table:</p>
<pre><code class="language-python">inputs = [1, 2, 3]
answers = [3, 6, 9]
w = 0.0
learning_rate = 0.05

for step in range(6):
    predictions = [w * x for x in inputs]
    loss = sum((p - y) ** 2 for p, y in zip(predictions, answers)) / 3
    gradient = sum(2 * x * (p - y) for x, p, y in zip(inputs, predictions, answers)) / 3
    print(f"step {step}  w={w:.2f}  gradient={gradient:.2f}  loss={loss:.2f}")
    w = w - learning_rate * gradient
</code></pre>
<p>Deep learning took off around 2012 because three things arrived together: very large datasets, GPU computing power, and improved training techniques.</p>
<h3>The main network architectures</h3>
<table>
<thead>
<tr>
<th>Architecture</th>
<th>Best known for</th>
<th>Idea in one line</th>
<th>For a child</th>
</tr>
</thead>
<tbody><tr>
<td><strong>CNN</strong> (convolutional neural network)</td>
<td>Images and video</td>
<td>Slides small filters across the image to detect local patterns</td>
<td>Looking at a big picture through a small magnifying glass, one patch at a time</td>
</tr>
<tr>
<td><strong>RNN / LSTM</strong> (recurrent networks)</td>
<td>Older sequence and speech models</td>
<td>Reads a sequence one step at a time, carrying a memory forward</td>
<td>Listening to a story one word at a time and trying to remember what came before</td>
</tr>
<tr>
<td><strong>Transformer</strong></td>
<td>Language, and now most of modern AI</td>
<td>Processes all tokens in parallel using attention. In an LLM, each token attends only to itself and the tokens before it</td>
<td>Seeing the whole page at once and drawing lines between the words that belong together</td>
</tr>
<tr>
<td><strong>Diffusion model</strong></td>
<td>Image and video generation</td>
<td>Learns to turn random noise into a picture, step by step</td>
<td>Wiping a foggy window a little at a time until the picture behind it is clear</td>
</tr>
</tbody></table>
<h2>5. Generative AI</h2>
<p>Most classical ML models are <strong>discriminative</strong>: they look at an input and choose a label or a number. <em>Is this mail spam? What will this house sell for?</em></p>
<p><strong>Generative AI</strong> models do something different: they <strong>produce new content</strong> that resembles the data they were trained on. That content can be text, images, audio, video or program code.</p>
<blockquote>
<p><strong>Explain it to a child:</strong> One friend can look at a drawing and tell you whether it is a cat or a dog. That is a discriminative model. Another friend has seen so many cat drawings that she can draw a brand-new cat nobody has drawn before. That is a generative model.</p>
</blockquote>
<p>A related term is <strong>foundation model</strong>: a very large model trained on broad data that can be adapted to many different tasks, instead of one model per task. LLMs are the best-known foundation models.</p>
<blockquote>
<p><strong>Explain it to a child:</strong> A foundation model is like a student who has read the whole library. After that, you can teach her almost any job quickly.</p>
</blockquote>
<h2>6. Large language models</h2>
<p>A <strong>Large Language Model (LLM)</strong> is a transformer-based neural network trained on an enormous amount of text to do one thing: <strong>predict the next token</strong>.</p>
<blockquote>
<p><strong>Explain it to a child:</strong> It is the "finish my sentence" game. I say "Once upon a..." and you say "time". An LLM has read a huge library of text, so it is very good at this game. It plays it again and again, one small piece of a word at a time, until a whole answer appears.</p>
</blockquote>
<img src="https://cdn.hashnode.com/uploads/covers/6b08205feff825bae3f3e201/55d84dc0-fdbf-4875-bca0-2df6cdcec66a.png" alt="Diagram showing how an LLM generates text: prompt, tokens, embeddings, transformer, probabilities, next token, and repeat" style="display:block;margin:0 auto" />

<p>Step by step:</p>
<ol>
<li><strong>Tokens.</strong> The model does not read letters or whole words. Text is split into <strong>tokens</strong>: a short word, a piece of a longer word, or a punctuation mark. As a rough rule for English, one token is about three quarters of a word. <em>For a child: building blocks for words. "Unhappiness" can be snapped together from smaller pieces such as "un", "happi" and "ness". The exact pieces depend on the model.</em></li>
<li><strong>Embeddings.</strong> Each token is converted into an <strong>embedding</strong>, a long list of numbers (a vector) that represents its meaning. Tokens with similar meanings end up with similar vectors, so "king" and "queen" are close together and "king" and "banana" are far apart. <em>For a child: a giant playground where every word has its own spot. Words that mean similar things stand close together, so "puppy" stands next to "dog", and "banana" is far away on the other side, next to "apple".</em></li>
<li><strong>Transformer and attention.</strong> The embeddings pass through many transformer layers. In each one, <strong>attention</strong> lets each token look at the tokens that came before it and decide which of them matter. In "The server crashed because <strong>it</strong> ran out of memory", attention is how the model links "it" to "the server". <em>For a child: in "The dog was muddy, so Dad washed it", you know "it" means the dog. You looked back at the right word. Attention is the model looking back in the same way.</em></li>
<li><strong>Probabilities.</strong> The output is a probability for every token in the vocabulary being the next one. <em>For a child: after "The sky is", your best guess is "blue", your second guess might be "clear", and "banana" is almost impossible. The model keeps a score like that for every possible next piece.</em></li>
<li><strong>Pick and repeat.</strong> One token is chosen, added to the text, and the whole process runs again for the next token. A long answer is this loop running hundreds of times. <em>For a child: threading one bead onto a necklace, looking at the whole necklace so far, then choosing the next bead.</em></li>
</ol>
<p>Watch the loop run. Each step shows the model's top candidates, the one it picks, and the sentence growing by one token:</p>
<img src="https://cdn.hashnode.com/uploads/covers/6b08205feff825bae3f3e201/eb72bfd3-d672-443c-9a94-48ba636ec45d.gif" alt="Animation: an LLM completing the prompt The sky is, one token at a time, picking the most likely token at each step" style="display:block;margin:0 auto" />

<h3>Why does next-token prediction work so well?</h3>
<p>To predict the next word of a physics explanation, a legal clause or a Python function accurately, a model has to capture grammar, facts, style and patterns of reasoning. Nobody programs these in. They emerge because they help with prediction. That is also why the same model can summarise, translate, write code and answer questions.</p>
<blockquote>
<p><strong>Explain it to a child:</strong> To finish the sentence "The capital of France is...", you need to know about France. To finish "2 + 2 is...", you need to know how to add. Getting good at finishing sentences forces you to learn a lot about the world.</p>
</blockquote>
<h3>LLM vocabulary</h3>
<ul>
<li><strong>Parameters</strong> - the learned weights. Modern LLMs have billions of them. "Large" refers to this and to the size of the training data. <em>For a child: billions of tiny dials inside the machine. Training turns each dial a little until the answers come out right.</em></li>
<li><strong>Pre-training</strong> - the expensive first stage where the model learns language from vast amounts of text by self-supervised next-token prediction. <em>For a child: going to school for years to learn a bit of everything.</em></li>
<li><strong>Fine-tuning</strong> - further training of an existing model on a smaller, specific dataset to specialise it. <em>For a child: special coaching for one job after school is finished, like training to be a pilot.</em></li>
<li><strong>Context window</strong> - the maximum amount of text, measured in tokens, the model can consider at once. It covers your prompt, any documents you supply and the answer. <em>For a child: a small desk. The model can only read the pages that fit on the desk. When the desk is full, older pages have to come off.</em></li>
<li><strong>Temperature</strong> - a setting that controls randomness when choosing the next token. Low values give focused, repeatable output; high values give more varied output. <em>For a child: at low temperature the model always orders its favourite ice cream. At high temperature it is happy to try a new flavour each time.</em></li>
<li><strong>Inference</strong> - running the trained model to generate a response. <em>For a child: school is over, and now you are using what you learned to answer a real question.</em></li>
</ul>
<h2>7. Working with LLMs: the terms you will meet</h2>
<ul>
<li><strong>Prompt</strong> - the text you give the model: your question, instructions and any supporting material. <em>For a child: the question you ask a librarian. The clearer the question, the better the book you get.</em></li>
<li><strong>System prompt</strong> - instructions set by the application developer that define the model's role and rules before the user types anything. <em>For a child: the classroom rules the teacher sets before the lesson begins.</em></li>
<li><strong>Prompt engineering</strong> - writing prompts carefully (clear instructions, examples, required format) to get better results. <em>For a child: saying "please draw a red car with big wheels on a sunny road" gets a better picture than "draw something".</em></li>
<li><strong>Hallucination</strong> - when the model produces something that sounds confident but is false. It happens because the model generates likely text; it does not look facts up. <em>For a child: a friend who never says "I don't know". Ask him something he has no idea about and he makes up an answer that sounds right.</em></li>
<li><strong>RAG (Retrieval-Augmented Generation)</strong> - before answering, the application searches your documents for relevant passages and puts them into the prompt, so the model answers from real sources instead of memory. <em>For a child: an open-book test. Before answering, you are allowed to find the right page and read it.</em></li>
<li><strong>Vector database</strong> - a database that stores embeddings and finds the items closest in meaning to a query. It is the usual search engine behind RAG. <em>For a child: a library where books are shelved by what they are about, so books on similar things always sit next to each other.</em></li>
<li><strong>Tool use (function calling)</strong> - letting the model request an action, such as running a SQL query or calling an API, with the application executing it and returning the result. <em>For a child: you are good with words but not with big sums, so you ask a friend with a calculator and use the number he gives you.</em></li>
<li><strong>AI agent</strong> - an LLM that works in a loop: it plans, uses tools, looks at the results and decides the next step until the task is finished. <em>For a child: asking a helper to get the room ready for your birthday party. The helper makes a list, does one job, checks what is still missing, and carries on until the room is ready.</em></li>
<li><strong>Multimodal model</strong> - a model that handles more than text, for example images, audio or video. <em>For a child: someone who can read, look at pictures and listen, and not only read.</em></li>
</ul>
<h2>8. What these systems cannot do</h2>
<p>Knowing the limits is part of knowing the basics.</p>
<ul>
<li><strong>They can be wrong with full confidence.</strong> Always verify facts, figures and code that matter. <em>For a child: the friend who makes things up again. Sounding sure is not the same as being right.</em></li>
<li><strong>Their knowledge has a cutoff date.</strong> A model knows nothing after its training data ends unless it is connected to search or to your own data. <em>For a child: someone who slept for a whole year and woke up not knowing anything that happened in between.</em></li>
<li><strong>They inherit bias.</strong> A model learns from human-written data, including its mistakes and prejudices. <em>For a child: if every doctor in your storybooks is a man, you might wrongly think only men can be doctors. The books taught you that. It is not the truth.</em></li>
<li><strong>They have limited working memory.</strong> Anything outside the context window does not exist for the model. <em>For a child: the small desk again. What does not fit on the desk cannot be read.</em></li>
<li><strong>They do not understand your business by default.</strong> Without your data, through RAG or fine-tuning, the answers stay generic. <em>For a child: a clever new teacher who has never met your class and does not know anyone's name until told.</em></li>
</ul>
<h3>Using AI responsibly</h3>
<ul>
<li><strong>Privacy.</strong> Do not paste confidential or personal data into a public AI tool unless you know how the provider stores and uses it.</li>
<li><strong>Accountability.</strong> A model cannot be held responsible for a decision. For anything important, a person should review the output and own the result.</li>
<li><strong>Fairness.</strong> If the training data under-represents a group of people, predictions for that group tend to be worse. Systems used for hiring, lending or medicine need to be tested for this.</li>
<li><strong>Copyright.</strong> The law on training data, and on who owns AI-generated content, is still being settled in many countries.</li>
<li><strong>Misuse.</strong> The same technology that drafts emails can produce convincing fake text, voices and images (deepfakes). Treat unverified media with care.</li>
</ul>
<blockquote>
<p><strong>Explain it to a child:</strong> Do not tell your secrets to a stranger. Check what you are told before you believe it. And if a helper does part of your homework, you are still the one responsible for it.</p>
</blockquote>
<h2>9. Common misconceptions</h2>
<ul>
<li><strong>"An LLM looks up the answer on the internet."</strong> Not by default. It generates the answer from patterns learned during training. Some products connect the model to a search tool, and the search results are then added to the prompt.</li>
<li><strong>"The model learns from me while we chat."</strong> The weights do not change during a conversation. The model seems to remember because the earlier messages are still inside the context window. Whether a provider uses conversations to train future versions depends on its policy and your settings.</li>
<li><strong>"The same question always gives the same answer."</strong> The next token is usually chosen with some randomness (see temperature), so two runs can differ.</li>
<li><strong>"A bigger model is always better."</strong> More parameters can help, but data quality, training method and fit to the task matter as much. A small specialised model often does a narrow job faster and at lower cost.</li>
<li><strong>"The model stores its training data like a database."</strong> It stores patterns as weights, not documents. It can still memorise text that appeared many times in training, which is why it sometimes repeats well-known passages word for word.</li>
<li><strong>"AI means neural networks."</strong> Many production systems still run on classical machine learning, and some on plain rules.</li>
</ul>
<h2>10. Quick reference glossary</h2>
<table>
<thead>
<tr>
<th>Term</th>
<th>Meaning in one line</th>
<th>For a child</th>
</tr>
</thead>
<tbody><tr>
<td>AI</td>
<td>Machines performing tasks that normally need human intelligence</td>
<td>A helper that has practised a lot</td>
</tr>
<tr>
<td>Machine learning</td>
<td>Learning patterns from data instead of following hand-written rules</td>
<td>Learning from examples, not from a rule book</td>
</tr>
<tr>
<td>Deep learning</td>
<td>Machine learning with many-layered neural networks</td>
<td>Rows of children passing whispers</td>
</tr>
<tr>
<td>Generative AI</td>
<td>Models that create new text, images, audio or code</td>
<td>Drawing a brand-new cat</td>
</tr>
<tr>
<td>LLM</td>
<td>A large transformer model trained to predict the next token of text</td>
<td>The champion of "finish my sentence"</td>
</tr>
<tr>
<td>Model</td>
<td>The trained function that turns inputs into outputs</td>
<td>The skill in your head</td>
</tr>
<tr>
<td>Parameters / weights</td>
<td>The numbers a model learns during training</td>
<td>Tiny dials, turned until the answers are right</td>
</tr>
<tr>
<td>Training</td>
<td>Adjusting the weights using data</td>
<td>Practice</td>
</tr>
<tr>
<td>Inference</td>
<td>Using the trained model to produce an output</td>
<td>Using what you learned</td>
</tr>
<tr>
<td>Loss</td>
<td>A number measuring how wrong a prediction is</td>
<td>How far the ball landed from the basket</td>
</tr>
<tr>
<td>Backpropagation</td>
<td>Calculating how much each weight contributed to the error</td>
<td>Working out what went wrong with the throw</td>
</tr>
<tr>
<td>Gradient descent</td>
<td>Adjusting weights step by step to reduce the loss</td>
<td>Walking downhill in fog, one step at a time</td>
</tr>
<tr>
<td>Overfitting</td>
<td>Memorising training data and failing on new data</td>
<td>Memorising last year's answers</td>
</tr>
<tr>
<td>Accuracy</td>
<td>The share of predictions that are correct</td>
<td>How many answers you got right</td>
</tr>
<tr>
<td>Precision</td>
<td>Of the items flagged, the share flagged correctly</td>
<td>How often your "red car!" is right</td>
</tr>
<tr>
<td>Recall</td>
<td>Of the items that should be flagged, the share that were found</td>
<td>How many of the red cars you spotted</td>
</tr>
<tr>
<td>Benchmark</td>
<td>A standard set of test questions for comparing models</td>
<td>The same exam paper for everyone</td>
</tr>
<tr>
<td>Learning rate</td>
<td>How big each weight adjustment is</td>
<td>How much you change your throw</td>
</tr>
<tr>
<td>Token</td>
<td>The unit of text an LLM reads and writes</td>
<td>A building block of a word</td>
</tr>
<tr>
<td>Embedding</td>
<td>A vector of numbers representing meaning</td>
<td>A word's spot on the playground</td>
</tr>
<tr>
<td>Transformer</td>
<td>The neural network architecture behind modern LLMs</td>
<td>Seeing the whole page at once</td>
</tr>
<tr>
<td>Attention</td>
<td>The mechanism that relates each token to the others</td>
<td>Looking back at the right word</td>
</tr>
<tr>
<td>Context window</td>
<td>How much text the model can consider at once</td>
<td>The small desk</td>
</tr>
<tr>
<td>Fine-tuning</td>
<td>Extra training to specialise an existing model</td>
<td>Special coaching for one job</td>
</tr>
<tr>
<td>RAG</td>
<td>Retrieving relevant documents and adding them to the prompt</td>
<td>An open-book test</td>
</tr>
<tr>
<td>Hallucination</td>
<td>A confident but false answer</td>
<td>A made-up answer that sounds right</td>
</tr>
<tr>
<td>Agent</td>
<td>An LLM that plans and uses tools in a loop to finish a task</td>
<td>A helper who finishes the whole job</td>
</tr>
</tbody></table>
<h2>11. Summary</h2>
<ul>
<li><strong>AI</strong> is the whole field of making machines act intelligently.</li>
<li><strong>Machine learning</strong> is the approach of learning from data instead of writing rules.</li>
<li><strong>Deep learning</strong> is machine learning with many-layered neural networks, trained by repeating forward pass, loss, backpropagation and gradient descent.</li>
<li><strong>Generative AI</strong> is deep learning that creates new content.</li>
<li><strong>LLMs</strong> are generative models for language. They turn text into tokens, tokens into embeddings, run them through transformer layers, and predict one token at a time.</li>
</ul>
<p>If you remember only one sentence, make it this: a modern AI model is a very large set of numbers, tuned by showing it examples until its predictions become useful.</p>
<blockquote>
<p><strong>Explain it to a child:</strong> AI is a helper that learned by practising. It guessed, checked how wrong it was, and fixed itself a tiny bit, millions of times. The chatty kind, an LLM, became very good at one game: guessing what comes next.</p>
</blockquote>
<p>In the next post I will go deeper into tokens and embeddings, with examples you can run yourself. If you spot a mistake in this one, tell me in the comments and I will correct it.</p>
]]></content:encoded></item></channel></rss>