# How AI Models Actually Work

#### The Building Blocks

At its core, a Large Language Model (LLM) is an advanced text-prediction system. It reads billions of examples of human writing and learns statistical patterns, like which words tend to follow other words, how sentences are structured, and how conversations flow.

Before training, all that text needs to be processed:

1. Data collection: Gathering text from websites, books, documentation, code
2. Cleaning: Removing spam, duplicates, low-quality content
3. Tokenization: Breaking text into small chunks (words, subwords, characters)
4. Encoding: Converting tokens into numbers the model can process

***

#### How Models Process Information

Inside an LLM is something called a transformer: think of it as the model's brain. It breaks sentences into tokens and constantly asks: which earlier words matter most for predicting what comes next?

Over time, the model learns patterns in sentence structure, tone, and basic reasoning. Its parameters (internal settings) control how much attention it pays to different patterns.

{% hint style="info" %}
In AI training, you won't redesign the model's architecture, but your feedback shapes what patterns it learns. When a model loses track of earlier conversation context, gives vague answers, or misses subtle instructions, you catch these failures and teach it to do better.<br>
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.folio.works/your-role-in-building-better-ai/how-ai-models-actually-work.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
