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

llama能加载多个lora模型的参数吗 #19

Open
greatewei opened this issue Mar 31, 2023 · 3 comments
Open

llama能加载多个lora模型的参数吗 #19

greatewei opened this issue Mar 31, 2023 · 3 comments

Comments

@greatewei
Copy link

greatewei commented Mar 31, 2023

我使用了作者的lora模型,还有一个是自己训练的lora模型,这两个lora权重可以共同作用吗

@Facico
Copy link
Owner

Facico commented Mar 31, 2023

@greatewei 目前还不支持。如果只是单纯把lora模型的权重叠加并不会有好的效果。

不过lora应该可以像MoE那样将多个lora模型合并,这是一个很有前途的架构,估计现在有很多科研前线的研究人员在做了,其实就和adapterFusion一个道理,原理很简单AdapterFusion: Non-Destructive Task Composition for Transfer Learning(AdapterFusion),stable diffusion那边挺多弄这个的。

要实现的话可以参考一下思路:
1、hard MoE,在对一个句子动态选择使用哪个lora权重
2、soft MoE,对一个句子的时候,把各种lora计算一个attention权重,然后fusion起来

这些都是很有意思的idea,不过我们目前还不支持这样做。

@greatewei
Copy link
Author

lora模型训练的数据大小有要求吗,我现在想要训练一个小领域的数据,但是数据量可能比较小,base_model使用BELLE,便于理解中文,这样训练出来的模型效果如何,是否能够正确回答lora小领域的问题。

@Facico
Copy link
Owner

Facico commented Mar 31, 2023

@greatewei lora的效果并不具有很强的学习新知识的能力,可以参考这个issue的回答

如果这个小领域是llama预训练覆盖的一些任务,可能会有挖掘它的能力的效果,所以我也不能回答你是否能确切地解决小领域的问题。

数据量的问题不是数据越多越好,在我们这个架构上,而是这个领域内是否能有高质量的instruction,同时要求instruction的种类丰富(instructGPT中每个任务都有不同的instruction),对于instruction改怎么写,这个可以参考相关论文、或者看看我们使用的相关数据,或者可以用chatgpt帮助你生成类似的instruction指令。

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

No branches or pull requests

2 participants