Kevin Luzbetak

Kevin Thomas Luzbetak, MSc

EducationMaster's Degree in Artificial Intelligence
LocationLos Angeles, California
EmailLuzbetak5739@gmail.com
Public Githubhttps://github.com/luzbetak

Model Parameters = Words × Dimensions

Key Concepts

Why This Example Has Exactly 6 Parameters

  1. There are 3 words: cat, dog, and car.
  2. Each word has 2 dimensions.
  3. Total parameters = 3 × 2 = 6.

Where the 6 Parameters Actually Live


    Feature Dimensions:  [Object, Animal]
                   cat → [0, 1] → 2 Dimensions
                   dog → [0, 1] → 2 Dimensions
                   car → [1, 0] → 2 Dimensions
          -------------------------------------
          Total: → 3 × 2 = 6 Parameters


          +---------------------------------------+
          |  Vector DB: with Feature Dimensions   |
          +--------+--------+--------+------------+
          |  Word  | Object | Animal | Dimensions |
          +--------+--------+--------+------------+
          |  cat   |   0    |   1    |     2      |
          |  dog   |   0    |   1    |     2      |
          |  car   |   1    |   0    |     2      |
          +--------+--------+--------+------------+
          | Total  |      3 × 2 = 6 Parameters    |
          +--------+--------+--------+------------+
  

   

Bridging the example to real models:

+------------------+------------+------------+------------------+ | Model | Words | Dimensions | Parameters | +------------------+------------+------------+------------------+ | This example | 3 | 2 | 6 | | GPT-2 embeddings | 50,257 | 768 | 38,597,376 | +------------------+------------+------------+------------------+

Python Code Example

import numpy as np

embedding_table = {

    #--- Feature Dim: [Object, Animal] ---#
    "cat": np.array([  0     ,  1 ]),
    "dog": np.array([  0     ,  1 ]),
    "car": np.array([  1     ,  0 ]),

}

def embed(word):
    return embedding_table[word]

print(embed("cat"))
print(embed("dog"))

Final Summary

How the Embedding Numbers Are Computed

Goal

Important Note

Simple Rule to Compute Embedding Numbers

Manual Feature Assignment

Python Example: Computing the Numbers


def compute_embedding(animal_score, object_score):
    # Combine two numeric features into a vector
    return [animal_score, object_score]

cat_embedding = compute_embedding(0, 1)
dog_embedding = compute_embedding(0, 1)

print("cat:", cat_embedding)
print("dog:", dog_embedding)

What This Represents

Connection to Real Models

Final Summary