dopetalk does not endorse any advertised product nor does it accept any liability for it's use or misuse


Our Discord Notification Server invitation link is https://discord.gg/jB2qmRrxyD

Author Topic: What the basic components of AI are and how the data flows  (Read 49 times)

Online Chip (OP)

  • Server Admin
  • Hero Member
  • *****
  • Administrator
  • *****
  • Join Date: Dec 2014
  • Location: Australia
  • Posts: 7150
  • Reputation Power: 0
  • Chip has hidden their reputation power
  • Gender: Male
  • Last Login:Today at 09:18:53 AM
  • Deeply Confused Learner
  • Profession: IT Engineer now retired
Quote
What are the basic components of AI and show the data flow

The Conceptual AI stack

Tokenisation

Neural Networks

Transformers

LLMs

RAG


The real AI stack

Raw Data

Tokenisation

Embeddings

Transformer Neural Network

Pretraining

LLM

Alignment 
Fine Tuning

Inference Runtime

Tools 
APIs Memory

RAG 
Agents Long-Term Memory

Applications


Core components of AI (neural network model)

1. Input data
Raw information such as:
- images, text, audio, sensor readings 
Converted into numeric form (vectors/tensors)

2. Parameters (weights + biases)
- Weights: control strength of connections 
- Biases: shift outputs 
These are the “learned memory” of the model.

3. Layers (transformations)
Each layer computes:
Code: [Select]
output = activation(Wx + b)
They progressively transform raw input into useful representations.

4. Activation function
Adds non-linearity:
- ReLU, sigmoid, tanh 
Without it, the model becomes just a linear function.

5. Loss function
Measures error:
- difference between prediction and truth 
Outputs a single number representing “how wrong” the model is.

6. Optimiser
Updates weights to reduce error:
- gradient descent / Adam 
It performs learning.

---

Data flow (forward + learning loop)

Forward pass
Code: [Select]
Input
 ↓
Layer 1 (Wx + b + activation)
 ↓
Layer 2
 ↓
...
 ↓
Output (prediction)

Loss calculation
Code: [Select]
Prediction + True label → Loss → Error value

Backward pass (backpropagation)
Code: [Select]
Error
 ↓
Compute gradients (credit assignment)
 ↓
Propagate backwards through layers

Parameter update
Code: [Select]
Weights = Weights - learning_rate × gradient

---

Full AI training loop
Code: [Select]
Input → Forward pass → Prediction
                    ↓
                   Loss
                    ↓
            Backpropagation
                    ↓
           Update parameters
                    ↓
              Repeat many times

---

Key idea
AI is not rules or logic.
It is a feedback loop that tunes a large mathematical function until its outputs match data.

Generated by ChatGPT.
« Last Edit: Today at 07:57:19 AM by Chip »
friendly
0
funny
0
informative
0
agree
0
disagree
0
like
0
dislike
0
No reactions
No reactions
No reactions
No reactions
No reactions
No reactions
No reactions
Our Discord Server invitation link is https://discord.gg/jB2qmRrxyD

Offline smfadmin

  • SMF (internal) Site
  • Administrator
  • Full Member
  • *****
  • Join Date: Dec 2014
  • Location: Management
  • Posts: 482
  • Reputation Power: 0
  • smfadmin has hidden their reputation power
  • Last Login:Today at 08:06:33 AM
  • Supplied Install Member
Re: What the basic components of AI are and how the data flows
« Reply #1 on: Today at 08:06:33 AM »
How A Query Moves/Flows Through AI And Becomes A Reply (According to ChatGPT)

A query like:

Quote
“Track this query as it moved through AI and when it becomes the reply”

passes through multiple transformation layers before you see text on screen.

Here’s the actual flow.



1. Raw User Input

You type characters into the client:

Code: [Select]
Track this query as it moved through AI and when it becomes the reply

At this point it is just UTF-8 text.

No meaning yet.
No intelligence yet.



2. Client Packaging

The app packages the message with metadata:

  • conversation history
  • timestamps
  • system prompts
  • tool availability
  • memory context
  • user settings
  • safety policies

The model never receives “just your sentence”.

It receives a huge structured context window.

Conceptually:

Code: [Select]
{
  "system": "...",
  "developer": "...",
  "memory": "...",
  "conversation": [...],
  "new_user_message": "Track this query..."
}



3. Tokenisation

The text is split into tokens.

Not words.
Subword fragments.

Example approximation:

Code: [Select]
["Track", " this", " query", " as", " it", " moved", ...]

Each token becomes an integer ID.

Example:

Code: [Select]
[18374, 420, 9912, 328, ...]

This is the first point where language becomes machine-processable.



4. Embedding Projection

Each token ID is mapped into a high-dimensional vector.

Conceptually:

Code: [Select]
"query" →
[-0.182, 0.991, 0.004, ...]

Now the sentence exists as geometry.

Meaning is represented as spatial relationships in vector space.

Words with similar meaning cluster nearby.



5. Positional Encoding

Transformers cannot inherently understand order.

So position information is injected:

Code: [Select]
Token 1 + position encoding
Token 2 + position encoding
...

This lets the model distinguish:

Code: [Select]
dog bites man

from:

Code: [Select]
man bites dog



6. Transformer Attention Passes

This is the core intelligence layer.

The model repeatedly performs:

  • self-attention
  • weighting
  • nonlinear transformations
  • residual mixing
  • layer normalization

Across dozens to hundreds of layers.

The sentence effectively becomes a dynamic graph of relationships.

The model starts constructing abstractions like:

  • “user wants architecture explanation”
  • “timeline/process requested”
  • “technical depth preferred”
  • “explanatory mode appropriate”

Attention dynamically links concepts:

Code: [Select]
"Track" ↔ process
"moved" ↔ pipeline
"reply" ↔ output generation



7. Internal Latent Reasoning

This part is invisible.

The model builds temporary internal representations:

  • intent estimation
  • response planning
  • style selection
  • safety evaluation
  • tool routing possibilities
  • probability forecasting

Not symbolic reasoning like code.

More like evolving activation fields.

There is no little narrator internally saying:

Quote
“I should explain transformers now.”

Instead:

billions of weighted activations statistically converge toward likely continuations.



8. Next-Token Prediction

The model does not generate replies all at once.

It predicts one token at a time.

Internally:

Code: [Select]
P("A") = 0.02
P("The") = 0.41
P("Your") = 0.03

The selected token becomes part of the context.

Then prediction repeats.

Loop:

Code: [Select]
input → predict token → append token → predict next token

Thousands of times.

Your entire reply emerges autoregressively.



9. Decoding

Token IDs convert back into text.

Example:

Code: [Select]
[32, 918, 4412]

"The model predicts"

Now language reappears from vector space.



10. Postprocessing Layer

Before display:

  • formatting is applied
  • markdown rendered
  • citations inserted
  • safety filters checked
  • UI elements added
  • streaming chunked



11. Streaming To User

You see the response progressively appear.

But internally the model may already have generated much further ahead.

The stream is buffered and emitted incrementally.



12. When Does It “Become” The Reply?

Interesting philosophical point.

There are several candidates:

A. At tokenisation?
No — syntax only.

B. During latent representation?
Partially — semantic structure exists internally.

C. At first generated token?
Closer.

D. When decoding back into text?
Most practical definition.

E. When rendered to the user?
Human-visible completion.



The Deep Reality

The reply is not stored anywhere beforehand.

It is not retrieved from a database.

It does not exist until generated.

The model continuously collapses probability distributions into actual token choices in real time.

So the “reply” only truly comes into existence progressively during autoregressive decoding.



Extremely Simplified Stack

Code: [Select]
User Text
   ↓
Tokenisation
   ↓
Vector Embeddings
   ↓
Transformer Attention
   ↓
Latent Semantic State
   ↓
Next-Token Prediction Loop
   ↓
Decoded Tokens
   ↓
Rendered Reply

Your earlier AI stack summary was actually fairly good:

Code: [Select]
Tokenisation Pipeline

Neural Networks

Transformers

LLMs

RAG Systems

Though technically:

Transformers ARE a type of neural network, and LLMs are transformer-based systems trained at massive scale.

So structurally it’s closer to:

Code: [Select]
Tokenisation

Embeddings

Transformer Neural Network

LLM Behaviour

Tooling / Memory / RAG / Agents

Final Response
« Last Edit: Today at 08:44:45 AM by Chip »
friendly
0
funny
0
informative
0
agree
0
disagree
0
like
0
dislike
0
No reactions
No reactions
No reactions
No reactions
No reactions
No reactions
No reactions
measure twice, cut once

Tags:
 

Related Topics

  Subject / Started by Replies Last post
3 Replies
28325 Views
Last post January 16, 2018, 08:59:49 AM
by Chip
0 Replies
20704 Views
Last post June 18, 2018, 03:40:55 AM
by Chip
0 Replies
21356 Views
Last post June 28, 2018, 02:32:54 AM
by Chip
0 Replies
22721 Views
Last post May 18, 2019, 07:53:52 AM
by Chip
0 Replies
19560 Views
Last post June 01, 2019, 03:59:14 PM
by Chip
0 Replies
26700 Views
Last post June 14, 2019, 04:06:52 PM
by Chip
0 Replies
25498 Views
Last post January 17, 2024, 05:45:07 PM
by Chip
0 Replies
12545 Views
Last post December 24, 2024, 07:17:40 AM
by Chip
0 Replies
13532 Views
Last post December 27, 2024, 06:15:16 PM
by Chip
0 Replies
12407 Views
Last post February 05, 2025, 08:24:07 AM
by smfadmin


dopetalk does not endorse any advertised product nor does it accept any liability for it's use or misuse





TERMS AND CONDITIONS

In no event will d&u or any person involved in creating, producing, or distributing site information be liable for any direct, indirect, incidental, punitive, special or consequential damages arising out of the use of or inability to use d&u. You agree to indemnify and hold harmless d&u, its domain founders, sponsors, maintainers, server administrators, volunteers and contributors from and against all liability, claims, damages, costs and expenses, including legal fees, that arise directly or indirectly from the use of any part of the d&u site.


TO USE THIS WEBSITE YOU MUST AGREE TO THE TERMS AND CONDITIONS ABOVE


Founded December 2014
SimplePortal 2.3.6 © 2008-2014, SimplePortal