Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question regarding the difference between llama-pro and the regular llama.(关于llama-pro和普通llama之间的区别的疑问) #9

Open
WUHU-G opened this issue Jan 30, 2024 · 8 comments

Comments

@WUHU-G
Copy link

WUHU-G commented Jan 30, 2024

作者您好,毫无疑问,你们在llm的增量学习方面上做了一项优秀的工作。以下的llama均为llama2
但我对llama-pro有一点疑问。llama-pro是在llama的基础上添加了8层 identity block,同时进行了通用语料的全参数训练,所以我可以认为此时的8层 identity block已经退化为与其余32层类似的block,llama-pro也就成为了8.3B的普通的llama。
在后面的代码和数学预训练中,只不过是冻结了llama-8.3b的32层block,只微调8层block(当然这8个block的位置还是添加时候的位置)
所以,作者应该设置一个实验,将llama7b中的block冻结24层,微调8层(顺序上是每冻结3层block而开放一层block),这样就能证明是否有必要添加8层新的块进行微调。

Hello Author, undoubtedly, you have done excellent work in the incremental learning of LLM. Below, all "llama" refer to "llama2".
But I have a question about "llama-pro". "llama-pro" adds 8 layers of identity block on top of llama, and is trained with a general corpus with full parameter tuning. So I believe that at this point, the 8 layers of identity block have degenerated into blocks similar to the other 32 layers, making "llama-pro" essentially an 8.3B regular llama.
In the subsequent code and mathematical pre-training, it's just that 32 layers of the llama-8.3b block are frozen, and only the 8 layers are fine-tuned (of course, the positions of these 8 blocks are still where they were added).
Therefore, the author should set up an experiment where they freeze 24 layers in the llama7b block and fine-tune 8 layers (sequentially, freezing 3 layers of the block and opening one layer), which would demonstrate whether it is necessary to add 8 new layers for fine-tuning.

@hills-code
Copy link
Collaborator

感谢您的关注!“llama-pro是在llama的基础上添加了8层 identity block,同时进行了通用语料的全参数训练” 您可能在这里有点误解,我们添加8层identity block后并没有进行全参数训练,只是在后面的代码和数学预训练中训练新添加的8层identity block。您提出的实验我们会考虑的,我认为我们的方法区别于您所提出的这个setting在于,我们完全保留了原先LLaMA的参数,只训练了新增加的block,希望通过这个方法保留通用能力,并训练出一些即插即用的block(对于不同领域,您可以用同一个base model然后训练新的层)

@FanXiang
Copy link

FanXiang commented Feb 23, 2024

感谢您的关注!“llama-pro是在llama的基础上添加了8层 identity block,同时进行了通用语料的全参数训练” 您可能在这里有点误解,我们添加8层identity block后并没有进行全参数训练,只是在后面的代码和数学预训练中训练新添加的8层identity block。您提出的实验我们会考虑的,我认为我们的方法区别于您所提出的这个setting在于,我们完全保留了原先LLaMA的参数,只训练了新增加的block,希望通过这个方法保留通用能力,并训练出一些即插即用的block(对于不同领域,您可以用同一个base model然后训练新的层)

请教下@hills-code,关于 “训练出一些即插即用的block” 是否可以理解为:运行block_expansion.py后llama2_7b_hf模型出来的就是带额外扩展的block的model (假如称为llama_pro_8B),然后可以全参训练新扩展的block。我的疑问是:如果我针对两个不同领域分别训练出来了各种block,那么此时我的base model 应该是llama2_7b_hf 还是 llama_pro_8B? 实现即插即用

我理解应该是基于llama_pro_8B+其中一个领域的block参数吧?

@hills-code
Copy link
Collaborator

运行block_expansion.py后llama2_7b_hf模型出来的就是带额外扩展的block的model (假如称为llama_pro_8B),然后可以全参训练新扩展的block

扩展后的带额外的block的model我们不进行全参数训练,只对新增加的block训练;新增加的block是即插即用的模块。

例如可以对数学,代码领域训练新增加的1B参数量的blocks,也可以对其他领域训练新增加的1B参数量的blocks,基座都是原来的llama-7B

@FanXiang
Copy link

运行block_expansion.py后llama2_7b_hf模型出来的就是带额外扩展的block的model (假如称为llama_pro_8B),然后可以全参训练新扩展的block

扩展后的带额外的block的model我们不进行全参数训练,只对新增加的block训练;新增加的block是即插即用的模块。

例如可以对数学,代码领域训练新增加的1B参数量的blocks,也可以对其他领域训练新增加的1B参数量的blocks,基座都是原来的llama-7B

'block即插即用' 指的是 llama-7B.load_state_dict(blocks checkpoint) 的意思吗?

@denghj3
Copy link

denghj3 commented Feb 28, 2024

我们添加8层identity block后并没有进行全参数训练,只是在后面的代码和数学预训练中训练新添加的8层identity block。

想请问下,这里添加8层identity block后的预训练时,是只使用了增量的代码和数学数据吗?

@hills-code
Copy link
Collaborator

想请问下,这里添加8层identity block后的预训练时,是只使用了增量的代码和数学数据吗?

是的,我们用了the-stack-dedup中的python子集,还有proof-pile-2

@hills-code
Copy link
Collaborator

'block即插即用' 指的是 llama-7B.load_state_dict(blocks checkpoint) 的意思吗?

我的理解应该是llama-8B.load_state_dict(base_model_ckpt + blocks checkpoint)

@FanXiang
Copy link

'block即插即用' 指的是 llama-7B.load_state_dict(blocks checkpoint) 的意思吗?

我的理解应该是llama-8B.load_state_dict(base_model_ckpt + blocks checkpoint)

Thanks a lot !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants