[{"data":1,"prerenderedAt":584},["ShallowReactive",2],{"ai-for-everyone-parts-en":3,"ai-for-everyone-\u002Fai-for-everyone\u002Fllm-fundamentals":16},[4,10],{"contentId":5,"path":6,"title":7,"description":8,"part":9},"e36af6d2-7c12-4f58-a3d1-83d8098c6d20","\u002Fai-for-everyone\u002Fllm-fundamentals","LLM Fundamentals, from the Next Token to Tools","How does an LLM work? Follow learned parameters, tokens, embeddings, and the Transformer to understand text generation, reasoning, and tool calling.",1,{"contentId":11,"path":12,"title":13,"description":14,"part":15},"b2b71986-97fb-43db-a549-c891e2251186","\u002Fai-for-everyone\u002Fthe-mcp-server","The MCP server, from conversation to action","Follow a GitHub issue from tool calling to MCP. Learn how applications discover tools, share resources and prompts, and connect with MCP.",2,{"page":17,"metadata":550},{"id":18,"title":7,"body":19,"contentId":5,"description":8,"ecosystem":540,"extension":541,"meta":542,"navigation":544,"part":9,"path":6,"rawbody":545,"repository":540,"robots":540,"schemaOrg":540,"seo":546,"sitemap":547,"stem":548,"url":540,"__hash__":549},"pages\u002Fai-for-everyone\u002Fllm-fundamentals.md",{"type":20,"value":21,"toc":526},"minimark",[22,26,29,32,35,38,43,46,49,52,55,63,66,69,72,83,86,89,92,95,99,102,108,111,118,121,124,127,138,141,148,151,164,167,170,174,177,184,190,193,200,203,218,221,224,228,231,238,241,244,249,252,259,262,265,268,277,281,284,287,290,293,298,301,306,309,327,331,334,337,340,344,347,352,355,369,372,375,378,393,396,399,402,406,409,412,490,493,496,500,503,506,509,523],[23,24,25],"p",{},"An AI assistant can translate a paragraph, explain a piece of code, work through a problem, and sometimes even take action on your behalf. From the outside, those look like very different abilities.",[23,27,28],{},"But underneath, there is a surprisingly consistent mechanism: producing the next token.",[23,30,31],{},"That's it?",[23,33,34],{},"Well, yes. But saying that an LLM produces the next token is a little like saying that a computer moves numbers around. It's true, but it doesn't explain much until we look at what those numbers represent and how the machine uses them.",[23,36,37],{},"So, let's do that. No mathematics background required. We'll follow one sentence through the model, then use what we've learned to understand reasoning and tool calling. By the end, the vocabulary around LLMs should feel much less mysterious.",[39,40,42],"h2",{"id":41},"a-model-learns-patterns-from-examples","A model learns patterns from examples",[23,44,45],{},"Before looking at how a large language model generates text, we need to understand where its behavior comes from.",[23,47,48],{},"Imagine building a spam detector. One approach would be to write a rule: if a message contains \"free\" or \"urgent\", mark it as spam.",[23,50,51],{},"Simple. Also, quite fragile.",[23,53,54],{},"\"This is urgent: can we move our meeting to 3 pm?\" contains one of our suspicious words, but that doesn't make it spam. Add an exception for meetings, and you'll soon find another message that breaks the new rule. You can spend a lot of time trying to describe every possible situation.",[23,56,57,58,62],{},"A language model learns numerical parameters from examples. These parameters are also called ",[59,60,61],"strong",{},"weights",".",[23,64,65],{},"During a common training stage, the model sees sequences of tokens and tries to predict what comes next. Its prediction is compared with the token that actually follows in the training example. The training process adjusts the parameters to make predictions like that one better. Repeat this across a large amount of text, and the parameters capture patterns in language, code, and the relationships described by that text.",[23,67,68],{},"Modern assistants usually go through additional training to follow instructions and improve how they respond. These training stages adjust the learned parameters that shape the model's responses.",[70,71],"llm-fundamentals-learning",{},[23,73,74,75,78,79,82],{},"The animation brings together two moments that are easy to confuse: ",[59,76,77],{},"training"," and ",[59,80,81],{},"inference",". Training changes the parameters. Inference uses them to generate an output.",[23,84,85],{},"When you send a message to an already trained model, those parameters normally stay fixed. The model can use information in your conversation, including a correction you just gave it, without permanently learning that correction in its weights.",[23,87,88],{},"An application can also save memories, retrieve documents, or use conversations in a later training process. Saved memories and retrieved documents supply context for future requests. Further training can update the parameters.",[23,90,91],{},"At inference time, the model produces outputs using its parameters and the context it receives. It can memorize some passages from training. Retrieving a specific document with its source requires a separate lookup system.",[23,93,94],{},"Even a fluent, confident answer needs checking. Look for sources you can verify.",[39,96,98],{"id":97},"a-token-is-a-piece-of-text","A token is a piece of text",[23,100,101],{},"Let's give our model a sentence to complete:",[103,104,105],"blockquote",{},[23,106,107],{},"The capital of France is",[23,109,110],{},"We see words. The model needs numbers.",[23,112,113,114,117],{},"The first step is ",[59,115,116],{},"tokenization",": splitting the text into pieces from a vocabulary. Those pieces are called tokens. Depending on the tokenizer, a token might correspond to a word, part of a word, punctuation, or a smaller piece of a character's encoded representation.",[23,119,120],{},"For our sentence, the split looks conveniently like words. That can be misleading. With the same tokenizer, \"unbelievable\" splits into \"un\", \"belie\", and \"vable\". A different tokenizer can produce a different split.",[23,122,123],{},"Spaces matter too. In the animation, a middle dot makes the leading space in a token visible. \" capital\" is one token in this example, including its space.",[125,126],"llm-fundamentals-tokens",{},[23,128,129,130,133,134,62],{},"Once the text is split, each token maps to an ",[59,131,132],{},"ID"," in the tokenizer's vocabulary. In this example, \" France\" has the ID ",[135,136,137],"code",{},"9822",[23,139,140],{},"The ID identifies an entry in the vocabulary, much like a catalog number. The tokenizer assigns these IDs independently of a token's importance or meaning.",[23,142,143,144,147],{},"The ID is then used to look up an ",[59,145,146],{},"embedding",": a learned vector, or list of numbers. This is the numerical representation the model can work with. Real embeddings typically have many more dimensions than the vectors shown above.",[23,149,150],{},"We now have a useful separation:",[152,153,154,158,161],"ul",{},[155,156,157],"li",{},"The token is a piece of text.",[155,159,160],{},"The token ID identifies it in the vocabulary.",[155,162,163],{},"The embedding represents it numerically for the model.",[23,165,166],{},"These three stages turn our sentence into something the model can process.",[23,168,169],{},"This also explains why model limits and pricing often use tokens rather than words. The amount of text a token represents depends on the tokenizer, the language, and the content. A fixed word-to-token conversion is only an approximation.",[39,171,173],{"id":172},"the-transformer-puts-those-pieces-in-context","The Transformer puts those pieces in context",[23,175,176],{},"The model then needs to account for context. The same word can mean different things depending on what surrounds it, and the order of words matters.",[23,178,179,180,183],{},"Most current text-generating LLMs use a ",[59,181,182],{},"decoder-only Transformer",". We don't need to unpack every operation inside it, but two building blocks are worth understanding: attention and the feed-forward network, often called an MLP.",[23,185,186,189],{},[59,187,188],{},"Attention lets a token's representation draw information from other positions in the context."," In a causal language model, attention at each position is limited to itself and earlier positions. Information about token positions also lets the model take order into account.",[23,191,192],{},"In our example, the representation at \" is\" can incorporate information from \"capital\" and \"France\". The next token should fit the whole phrase.",[23,194,195,196,199],{},"The ",[59,197,198],{},"MLP"," then transforms the representation at each position. Attention and these transformations repeat across many layers. Each layer updates the representations with information from the surrounding text.",[23,201,202],{},"There are other important details, including normalization and residual connections. For our mental model, the key is that the Transformer repeatedly mixes relevant context and transforms the resulting representations.",[23,204,205,206,209,210,213,214,217],{},"At the end, the model uses the final representation at the ",[59,207,208],{},"last position"," to calculate a score for every possible next token in its vocabulary. These scores are called ",[59,211,212],{},"logits",". A function called ",[59,215,216],{},"softmax"," turns them into a probability distribution.",[23,219,220],{},"So we arrive at something like this: \" Paris\" has a high probability, \" Lyon\" a lower one, and many other tokens have smaller probabilities.",[222,223],"llm-fundamentals-transformer",{},[39,225,227],{"id":226},"generating-a-response-means-repeating-the-same-operation","Generating a response means repeating the same operation",[23,229,230],{},"We have a probability distribution. Now we need a token.",[23,232,233,234,237],{},"A ",[59,235,236],{},"decoding procedure"," selects it. One option is to choose the highest-scoring token. Another is to sample from the distribution, potentially after changing it with settings such as temperature or top-p.",[23,239,240],{},"Temperature changes how concentrated the sampling distribution is. Even at low temperature, the model can produce factual errors.",[23,242,243],{},"In our example, the selected token is \" Paris\". It gets appended to the context:",[103,245,246],{},[23,247,248],{},"The capital of France is Paris",[23,250,251],{},"Then we repeat. The model now predicts what comes after this longer sequence. Perhaps the next token is a period. Append it, and continue until a stopping condition is reached, such as an end-of-turn token or an output limit.",[23,253,254,255,258],{},"This is called ",[59,256,257],{},"autoregressive generation",": previously generated output becomes part of the input for what follows.",[260,261],"llm-fundamentals-generation",{},[23,263,264],{},"The answer grows token by token, with each new token shaped by what came before it. Implementations can reuse cached intermediate computations to reduce the work at each step.",[23,266,267],{},"And our original context can be much richer than a half-finished sentence. It can include instructions, previous messages, documents, code, or tool results. All of that influences the continuation.",[23,269,270,271,276],{},"If you've read my article about ",[272,273,275],"a",{"href":274},"\u002Fposts\u002Fcode-mode-two-tools-and-an-mcp-can-save-your-llm-context","Code Mode and the LLM context",", that's why context management matters so much. The model generates from what it has been given, within a finite context window. Missing information, irrelevant material, and misleading instructions can all affect the result.",[39,278,280],{"id":279},"how-can-next-token-prediction-produce-useful-abilities","How can next-token prediction produce useful abilities?",[23,282,283],{},"Predicting the next token across varied text requires learning many kinds of patterns.",[23,285,286],{},"To complete a translation example, it helps to capture relationships between languages. To continue a program, it helps to represent patterns in code. To answer a question in a conversation, it helps to follow its instructions and use the surrounding information.",[23,288,289],{},"Training and scale can produce a broad range of capabilities through that shared mechanism. Performance varies by model and task, so reliability needs to be evaluated on the work you want it to do.",[23,291,292],{},"Two capabilities deserve a closer look because they often make assistants feel as though they work in a completely different way: reasoning and tool calling.",[294,295,297],"h3",{"id":296},"reasoning-doing-intermediate-work-before-answering","Reasoning: doing intermediate work before answering",[23,299,300],{},"Consider this problem:",[103,302,303],{},[23,304,305],{},"A notebook and a pen cost €11 together. The notebook costs €10 more than the pen. How much does the pen cost?",[23,307,308],{},"The tempting answer is €1. But then the notebook would cost €11, and together they would cost €12. It doesn't work.",[23,310,311,312,315,316,319,320,323,324,62],{},"If we write down the relationship instead, the problem becomes easier. Let the pen cost ",[135,313,314],{},"x",". The notebook costs ",[135,317,318],{},"x + 10",", so ",[135,321,322],{},"x + (x + 10) = 11",". That gives us ",[135,325,326],{},"x = 0.50",[328,329],"llm-fundamentals-capabilities",{"mode":330},"reasoning",[23,332,333],{},"Reasoning models can spend additional computation on intermediate work before delivering an answer. That work can involve generating reasoning tokens, evaluating possible approaches, or revising a first attempt. Generating intermediate tokens still uses the same underlying next-token mechanism.",[23,335,336],{},"Intermediate work gives the model more opportunities to revise its answer. Spending more computation can improve results on some problems. It also increases latency and cost. The final answer still needs checking.",[23,338,339],{},"For our pen, the check is straightforward: €0.50 + €10.50 = €11, and the difference is €10. For a real business decision, the check may require evidence outside the model.",[294,341,343],{"id":342},"tool-calling-generating-a-request-for-something-else-to-execute","Tool calling: generating a request for something else to execute",[23,345,346],{},"Now ask a different question:",[103,348,349],{},[23,350,351],{},"What time is it in Paris right now?",[23,353,354],{},"The answer changes every minute, so the assistant needs a current clock reading.",[23,356,357,358,361,362,365,366,62],{},"A surrounding application can give the model access to a tool, for example ",[135,359,360],{},"get_time",". The tool description tells the model what the function does and which arguments it expects. The model can then generate a structured request with ",[135,363,364],{},"city"," set to ",[135,367,368],{},"Paris",[328,370],{"mode":371},"tools",[23,373,374],{},"The application receives the request, validates it, and runs the external function. It adds the result to the model's context. The model can then generate an answer based on that fresh information.",[23,376,377],{},"There are two different systems doing two different jobs:",[379,380,381,387],"ol",{},[155,382,383,386],{},[59,384,385],{},"The model generates a request"," using the available tool definitions and context.",[155,388,389,392],{},[59,390,391],{},"The application executes a function"," and returns its result.",[23,394,395],{},"The surrounding software connects the model to the clock and supplies the current reading.",[23,397,398],{},"That boundary is essential for security. A model can ask for the wrong action or generate invalid arguments. The application must enforce permissions, validate inputs, and decide which actions require confirmation. Those checks belong in the application's execution code.",[23,400,401],{},"Connect generation, intermediate work, and tools in a loop, and you have the basis of many AI agents: a system that can work toward a goal through several steps. The application coordinates the LLM, tools, and results across those steps.",[39,403,405],{"id":404},"reading-a-models-identity-card","Reading a model's identity card",[23,407,408],{},"Once these ideas are clear, announcements about new models become easier to read. Each number describes a specific part of the system.",[23,410,411],{},"Here are the fields I look at:",[413,414,415,431],"table",{},[416,417,418],"thead",{},[419,420,421,425,428],"tr",{},[422,423,424],"th",{},"Field",[422,426,427],{},"Meaning",[422,429,430],{},"What to check",[432,433,434,446,457,468,479],"tbody",{},[419,435,436,440,443],{},[437,438,439],"td",{},"Parameters",[437,441,442],{},"How many learned numerical values the model contains. \"B\" means billion; \"T\" means trillion.",[437,444,445],{},"Evaluate performance on your particular task.",[419,447,448,451,454],{},[437,449,450],{},"Active parameters",[437,452,453],{},"For some mixture-of-experts models, how many parameters are used for a token.",[437,455,456],{},"Check total memory requirements and deployment costs too.",[419,458,459,462,465],{},[437,460,461],{},"Context window",[437,463,464],{},"How many tokens can fit in the model's context, subject to the provider's specific limits.",[437,466,467],{},"Test how reliably the model uses information across that context. Check how the application handles persistent memory separately.",[419,469,470,473,476],{},[437,471,472],{},"Weights availability",[437,474,475],{},"Whether you can obtain the model's learned parameters.",[437,477,478],{},"Check training data and training code availability separately.",[419,480,481,484,487],{},[437,482,483],{},"License and access",[437,485,486],{},"What you are allowed to do, and whether you can use an API, run it yourself, or both.",[437,488,489],{},"Check hardware requirements before planning to self-host.",[23,491,492],{},"For example, a hypothetical model advertised as \"100B total, 10B active, 128k context, downloadable weights\" tells us about its architecture, working space, and distribution. To compare it with a smaller model, evaluate both on your documents.",[23,494,495],{},"Check the license for permitted uses of downloadable weights. Training code and data may have separate terms or remain private. And if a provider doesn't disclose the parameter count, that's simply information we don't have.",[39,497,499],{"id":498},"the-mental-model-to-keep","The mental model to keep",[23,501,502],{},"Think of an LLM as a model that builds a response one small piece of text at a time. Each piece is a token.",[23,504,505],{},"Training teaches it patterns from examples. When you send a message, it uses those patterns and the information in the conversation to choose the next token. Then it adds that token to the conversation and chooses the next one, until the response is finished.",[23,507,508],{},"This explains a few things you'll notice when using an assistant:",[152,510,511,514,517,520],{},[155,512,513],{},"It can use a correction you give it in the conversation without permanently learning it.",[155,515,516],{},"It can write a convincing answer that's wrong. Check factual claims against reliable sources.",[155,518,519],{},"It can do intermediate work before answering. The result still needs checking.",[155,521,522],{},"It can ask to use a tool, such as a clock or a search engine. The application runs that tool and gives the result back to the model.",[23,524,525],{},"So when you read an answer, ask what it is based on. Did you provide the information? Did a tool return it? Or is the model answering from patterns learned during training? Knowing the difference helps you decide what to trust and what to check.",{"title":527,"searchDepth":15,"depth":15,"links":528},"",[529,530,531,532,533,538,539],{"id":41,"depth":15,"text":42},{"id":97,"depth":15,"text":98},{"id":172,"depth":15,"text":173},{"id":226,"depth":15,"text":227},{"id":279,"depth":15,"text":280,"children":534},[535,537],{"id":296,"depth":536,"text":297},3,{"id":342,"depth":536,"text":343},{"id":404,"depth":15,"text":405},{"id":498,"depth":15,"text":499},null,"md",{"date":543},"2026-10-23",true,"---\ncontentId: e36af6d2-7c12-4f58-a3d1-83d8098c6d20\ntitle: LLM Fundamentals, from the Next Token to Tools\ndescription: How does an LLM work? Follow learned parameters, tokens, embeddings, and the Transformer to understand text generation, reasoning, and tool calling.\ndate: 2026-10-23\npart: 1\n---\n\nAn AI assistant can translate a paragraph, explain a piece of code, work through a problem, and sometimes even take action on your behalf. From the outside, those look like very different abilities.\n\nBut underneath, there is a surprisingly consistent mechanism: producing the next token.\n\nThat's it?\n\nWell, yes. But saying that an LLM produces the next token is a little like saying that a computer moves numbers around. It's true, but it doesn't explain much until we look at what those numbers represent and how the machine uses them.\n\nSo, let's do that. No mathematics background required. We'll follow one sentence through the model, then use what we've learned to understand reasoning and tool calling. By the end, the vocabulary around LLMs should feel much less mysterious.\n\n## A model learns patterns from examples\n\nBefore looking at how a large language model generates text, we need to understand where its behavior comes from.\n\nImagine building a spam detector. One approach would be to write a rule: if a message contains \"free\" or \"urgent\", mark it as spam.\n\nSimple. Also, quite fragile.\n\n\"This is urgent: can we move our meeting to 3 pm?\" contains one of our suspicious words, but that doesn't make it spam. Add an exception for meetings, and you'll soon find another message that breaks the new rule. You can spend a lot of time trying to describe every possible situation.\n\nA language model learns numerical parameters from examples. These parameters are also called **weights**.\n\nDuring a common training stage, the model sees sequences of tokens and tries to predict what comes next. Its prediction is compared with the token that actually follows in the training example. The training process adjusts the parameters to make predictions like that one better. Repeat this across a large amount of text, and the parameters capture patterns in language, code, and the relationships described by that text.\n\nModern assistants usually go through additional training to follow instructions and improve how they respond. These training stages adjust the learned parameters that shape the model's responses.\n\n\u003CLlmFundamentalsLearning \u002F>\n\nThe animation brings together two moments that are easy to confuse: **training** and **inference**. Training changes the parameters. Inference uses them to generate an output.\n\nWhen you send a message to an already trained model, those parameters normally stay fixed. The model can use information in your conversation, including a correction you just gave it, without permanently learning that correction in its weights.\n\nAn application can also save memories, retrieve documents, or use conversations in a later training process. Saved memories and retrieved documents supply context for future requests. Further training can update the parameters.\n\nAt inference time, the model produces outputs using its parameters and the context it receives. It can memorize some passages from training. Retrieving a specific document with its source requires a separate lookup system.\n\nEven a fluent, confident answer needs checking. Look for sources you can verify.\n\n## A token is a piece of text\n\nLet's give our model a sentence to complete:\n\n> The capital of France is\n\nWe see words. The model needs numbers.\n\nThe first step is **tokenization**: splitting the text into pieces from a vocabulary. Those pieces are called tokens. Depending on the tokenizer, a token might correspond to a word, part of a word, punctuation, or a smaller piece of a character's encoded representation.\n\nFor our sentence, the split looks conveniently like words. That can be misleading. With the same tokenizer, \"unbelievable\" splits into \"un\", \"belie\", and \"vable\". A different tokenizer can produce a different split.\n\nSpaces matter too. In the animation, a middle dot makes the leading space in a token visible. \" capital\" is one token in this example, including its space.\n\n\u003CLlmFundamentalsTokens \u002F>\n\nOnce the text is split, each token maps to an **ID** in the tokenizer's vocabulary. In this example, \" France\" has the ID `9822`.\n\nThe ID identifies an entry in the vocabulary, much like a catalog number. The tokenizer assigns these IDs independently of a token's importance or meaning.\n\nThe ID is then used to look up an **embedding**: a learned vector, or list of numbers. This is the numerical representation the model can work with. Real embeddings typically have many more dimensions than the vectors shown above.\n\nWe now have a useful separation:\n\n- The token is a piece of text.\n- The token ID identifies it in the vocabulary.\n- The embedding represents it numerically for the model.\n\nThese three stages turn our sentence into something the model can process.\n\nThis also explains why model limits and pricing often use tokens rather than words. The amount of text a token represents depends on the tokenizer, the language, and the content. A fixed word-to-token conversion is only an approximation.\n\n## The Transformer puts those pieces in context\n\nThe model then needs to account for context. The same word can mean different things depending on what surrounds it, and the order of words matters.\n\nMost current text-generating LLMs use a **decoder-only Transformer**. We don't need to unpack every operation inside it, but two building blocks are worth understanding: attention and the feed-forward network, often called an MLP.\n\n**Attention lets a token's representation draw information from other positions in the context.** In a causal language model, attention at each position is limited to itself and earlier positions. Information about token positions also lets the model take order into account.\n\nIn our example, the representation at \" is\" can incorporate information from \"capital\" and \"France\". The next token should fit the whole phrase.\n\nThe **MLP** then transforms the representation at each position. Attention and these transformations repeat across many layers. Each layer updates the representations with information from the surrounding text.\n\nThere are other important details, including normalization and residual connections. For our mental model, the key is that the Transformer repeatedly mixes relevant context and transforms the resulting representations.\n\nAt the end, the model uses the final representation at the **last position** to calculate a score for every possible next token in its vocabulary. These scores are called **logits**. A function called **softmax** turns them into a probability distribution.\n\nSo we arrive at something like this: \" Paris\" has a high probability, \" Lyon\" a lower one, and many other tokens have smaller probabilities.\n\n\u003CLlmFundamentalsTransformer \u002F>\n\n## Generating a response means repeating the same operation\n\nWe have a probability distribution. Now we need a token.\n\nA **decoding procedure** selects it. One option is to choose the highest-scoring token. Another is to sample from the distribution, potentially after changing it with settings such as temperature or top-p.\n\nTemperature changes how concentrated the sampling distribution is. Even at low temperature, the model can produce factual errors.\n\nIn our example, the selected token is \" Paris\". It gets appended to the context:\n\n> The capital of France is Paris\n\nThen we repeat. The model now predicts what comes after this longer sequence. Perhaps the next token is a period. Append it, and continue until a stopping condition is reached, such as an end-of-turn token or an output limit.\n\nThis is called **autoregressive generation**: previously generated output becomes part of the input for what follows.\n\n\u003CLlmFundamentalsGeneration \u002F>\n\nThe answer grows token by token, with each new token shaped by what came before it. Implementations can reuse cached intermediate computations to reduce the work at each step.\n\nAnd our original context can be much richer than a half-finished sentence. It can include instructions, previous messages, documents, code, or tool results. All of that influences the continuation.\n\nIf you've read my article about [Code Mode and the LLM context](\u002Fposts\u002Fcode-mode-two-tools-and-an-mcp-can-save-your-llm-context), that's why context management matters so much. The model generates from what it has been given, within a finite context window. Missing information, irrelevant material, and misleading instructions can all affect the result.\n\n## How can next-token prediction produce useful abilities?\n\nPredicting the next token across varied text requires learning many kinds of patterns.\n\nTo complete a translation example, it helps to capture relationships between languages. To continue a program, it helps to represent patterns in code. To answer a question in a conversation, it helps to follow its instructions and use the surrounding information.\n\nTraining and scale can produce a broad range of capabilities through that shared mechanism. Performance varies by model and task, so reliability needs to be evaluated on the work you want it to do.\n\nTwo capabilities deserve a closer look because they often make assistants feel as though they work in a completely different way: reasoning and tool calling.\n\n### Reasoning: doing intermediate work before answering\n\nConsider this problem:\n\n> A notebook and a pen cost €11 together. The notebook costs €10 more than the pen. How much does the pen cost?\n\nThe tempting answer is €1. But then the notebook would cost €11, and together they would cost €12. It doesn't work.\n\nIf we write down the relationship instead, the problem becomes easier. Let the pen cost `x`. The notebook costs `x + 10`, so `x + (x + 10) = 11`. That gives us `x = 0.50`.\n\n\u003CLlmFundamentalsCapabilities mode=\"reasoning\" \u002F>\n\nReasoning models can spend additional computation on intermediate work before delivering an answer. That work can involve generating reasoning tokens, evaluating possible approaches, or revising a first attempt. Generating intermediate tokens still uses the same underlying next-token mechanism.\n\nIntermediate work gives the model more opportunities to revise its answer. Spending more computation can improve results on some problems. It also increases latency and cost. The final answer still needs checking.\n\nFor our pen, the check is straightforward: €0.50 + €10.50 = €11, and the difference is €10. For a real business decision, the check may require evidence outside the model.\n\n### Tool calling: generating a request for something else to execute\n\nNow ask a different question:\n\n> What time is it in Paris right now?\n\nThe answer changes every minute, so the assistant needs a current clock reading.\n\nA surrounding application can give the model access to a tool, for example `get_time`. The tool description tells the model what the function does and which arguments it expects. The model can then generate a structured request with `city` set to `Paris`.\n\n\u003CLlmFundamentalsCapabilities mode=\"tools\" \u002F>\n\nThe application receives the request, validates it, and runs the external function. It adds the result to the model's context. The model can then generate an answer based on that fresh information.\n\nThere are two different systems doing two different jobs:\n\n1. **The model generates a request** using the available tool definitions and context.\n2. **The application executes a function** and returns its result.\n\nThe surrounding software connects the model to the clock and supplies the current reading.\n\nThat boundary is essential for security. A model can ask for the wrong action or generate invalid arguments. The application must enforce permissions, validate inputs, and decide which actions require confirmation. Those checks belong in the application's execution code.\n\nConnect generation, intermediate work, and tools in a loop, and you have the basis of many AI agents: a system that can work toward a goal through several steps. The application coordinates the LLM, tools, and results across those steps.\n\n## Reading a model's identity card\n\nOnce these ideas are clear, announcements about new models become easier to read. Each number describes a specific part of the system.\n\nHere are the fields I look at:\n\n| Field | Meaning | What to check |\n| --- | --- | --- |\n| Parameters | How many learned numerical values the model contains. \"B\" means billion; \"T\" means trillion. | Evaluate performance on your particular task. |\n| Active parameters | For some mixture-of-experts models, how many parameters are used for a token. | Check total memory requirements and deployment costs too. |\n| Context window | How many tokens can fit in the model's context, subject to the provider's specific limits. | Test how reliably the model uses information across that context. Check how the application handles persistent memory separately. |\n| Weights availability | Whether you can obtain the model's learned parameters. | Check training data and training code availability separately. |\n| License and access | What you are allowed to do, and whether you can use an API, run it yourself, or both. | Check hardware requirements before planning to self-host. |\n\nFor example, a hypothetical model advertised as \"100B total, 10B active, 128k context, downloadable weights\" tells us about its architecture, working space, and distribution. To compare it with a smaller model, evaluate both on your documents.\n\nCheck the license for permitted uses of downloadable weights. Training code and data may have separate terms or remain private. And if a provider doesn't disclose the parameter count, that's simply information we don't have.\n\n## The mental model to keep\n\nThink of an LLM as a model that builds a response one small piece of text at a time. Each piece is a token.\n\nTraining teaches it patterns from examples. When you send a message, it uses those patterns and the information in the conversation to choose the next token. Then it adds that token to the conversation and chooses the next one, until the response is finished.\n\nThis explains a few things you'll notice when using an assistant:\n\n- It can use a correction you give it in the conversation without permanently learning it.\n- It can write a convincing answer that's wrong. Check factual claims against reliable sources.\n- It can do intermediate work before answering. The result still needs checking.\n- It can ask to use a tool, such as a clock or a search engine. The application runs that tool and gives the result back to the model.\n\nSo when you read an answer, ask what it is based on. Did you provide the information? Did a tool return it? Or is the model answering from patterns learned during training? Knowing the difference helps you decide what to trust and what to check.\n",{"title":7,"description":8},{"loc":6},"ai-for-everyone\u002Fllm-fundamentals","dYt6ijhVOeMUCC8s2Lt0FYgl3XQNlF1-uFnaDibwe8A",{"id":551,"title":552,"artifacts":553,"date":556,"description":557,"event":558,"extension":561,"links":562,"locale":571,"meta":572,"slug":548,"sourceLanguage":571,"stem":574,"topics":575,"__hash__":583},"talkResources\u002Ftalk-resources\u002Fai-for-everyone\u002Fllm-fundamentals.json","LLM fundamentals",{"summary":554,"transcript":555},"summary.en.md","transcript.en.md","2026-10-29","Understand how LLMs predict tokens, learn from data, and use transformers, reasoning, and tools, with examples of their capabilities and limitations.",{"name":559,"url":560},"AI for Everyone","https:\u002F\u002Fbeta.soubiran.dev\u002Fai-for-everyone","json",{"slides":563,"thumbnail":564,"thumbnailDark":565,"source":566,"pdf":567,"recording":568,"youtubeEmbed":569,"audio":570},"https:\u002F\u002Ftalks.soubiran.dev\u002Fai-for-everyone\u002Fllm-fundamentals","https:\u002F\u002Ftalks.soubiran.dev\u002Fai-for-everyone\u002Fllm-fundamentals\u002Fthumbnail.png","https:\u002F\u002Ftalks.soubiran.dev\u002Fai-for-everyone\u002Fllm-fundamentals\u002Fthumbnail-dark.png","https:\u002F\u002Ftalks.soubiran.dev\u002Fai-for-everyone\u002Fllm-fundamentals\u002Fsrc","https:\u002F\u002Ftalks.soubiran.dev\u002Fai-for-everyone\u002Fllm-fundamentals\u002Fpdf","https:\u002F\u002Ftalks.soubiran.dev\u002Fai-for-everyone\u002Fllm-fundamentals\u002Frecording\u002Fen","https:\u002F\u002Fwww.youtube.com\u002Fembed\u002FeyChRqRsOuI","https:\u002F\u002Ftalks.soubiran.dev\u002Fai-for-everyone\u002Fllm-fundamentals\u002Faudio\u002Fen","en",{"publication":573},"article-resource","talk-resources\u002Fai-for-everyone\u002Fllm-fundamentals",[576,577,578,579,330,580,581,582],"agents","ai","llm","machine-learning","tokens","tool-calling","transformer","huUlnKA2SXqXJriuj0XyTYZc_bn7Kmwb2OZthEG4ehg",1795016666067]