How it works
Model weights are the numbers the model adjusts during training to turn an input into an output. Each connection between neurons has a weight, and the combination of these values determines the system's response. During training, the model compares the output to the target, calculates an error and adjusts the weights to reduce it. With each new sample, the weights undergo small corrections that, added up over time, help the model generalize the learned patterns better. Weights start with random values or with specialized initialization rules and evolve as the model sees more data. The model starts with randomly initialized weights, and training adjusts these numbers little by little. In deep networks, a small update across all weights is enough for the total error to drop visibly.
Practical example
In a spam filter, each word and each pattern has an associated weight. When a new email arrives, the sum of the weights of the message terms decides the result. If the sum is positive, the email is classified as spam; if it is negative, as not spam. Training adjusts these weights based on labeled examples, and the final values reflect how often certain words indicate spam in the training set. In larger networks, each neuron has a layer of weights that reflect combinations of previous features.
What it's for
Weights consume memory and define the model's capacity. They are what makes a model specialized for a task and what is shared when a model is published, so others can infer without training from scratch. Models with open weights allow the community to review what the system learned and create variations, such as domain adaptation, without starting from zero. The total size of the weights also influences whether the model fits on a local machine or needs inference servers.
Difference between X and Y
Weights are adjusted during training; inference uses them as is. Quantizing the weights changes the numeric values, but not the inference process. The model produces the same class of output, with less precision.