[AI医学] 领域指令微调样本生成框架OpenGPT与医疗健康大模型NHS-LLM

关键词:AI医疗,医学大模型,样本数据生成,OpenGPT, chatGPT, NHS, NHS-LLM

OpenGPT:基于领域知识生成指令微调样本框架

用于创建基于领域数据的指令微调样本,并在底座大模型上进行指令微调的一个开源框架。使用该框架,作者对医疗健康数据 NHS生成指令微调样本,并在LLaMA的基础上进行微调训练,得到医疗健康大模型NHS-LLM。

指令微调样本的生成思路有别于standford-alpaca,相比于直接使用chatGPT的生成结果,引入领域数据作为chatGPT生成数据的参考,在一定程度能够约束生成结果的有效性,避免有偏或不恰当的生成结果。使用该框架还可用于在其他领域的非结构化数据上生成指令样本,这种样本数据的生成方式值得借鉴。

项目地址: https://github.com/CogStack/opengpt

1. 样本数据描述及格式

  • NHS UK Q/A:24665对,基于NHS网站数据在OpenGPT框架下使用ChatGPT生成
text,raw_data_id
"<|user|> What is high blood pressure? <|eos|> <|ai|> High blood pressure is a condition where the force at which your heart pumps blood around your body is high. It is recorded with 2 numbers, the systolic pressure and the diastolic pressure, both measured in millimetres of mercury (mmHg).
References:
- https://www.nhs.uk/conditions/Blood-pressure-(high)/Pages/Introduction.aspx <|eos|> <|eod|>",0
  • NHS UK对话:2354条会话,基于NHS网站数据在OpenGPT框架下使用ChatGPT生成
text,raw_data_id
"<|user|> Hi, I am a bit worried about my blood pressure. How can I tell if I have high blood pressure? <|eos|> <|ai|> The only way to determine if you have high blood pressure is to have your blood pressure checked. All adults over 40 are recommended to have their blood pressure checked at least every 5 years. You can get your blood pressure checked at your GP surgery, some pharmacies, as part of your NHS Health Check or in some workplaces. You can also check your blood pressure yourself with a home blood pressure monitor.
References:
- https://www.nhs.uk/conditions/Blood-pressure-(high)/Pages/Introduction.aspx <|eos|> <|user|> What is considered high blood pressure? <|eos|> <|ai|> Blood pressure is measured with two numbers, the systolic pressure (higher number) is the force at which your heart pumps blood around your body, and the diastolic pressure (lower number) is the resistance to the blood flow in the blood vessels. A reading of 140/90mmHg or higher is considered high blood pressure. However, it's essential to note that what's considered high for you may be normal for someone else. It is always best to speak with your doctor about your individual health needs.
References:
- https://www.nhs.uk/conditions/Blood-pressure-(high)/Pages/Introduction.aspx <|eos|> <|user|> What are the risks of high blood pressure? <|eos|> <|ai|> Persistent high blood pressure can increase your risk of developing serious and potentially life-threatening health conditions, such as heart disease, heart attacks, strokes, heart failure, peripheral arterial disease, aortic aneurysms, and kidney disease. If you have high blood pressure, reducing it, even a small amount, can help lower your risk of these health conditions.
References:
- https://www.nhs.uk/conditions/Blood-pressure-(high)/Pages/Introduction.aspx <|eos|> <|user|> What can increase my risk of high blood pressure? <|eos|> <|ai|> It's not always clear what causes high blood pressure, but there are things that can increase your risk of developing it. These include being overweight, eating too much salt and not enough fruit and vegetables, not exercising enough, drinking too much alcohol or coffee, smoking, not getting much sleep, being over 65, having a relative with high blood pressure, and being of black African or Caribbean descent or living in a deprived area. Making healthy lifestyle changes can sometimes help reduce your chances of getting high blood pressure and help lower it if it's already high.
References:
- https://www.nhs.uk/conditions/Blood-pressure-(high)/Pages/Introduction.aspx <|eos|> <|user|> Can medication be used to treat high blood pressure? <|eos|> <|ai|> Yes, medication can be used to treat high blood pressure. If you're diagnosed with high blood pressure, your doctor may recommend taking one or more medicines to keep it under control. The medicine recommended for you will depend on things like how high your blood pressure is, your age, and your ethnicity. Lifestyle changes such as losing weight, reducing salt intake, exercising regularly, and quitting smoking can also help lower high blood pressure. It is essential to speak with your healthcare provider to determine the best course of action for your individual health needs.
References:
- https://www.nhs.uk/conditions/Blood-pressure-(high)/Pages/Introduction.aspx <|eos|> <|eod|>",0
  • 医疗任务/解决方案:4688对,在OpenGPT框架下使用GPT-4模型生成
text,raw_data_id
"<|user|> Analyse the patient's symptoms and provide a brief possible diagnosis.
A 35-year-old male patient reports experiencing persistent fatigue, joint pain, and unexplained weight loss over the past few months. He also mentions having a low-grade fever and occasional night sweats. <|eos|> <|ai|> The patient's symptoms could indicate a number of possible conditions, such as an autoimmune disorder (e.g., rheumatoid arthritis), infection (e.g., tuberculosis, HIV), or malignancy (e.g., lymphoma). Further history, examination, and investigations are required to confirm the diagnosis. <|eos|> <|eod|>",0
"<|user|> List the steps to correctly administer an intramuscular injection. <|eos|> <|ai|> 1. Gather all necessary equipment: needle, syringe, medication, alcohol wipes, and a cotton swab or gauze pad.
2. Select the appropriate injection site based on patient age, muscle size, and level of development: common sites include the deltoid, vastus lateralis, and ventrogluteal muscles.
3. Prepare the patient: explain the procedure and obtain consent.
4. Wash your hands and put on gloves.
5. Prepare the medication: draw up the appropriate dose using aseptic technique.
6. Clean the injection site with an alcohol wipe, moving in a circular motion from the center outward.
7. Hold the syringe like a dart and insert the needle quickly at a 90-degree angle to the skin.
8. Aspirate by pulling back the plunger slightly to check for blood, which would indicate inadvertent needle placement in a blood vessel.
9. If no blood is present, inject the medication slowly and steadily.
10. Withdraw the needle swiftly and apply a cotton swab or gauze pad with slight pressure to the site.
11. Dispose of the needle and syringe properly using a sharps container.
12. Document the injection, including the date, time, medication, dose, and site. <|eos|> <|eod|>",0

样本生成方式

本项目的重点在于提出了一种基于领域数据的指令样本生成方式,以NHS数据为例,从NHS Conditions上爬取数据,每个词条内容做为一条领域知识,通过下面的prompt生成样本{context}表示词条内容:

{context} - <e.g all the text from the Acromegaly page>
----------------
You are asked to come up with a set of 5 diverse task instructions in the field of medicine and healthcare.
All the task instructions have to be based on the context provided above, and cannot require external knowledge or information.
These tasks will be used to quiz an AI Assistant on the knowledge of the topic above.

Here are the requirements:
1. Try not to repeat the verb for each instruction to maximize diversity.
2. The language used for the instruction also should be diverse. For example, you should combine questions with imperative instructions.
3. The type of instructions should be diverse. Create instructions that include diverse kinds of tasks like step-by-step reasoning, multiple-choice-questions, open-ended generation, classification, editing, complex medical questions, etc.
4. Every instruction has to be self-contained, all the information necessary to solve the task has to be part of the instruction. For example, the instructions should never say "From the provided context" or "given the context" or "based on the context" or "based on the information".

List of 5 task instruction (every task has the following fields: Task Number:, Instruction:, Solution:):

生成结果如下

Task Number: 1
Instruction: What is considered a high blood pressure reading? 
Solution: Blood pressure readings are recorded with 2 numbers. The systolic pressure (higher number) is considered high when it is above 140, while the diastolic pressure (lower number) is high when it is above 90. However, readings between 120/80mmHg and 140/90mmHg could mean you're at risk of developing high blood pressure if you do not take steps to keep your blood pressure under control. The ideal blood pressure is usually between 90/60mmHg and 120/80mmHg.
...

疑问点: context为词条知识内容,如果过长怎么办(比如大于chatGPT的窗口4096)?

2. 模型训练

使用OpenGPT框架,借助chatGPT能力,以NHS数据为领域知识,生成训练样本,基础模型使用LLaMA-13B,训练数据同时使用了 NICE Guideline, MIMIC-III, Open Assistant,对模型进行有监督指令微调,最终得到医疗健康领域模型NHS-LLM。在一些case上对比chatGPT测试,NHS-LLM的结果更加准确。

通过OpenGPT框架生成领域样本数据,在LLaMA上进行微调训练得到NHS-LLM模型:
在这里插入图片描述

参考:
https://aiforhealthcare.substack.com/p/a-large-language-model-for-healthcare

同步更新到: AI加油站

----------END----------

晨阳2023
关注 关注
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
研究篇| 一款深入浅出的微调框架
youbingchen的博客
05-21 1711
中介绍了模型训练需要大量的计算资源,一般情况下,个人和企业是无法承担的成本,所以微调的方案就出来, 关于微调的方式也很多,大部分微调方式都是固定模型参数(freeze model), 可以降低计算梯度等内存空间, 从而实现小参数撬动大模型, 关于更多的微调方法可以查看《LoRA在需要微调的层上引入了一对小的可训练矩阵,称为低秩矩阵。训练器: 主要支持lora方式微调, 支持 (增量)预训练、(多模态)指令监督微调、奖励模型训练、PPO 训练、DPO 训练、KTO 训练和 ORPO 训练方法。
中文医学模型“本草”(原名华驼):医学知识增强在中文大型语言模型指令微调上的初步探索...
zenRRan的博客
05-22 2156
来自:哈工大SCIR深度学习自然语言处理 分享进NLP群—>加入NLP交流群1.背景当前大规模语言模型(Large Language Model)在通用域自然语言处理任务上已获得巨大的成功[1,2],然而,由于训练预料占比有限,在部分垂直领域,如生物医学,大规模语言模型的效果仍有限,为缓解上述问题,我们提出了一种基于医学知识增强的大型语言模型指令微调方法,一种让通用大模型适配行业并改造成行业...
人工智能领域微调指的是什么?
最新发布
AngelCryToo的专栏
09-08 1018
微调AI模型开发中的一个重要步骤,通过将预训练好的模型在特定任务或领域的数据上进行再训练模型可以在特定任务中展现出更好的效果。它不仅提高了模型的适应性,还能节省大量的计算资源,广泛应用于自然语言处理、计算机视觉、语音识别等领域
在具体领域微调LLM模型的方案实施建议
年少的勇气已经用完,剩下的就是三思而后行
06-02 1391
大参数的模型比高精度的模型要好;模型的预训练虽然会付出极高的代价,但是效果也会提升比较明显;强化学习在一般的微调任务中很有必要加入;适当的在数据中引入历史对话可能有一定的提升效果;
LLM模型指令微调、peft高效参数微调
热门推荐
发现问题,并解决问题,批判性思维
05-07 1万+
LLaMA 是 Meta AI 发布的包含 7B、13B、33B 和 65B 四种参数规模的基础语言模型集合,LLaMA-13B 仅以 1/10 规模的参数在多数的 benchmarks 上性能优于 GPT-3(175B),LLaMA-65B 与业内最好的模型 Chinchilla-70B 和 PaLM-540B 比较也具有竞争力。通过使用与 ChatGLM(chatglm.cn)相同的技术,ChatGLM-6B 初具中文问答和对话功能,并支持在单张 2080Ti 上进行推理使用。
NHS-ui:一个简单的前端CSS框架,可以替代引导和顺风
03-09
NHS-ui是一个专门为前端开发者设计的轻量级CSS框架,其目标是提供一个简洁、高效且易于定制的解决方案,以替代传统的Bootstrap和Foundation等大型框架。这个框架专注于基础的UI元素设计,帮助开发者快速构建一致性和...
NHS 人工智能实验室:为什么我们需要在道德上注意医疗保健人工智能-研究论文
06-09
2019 年 8 月 8 日,卫生和社会保健... 为了应对这种严重的风险,NHS 人工智能实验室应该建立一个道德咨询委员会,并监督、分析和解决医疗保健人工智能在个人、人际、团体、机构和社会层面出现的规范和总体道德问题。
nhs-vaccination-appointment-checker:NHS冠状病毒疫苗接种标准更新后发送通知
04-02
NHS冠状病毒疫苗接种检查器 一种快速的自动化服务,可监视英国,以了解是否更改了资格标准。 通知通过发送,并在macOS和Windows上作为本地桌面通知发送。 将API凭据添加到用于Pushover的.env文件中。 负责任地使用...
UCL-Website---IBM-NHS-Systems-Engineering
03-17
【标题】"UCL-Website---IBM-NHS-Systems-Engineering" 暗示这是一个与伦敦大学学院(University College London, UCL)相关的项目,该项目可能涉及到IBM公司为英国国家健康服务(NHS)设计和实施的系统工程。...
nhs-covid19-app-data:NHS COVID-19应用程序数据
02-10
NHS COVID-19应用数据 此存储库包含一个SQLite数据库,该数据库会定期使用从的API获取的数据进行更新。 这对于计算曝光通知系统的统计信息应该很有用。 此数据为的“。 资料格式 该数据库包含两个表: 曝光键 该表...
垂直领域模型微调最全指南
m0_56022510的博客
06-17 3594
一年来多以来,大语言模型发展和变化越来越快,总体呈现出模型尺寸越变越大,算力需求越来越多,模型推理要求越来越高的特点。在这种背景下,现在不同的人关于垂域 LLM 出现了一些争议,一部分人认为随着大模型的能力越来越强,垂的知识会加训融合到大模型。尤其当下,在 GPT-4o 效果一枝独秀的前提下,其他无论是通用模型,还是基于垂模型都被 GPT-4o 吊打,一个典型的对比就是 GPT-4o 加持的Code Colpliot的代码能力一点都不逊色与Devins等智能体工程师。
『保姆级』大模型教程来了(从入门到实战)
2301_76168381的博客
04-01 4161
在大模型的构建之下,AI自动化交互,将会决定世界的未来,谁的大模型更强大,将决定在遥远的未来的话语权,同时,大模型会成为AI基础设施。AI模型,正在构建的颠覆力,为了更好的入局AI模型,🔻 针对ChatGLM大模型,介绍ChatGLM模型微调。🔻 大模型的定义和特点,如预训练微调指令学习等。🔻 05 精读大模型-3论文、Instruct论文。🔻 04 GLM-130B训练营——论文泛读。🔻 05 GLM-130B训练营——论文精读。🔻 08 Alpaca训练营——论文精读。
四个大模型轻量级微调训练框架:兼看PPT转Markdown工具
人工智能曾小健
07-28 1039
本文主要看了看当前的四个微调训练框架以及文档智能工具-PPT转Markdown工具的一些实现逻辑,实现都很简单。大家对微调、文档处理等有需求的,可以跑一跑,会有一定收获。
LLM模型】介绍一个大语言模型微调框架Swift
2301_81940605的博客
07-18 901
微调(Fine-tuning)是指在已经预训练好的大语言模型基础上,使用特定领域或任务的数据集进行进一步的训练,使模型能够更好地适应并完成该领域或任务的具体要求。预训练的大语言模型通常在大规模通用语料库上进行训练,学习了语言的普遍规律和特征,但对于特定领域或任务的专业知识和特定需求,往往需要通过微调来优化。
LLM微调框架学习笔记
墨门
01-04 425
1 Xtuner:“只需8G显存即可微调7B模型
微调框架Llama-factory和Unsloth:应该选择哪个?
wangjye99的博客
09-05 1284
测试表明,UNSLOTH和LLAMA-FACTORY在社区支持、模型和易用性上相近,但UNSLOTH在微调速度上表现突出。尽管处理的数据量是LLAMA-FACTORY的20倍,UNSLOTH的速度仍快约2.5倍,极大优化了时间成本,尤其在大规模数据处理中的效率优势显著。
模型-微调技术:DeltaTuning【提出现有PEFT的统一框架;从优化角度解释PEFT的有效性;进行了超大规模的实验】【参数高效微调统一框架
u013250861的博客
06-17 268
提出现有PEFT的统一框架;从优化角度解释PEFT的有效性;进行了超大规模的实验;
LLamaFactory:当下最容易上手的大模型微调工具
2201_75499313的博客
04-07 2572
近日,国内的一款微调框架发布了自己的论文《LLAMAFACTORY: Unified Efficient Fine-Tuning of 100+ Language Models》,对他们的框架做了系统性的总结。该框架自推出后迅速出圈,现已斩获15.6k的star,逐步成为当下微调的首选工具。
大学生团队打造智能医疗APP:e随,连接健康与云端服务
智能医疗项目计划书详细阐述了一项旨在利用先进的信息技术改善医疗服务的创新项目。该计划由八名来自计算机系的大学生组成,他们以"e随创业设计小组"为团队名称,致力于通过开发一款名为"e随"的医疗APP,为用户提供...
写文章

热门文章

  • [踩坑记] CUDA环境下bitsandbytes安装报错/异常解决 26240
  • [评估指标] 敏感性/特异性/PPV/NPV等指标原理与计算方法 6685
  • [AI医学] 医学领域几个微调&预训练大模型的项目 6518
  • [大模型] LLaMA系列大模型调研与整理-llama/alpaca/lora(部分) 4359
  • [大模型] 搭建llama主流大模型训练环境 4325

分类专栏

  • NLP 2篇
  • 机器学习 1篇
  • 论文 2篇
  • 开发 1篇
  • 工具 1篇
  • 图像 1篇
  • opencv 1篇
  • 开发环境 1篇

最新评论

  • 【CV】比较yolov5和yolov8: 在实际应该中应该选用哪个版本?

    z5391: yolov8是无锚框的把

  • [AI医学] 领域指令微调样本生成框架OpenGPT与医疗健康大模型NHS-LLM

    m0_62196601: 阿里云计算巢中有中文医疗相关数据集,该数据集医学知识库围绕疾病、药物、检查指标等构建,字段包括并发症,高危因素,组织学检查,临床症状,药物治疗,辅助治疗等,可以利用该数据集对ChatGLM或者LLaMA模型进行训练,提高模型在医疗领域的问答效果,数据集订阅和下载都很方便,访问地址(https://computenest.console.aliyun.com/dataset/service/service-b23ee2aeb8fa4784bd31/detail/cn-hangzhou?fromAddress=USER_NO_SING_IN_DATASET_SERVICE)

  • [评估指标] 敏感性/特异性/PPV/NPV等指标原理与计算方法

    AbigaleXinn: 和R的精度好像不太一样诶

  • [踩坑记] CUDA环境下bitsandbytes安装报错/异常解决

    Raymond冲: 请问大佬,Windows要怎么卸载干净呢,很多Nvidia相关的项,需要都删掉吗,还是只删掉带有版本号的

  • [AI医学] 医学领域几个微调&预训练大模型的项目

    ITDaBao: 可以根据自己的数据来微调这些模型吗

最新文章

  • 【CV】比较yolov5和yolov8: 在实际应该中应该选用哪个版本?
  • [工具环境] pip&git lfs下载命令
  • [论文] LIMA: Less Is More for Alignment
2024年1篇
2023年14篇
2019年5篇

目录

目录

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值

玻璃钢生产厂家浙江环保玻璃钢雕塑价位kaws玻璃钢雕塑ip巡展四平玻璃钢花盆花器西宁彩色玻璃钢雕塑哪家好滕州玻璃钢雕塑时尚的玻璃钢雕塑造型园林景观玻璃钢雕塑艺术小品佛像玻璃钢仿铜雕塑制造浙江神雕玻璃钢雕塑厂商场美陈推荐 青岛 程通板芙商场美陈云浮玻璃钢动物雕塑现货铜仁商场美陈公司合作玻璃钢牛雕塑泉州雕像玻璃钢雕塑马鞍山环保玻璃钢雕塑天津玻璃钢雕塑加工玻璃钢煎蛋雕塑玻璃钢人像雕塑公司有哪些温州户内玻璃钢雕塑商场专柜美陈气球摆放东莞商场装饰玻璃钢人物雕塑松江玻璃钢雕塑价格玻璃钢雕塑手绘价格南通玻璃钢花盆组合佛山广东玻璃钢雕塑安庆玻璃钢伟人像雕塑广州制作商场美陈玻璃钢龙雕塑设计玻璃钢基督教雕塑安装香港通过《维护国家安全条例》两大学生合买彩票中奖一人不认账让美丽中国“从细节出发”19岁小伙救下5人后溺亡 多方发声单亲妈妈陷入热恋 14岁儿子报警汪小菲曝离婚始末遭遇山火的松茸之乡雅江山火三名扑火人员牺牲系谣言何赛飞追着代拍打萧美琴窜访捷克 外交部回应卫健委通报少年有偿捐血浆16次猝死手机成瘾是影响睡眠质量重要因素高校汽车撞人致3死16伤 司机系学生315晚会后胖东来又人满为患了小米汽车超级工厂正式揭幕中国拥有亿元资产的家庭达13.3万户周杰伦一审败诉网易男孩8年未见母亲被告知被遗忘许家印被限制高消费饲养员用铁锨驱打大熊猫被辞退男子被猫抓伤后确诊“猫抓病”特朗普无法缴纳4.54亿美元罚金倪萍分享减重40斤方法联合利华开始重组张家界的山上“长”满了韩国人?张立群任西安交通大学校长杨倩无缘巴黎奥运“重生之我在北大当嫡校长”黑马情侣提车了专访95后高颜值猪保姆考生莫言也上北大硕士复试名单了网友洛杉矶偶遇贾玲专家建议不必谈骨泥色变沉迷短剧的人就像掉进了杀猪盘奥巴马现身唐宁街 黑色着装引猜测七年后宇文玥被薅头发捞上岸事业单位女子向同事水杯投不明物质凯特王妃现身!外出购物视频曝光河南驻马店通报西平中学跳楼事件王树国卸任西安交大校长 师生送别恒大被罚41.75亿到底怎么缴男子被流浪猫绊倒 投喂者赔24万房客欠租失踪 房东直发愁西双版纳热带植物园回应蜉蝣大爆发钱人豪晒法院裁定实锤抄袭外国人感慨凌晨的中国很安全胖东来员工每周单休无小长假白宫:哈马斯三号人物被杀测试车高速逃费 小米:已补缴老人退休金被冒领16年 金额超20万

玻璃钢生产厂家 XML地图 TXT地图 虚拟主机 SEO 网站制作 网站优化