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

LoRA論文解説 #528

Open
AkihikoWatanabe opened this issue Apr 25, 2023 · 4 comments
Open

LoRA論文解説 #528

AkihikoWatanabe opened this issue Apr 25, 2023 · 4 comments

Comments

@AkihikoWatanabe
Copy link
Owner

https://speakerdeck.com/hpprc/lun-jiang-zi-liao-lora-low-rank-adaptation-of-large-language-models

@AkihikoWatanabe
Copy link
Owner Author

AkihikoWatanabe commented Apr 25, 2023

ベースとなる事前学習モデルの一部の線形層の隣に、低ランク行列A,Bを導入し、A,Bのパラメータのみをfinetuningの対象とすることで、チューニングするパラメータ数を激減させた上で同等の予測性能を達成し、推論速度も変わらないようにするfinetuning手法の解説

@AkihikoWatanabe
Copy link
Owner Author

AkihikoWatanabe commented Apr 25, 2023

LoRAを使うと、でかすぎるモデルだと、そもそもGPUに載らない問題や、ファインチューニング後のモデルファイルでかすぎワロタ問題が回避できる。

前者は事前学習済みモデルのBPのための勾配を保存しておく必要がなくなるため学習時にメモリ節約になる。後者はA,Bのパラメータだけ保存すればいいので、ストレージの節約になる。

かつ、学習速度が25%程度早くなる。

@AkihikoWatanabe
Copy link
Owner Author

既存研究であるAdapter(transformerの中に学習可能なMLPを差し込む手法)は推論コストが増加し、prefix tuningは学習が非常に難しく、高い性能を達成するためにprefixとして128 token入れたりしなければならない。

@AkihikoWatanabe
Copy link
Owner Author

huggingfaceがすでにLoRAを実装している
https://github.com/huggingface/peft

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

1 participant