[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 1640
中介绍了模型训练需要大量的计算资源,一般情况下,个人和企业是无法承担的成本,所以微调的方案就出来, 关于微调的方式也很多,大部分微调方式都是固定模型参数(freeze model), 可以降低计算梯度等内存空间, 从而实现小参数撬动大模型, 关于更多的微调方法可以查看《LoRA在需要微调的层上引入了一对小的可训练矩阵,称为低秩矩阵。训练器: 主要支持lora方式微调, 支持 (增量)预训练、(多模态)指令监督微调、奖励模型训练、PPO 训练、DPO 训练、KTO 训练和 ORPO 训练方法。
中文医学模型“本草”(原名华驼):医学知识增强在中文大型语言模型指令微调上的初步探索...
zenRRan的博客
05-22 2118
来自:哈工大SCIR深度学习自然语言处理 分享进NLP群—>加入NLP交流群1.背景当前大规模语言模型(Large Language Model)在通用域自然语言处理任务上已获得巨大的成功[1,2],然而,由于训练预料占比有限,在部分垂直领域,如生物医学,大规模语言模型的效果仍有限,为缓解上述问题,我们提出了一种基于医学知识增强的大型语言模型指令微调方法,一种让通用大模型适配行业并改造成行业...
四个大模型轻量级微调训练框架:兼看PPT转Markdown工具
最新发布
人工智能曾小健
07-28 863
本文主要看了看当前的四个微调训练框架以及文档智能工具-PPT转Markdown工具的一些实现逻辑,实现都很简单。大家对微调、文档处理等有需求的,可以跑一跑,会有一定收获。
在具体领域微调LLM模型的方案实施建议
年少的勇气已经用完,剩下的就是三思而后行
06-02 1371
大参数的模型比高精度的模型要好;模型的预训练虽然会付出极高的代价,但是效果也会提升比较明显;强化学习在一般的微调任务中很有必要加入;适当的在数据中引入历史对话可能有一定的提升效果;
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 上进行推理使用。
垂直领域模型微调最全指南
m0_56022510的博客
06-17 3123
一年来多以来,大语言模型发展和变化越来越快,总体呈现出模型尺寸越变越大,算力需求越来越多,模型推理要求越来越高的特点。在这种背景下,现在不同的人关于垂域 LLM 出现了一些争议,一部分人认为随着大模型的能力越来越强,垂的知识会加训融合到大模型。尤其当下,在 GPT-4o 效果一枝独秀的前提下,其他无论是通用模型,还是基于垂模型都被 GPT-4o 吊打,一个典型的对比就是 GPT-4o 加持的Code Colpliot的代码能力一点都不逊色与Devins等智能体工程师。
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-risky-venues-main.rar
10-09
【标题】"nhs-risky-venues-main.rar" 指的可能是一个与英国国家医疗服务体系(NHS)相关的项目,其中可能包含了分析潜在风险场所的代码或数据。"nhs-risky-venues-main"这个名字暗示了这个项目的核心是识别和评估对...
『保姆级』大模型教程来了(从入门到实战)
2301_76168381的博客
04-01 3983
在大模型的构建之下,AI自动化交互,将会决定世界的未来,谁的大模型更强大,将决定在遥远的未来的话语权,同时,大模型会成为AI基础设施。AI模型,正在构建的颠覆力,为了更好的入局AI模型,🔻 针对ChatGLM大模型,介绍ChatGLM模型微调。🔻 大模型的定义和特点,如预训练微调指令学习等。🔻 05 精读大模型-3论文、Instruct论文。🔻 04 GLM-130B训练营——论文泛读。🔻 05 GLM-130B训练营——论文精读。🔻 08 Alpaca训练营——论文精读。
LLM微调框架学习笔记
墨门
01-04 417
1 Xtuner:“只需8G显存即可微调7B模型
模型-微调技术:DeltaTuning【提出现有PEFT的统一框架;从优化角度解释PEFT的有效性;进行了超大规模的实验】【参数高效微调统一框架
u013250861的博客
06-17 255
提出现有PEFT的统一框架;从优化角度解释PEFT的有效性;进行了超大规模的实验;
LLamaFactory:当下最容易上手的大模型微调工具
2201_75499313的博客
04-07 2439
近日,国内的一款微调框架发布了自己的论文《LLAMAFACTORY: Unified Efficient Fine-Tuning of 100+ Language Models》,对他们的框架做了系统性的总结。该框架自推出后迅速出圈,现已斩获15.6k的star,逐步成为当下微调的首选工具。
LLaMA-Factory:大语言模型微调框架(大模型
2301_81940605的博客
07-18 2561
LLaMA-Factory 是一个国内北航开源的低代码大模型训练框架,专为大型语言模型LLMs)的微调而设计
NeurIPS 2021 | 医学图像生成新范式!在Noisy Data上训练出超越监督学习的模型
阿木寺的博客
10-19 3092
点击下方卡片,关注“CVer”公众号AI/CV重磅干货,第一时间送达作者:藏云阁主 |已授权转载(源:知乎)https://zhuanlan.zhihu.com/p/41523868...
OpenGPT的11种高效用法
了迹奇有没
01-07 4884
OpenGPT的11种高效用法
大学生团队打造智能医疗APP:e随,连接健康与云端服务
智能医疗项目计划书详细阐述了一项旨在利用先进的信息技术改善医疗服务的创新项目。该计划由八名来自计算机系的大学生组成,他们以"e随创业设计小组"为团队名称,致力于通过开发一款名为"e随"的医疗APP,为用户提供...
写文章

热门文章

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

分类专栏

  • 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: 可以根据自己的数据来微调这些模型吗

大家在看

  • 随机过程与信号分析中的计算方法总结
  • 如何将示波器中的数据通过MATLAB/Simulink进行显示、处理和分析
  • 类和对象(Java) 327
  • WebLogic 后台弱⼝令GetShell
  • 索引的介绍 804

最新文章

  • 【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、付费专栏及课程。

余额充值

天下网标王深圳网站竞价优化案例中牟网站优化推广公司怎么优化网站排行榜深圳各大网站优化费用多少河源网站搜索优化上海专业网站优化案例杨浦区官方网站优化定制方案网站快速优化产品易速达智能网站排名优化公司新乡网站自然优化报价河南新乡专业网站排名优化如何通过seo实现网站优化网站排名云优化工具杭州萧山区seo网站优化培训网站从哪些方面做优化北京优化排名网站湛江企业网站关键词优化排名哪里网站优化工资高网站外部优化笔记帮忙优化句子的网站无锡做网站优化哪家公司靠谱荣成网站优化多少钱河南建材行业网站优化推广特点伊宁网站优化排名张家港网站优化网站内部结构对优化有影响吗新乡seo网站优化有哪些泉州网站优化常识安庆如何做网站推广优化香河网站优化推广香港通过《维护国家安全条例》两大学生合买彩票中奖一人不认账让美丽中国“从细节出发”19岁小伙救下5人后溺亡 多方发声卫健委通报少年有偿捐血浆16次猝死汪小菲曝离婚始末何赛飞追着代拍打雅江山火三名扑火人员牺牲系谣言男子被猫抓伤后确诊“猫抓病”周杰伦一审败诉网易中国拥有亿元资产的家庭达13.3万户315晚会后胖东来又人满为患了高校汽车撞人致3死16伤 司机系学生张家界的山上“长”满了韩国人?张立群任西安交通大学校长手机成瘾是影响睡眠质量重要因素网友洛杉矶偶遇贾玲“重生之我在北大当嫡校长”单亲妈妈陷入热恋 14岁儿子报警倪萍分享减重40斤方法杨倩无缘巴黎奥运考生莫言也上北大硕士复试名单了许家印被限制高消费奥巴马现身唐宁街 黑色着装引猜测专访95后高颜值猪保姆男孩8年未见母亲被告知被遗忘七年后宇文玥被薅头发捞上岸郑州一火锅店爆改成麻辣烫店西双版纳热带植物园回应蜉蝣大爆发沉迷短剧的人就像掉进了杀猪盘当地回应沈阳致3死车祸车主疑毒驾开除党籍5年后 原水城县长再被查凯特王妃现身!外出购物视频曝光初中生遭15人围殴自卫刺伤3人判无罪事业单位女子向同事水杯投不明物质男子被流浪猫绊倒 投喂者赔24万外国人感慨凌晨的中国很安全路边卖淀粉肠阿姨主动出示声明书胖东来员工每周单休无小长假王树国卸任西安交大校长 师生送别小米汽车超级工厂正式揭幕黑马情侣提车了妈妈回应孩子在校撞护栏坠楼校方回应护栏损坏小学生课间坠楼房客欠租失踪 房东直发愁专家建议不必谈骨泥色变老人退休金被冒领16年 金额超20万西藏招商引资投资者子女可当地高考特朗普无法缴纳4.54亿美元罚金浙江一高校内汽车冲撞行人 多人受伤

天下网标王 XML地图 TXT地图 虚拟主机 SEO 网站制作 网站优化