This example shows how an AI model could learn physics concepts using only the three Newton laws.
1. An object remains at rest or in uniform motion unless acted upon by a force.
2. Force equals mass times acceleration.
3. For every action there is an equal and opposite reaction.
The text is broken into tokens (words or subwords).
["an","object","remains","at","rest","or","in","uniform","motion",
"unless","acted","upon","by","a","force"]
["force","equals","mass","times","acceleration"]
["for","every","action","there","is","an","equal","and","opposite","reaction"]
An embedding is a numeric vector representing the meaning of a word.
Example dimension = 4 (real models use ~1000+)
Token
Embedding Vector
force
[0.8,0.2,0.4,0.5]
mass
[0.7,0.6,0.2,0.3]
acceleration
[0.9,0.7,0.8,0.6]
action
[0.5,0.9,0.3,0.7]
reaction
[0.6,0.8,0.4,0.8]
Initially vectors are random.
force = [0.13,0.77,0.05,0.41]
mass = [0.91,0.21,0.66,0.14]
During training, prediction errors adjust them.
Words appearing in similar contexts gradually move closer in vector space.
force → near acceleration
action → near reaction
Attention determines which tokens are most relevant to each other.
Example sentence:
force equals mass times acceleration
Token
Attends To
Reason
force
acceleration
physical relationship
mass
acceleration
part of equation
times
mass
multiplication operator
Attention(Q,K,V) = softmax(QKᵀ / √d) V
Where
Q = query vector
K = key vector
V = value vector
Example:
action → attends strongly to → reaction
because their embeddings produce a high similarity score.
User asks:
how do people swim
Tokens:
["how","do","people","swim"]
Embedding example:
swim = [0.6,0.7,0.2,0.5]
The model notices similarity to concepts:
push water → action
action → reaction
A retrieval system finds relevant knowledge. Relevant law:
For every action there is an equal and opposite reaction.
Combined prompt:
Context:
For every action there is an equal and opposite reaction.
Question:
How do people swim?
This full text becomes the model input.
Neural networks contain weight matrices. Example:
W1 =
[
[0.2,0.5,0.1],
[0.3,0.4,0.2],
[0.6,0.1,0.7],
[0.8,0.3,0.5]
]
Embedding input:
action = [0.5,0.9,0.3,0.7]
Multiplication:
hidden = action × W1
This transforms the token representation. Multiple layers repeatedly refine relationships. Over training the weights encode patterns like:
action → reaction
force → acceleration
mass → acceleration
The model predicts the next token probabilities. Example:
Token
Probability
people
0.42
swim
0.33
push
0.21
The tokens are decoded into text.
People swim by pushing water backward.
The reaction force pushes them forward.
Training:
Text → tokens → embeddings → attention → weight updates
Inference:
Prompt → embeddings → attention → parameters → next-token prediction
So AI is essentially:
knowledge compressed into numerical parameters