LoRA from scratch: implementation for LLM finetuning
61–70 of 87 posts
Re: LoRA from scratch: implementation for LLM finetuning
#62Nice article, I'm not in this field, however, my understanding of the original paper was that the LoRA was applied only on the last dense layer, and not to all independently (maybe I misread it originally). Digging a bit in why the implementation is like this in the link, I found that in QLoRA they used this and it seems to have some interesting effects, maybe adding a note on the QLoRA decision would be nice :) I'm…
Like most things in ML, the answer of which layers to use come down to empirical evidence more than theory. In a typical Lora training pipeline, you freeze the contents of the base model and just adjust the Lora layers. The more layers you convert to lora layers the more degrees of freedom you have for the optimization. There are some finetuning regimens that only recommend finetuning the last layer since this is the…
Re: LoRA from scratch: implementation for LLM finetuning
#63[dead]
Re: LoRA from scratch: implementation for LLM finetuning
#64Earlier quoted context omitted.
Like most things in ML, the answer of which layers to use come down to empirical evidence more than theory. In a typical Lora training pipeline, you freeze the contents of the base model and just adjust the Lora layers. The more layers you convert to lora layers the more degrees of freedom you have for the optimization. There are some finetuning regimens that only recommend finetuning the last layer since this is the…
Yeah, but if I remember correctly the paper, LoRA followed the logic that only the last layers on a llm changed drastically during finetuning, and the layers above remained almost unchanged, so it made sense to alterate only the last ones, breaking this by adding a LoRA at each linear layer doesn't seem to follow the logic of why LoRA was created and why it works.
My point is that the original Lora paper choosing the last layer is one choice. And it is likely the most common one because of its higher symbolic nature typically being all that's needed for good performance on downstream tasks.
Depending on the size of your finetuning job I've personally seen updating more layers (or updating some only on a certain learning rate schedule) to be more effective. Lora is just the mathematical technique of updating, it doesn't really have a hypothesis on the ideal training regimen.
Re: LoRA from scratch: implementation for LLM finetuning
#65LoRA != LoRa. I keep on getting confused and hate that they chose to reuse an existing acronym
Likewise. My day job is machine learning and I still, or maybe consequently, do a double-take every time I see the acronym with minimal context (like on the HN front page, where either usage would be normal).
Re: LoRA from scratch: implementation for LLM finetuning
#66LoRA != LoRa. I keep on getting confused and hate that they chose to reuse an existing acronym
Re: LoRA from scratch: implementation for LLM finetuning
#67LoRA != LoRa. I keep on getting confused and hate that they chose to reuse an existing acronym
Re: LoRA from scratch: implementation for LLM finetuning
#68LoRA != LoRa. I keep on getting confused and hate that they chose to reuse an existing acronym
It's unfortunate that those two so far unrelated technologies have the same acronym.
Re: LoRA from scratch: implementation for LLM finetuning
#69HN friends, What are the most popular libraries for fine-tuning? (Not from scratch)