Skip to main content

Posts

Showing posts with the label LLM

(AI #22) LLM Fine-Tuning Techniques

LLM finetuning is all about taking a pre-trained LLM and training it further on your own domain/task-specific data so it becomes specialized for your use case.  In fine tuning, model might haven't seen this type of complex data during pre-training and we would like to tune the model with this complex data. Here we are not talking about changing the model, we are going to use same model where we have less accuracy but we will train it further with this complex set of data to make the model perfect. Generally prompt engineering rely on the current knowledge of LLM, and we will use RAG to get more accuracy in our project specific data. If problem is beyond this, then we end up fine-tuning model itself. Drug discovery companies, Oil and Gas etc. domains use model fine-tuning as data is very rare .  What is model fine-tuning is still not enough ? Then we have obviously go for developing a new ML model. Sometime, for some use cases - a combination of fine-tuning model + prompt engin...

(AI #11) LLM - Coding Attention Mechanism

Attention Mechanism is the heart of LLM. Around 70% of transformer architecture is about Attention Mechanism. Four categories of Attention Mechanism : Simplified Attention Mechanism Attention Mechanism with trainable weights Causal Attention Mechanism  Multi Head Attention Mechanism Note : If we familiar with above attention mechanisms, then it is not just about GPT model, we will be familiar with other LLM architectures like Deep Seek R1, R2 etc. It is extremely important to have commanding knowledge on one LLM framework(in our case GPT), to understand the changes in other models. Background about Attention Mechanism :  Before discussing about Attention Mechanism , first lets discuss what are the problems for implementing this concept. RNN (Recurrent Neural Network) - We have discussed about RNN, it introduces very important concept called MEMORY , which is the hidden state in a RNN. It will maintain previous context information.  Each RNN cell receive an input x1, x2,...