What You Will Learn

By the end of this lesson, you should be able to:

  • Explain the difference between AI training and AI inference.
  • Understand what happens to data during model training.
  • Understand what a loss function is and why it matters.
  • Explain gradients and backpropagation at a conceptual level.
  • Understand how parameters change during training.
  • Explain why training a modern language model can require enormous amounts of computation.
  • Understand why running a trained model is a fundamentally different task.
  • Understand why inference can be performed locally on ordinary consumer hardware for appropriately sized models.
  • Understand the difference between model training, fine-tuning, and inference.
  • Understand why downloading a model does not mean downloading an AI that is still “learning.”
  • Understand why prompting a model normally does not permanently change its weights.
  • Understand how context, memory, retrieval, and training are different mechanisms.
  • Understand where Loco fits into the training/inference lifecycle.
  • Develop a mental model that will make later lessons about neural networks, tokens, hardware, quantization, and local inference much easier.

1. Introduction: Two Very Different Jobs

One of the most important distinctions in artificial intelligence is also one of the easiest to misunderstand:

Training and inference are not the same thing.

They are related, but they are fundamentally different computational processes. Imagine that an AI model is a student. Before the student knows anything, the student needs to study.

They read examples. They attempt problems. They make mistakes.

Someone measures those mistakes. The student adjusts their understanding. They repeat the process thousands, millions, or billions of times.

That is roughly analogous to training. Now imagine the student has completed their training. You give them a question:

“Explain photosynthesis.”

The student thinks about what they have learned and produces an answer. That is roughly analogous to inference.

The student is no longer undergoing the original learning process. They are using the knowledge and patterns represented in their trained system to produce an output.

This distinction is absolutely fundamental to Local AI. When you download a model into Loco and ask it a question, you are generally performing inference. You are not training the model.

You are using a model that has already been trained. This single distinction explains a huge amount about how AI software works. It explains:

  • why model training requires enormous datasets,
  • why training can require large computing clusters,
  • why inference can sometimes run on a laptop,
  • why downloading a model does not mean it is still learning,
  • why changing a prompt normally does not permanently modify the model,
  • why a knowledge base is different from retraining,
  • why fine-tuning is different from ordinary prompting,
  • why model files contain learned parameters,
  • and why Local AI is primarily an inference technology for most everyday users.

To understand Local AI properly, you therefore need to understand what happens during both phases. This lesson will build that understanding from the ground up.


2. The Simplest Possible Definition

Let's start with extremely simple definitions.

Training

Training is the process of adjusting a model's parameters so that it becomes better at a particular task or set of tasks.

Inference

Inference is the process of using the trained model to produce an output from an input.

For a language model, the input might be:

“Write a short explanation of gravity.”

The model processes that input and generates text. That generation is inference. Training is what happened before the model was distributed to you.

A useful simplified diagram is:

Training Phase

Compute & Data Heavy
1. Input
Training Data
Massive text, code or image corpora
↓
2. Computation
Training Process
Forward pass, loss calculation & backpropagation
↓
3. Optimization
Model Parameters
Billions of weights adjusted iteratively
↓
4. Artifact
Trained Model
Exported, frozen weight file (.gguf)

Inference Phase

Fast & On-Device
1. Input
User Prompt
Question, context or document input
↓
2. Execution
Trained Model (Frozen)
Local CPU / GPU runtime performs matrix math
↓
3. Output
Model Output
Generated response produced token-by-token

The model produced by training becomes the thing used during inference. This distinction will appear again and again throughout Local AI.


3. A More Precise Mental Model

It is tempting to imagine training as:

“The AI reads some information and remembers it.”

That is not a sufficiently accurate model. Training is better understood as an optimization process. A model begins with parameters.

Those parameters contain numerical values.

During training, the model repeatedly processes examples and adjusts those values so that its predictions become better according to a defined objective.

Very roughly:

Input
Initial parameters
→
Step 2
Process example
→
Step 3
Produce prediction
→
Step 4
Measure error
→
Step 5
Calculate adjustments
→
Step 6
Update parameters
→
Output
Repeat

After an enormous number of repetitions, the resulting parameter configuration represents a learned model. This is why a trained model is not simply a giant database of sentences. It is a mathematical system whose parameters encode patterns learned from data.

That distinction is extremely important.


4. What Does “Learning” Mean for an AI?

Humans use the word “learning” very naturally. A child learns that fire is hot. A student learns how to solve quadratic equations.

A mechanic learns how an engine works. When we say a neural network “learns,” we are using the word in an analogous but technical sense. The model does not necessarily experience understanding in the human sense.

Instead, its parameters are adjusted through optimization.

The model becomes better at producing desired outputs because the numerical relationships inside the model have changed.

This gives us an important definition:

Machine learning is the process of finding parameter values that allow a model to perform better on a task.

The word parameter is important. You encountered parameters in Lesson 4. A parameter is a numerical value within the model that can be adjusted during training.

A modern neural network may contain millions, billions, or more parameters. Training changes those parameters. Inference normally does not.


5. The Model Before Training

Imagine constructing a neural network with billions of parameters. At the beginning, those parameters need to have some initial values. Those initial values do not represent the useful knowledge of the finished model.

The model therefore starts in a state where its predictions are generally poor. Imagine asking an untrained language model:

“What is the capital of France?”

There is no reason to expect a useful answer. The model needs to undergo training. Training gradually modifies its parameters.

Eventually, the parameter configuration can represent extremely complicated patterns involving:

  • language,
  • grammar,
  • syntax,
  • semantics,
  • factual associations,
  • reasoning patterns,
  • programming structures,
  • mathematical relationships,
  • stylistic patterns,
  • and many other statistical relationships.

The important point is that these capabilities do not appear because someone manually types billions of facts into the model.

They emerge through optimization over training data.


6. What Is Training Data?

Training requires examples. For a language model, these examples can consist of enormous quantities of text and other data. Depending on the model, training data can contain things such as:

  • books,
  • websites,
  • technical documents,
  • articles,
  • code,
  • educational material,
  • mathematical text,
  • conversations,
  • reference material,
  • and other forms of data.

The exact composition of a particular model's dataset depends on its developers and licensing arrangements.

A language model does not simply need “a lot of words.”

It needs data from which useful patterns can be learned. Consider the following sentence:

The cat sat on the mat.

A single sentence contains relationships between:

  • words,
  • grammar,
  • syntax,
  • objects,
  • actions,
  • and context.

Now imagine millions or billions of examples. The model can encounter countless variations of language. For example:

The dog slept on the rug.

The child sat on the chair.

The bird landed on the branch.

The engineer worked on the machine.

Across many examples, the model can learn statistical relationships between words and structures. Training is how those relationships become encoded in the model's parameters.


7. The Prediction Game

A particularly useful way to understand language-model training is to imagine a prediction game. Suppose the training data contains:

The cat sat on the mat.

The model might be given:

The cat sat on the

and asked to predict the next token. Perhaps the correct next token is:

mat

The model produces probabilities. For example, conceptually:

mat 0.18 floor 0.12 chair 0.07 table 0.05 road 0.01 ...

These numbers are illustrative only. The actual model's probability distribution would contain many possible tokens. Suppose the correct answer is “mat,” but the model assigned it a low probability.

The training process can measure how wrong the model was. It then calculates how the parameters should change so that predictions become better. This process repeats.

And repeats. And repeats. At enormous scale.


8. Loss: Measuring How Wrong the Model Is

Training requires some way to measure performance. This is where the concept of a loss function becomes important.

A loss function produces a numerical measurement representing how poorly the model performed relative to the training objective.

You can think of it as an error meter. Conceptually:

Input
Prediction
→
Step 2
Compare with target
→
Output
Calculate loss

A high loss generally means the model performed poorly according to that objective. A lower loss means the model performed better. The exact mathematical definition depends on the task and training setup.

For language modeling, a common family of objectives is based on predicting tokens and measuring the probability assigned to the correct next token.

You do not need to understand the full mathematics yet. The important idea is:

The training system needs a measurable way to determine how much the model's prediction should improve.

Without a meaningful training objective, there is no clear direction for optimization.


9. Why Loss Alone Is Not Enough

You might now ask:

“If the model knows that it was wrong, how does it know what to change?”

This is where gradients and backpropagation enter the picture. Imagine the model produces an incorrect prediction. The training system calculates a loss.

But the model contains millions or billions of parameters. Which parameters contributed to the error? And by how much?

The training process uses mathematical techniques to estimate the direction in which those parameters should be adjusted.

This is where the gradient becomes important. A gradient tells us, in simplified terms, how changing parameters would affect the loss. The training system can therefore determine a direction that should reduce the loss.

This is the conceptual role of backpropagation.


10. Backpropagation Explained Simply

The word backpropagation sounds intimidating. The underlying idea can be explained simply. Suppose you have a complicated system:

Input
Input
→
Step 2
Layer 1
→
Step 3
Layer 2
→
Step 4
Layer 3
→
Output
Output

The model produces an incorrect output. The training system calculates the error. It then works backward through the network to determine how much different parameters contributed to that error.

This produces gradients. Those gradients can then be used by an optimization algorithm to update the parameters. Conceptually:

Input
Forward pass: Input
→
Step 2
Layer
→
Step 3
Layer
→
Step 4
Prediction Backward pass: Prediction error
→
Step 5
Gradient calculation
→
Output
Parameter adjustments

The forward pass answers:

“What does the current model predict?”

The backward pass answers something closer to:

“How should the parameters change to make that prediction better?”

This process is one of the foundational mechanisms behind neural-network training.


11. The Optimizer

Once gradients have been calculated, the training system needs a method for actually updating the parameters. This is handled by an optimizer. One common family of optimizers used in deep learning is based on gradient descent.

The basic idea is remarkably intuitive. Imagine standing on a hill. You want to reach the bottom.

You look at the slope around you. Then you take a small step downhill. You measure again.

Then another step. And another. The goal is to move toward a region where the loss is lower.

In simplified form:

Input
Current parameters
→
Step 2
Calculate loss
→
Step 3
Calculate gradients
→
Step 4
Optimizer chooses update
→
Output
New parameters

Then the process repeats.


12. Learning Rate

There is an important detail here. How large should each update be? If the training process changes parameters too aggressively, training can become unstable.

If it changes them too little, training can become extremely slow. This is where the learning rate becomes important. A simplified example:

Learning rate = small → tiny updates → slower progress

Learning rate = large → large updates → potentially unstable training

Real training systems use sophisticated schedules and optimization strategies. But the underlying concept is simple:

The learning rate controls how strongly the model's parameters are updated in response to calculated gradients.

This is one of many hyperparameters that influence training.


13. What Actually Changes During Training?

This is one of the most important questions in the entire lesson. When a model trains, what physically changes? The answer is:

Its parameters.

Consider a simplified model containing:

Parameter A = 0.21 Parameter B = -0.73 Parameter C = 1.12

After training updates:

Parameter A = 0.24 Parameter B = -0.68 Parameter C = 1.09

Real neural networks have enormous numbers of parameters. Training repeatedly adjusts these values. The resulting collection of parameters becomes the trained model.

This is why Lesson 4 emphasized that model files contain numerical information representing the trained model.


14. Training Does Not Mean Manually Writing Facts Into Parameters

A common misconception is:

“Someone programs the model with the answers.”

That is not normally how modern neural-network training works. Developers define:

  • the model architecture,
  • the training objective,
  • the optimization process,
  • the data pipeline,
  • and other training settings.

The system then performs enormous numbers of mathematical operations. The resulting parameters emerge from that optimization process. This is why it is difficult to point at one specific parameter and say:

“This parameter stores the fact that Paris is the capital of France.”

The knowledge represented by a neural network is distributed throughout the parameter space. It is not generally organized like a conventional database table.


15. A Neural Network Is Not a Database

This distinction is worth emphasizing. Imagine a database:

Country Capital France Paris Germany Berlin Japan Tokyo

A database stores explicit records. A neural network is fundamentally different. Its parameters encode patterns across a high-dimensional mathematical space.

A trained language model may be able to produce:

“The capital of France is Paris.”

But that does not mean there is a simple row somewhere inside the model saying:

France → Paris

The model's behavior emerges from the interaction of enormous numbers of parameters. This is one reason neural networks can generalize.

They can produce outputs for combinations of concepts that were not necessarily presented as exact sentences during training.


16. Training Is Usually Repetitive

Modern model training involves enormous repetition. A simplified loop looks like this:

  1. Obtain training examples
  2. Convert data into model inputs
  3. Run the model
  4. Produce predictions
  5. Calculate loss
  6. Calculate gradients
  7. Update parameters
  8. Repeat

This process may run across enormous datasets. The number of individual mathematical operations can become extraordinary. That is one reason training frontier-scale models is such a computationally intensive undertaking.


17. Batches

Training normally does not process an entire massive dataset in one giant operation. Instead, data is divided into smaller groups called batches. Suppose you have:

10,000,000 training examples

You might process smaller groups at a time. For example:

Batch 1 Batch 2 Batch 3 ... Batch 100000

The exact batch size depends on the training system and hardware. Processing examples in batches allows modern hardware to perform many calculations in parallel. It also interacts with optimization behavior.


18. Epochs

Another useful training concept is an epoch. An epoch represents one complete pass through the training dataset. Imagine your dataset contains:

1,000,000 examples

If the training process processes all one million examples once, that is approximately one epoch. If it processes them again, that is another epoch. Conceptually:

Epoch 1 ████████████████████

Epoch 2 ████████████████████

Epoch 3 ████████████████████

Modern large-model training is more complicated than simply repeatedly reading the same small dataset.

Training pipelines can involve enormous corpora, data mixtures, filtering, weighting, curriculum strategies, and multiple training stages.

Still, the concept of repeated exposure to training data is useful.


19. Pretraining

When people talk about a language model being “trained,” they may actually be referring to several stages. One major stage is pretraining. Pretraining is where a model learns broad statistical patterns from a very large dataset.

For language models, a central objective often involves predicting tokens. A simplified example:

Input: The chemical formula for water is

Target: H2O

Or:

Input: The sun rises in the

Target: east

The model sees huge quantities of examples like this. Over time, the parameters become increasingly capable of modeling language and other patterns. Pretraining is one of the major reasons large language models can develop broad capabilities.


20. Instruction Tuning

A pretrained model is not necessarily optimized for interacting with humans in the way users expect. It may be capable of language prediction without being particularly good at following instructions. A later training stage can therefore teach the model to behave more like an assistant.

This can involve instruction-response examples such as:

Instruction: Explain photosynthesis to a child.

Desired response: Photosynthesis is the process...

The exact methods vary between model developers. But the conceptual distinction is important:

Input
Pretraining
→
Step 2
Broad language/pattern learning Instruction tuning
→
Output
Better instruction following

This is still training. The model's parameters are being changed.


21. Fine-Tuning

Fine-tuning is another form of training.

Instead of training a model from scratch on a gigantic dataset, a developer can begin with an already trained model and continue training it on a more specialized dataset.

For example, imagine an existing language model. A developer might fine-tune it on:

  • legal documents,
  • medical terminology,
  • programming examples,
  • customer-support conversations,
  • scientific material,
  • or a specific communication style.

The result can be a model adapted toward a narrower purpose. This is fundamentally different from simply putting a document into a prompt.


22. Training From Scratch vs Fine-Tuning

These concepts should not be confused.

Training from scratch

Input
Random/initial parameters
→
Step 2
Huge training process
→
Output
New base model

Fine-tuning

Input
Existing trained model
→
Step 2
Additional training
→
Output
Adapted model

Training from scratch is generally far more computationally demanding. Fine-tuning starts from a model that already contains useful learned representations. This is one reason existing models are so valuable.

The difficult general-purpose learning has already happened.


23. LoRA and Parameter-Efficient Fine-Tuning

You will encounter LoRA, or Low-Rank Adaptation, later in the course. It is worth introducing the concept now. Traditional fine-tuning can involve updating many model parameters.

Parameter-efficient methods attempt to reduce the amount of information that must be modified or stored for an adaptation.

LoRA is one well-known technique. Conceptually:

Input
Base model + Small trainable adaptation
→
Output
Specialized behavior

The base model remains available, while an additional learned component represents the adaptation. This can make certain fine-tuning workflows substantially more manageable. We will cover this in depth in Lesson 58.


24. What Is Inference?

Now we reach the second half of this lesson.

Inference is using a trained model to generate an output from an input.

For a language model:

Input
Prompt
→
Step 2
Tokenization
→
Step 3
Model computation
→
Step 4
Next-token probabilities
→
Step 5
Token selection
→
Step 6
More computation
→
Step 7
More tokens
→
Output
Final response

That entire process is inference. When you open Loco, load a local language model, type a prompt, and receive an answer, you are performing inference.


25. Inference Does Not Normally Change the Model

This is one of the most important concepts for Local AI beginners. Suppose you download a model. You ask:

“What is photosynthesis?”

The model answers. Then you ask:

“Explain it more simply.”

The model answers again. You have not normally retrained the model. Its parameters have not been permanently modified simply because you asked questions.

The model is using its existing parameters to calculate outputs. This can be represented as:

Input
Fixed trained parameters
→
Step 2
Prompt → [ Model ] → Output ^
→
Output
Context

The prompt changes the input. It does not normally rewrite the model.


26. Why Does the Model Seem to Learn During a Conversation?

This is where things get confusing. You might tell a model:

“My name is Alex.”

Then later:

“What is my name?”

The model may answer:

“Your name is Alex.”

It can look like the model has learned something. But something very different may be happening. The conversation itself is part of the model's context.

Conceptually:

Input
System instructions + Previous messages + Current message
→
Step 2
Model
→
Output
Output

The model can use information in the current context without permanently changing its underlying parameters. This is sometimes called in-context learning or context-based adaptation. It is not the same thing as updating the model's weights.


27. Context vs Training

Consider this example. You tell the model:

“For this conversation, call the fictional company AcmeCo.”

The model may follow that instruction.

But if you close the conversation and start a completely separate interaction, the model does not necessarily retain that instruction.

Why? Because the information may have existed only in the context. Compare:

Context

Temporary information supplied to the model

Training

A process that modifies model parameters

These are completely different mechanisms. This distinction becomes extremely important when building AI systems.


28. Retrieval Is Also Different

Suppose you want Loco to answer questions about a company's internal documents. You could provide the documents to the model through a retrieval system. For example:

Input
Company documents
→
Step 2
Index / retrieval system
→
Step 3
Relevant passages
→
Step 4
Prompt
→
Step 5
Local model
→
Output
Answer

The model can now answer using information retrieved from those documents. But the model itself has not necessarily been retrained. The documents can remain external.

This distinction is fundamental to RAG, which you will study later. RAG stands for Retrieval-Augmented Generation. It combines information retrieval with generative AI.


29. Training vs Context vs Retrieval

Let's put the three mechanisms side by side.

Mechanism Changes model parameters? Information source
Training Yes Training dataset
Fine-tuning Yes Specialized training data
Prompting No User-provided context
Conversation context No Previous messages
Retrieval/RAG Usually no External documents
Inference No Model + input/context

This table is one of the most useful mental models in Local AI. If you remember nothing else from this lesson, remember this distinction.


30. Why Training Is So Computationally Expensive

Training a large neural network can require enormous computation. Why? Because training involves repeatedly calculating:

  • model outputs,
  • loss,
  • gradients,
  • parameter updates,
  • and many intermediate values.

And this happens across enormous datasets. A large neural network may contain billions of parameters. During training, many of those parameters participate in calculations involving large tensors.

The hardware therefore has to perform huge numbers of mathematical operations. This is where accelerators become particularly important.


31. Why GPUs Are So Useful for Training

GPUs are designed to perform large numbers of similar mathematical operations in parallel. Neural-network workloads contain many operations that are highly parallelizable. A simplified conceptual comparison:

CPU: A few powerful general-purpose workers

GPU: A very large number of specialized parallel workers

This analogy is imperfect, but useful. Training neural networks often involves operations that map well onto GPU architectures. That is why large AI training systems commonly use large collections of GPUs or other accelerators.

You will learn much more about CPUs and GPUs in Part 3.


32. Training and Memory

Training also has significant memory requirements. This is because training may need to keep track of more than just the model's parameters. Depending on the training method, memory may be needed for:

  • model parameters,
  • gradients,
  • optimizer state,
  • activations,
  • batches of input data,
  • temporary tensors,
  • and other intermediate information.

This can make training dramatically more memory-intensive than simply running a trained model. This distinction becomes extremely important later.


33. Inference Can Be Much Cheaper

Once a model is trained, inference does not normally require the full training machinery. The model parameters can be loaded and used to calculate outputs. Conceptually:

Training:

Parameters + gradients + optimizer state + activations + training data + repeated updates

Inference:

Parameters + input/context + intermediate computation

The exact memory and compute requirements depend heavily on the model, context size, implementation, numerical precision, batching, hardware, and other factors.

But the broad difference remains:

Training is an optimization process. Inference is a model-execution process.


34. Why This Matters for Local AI

This distinction is one of the main reasons Local AI is possible. Suppose a company spent enormous resources training a model. They could distribute the resulting trained model.

A user does not need to repeat the original training process to use it. The user can download an appropriate model and perform inference locally.

This means a model that required extremely substantial resources to create can potentially be used by an individual on much smaller hardware.

That does not mean every model can run on every computer. Model size, architecture, quantization, memory, context length, and hardware still matter enormously. But the fundamental principle is powerful:

You do not need to reproduce the training process in order to perform inference.


35. A Simple Analogy: The Cook and the Recipe

Imagine a professional kitchen. Training is somewhat like developing a chef. The chef studies thousands of recipes.

They practice techniques. They make mistakes. They receive feedback.

They improve. Eventually, the chef becomes highly capable. Inference is what happens when you walk into the restaurant and say:

“I'd like pasta.”

The chef uses their learned abilities to produce a dish. You do not need to retrain the chef every time someone orders pasta. Likewise, a trained AI model does not need to be retrained every time you ask it a question.

The model's learned parameters already exist.


36. Another Analogy: Compiling Software

There is another useful technical analogy. Imagine writing source code. You compile it.

The compiler transforms the source into an executable representation. Later, you run the executable.

Training and inference are not exactly equivalent to compilation and execution, but there is a useful conceptual similarity:

Training → produces a trained model

Inference → executes that trained model

The analogy breaks down in many technical details, so do not take it literally. But it can help establish the distinction between creating/adapting the model and using the model.


37. What Happens When Loco Loads a Model?

At a conceptual level, imagine that you have downloaded a local model. Loco needs to make that model available to an inference engine. A simplified process looks like:

Input
Model file
→
Step 2
Read model metadata
→
Step 3
Load model tensors
→
Step 4
Allocate memory
→
Step 5
Prepare inference runtime
→
Step 6
Process prompt
→
Step 7
Generate tokens
→
Output
Display response

The exact internal implementation can vary depending on the model format, inference backend, hardware, and Loco version.

The important point is that this is inference, not training. Loco is using the already-trained model.


38. Where llama.cpp Fits

Open-source inference infrastructure such as llama.cpp demonstrates the idea particularly well.

llama.cpp is designed to perform local inference for supported language and vision-language models and can operate across different hardware configurations.

At a conceptual level:

Input
Trained model
→
Step 2
Model format
→
Step 3
Inference runtime
→
Step 4
CPU / GPU / accelerator
→
Output
Generated output

This type of infrastructure is one of the technologies that makes practical local inference possible. The important distinction remains: The inference runtime is executing the model.

It is not automatically retraining the model every time you use it.


39. What Happens During One Inference Request?

Let's slow down and examine a single request. Suppose you type:

Explain gravity in simple terms.

The system first has to process your input. For a language model, that usually involves tokenization. The text becomes tokens.

Conceptually:

Input
"Explain gravity in simple terms."
→
Output
[Explain] [ gravity] [ in] [ simple] [ terms] [...]

The exact token boundaries depend on the tokenizer. Those tokens are converted into numerical representations that the model can process. Then the model performs its neural-network calculations.

It produces probabilities over possible next tokens. A token is selected. That token becomes part of the growing context.

The process repeats. Eventually the response is complete. This entire sequence is inference.


40. Token Generation Is Sequential

Language generation has an interesting property. A model typically generates one token at a time. Conceptually:

Input
Prompt
→
Step 2
Token 1
→
Step 3
Token 2
→
Step 4
Token 3
→
Step 5
Token 4
→
Output
...

Each new token becomes part of the context used to determine what comes next. This is why generating a long response requires repeated model computation.

Later in the course, we will examine prompt processing, token generation, latency, and tokens per second in much greater detail.


41. Why Inference Still Requires Significant Hardware

It would be a mistake to conclude:

“Training is expensive, so inference is free.”

It is not. Inference can still require substantial:

  • RAM,
  • VRAM,
  • CPU/GPU compute,
  • storage,
  • memory bandwidth,
  • and time.

A large model can be difficult to run locally. A small model may run comfortably on a modest computer. This is why model selection matters.

The goal of Local AI is not simply:

“Run the biggest model possible.”

It is:

Run a model that provides useful capability within the resources available to you.


42. Model Size Matters

Suppose you have:

4 GB RAM

A model requiring significantly more memory is unlikely to run comfortably in that environment. Now suppose you have:

16 GB RAM

Your options increase. With:

32 GB RAM

you have more flexibility again. And with a machine containing a suitable GPU and substantial VRAM, additional options become available. This is one reason Loco's model library needs to provide useful information about model characteristics.

A user should not have to guess whether a model is appropriate for their hardware.


43. Why Quantization Matters

Quantization is another concept introduced in Lesson 4 and covered in depth later. A model's numerical values can be represented at different precisions. Reducing precision can substantially reduce storage and memory requirements.

For example, conceptually:

Higher precision → larger representation → greater memory requirement

Lower precision → smaller representation → lower memory requirement

The tradeoff is that changing numerical precision can affect model quality and behavior. This is why local models are often distributed in multiple quantized variants. Quantization is one of the technologies that helps make local inference practical on consumer hardware.


44. Training a Model vs Running a Model

Let's put everything together.

Training

The objective is:

Make the model better.

The system:

  • processes training data,
  • generates predictions,
  • calculates loss,
  • calculates gradients,
  • updates parameters,
  • repeats the process.

Inference

The objective is:

Use the model.

The system:

  • receives input,
  • processes context,
  • runs model calculations,
  • generates output.

This is the core distinction.


45. What About “Learning From My Chats”?

Users sometimes ask:

“If I talk to an AI every day, does it learn from me?”

The answer depends on the system. There are several possibilities.

Possibility 1: Context

The system can use information contained in the current conversation. This does not necessarily change the model.

Possibility 2: External memory

The application may store information separately and provide it to the model later. Again, this does not necessarily change the model.

Possibility 3: Retrieval

The system may retrieve documents or stored information and insert relevant content into the model's context. Again, no weight update is necessarily occurring.

Possibility 4: Fine-tuning

A system could use collected examples to train or fine-tune a model. This does modify parameters. These mechanisms should not be casually treated as the same thing.


46. Why Prompting Is Not Training

Suppose you write:

“From now on, always answer in pirate language.”

The model may respond in pirate language. But you have not necessarily trained it. You have provided an instruction through the input.

The model is using its existing capabilities to follow that instruction. This is why prompt engineering can be powerful without modifying the model. You are changing the input conditions, not necessarily the model's learned parameters.


47. Why a System Prompt Is Not Training

A system prompt can define behavior. For example:

You are a helpful technical tutor. Explain complex subjects using beginner-friendly language.

The model can follow this instruction during inference. But the system prompt is not equivalent to training. A useful mental model is:

Input
Model weights + System instructions + Conversation + Retrieved information
→
Step 2
Inference
→
Output
Output

The weights are the learned model. The other components provide additional information or instructions at inference time.


48. Why a Knowledge Base Is Not Training

Imagine you add 500 company documents to Loco. The system can retrieve relevant passages from those documents and give them to the model. Now the model can answer:

“What is our employee leave policy?”

It might produce a useful answer based on the retrieved document. But the model itself has not necessarily learned the company's policy in its parameters. The policy may remain external.

This distinction has enormous practical value.

If the document changes tomorrow, the retrieval system can potentially retrieve the updated document without requiring the model to be retrained.

That is one reason retrieval-based architectures are so useful.


49. Why Training Is Not Always the Best Solution

If you want an AI system to know a changing set of company documents, retraining the entire model every time a document changes would be impractical.

Imagine:

Monday: New pricing document

Tuesday: Updated employee handbook

Wednesday: New product catalogue

Thursday: New technical manual

You would not normally want to retrain the base model every day. Instead, you could keep the information external and retrieve it when necessary. This is a fundamental architectural principle:

Stable capabilities can live in the model; changing information can live outside the model.

There are many nuances to this idea, but it is extremely useful when designing AI systems.


50. The Difference Between Knowledge and Capability

This leads to another important distinction. A model can contain learned patterns that give it capabilities. For example:

  • writing,
  • summarization,
  • coding,
  • translation,
  • reasoning-like behavior,
  • classification,
  • pattern recognition.

External information can provide specific knowledge. For example:

Model capability: Understand written English.

External knowledge: Our company's refund policy.

The model combines its learned capabilities with the supplied information during inference. This is one of the fundamental ideas behind useful AI applications.


51. Training Produces a General Capability

Imagine a model trained on enormous quantities of language. It may learn general patterns that allow it to perform many tasks. The training process does not need to explicitly teach a separate algorithm for every possible sentence.

Instead, the model learns representations and transformations that can be reused across tasks. This is one reason modern foundation models are so flexible. A single trained model can potentially perform:

Question answering Summarization Translation Coding Classification Writing Extraction

depending on its capabilities and training.


52. Why Models Can Generalize

One of the most fascinating properties of machine learning is generalization. Suppose a model encounters many examples involving animals. It may learn relationships between:

  • cats,
  • dogs,
  • mammals,
  • legs,
  • fur,
  • movement,
  • sounds,
  • habitats,
  • and language structures.

The model does not necessarily need to have seen every possible sentence to respond sensibly to a new sentence. This is because training is not simply memorization. The model is learning patterns.

However, generalization is imperfect. A model can produce incorrect or nonsensical outputs.

This is one reason inference quality depends on model architecture, training, data, context, prompting, and many other factors.


53. Memorization Still Exists

It would also be wrong to claim that models never memorize. Neural networks can memorize portions or patterns from training data. The relationship between memorization and generalization is complicated.

A trained model can therefore exhibit both:

  • generalized behavior,
  • and memorized information.

This is one reason responsible AI research studies issues such as:

  • privacy,
  • training-data leakage,
  • memorization,
  • copyright,
  • dataset contamination,
  • and model behavior.

For Local AI users, the key point is that a model's outputs should not automatically be assumed to represent perfectly verified truth.


54. Training Does Not Guarantee Truth

This deserves its own section. A model can be extremely well trained and still generate an incorrect statement. Why?

Because training is not equivalent to building a perfect database of reality. The model learns statistical patterns from its training process. It does not receive an infallible connection to truth.

During inference, it generates outputs according to its learned representations and the current context. This is one reason hallucinations occur. You will study hallucinations in Lesson 16.


55. Inference Is Not “Looking Up the Answer”

A language model does not necessarily perform a database lookup every time it answers a question. Instead, it runs computations through its learned parameters. That can produce highly knowledgeable-looking responses.

But the mechanism is fundamentally different from querying a traditional database. This distinction is important because it explains why a model can confidently produce an incorrect answer. There may be no database transaction checking whether the generated claim is true.

The model is generating.


56. Why Local Inference Can Be Private

Local inference has an important architectural property.

If the model and inference process are running entirely on your own computer, your prompt can potentially remain on that machine rather than being transmitted to a remote AI service.

That can be valuable for:

  • confidential documents,
  • private notes,
  • proprietary code,
  • internal business information,
  • offline environments,
  • and situations where network transmission is undesirable.

However, privacy is an architectural property, not a magic guarantee. A complete system may still use network connections for:

  • model downloads,
  • software updates,
  • external integrations,
  • web requests,
  • telemetry,
  • authentication,
  • licensing,
  • or other configured services.

With Loco, it is important to understand the distinction between local inference and the broader application environment.

Local inference means the model computation itself can happen on the local machine. It does not automatically mean that every component of an application is permanently disconnected from the network.


57. Local AI Changes the Location of Inference

A useful way to think about cloud and local AI is to ask:

“Where does inference happen?”

In a remote AI architecture:

Input
Your device
→
Step 2
| network
→
Step 3
Remote infrastructure
→
Step 4
Model inference
→
Output
Response

In a local architecture:

Input
Your device
→
Step 2
Local inference runtime
→
Step 3
Local model
→
Output
Response

The second architecture can eliminate the network round trip for the core inference operation. This can affect:

  • privacy,
  • latency,
  • availability,
  • infrastructure costs,
  • control,
  • and deployment architecture.

It also introduces responsibilities. You now need to consider:

  • hardware,
  • storage,
  • model management,
  • updates,
  • security,
  • memory,
  • performance,
  • and compatibility.

58. Why Inference Can Be Offline

If you already have:

  • the application,
  • the model,
  • the inference runtime,
  • and everything required to execute it,

then the core inference process can potentially run without an internet connection. This is one of the major properties of local models. For example:

Input
Internet unavailable
→
Step 2
Loco + Local model + Local hardware
→
Output
Inference

The model does not need to contact a remote server simply to calculate the next token. However, the exact offline behavior of an application depends on its implementation and configuration.


59. The Difference Between Model Download and Model Use

Another common misconception:

“If the model was downloaded from the internet, then the AI is online.”

Not necessarily. The model can be downloaded once. Afterward, the model file can remain on your storage.

Inference can then occur locally. For example:

Input
Internet
→
Step 2
Download model
→
Step 3
Local storage
→
Output
Local inference

The internet was required for the download. It does not necessarily need to remain involved in every inference request. This distinction is central to understanding local-first AI.


60. Why Model Files Can Be Large

You learned in Lesson 4 that models contain enormous numbers of numerical values. Those values need to be stored. A larger model generally contains more parameters.

More parameters can mean more storage. Quantization can reduce the amount of storage required. This produces a chain of relationships:

Input
More parameters
→
Step 2
More model data
→
Step 3
Larger model representation
→
Output
More storage and memory requirements

And:

Input
Quantization
→
Step 2
Lower numerical precision
→
Step 3
Smaller representation
→
Output
Potentially lower memory requirement

These relationships are central to Local AI hardware planning.


61. Training and Inference Have Different Bottlenecks

Training and inference can stress hardware differently. Training can be heavily influenced by:

  • accelerator compute,
  • memory capacity,
  • memory bandwidth,
  • interconnects,
  • batch size,
  • dataset throughput,
  • and distributed-system performance.

Inference can be heavily influenced by:

  • model size,
  • available RAM/VRAM,
  • memory bandwidth,
  • compute performance,
  • context length,
  • implementation efficiency,
  • and token generation workload.

This is why hardware discussions need context. Saying:

“This computer has a fast GPU”

is not enough to determine whether a particular model will run well. The entire workload matters.


62. Why Training Hardware Is Different From Your Laptop

A modern AI training cluster may contain:

  • many accelerators,
  • large pools of memory,
  • high-speed networking,
  • fast storage,
  • and sophisticated cooling and power infrastructure.

Your personal computer may contain:

  • one CPU,
  • perhaps one GPU,
  • a limited amount of RAM,
  • consumer storage,
  • and ordinary cooling.

These systems serve different purposes. The important insight is not:

“My laptop cannot train a giant model.”

The important insight is:

You do not need to reproduce large-scale training infrastructure simply to use a trained model locally.

That is what makes local inference accessible.


63. A Practical Example

Imagine a fictional model called:

Loco-Example-8B

Suppose its creators trained it using a huge dataset and substantial computing infrastructure. Eventually they produce a model release. You download an appropriate model file.

You open Loco. You load the model. You type:

Explain the difference between RAM and VRAM.

Loco performs inference. Conceptually:

Input
Original training
→
Step 2
Trained model
→
Step 3
Model file
→
Step 4
Your computer
→
Step 5
Loco
→
Step 6
Inference runtime
→
Step 7
Prompt
→
Output
Generated response

You did not perform the original training. You performed inference.


64. What If You Give the Model New Information?

Suppose you tell it:

“In my company, the support department is open from 08:00 to 16:00.”

Then you ask:

“What time does our support department close?”

The model can use the information from the current context. But unless a separate training or memory system is involved, you have not changed the model's parameters. This distinction is incredibly useful when designing Loco workflows.

You can provide information dynamically. You do not necessarily need to retrain the underlying model.


65. A More Technical View

At a high level, a neural network can be represented as a function:

y = f(x; θ)

Where:

  • x is the input,
  • y is the output,
  • f represents the model's computation,
  • θ represents the model parameters.

During training, we seek parameters θ that minimize a loss function:

θ* = argmin L(f(x; θ), y)

This notation looks intimidating, but the idea is simple. We are looking for parameter values that make the model's predictions better according to the training objective. During inference, we generally use the learned parameters:

y = f(x; θ*)

The important difference is that inference is using the learned θ*. Training is the process of finding and improving it.


66. The Training Loop in Mathematical Form

A simplified training loop can be represented as:

Input
Input batch
→
Step 2
Forward pass
→
Step 3
Prediction
→
Step 4
Loss
→
Step 5
Gradient
→
Step 6
Optimizer update
→
Output
New parameters

Mathematically, you can think of the update as something like:

θ_new = θ_old - η ∇L

Where:

  • θ represents parameters,
  • η represents the learning rate,
  • ∇L represents the gradient of the loss.

This is simplified.

Modern training systems can use much more sophisticated optimization algorithms, numerical precision strategies, schedules, regularization, distributed training, and other techniques.

But this equation captures the central intuition:

Use the gradient to move parameters toward lower loss.


67. Why Inference Does Not Need the Optimizer

During ordinary inference, there is no need to continually calculate parameter updates. The model has already been trained. The inference process primarily needs to calculate the model's outputs.

Conceptually: Training:

Model + Loss + Gradients + Optimizer + Parameter updates

Inference:

Model + Input = Output

That is why inference can be much more manageable than training.


68. What About “Thinking” Models?

You may encounter models marketed or described as reasoning or thinking models.

They can perform additional internal computation or generate intermediate reasoning-related tokens depending on their architecture and implementation.

But the fundamental distinction still applies. The model was trained during training. When you use it to answer a question, it is performing inference.

Even if inference involves substantial computation, it is not automatically retraining. This distinction is important because “the model is thinking” and “the model is training” are not synonymous.


69. Inference Can Still Be Computationally Heavy

Some inference workloads can be substantial. For example, a large model with a long context may require considerable memory and computation. An application performing many simultaneous requests can also require substantial infrastructure.

So do not interpret:

“Inference is cheaper than training”

as:

“Inference is trivial.”

Inference is often dramatically less demanding than training the model, but it can still be expensive. At scale, inference itself becomes a major engineering challenge.


70. Batch Inference

Inference can also be performed in batches. Suppose a business wants to classify 10,000 documents. Instead of asking the model one question manually at a time, a system could process many requests efficiently.

Conceptually:

Input
Documents
→
Step 2
Batch
→
Step 3
Model
→
Output
Outputs

This can improve hardware utilization. It is one reason inference servers are useful for organizations.

Loco's future business-oriented workflows can use the same general principle: a local model can become a component inside a larger automated system.


71. Local Inference as Infrastructure

Once you understand inference, an important possibility becomes visible. A local model does not have to be a chatbot sitting on a desktop. It can become a component of a larger system.

For example:

Input
Application
→
Step 2
Local AI API
→
Step 3
Inference runtime
→
Output
Local model

Now other software can send requests to the local model. This is the foundation of many local AI architectures. It allows developers to build:

  • document processing systems,
  • coding assistants,
  • classification tools,
  • extraction pipelines,
  • knowledge systems,
  • automation workflows,
  • private business applications,
  • and AI agents.

We will explore local AI APIs and servers later in the course.


72. The Loco Perspective

Loco is best understood as part of the inference and application layer of the Local AI ecosystem. The model itself contains learned parameters. The inference runtime executes those parameters.

Loco provides the user-facing environment around the local model. Conceptually:

Loco ┌─────────────────────┐ │ User Interface │ │ Model Management │ │ Knowledge Features │ │ Workflows │ │ Agents │ │ Configuration │ │ Integrations │ └──────────┬──────────┘ │ v Inference Runtime │ v Local Model │ v CPU / GPU

The exact internal architecture can evolve as Loco develops. But this conceptual stack is useful. It shows why Loco is more than simply a model file.

A model is the learned component. Loco is the environment that helps people actually use local AI.


73. Why Loco Needs Model Management

If a user has several model files, they need a way to understand and manage them. For example:

Model A 8B parameters Quantized General purpose

Model B 3B parameters Quantized Fast / lightweight

Model C 14B parameters Quantized Higher capability / greater resource requirement

The user needs useful information about:

  • model size,
  • parameter count,
  • architecture,
  • quantization,
  • supported capabilities,
  • context length,
  • expected hardware requirements,
  • and other relevant metadata.

This is why a model library is an important component of a Local AI platform.


74. Why Model Choice Comes Before Performance Tuning

Suppose someone has a computer with limited memory. They select an enormous model. It runs extremely slowly or fails to load.

They might conclude:

“Local AI doesn't work.”

But the actual problem could simply be a mismatch between:

Model requirements

and:

Available hardware

A smaller model may perform dramatically better in that environment. This is why Local AI education must teach users how models, memory, quantization, and hardware interact. That is exactly what later lessons will cover.


75. Training Is a Long-Term Investment

A trained model is valuable because training has already transformed raw computation and data into a reusable model. Once trained, the resulting model can be distributed. Many users can perform inference without repeating the original training process.

This is conceptually similar to producing a complex tool once and then distributing copies. The original creation process may be expensive. Using the finished tool can be far cheaper.


76. Model Distribution

A model developer can distribute model files through model repositories or other channels. The user downloads the model. The model can then be loaded into a compatible inference environment.

For Local AI, this creates an ecosystem:

Input
Researchers / developers
→
Step 2
Model development
→
Step 3
Training
→
Step 4
Model release
→
Step 5
Model repository
→
Step 6
User download
→
Step 7
Local inference
→
Output
Applications

Loco sits within the user-facing portion of this ecosystem. This is one reason integrating model discovery and metadata is valuable.


77. Why the Same Model Can Behave Differently on Different Machines

A trained model's underlying parameters may be the same. But the user experience can differ depending on:

  • hardware,
  • inference runtime,
  • quantization,
  • context size,
  • batch configuration,
  • memory availability,
  • GPU acceleration,
  • CPU performance,
  • and other settings.

For example:

Same model
• Computer A → faster
• Computer B → slower

The model itself has not necessarily changed. The execution environment has. This distinction will become extremely important when we discuss hardware.


78. Why the Same Model Can Also Behave Differently With Different Quantizations

Suppose the same underlying model is represented at different numerical precisions. You might have:

Higher precision version Lower precision version

They may produce broadly similar outputs, but quantization can introduce differences. This creates another important distinction:

Model identity ≠ Exact model file ≠ Exact execution configuration

A model family can have multiple releases, formats, quantizations, and configurations. Loco's model library should make these distinctions understandable to users.


79. Training Data Is Not Automatically Available to the User

Another misconception is:

“If I download the model, I also get all the training data.”

Usually, that is not the case.

The model file primarily contains the trained model representation, not a complete copy of the entire dataset used during training.

This is important because:

Input
Training dataset
→
Step 2
Training process
→
Step 3
Model parameters
→
Output
Model file

The dataset and model are different artifacts. The model may encode patterns learned from the dataset without containing a simple copy of the dataset.


80. Why This Matters for Privacy

This also explains why model distribution raises interesting privacy questions.

If sensitive information appears in training data, researchers may study whether and how models can reproduce portions of that information.

But a model is not simply a ZIP archive containing every training document. Its relationship with training data is more complex. This is an active research area involving memorization, extraction, privacy, and dataset design.

For Local AI users, it reinforces an important principle:

Do not assume that a model is a perfect, complete, or transparent representation of its training data.


81. The Three Big Questions

Whenever you encounter an AI system, ask three questions:

1. Where did the model come from?

Was it trained from scratch? Fine-tuned? Adapted?

Converted? Quantized?

2. Where does inference happen?

On your device? On a remote server? On a hybrid architecture?

3. Where does additional information come from?

The model's parameters? The current prompt? Conversation context?

A knowledge base? A database? An API?

These three questions can clarify an enormous amount about an AI application.


82. A Complete Local AI Request

Let's trace a hypothetical request through Loco. You open Loco. You have a local model installed.

You type:

“Summarize this document in five bullet points.”

The process might conceptually look like:

YOU
Input
Loco Interface
→
Step 2
Input / Document
→
Step 3
Context Preparation
→
Step 4
Inference Runtime
→
Step 5
Local Model
→
Step 6
Token Generation
→
Step 7
Response
→
Output
Loco Interface

No model training occurs merely because you submitted that request. The model is being executed.


83. What If You Add a Knowledge Base?

Now imagine the document is part of a larger company knowledge base. The architecture might become:

Input
User Question
→
Step 2
Knowledge Retrieval
→
Step 3
Relevant Information
→
Step 4
Prompt Construction
→
Step 5
Local Model
→
Step 6
Inference
→
Output
Answer

Again, this does not necessarily involve training. The model is being given additional context at inference time. This distinction is one of the most useful concepts for building real AI systems.


84. What If You Want the Model to Behave Differently?

There are several possible approaches.

Prompting

Give the model better instructions.

System configuration

Define persistent behavior at the application level.

Retrieval

Give the model relevant external information.

Fine-tuning

Train the model further on examples representing desired behavior.

Training from scratch

Build a new model through a complete training process. These approaches have very different costs and use cases. A good AI engineer does not automatically choose training.

They choose the mechanism appropriate to the problem.


85. A Decision Framework

Suppose you want an AI assistant to answer questions about a company's policies. Ask:

Does the model simply need access to changing documents?

If yes, retrieval may be appropriate. Suppose you want the assistant to consistently follow a particular response structure. Prompting or application-level instructions may be sufficient.

Suppose you want the model to develop a specialized behavior across thousands of examples. Fine-tuning may become relevant. Suppose you want to create an entirely new foundation model.

Now you are talking about large-scale training. This gives you a powerful hierarchy:

Need more information? → Context / Retrieval

Need different instructions? → Prompting / System behavior

Need specialized learned behavior? → Fine-tuning

Need a new foundation model? → Training

The boundaries are not absolute, but this framework is highly useful.


86. Why Most Loco Users Are Doing Inference

For most people using Loco, the workflow is:

Input
Choose model
→
Step 2
Download model
→
Step 3
Load model
→
Step 4
Write prompt
→
Output
Generate response

That is inference. They are not expected to become machine-learning researchers just to use local AI. This is one of the major goals of a platform such as Loco:

Make the complicated infrastructure surrounding local inference easier for ordinary users to access.

The user can focus on what they want to accomplish rather than manually managing every underlying technical component.


87. But Developers Can Go Deeper

For developers, Local AI can go much further. A local model can become an API endpoint. Then software can communicate with it.

For example:

Input
Your Application
→
Step 2
| request
→
Step 3
Local AI API
→
Step 4
Inference Runtime
→
Step 5
Model
→
Output
Response

Now the model is no longer just a chat interface. It becomes a component inside software. This opens the door to:

  • automation,
  • document pipelines,
  • local agents,
  • developer tools,
  • business applications,
  • data extraction,
  • classification,
  • and private AI infrastructure.

88. The Most Important Misconception

Here is perhaps the single most important misconception to eliminate:

“Every time I use an AI model, it is learning.”

No. In ordinary use, you are generally performing inference. Training is a separate process.

A model can appear adaptive because it uses:

  • conversation context,
  • instructions,
  • retrieved information,
  • application memory,
  • or other runtime mechanisms.

But those are not automatically equivalent to updating the model's parameters. Remember:

Using the model ≠ Training the model


89. The Second Most Important Misconception

Another misconception is:

“If I give the model a document, it has learned the document.”

Not necessarily. It may simply have received the document as context. If the document is removed from the context, the model may no longer have access to it.

A retrieval system may provide the document again later. Fine-tuning could potentially change the model's parameters based on examples derived from documents. But simply putting text into a prompt is not equivalent to training.


90. The Third Most Important Misconception

Another common misunderstanding:

“If training required massive computers, local AI must also require massive computers.”

Not necessarily. Training and inference are different workloads. The original model may have required enormous resources to create.

A smaller quantized representation of that model may be usable on a consumer computer. The hardware requirements depend on the specific model and configuration. This is one of the foundational reasons Local AI is practical.


91. A Visual Summary

Keep this diagram.

AI MODEL LIFECYCLE
Input
DATA
→
Step 2
TRAINING Forward pass Loss Gradients Optimizer Parameter update +--------+---------+ v
→
Step 3
TRAINED MODEL
→
Step 4
Learned
→
Step 5
parameters
→
Step 6
+--------+---------+
→
Step 7
Model distribution
→
Step 8
LOCAL / REMOTE INFERENCE +--------+---------+ +---------+---------+ Input Context +---------+---------+ v
→
Output
OUTPUT

This is the entire lesson in one diagram.


92. Training vs Inference: Side-by-Side

Concept Training Inference
Main purpose Improve the model Use the model
Uses training data Yes Not necessarily
Changes model parameters Yes Normally no
Calculates loss Yes Not normally
Calculates gradients Yes Not normally
Uses optimizer Yes No
Requires model parameters Yes Yes
Can be local Yes Yes
Usually computationally heavier Yes Usually
Typical Loco user activity No Yes

The word normally matters. There are advanced inference-time adaptation techniques and specialized systems that blur some boundaries. But for the foundational Local AI model, this table is the right mental framework.


93. Knowledge Check

Before continuing, try answering these questions without looking back.

Question 1

What is training?

Question 2

What is inference?

Question 3

What happens to model parameters during training?

Question 4

Does simply asking a model a question normally modify its parameters?

Question 5

What is the purpose of a loss function?

Question 6

What does backpropagation help calculate?

Question 7

What does an optimizer do?

Question 8

What is the difference between prompting and fine-tuning?

Question 9

Why can a knowledge base provide new information without necessarily retraining a model?

Question 10

Why can a model that required enormous resources to train potentially run on a consumer computer?


94. Knowledge Check Answers

Answer 1

Training is the process of adjusting model parameters so that the model improves according to a defined objective.

Answer 2

Inference is using a trained model to produce an output from an input.

Answer 3

The parameters are updated during training.

Answer 4

Normally, no. Asking questions generally uses the existing model parameters to perform inference.

Answer 5

The loss function measures how poorly the model performed relative to the training objective.

Answer 6

Backpropagation helps determine how changes to parameters affect the loss, producing gradients used during optimization.

Answer 7

The optimizer uses gradient information to update parameters according to the training strategy.

Answer 8

Prompting provides instructions or information during inference. Fine-tuning involves additional training that changes model parameters.

Answer 9

The knowledge can remain external and be retrieved or inserted into the model's context during inference.

Answer 10

Because training and inference are different workloads. A finished model can be distributed and executed without repeating the original training process.


95. Practical Exercise: Identify the Mechanism

For each scenario, decide whether it is primarily:

  • Training
  • Fine-tuning
  • Prompting
  • Retrieval
  • Inference

Scenario A

You type:

“Summarize this paragraph.”

Answer: Inference.

Scenario B

You train an existing model on 50,000 examples of your company's preferred customer-service responses.

Answer: Fine-tuning.

Scenario C

You provide a company policy document to the model along with your question.

Answer: Context-based inference.

Scenario D

A system searches a document database and inserts relevant passages into the prompt.

Answer: Retrieval + inference.

Scenario E

A model developer trains a new foundation model on a massive dataset.

Answer: Training.

This exercise may seem simple, but these distinctions become increasingly important as AI systems become more complex.


96. Practical Exercise: Trace the Loco Workflow

Imagine you are using Loco to ask:

“Explain this PDF in beginner-friendly language.”

Try to identify each stage. A conceptual answer might look like:

PDF
Input
Application processing
→
Step 2
Relevant content/context
→
Step 3
Prompt
→
Step 4
Local model
→
Step 5
Inference
→
Output
Generated explanation

At no point does the model necessarily need to be retrained. The existing model provides the language-generation capability. The PDF provides the information.

The inference process combines them. That is the core architecture behind many useful AI applications.


97. A Deeper Mental Model: Parameters Are the Long-Term Learned Component

Think of the model parameters as the relatively stable learned component. During training:

Input
Parameters
→
Step 2
Updated
→
Step 3
Updated
→
Step 4
Updated
→
Output
Trained parameters

During ordinary inference:

Input
Trained parameters
→
Step 2
Repeatedly used
→
Output
Output

The same model can answer thousands of questions without changing its parameters. That is why one downloaded model can be reused again and again.


98. A Deeper Mental Model: Context Is Runtime Information

Now think about context as temporary runtime information.

Model parameters + Current context = Current inference behavior

Context can contain:

  • system instructions,
  • user messages,
  • previous conversation turns,
  • retrieved documents,
  • examples,
  • tool results,
  • and other information.

The model uses this information while producing the current output. The distinction between what is inside the model and what is supplied to the model is fundamental.


99. A Deeper Mental Model: Applications Combine Both

A real AI application often combines:

Model + Prompt + Context + External information + Tools + Application logic + Inference runtime

That is why saying:

“The AI is just the model”

is often too simplistic. The model is a crucial component. But a useful AI product is usually a larger system.

Loco exists at that system level.


100. Why This Matters for the Future of Loco

As Loco develops, understanding this distinction helps explain several product capabilities.

Model Library

Helps users discover trained models.

Model Management

Helps users download and organize model files.

Local Inference

Executes models on the user's hardware.

Knowledge Features

Can provide external information during inference.

Agents

Can combine inference with tools and actions.

Workflows

Can place AI inference inside automated processes.

APIs

Can allow other applications to access local inference.

Licensing

Can manage access to Loco's own software features without changing the underlying model's training. Each feature operates at a different layer of the overall AI system.


101. Why This Matters for Business

Imagine a business wants an AI system that processes sensitive internal documents. A local architecture could potentially look like:

Input
Internal Documents
→
Step 2
Local Knowledge System
→
Step 3
Local AI Model
→
Step 4
Inference
→
Output
Business Application

The business does not necessarily need to train a foundation model. It can use an existing trained model and build infrastructure around it. This is one of the most important practical insights in Local AI:

Building a useful AI system is often about combining an existing model with good data, retrieval, instructions, tools, and application logic rather than training a model from scratch.


102. Training Is Only One Part of AI Engineering

AI engineering is broader than model training. It can involve:

  • selecting models,
  • preparing data,
  • designing prompts,
  • building retrieval systems,
  • managing context,
  • integrating tools,
  • creating APIs,
  • optimizing inference,
  • evaluating outputs,
  • monitoring systems,
  • securing data,
  • managing models,
  • and designing user experiences.

This is why Local AI is not only a machine-learning research topic. It is also a software engineering and systems engineering topic. Loco sits directly in this intersection.


103. What You Should Know Before Moving On

At this point, you should be able to explain the following sentence:

A trained AI model contains learned parameters produced by an optimization process; inference uses those parameters to transform an input and its context into an output.

That sentence is dense, but every part matters.

“Trained AI model”

The model has already undergone a training process.

“Contains learned parameters”

Its behavior is represented through numerical parameters.

“Produced by an optimization process”

Training adjusted those parameters according to a loss objective.

“Inference uses those parameters”

The model is executed using the learned parameter values.

“Input and its context”

The model receives information at runtime.

“Into an output”

The model generates a result. That is the foundation of everything that follows.


104. Key Takeaways

If you remember only the essentials from this lesson, remember these:

  1. Training and inference are different processes.
  2. Training changes model parameters.
  3. Inference normally does not change model parameters.
  4. Training uses data and an optimization process.
  5. Loss measures how poorly the model performed.
  6. Gradients indicate how parameter changes affect the loss.
  7. Optimizers use gradients to update parameters.
  8. Pretraining creates broad model capabilities.
  9. Instruction tuning and fine-tuning are additional training stages.
  10. Prompting is not the same as training.
  11. Conversation context is not the same as changing model weights.
  12. Retrieval can provide external information without necessarily retraining the model.
  13. Inference can be performed locally.
  14. Local inference does not require reproducing the original training process.
  15. Model size, quantization, memory, and hardware affect local inference performance.
  16. A local AI application is larger than the model itself.
  17. Loco provides an environment for managing and using local AI.
  18. Understanding training vs inference is essential for understanding Local AI.

105. Preview of Lesson 6

Lesson 6: What Is a Neural Network?

You now understand that training changes model parameters. But we have deliberately treated the model itself as a black box. The next question is:

What is actually inside that box?

Lesson 6 opens it. You will learn:

  • what a neural network is,
  • what a neuron means in artificial neural networks,
  • inputs and outputs,
  • weights and biases,
  • activation functions,
  • layers,
  • forward propagation,
  • why multiple layers are useful,
  • how simple mathematical operations can create complex behavior,
  • what “deep” actually means in deep learning,
  • why neural networks can approximate complicated functions,
  • and how the basic neural-network idea eventually leads to modern language models.

We will start with an extremely simple artificial neuron and gradually build upward. By the end, the mysterious “AI model” from the previous lessons should start looking much less mysterious.


Sources and Further Reading

The following resources provide authoritative or technically useful background for the concepts covered in this lesson.

  • Google Machine Learning Glossary
    https://developers.google.com/machine-learning/glossary

  • Google Machine Learning Crash Course
    https://developers.google.com/machine-learning/crash-course

  • Deep Learning by Ian Goodfellow, Yoshua Bengio, and Aaron Courville
    https://www.deeplearningbook.org/

  • Attention Is All You Need
    Vaswani et al., 2017
    https://arxiv.org/abs/1706.03762

  • Hugging Face Course
    https://huggingface.co/learn

  • Hugging Face Transformers Documentation
    https://huggingface.co/docs/transformers/

  • Hugging Face Quantization Documentation
    https://huggingface.co/docs/transformers/main/en/quantization/overview

  • llama.cpp
    https://github.com/ggml-org/llama.cpp

  • NIST Artificial Intelligence Risk Management Framework
    https://www.nist.gov/itl/ai-risk-management-framework

These resources provide deeper technical material for readers who want to move beyond the introductory level.


Completed Lesson

You have completed:

Local AI 101 — Lesson 5: Training vs Inference

You now have the conceptual foundation needed to understand how a model goes from mathematical parameters to an actual neural network.

Next Lesson

Lesson 6: What Is a Neural Network?

Course

Local AI 101

A deep educational course by Loco Learn.


Loco Academy: Lesson Status

Completed: Lesson 5: Training vs Inference

Next: What Is a Neural Network?

Course: Local AI 101

Local AI 101 Navigation