In my last post Personal Data in Large Language Models: The Removal Process and Its Impact, I mentioned about the potential impact of the model if data is removed. With such laws like GDPR this “right to be forgotten” could play out in certain instances.
From a model training point of view, what actually changes? As I said in my previous post, I believe the butterfly effect is in full motion.
When data is removed from a large language model, the model’s mathematical structure and learning process are affected. To explain the mathematical reasoning behind this, let’s first understand how large language models, like GPT-4, work.
Large language models are based on neural networks, specifically the Transformer architecture. They consist of millions or billions of parameters, which are used to learn and predict relationships between words in a sequence. The learning process is typically performed through a method called gradient descent, which minimises a loss function that quantifies the difference between the model’s predictions and the actual target data.
Gradient descent is an optimisation algorithm used to find the minimum value of a function.
Understanding how the model works, in a very simplified form, let’s discuss the mathematical impact of removing data on a large language model.
Reduced Training Dataset
When data is removed from the training set, the model has fewer examples to learn from. This can lead to two potential outcomes:
- Underfitting: If the removed data is significant, the model may not be able to capture the true underlying relationships in the data, leading to poor generalisation on new, unseen examples.
- Overfitting: If the remaining data is not diverse enough or not representative of the entire distribution, the model may memorise specific examples instead of learning to generalise. This can result in poor performance on new, unseen data.
Changes in Model Parameters
When data is removed, the gradients calculated during the training process will be affected, as they depend on the training examples. As a consequence, the updated model parameters will be different from what they would have been if the original data were present. This may lead to a change in the model’s performance and its ability to understand and generate text.
Shift in Learned Patterns:
The model learns to predict words in a sequence by capturing patterns, relationships, and correlations in the training data. When data is removed, the model may not learn some patterns that were present in the removed data. This can alter the types of correlations that the model learns, which can impact its overall performance and understanding of language.
Changes in Loss Function Landscape
The loss function quantifies the difference between the model’s predictions and the actual target data. When data is removed, the loss function landscape changes, which impacts the optimisation process (e.g., gradient descent). This can lead to the model converging to a different local minimum, affecting its overall performance.
Will It Make Any Difference?
This is the real question, as large language models are by their very nature, large. Will removing pages of a website or article make any real difference? Personally I don’t think so, when you have 17 billion parameters a few hundred words being removed will not make a major dent in the model.
The right to be forgotten is important in certain situations and the legalities of some countries mean that it has to be observed and acted on.
Removing data from a large language model affects its mathematical structure and learning process, which can lead to underfitting or overfitting, changes in model parameters, shifts in learned patterns, and changes in the loss function landscape. All of these factors can influence the model’s performance and its ability to understand and generate text.