大語言模型
大語言模型(LLM)是指使用大量文本數(shù)據(jù)訓(xùn)練的深度學(xué)習(xí)模型,可以生成自然語言文本或理解語言文本的含義。大語言模型可以處理多種自然語言任務(wù),如文本分類、問答、對話等,是通向人工智能的一條重要途徑。來自百度百科
-
發(fā)展歷史
2020年9月,OpenAI授權(quán)微軟使用GPT-3模型,微軟成為全球首個享用GPT-3能力的公司。2022年,Open AI發(fā)布ChatGPT模型用于生成自然語言文本。2023年3月15日,Open AI發(fā)布了多模態(tài)預(yù)訓(xùn)練大模型GPT4.0。
2023年2月,谷歌發(fā)布會公布了聊天機(jī)器人Bard,它由谷歌的大語言模型LaMDA驅(qū)動。2023年3月22日,谷歌開放Bard的公測,首先面向美國和英國地區(qū)啟動,未來逐步在其它地區(qū)上線。
2023年2月7日,百度正式宣布將推出文心一言,3月16日正式上線。文心一言的底層技術(shù)基礎(chǔ)為文心大模型,底層邏輯是通過百度智能云提供服務(wù),吸引企業(yè)和機(jī)構(gòu)客戶使用API和基礎(chǔ)設(shè)施,共同搭建AI模型、開發(fā)應(yīng)用,實(shí)現(xiàn)產(chǎn)業(yè)AI普惠。
開源大語言模型
本文列舉了截止到 2023 年 6 月 8 日開源的大語言模型
1、LLaMA
-
簡介
meta 開源的 LLaMA
LLaMA完全是在公共開源預(yù)訓(xùn)練數(shù)據(jù)上訓(xùn)練。并且取得相當(dāng)不錯的效果,LaMA-13B在絕大部分的benchmarks上超越了GPT-3(175 B),并且LLaMA-65B的效果能夠和最好的大模型,Chinchilla-70B以及PaLM-540B相比。
Meta宣稱會將LLaMA開源出來的。 -
論文及代碼
論文:https://arxiv.org/abs/2302.13971v1
代碼:https://github.com/facebookresearch/llama
2、ChatGLM - 6B
-
簡介
ChatGLM-6B 是一個開源的、支持中英雙語的對話語言模型,基于 General Language Model (GLM) 架構(gòu),具有 62 億參數(shù)。結(jié)合模型量化技術(shù),用戶可以在消費(fèi)級的顯卡上進(jìn)行本地部署(INT4 量化級別下最低只需 6GB 顯存)。 ChatGLM-6B 使用了和 ChatGPT 相似的技術(shù),針對中文問答和對話進(jìn)行了優(yōu)化。經(jīng)過約 1T 標(biāo)識符的中英雙語訓(xùn)練,輔以監(jiān)督微調(diào)、反饋?zhàn)灾⑷祟惙答亸?qiáng)化學(xué)習(xí)等技術(shù)的加持,62 億參數(shù)的 ChatGLM-6B 已經(jīng)能生成相當(dāng)符合人類偏好的回答。 -
論文及代碼
論文:
代碼:https://github.com/THUDM/ChatGLM-6B
官網(wǎng):https://chatglm.cn/blog -
硬件需求
-
開源協(xié)議
本倉庫的代碼依照 Apache-2.0 協(xié)議開源,ChatGLM-6B 模型的權(quán)重的使用則需要遵循 Model License。
【個人認(rèn)為】 ChatGLM-6B 是目前開源的中文大語言模型的佼佼者。
3、Alpaca
-
簡介
Stanford Alpaca: An Instruction-following LLaMA Model
This is the repo for the Stanford Alpaca project, which aims to build and share an instruction-following LLaMA model. The repo contains:The 52K data used for fine-tuning the model.
The code for generating the data.
The code for fine-tuning the model.
The code for recovering Alpaca-7B weights from our released weight diff.
Note: We thank the community for feedback on Stanford-Alpaca and supporting our research. Our live demo is suspended until further notice.Usage and License Notices: Alpaca is intended and licensed for research use only. The dataset is CC BY NC 4.0 (allowing only non-commercial use) and models trained using the dataset should not be used outside of research purposes. The weight diff is also CC BY NC 4.0 (allowing only non-commercial use).
-
論文及代碼
論文:https://arxiv.org/abs/2212.10560
代碼:https://github.com/tatsu-lab/stanford_alpaca
4、PandaLLM
-
簡介
Panda: 海外中文開源大語言模型
Panda 系列語言模型目前基于 Llama-7B, -13B, -33B, -65B 進(jìn)行中文領(lǐng)域上的持續(xù)預(yù)訓(xùn)練, 使用了接近 15M 條數(shù)據(jù), 并針對推理能力在中文 benchmark 上進(jìn)行了評測, 希望能夠?yàn)橹形淖匀徽Z言處理領(lǐng)域提供具有泛用性的通用基礎(chǔ)工具.
我們的 Panda 模型以及訓(xùn)練涉及的中文數(shù)據(jù)集將以開源形式發(fā)布,任何人都可以免費(fèi)使用并參與開發(fā)。我們歡迎來自全球的開發(fā)者一起參與到該項(xiàng)目中,共同推動中文自然語言處理技術(shù)的發(fā)展。我們后續(xù)會進(jìn)一步完善針對中文語言模型基礎(chǔ)能力的評測,同時開放更大規(guī)模的模型。
-
論文及代碼
論文:https://arxiv.org/pdf/2305.03025v1.pdf
代碼:https://github.com/dandelionsllm/pandallm -
模型版本:
-
模型測評
5、GTP4ALL
- 簡介
Open-source assistant-style large language models that run locally on your CPU.
GPT4All is made possible by our compute partner Paperspace.
GPT4All is an ecosystem to train and deploy powerful and customized large language models that run locally on consumer grade CPUs.
A GPT4All model is a 3GB - 8GB file that you can download and plug into the GPT4All open-source ecosystem software. Nomic AI supports and maintains this software ecosystem to enforce quality and security alongside spearheading the effort to allow any person or enterprise to easily train and deploy their own on-edge large language models.
-
論文及代碼
代碼:https://github.com/nomic-ai/gpt4all
6、DoctorGLM (MedicalGPT-zh v2)
-
簡介
基于 ChatGLM-6B的中文問診模型 -
論文及代碼
論文:https://arxiv.org/pdf/2304.01097.pdf
代碼:https://github.com/xionghonglin/DoctorGLM
huggingface:https://huggingface.co/zhaozh/medical_chat-en-zh -
訓(xùn)練數(shù)據(jù)
7、MedicalGPT-zh v1
-
簡介
本項(xiàng)目開源了基于ChatGLM-6B LoRA 16-bit指令微調(diào)的中文醫(yī)療通用模型?;诠灿?8科室的中文醫(yī)療共識與臨床指南文本,我們生成醫(yī)療知識覆蓋面更全,回答內(nèi)容更加精準(zhǔn)的高質(zhì)量指令數(shù)據(jù)集。以此提高模型在醫(yī)療領(lǐng)域的知識與對話能力。 -
論文及代碼
論文:https://arxiv.org/pdf/2304.01097.pdf
代碼:https://github.com/MediaBrain-SJTU/MedicalGPT-zh -
數(shù)據(jù)集構(gòu)建
8、Cornucopia-LLaMA-Fin-Chinese
-
簡介
聚寶盆(Cornucopia): 基于中文金融知識的LLaMA微調(diào)模型
本項(xiàng)目開源了經(jīng)過中文金融知識指令精調(diào)/指令微調(diào)(Instruct-tuning) 的LLaMA-7B模型。通過中文金融公開數(shù)據(jù)+爬取的金融數(shù)據(jù)構(gòu)建指令數(shù)據(jù)集,并在此基礎(chǔ)上對LLaMA進(jìn)行了指令微調(diào),提高了 LLaMA 在金融領(lǐng)域的問答效果。基于相同的數(shù)據(jù),后期還會利用GPT3.5 API構(gòu)建高質(zhì)量的數(shù)據(jù)集,另在中文知識圖譜-金融上進(jìn)一步擴(kuò)充高質(zhì)量的指令數(shù)據(jù)集。
-
論文和代碼
代碼:https://github.com/jerry1993-tech/Cornucopia-LLaMA-Fin-Chinese/tree/main
-
模型下載
-
數(shù)據(jù)集構(gòu)建
目前采用了公開和爬取的中文金融領(lǐng)域問答數(shù)據(jù),涉及到保險、理財、股票、基金、貸款、信用卡、社保等。指令微調(diào)的訓(xùn)練集數(shù)據(jù)示例如下:
問題:辦理商業(yè)匯票應(yīng)遵守哪些原則和規(guī)定? 回答: 辦理商業(yè)匯票應(yīng)遵守下列原則和規(guī)定:1.使用商業(yè)匯票的單位,必須是在銀行開立帳戶的法人;2.商業(yè)匯票在同城和異地均可使用;3.簽發(fā)商業(yè)匯票必須以合法的商品交易為基礎(chǔ);4.經(jīng)承兌的商業(yè)匯票,可向銀行貼現(xiàn);5.商業(yè)匯票一律記名,允許背書轉(zhuǎn)讓;6.商業(yè)匯票的付款期限由交易雙方商定,最長不得超過6個月;7.商業(yè)匯票經(jīng)承兌后,承兌人即付款人負(fù)有到期無條件交付票款的責(zé)任;8.商業(yè)匯票由銀行印制和發(fā)售。
針對現(xiàn)有數(shù)據(jù)仍存在不準(zhǔn)確和不完善的地方,后續(xù)我們會利用GPT3.5接口圍繞中文金融知識庫進(jìn)一步構(gòu)建與拓展問答數(shù)據(jù),設(shè)置多種Prompt形式來充分利用知識迭代更新數(shù)據(jù)集。
9、minGPT
-
簡介
A PyTorch re-implementation of GPT, both training and inference. minGPT tries to be small, clean, interpretable and educational, as most of the currently available GPT model implementations can a bit sprawling. GPT is not a complicated model and this implementation is appropriately about 300 lines of code (see mingpt/model.py). All that’s going on is that a sequence of indices feeds into a Transformer, and a probability distribution over the next index in the sequence comes out. The majority of the complexity is just being clever with batching (both across examples and over sequence length) for efficiency. -
論文及代碼
代碼:https://github.com/karpathy/minGPT
10、InstructGLM
-
簡介
基于ChatGLM-6B+LoRA在指令數(shù)據(jù)集上進(jìn)行微調(diào)。 -
論文及代碼
代碼:https://github.com/yanqiangmiffy/InstructGLM -
開源指令數(shù)據(jù)集
11、FastChat
-
簡介
FastChat is an open platform for training, serving, and evaluating large language model based chatbots. The core features include:- The weights, training code, and evaluation code for state-of-the-art models (e.g., Vicuna, FastChat-T5).
- A distributed multi-model serving system with Web UI and OpenAI-compatible RESTful APIs.
-
論文及代碼
代碼:https://github.com/lm-sys/FastChat -
Model Weights
Vicuna Weights
We release Vicuna weights as delta weights to comply with the LLaMA model license. You can add our delta to the original LLaMA weights to obtain the Vicuna weights. Instructions:Get the original LLaMA weights in the Hugging Face format by following the instructions here.
Use the following scripts to get Vicuna weights by applying our delta. They will automatically download delta weights from our Hugging Face account.
12、Luotuo-Chinese-LLM
-
簡介
駱駝(Luotuo): 開源中文大語言模型
駱駝(Luotuo)項(xiàng)目是由冷子昂 @ 商湯科技, 陳啟源 @ 華中師范大學(xué) 以及 李魯魯 @ 商湯科技 發(fā)起的中文大語言模型開源項(xiàng)目,包含了一系列語言模型。 -
論文及代碼
代碼:https://github.com/LC1332/Luotuo-Chinese-LLM
13、CamelBell-Chinese-LoRA
-
簡介
同【 12、Luotuo-Chinese-LLM】 -
論文及代碼
代碼:https://github.com/LC1332/CamelBell-Chinese-LoRA
14、alpaca-lora
-
簡介
This repository contains code for reproducing the Stanford Alpaca results using low-rank adaptation (LoRA). We provide an Instruct model of similar quality to text-davinci-003 that can run on a Raspberry Pi (for research), and the code is easily extended to the 13b, 30b, and 65b models.In addition to the training code, which runs within hours on a single RTX 4090, we publish a script for downloading and inference on the foundation model and LoRA, as well as the resulting LoRA weights themselves. To fine-tune cheaply and efficiently, we use Hugging Face’s PEFT as well as Tim Dettmers’ bitsandbytes.
Without hyperparameter tuning, the LoRA model produces outputs comparable to the Stanford Alpaca model. (Please see the outputs included below.) Further tuning might be able to achieve better performance; I invite interested users to give it a try and report their results.
-
論文及代碼
代碼:https://github.com/tloen/alpaca-lora文章來源:http://www.zghlxwxcb.cn/news/detail-532589.html
其他開源項(xiàng)目,待補(bǔ)充。。。
參考
https://github.com/mymusise/ChatGLM-Tuning
https://huggingface.co/BelleGroup/BELLE-7B-2M
https://github.com/LianjiaTech/BELLE
https://huggingface.co/datasets/BelleGroup/generated_train_0.5M_CN
https://huggingface.co/datasets/JosephusCheung/GuanacoDataset
https://guanaco-model.github.io/
https://github.com/carbonz0/alpaca-chinese-dataset
https://github.com/THUDM/ChatGLM-6B
https://huggingface.co/THUDM/chatglm-6b
https://github.com/lich99/ChatGLM-finetune-LoRA文章來源地址http://www.zghlxwxcb.cn/news/detail-532589.html
到了這里,關(guān)于【AI實(shí)戰(zhàn)】開源大語言模型LLMs匯總的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!