Guest User

Untitled

a guest
Mar 4th, 2026
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.03 KB | None | 0 0
  1. I declared my GPT style arhitecture for my NN (neuronal network).
  2.  
  3. Let me explain you how it works:
  4. 1) Let's say we have this dataset: "The dog chased the cat because it was a bad dog"
  5. 2) The model (I will name the AI as model) first transforms the dataset into a vocabulary of numbers and then every word into a sequence of numbers, that's because the computer can not read words like people, they need binary code and integers are the closest solution😎 !
  6. For example, the data set is transformed into:
  7. "The" → 17
  8. "dog" → 482
  9. "chased" → 901
  10. etc.
  11. Now we have: [17, 482, 901, 17, 623, 77, 55, 34, 12, 482] P.S. there are no duplicates in this
  12. Then he transforms it again in this:
  13. 482 ("dog") →
  14. [0.21, -0.44, 0.88, ..., 0.03]
  15. etc.
  16.  
  17. 3) The model needs an order: "this is" and "is this" are not the same thing, so he creates arrays of positions and then he combines it with the array of the word itself, giving birth to a usable word.
  18.  
  19. Position 0 → [0.01, 0.02, -0.01, 0.03, 0.00]
  20. Position 1 → [-0.02, 0.00, 0.04, 0.01, -0.01]
  21. Position 2 → [0.03, -0.01, 0.02, -0.02, 0.04]
  22. etc.
  23. P.S. every position needs combinations!!!
  24. Then:
  25. for the word "dog":
  26. Word vector: [0.21, -0.44, 0.88, -0.1, 0.03] (the word itself)
  27. Position vector: [-0.02, 0.00, 0.04, 0.01, -0.01] (the position in dataset)
  28. -----------------------------------------------
  29. Sum → [0.19, -0.44, 0.92, -0.09, 0.02]
  30. P.S. Like this dog from the last position is different from dog on the second position
  31.  
  32. 4) It then creates attentions, meaning that for every word he looks for the most important words for him:
  33. For the word "it", he looks and see the words "cat" and "dog", and he creates attentions like this
  34. dog: 0.7
  35. cat: 0.3
  36. This are named importance scores, so when he will see it he will probably refer to a dog, how smart😎!!!!
  37. 5) MLP (thinking step)
  38. He now starts to make patterns putting words in correlation:
  39. It may learn patterns like:
  40.  
  41. If sentence contains “bad dog”
  42.  
  43. And earlier subject is dog
  44.  
  45. Strengthen dog-related features
  46.  
  47. This is where feature combinations happen.
  48. 6) This repeats many times.
  49.  
  50. Each block refines meaning.
  51.  
  52. Early blocks:
  53.  
  54. Learn simple relationships
  55.  
  56. Later blocks:
  57.  
  58. Learn long-range structure
  59.  
  60. Learn cause/effect
  61.  
  62. Learn grammar
  63.  
  64. After all blocks:
  65. Each word vector contains deep context.
  66. 7) Now he starts predicting words
  67. At each position, the model tries to predict the next word.
  68.  
  69. For example:
  70.  
  71. Input:
  72.  
  73. "The"
  74.  
  75. Model predicts:
  76.  
  77. "dog" (maybe high probability)
  78.  
  79. Then:
  80.  
  81. Input:
  82.  
  83. "The dog"
  84.  
  85. Model predicts:
  86.  
  87. "chased"
  88.  
  89. And so on.
  90.  
  91. At the end of:
  92.  
  93. "The dog chased the cat because it was a bad"
  94.  
  95. Model predicts:
  96.  
  97. "dog"
  98.  
  99. ******************************
  100. This is the key part.
  101.  
  102. During training:
  103.  
  104. The real next word is known.
  105.  
  106. Example training pairs:
  107.  
  108. Input:
  109.  
  110. "The"
  111.  
  112. Correct next word:
  113.  
  114. "dog"
  115.  
  116. Input:
  117.  
  118. "The dog"
  119.  
  120. Correct next word:
  121.  
  122. "chased"
  123.  
  124. And so on.
  125. **********************
  126. After many repetitions he will learn to talk!!!!
  127.  
  128. See you when the model will be trained!!!
Tags: ai
Advertisement
Add Comment
Please, Sign In to add comment