YuLan: An Open-source Large Language Model

YuLan-12B: 开源LLM

本文是LLM系列文章,针对《YuLan: An Open-source Large Language Model》的翻译。

摘要

大型语言模型(LLM)已经成为许多应用程序的基础,利用其在处理和理解自然语言方面的广泛能力。虽然许多开源LLM都发布了技术报告,但缺乏训练细节阻碍了进一步的研究和开发。本文介绍了YuLan的开发,这是一系列具有120亿参数的开源LLM。YuLan的基本模型是在来自不同语料库的大约1.7Ttoken上预训练的,这些语料库包括大量的英语、汉语和多语言文本。我们设计了一个三阶段的预训练方法,以提高玉兰的整体能力。随后的训练阶段包括指令调整和人员调整,使用大量高质量的综合数据。为了促进复杂和长尾知识的学习,我们设计了一个贯穿这些阶段的课程学习框架,帮助LLM以从易到难的方式学习知识。玉兰的训练将于2024年1月结束,在各种英语和汉语基准中取得了与最先进的LLM不相上下的成绩。本文概述了从头开始开发LLM的全面技术路线图。我们的模型和代码可在https://github.com/RUC-GSAI/YuLan-Chat

1 引言

2 模型架构

3 预训练

4 监督微调和人类对齐

5 评估

6 讨论

7 结论

在本报告中,我们介绍了YuLan-12B的详细训练过程,包括预训练、监督微调和人类校准。YuLa

<template> <div class="super-flow-base-demo"> <div class="show-flow"> <div class="form-box-header"> <StepHeader title="产线信息" /> </div> <!-- <el-divider></el-divider> --> <form-builder v-if="dispose" :value="head" :schemas="fromSchemas" class="from-back" operation="view" > </form-builder> </div> <div class="show-map"> <div class="flex"> <StepHeader style="width: 8rem;" :title="type == 1 ? `平面图配置` : '平面图展示'" /> <div v-if="type == 1" style="width: 7rem;" class="flex h-6 cursor-pointer items-center rounded-full bg-primary/5 px-[7px] py-[5px] text-[14px] leading-none text-primary hover:bg-primary/[0.13]" @click="addItem()" > <iconpark-icon class=" pr-[8px]" name="tianjiatuopanwei" ></iconpark-icon> 添加托盘位 </div> </div> <!-- <div class="common-btn" @click="handleSee">--> <!-- <iconpark-icon--> <!-- name="yulan"--> <!-- class="pr-[3px]"--> <!-- :fill="['#333399']"--> <!-- ></iconpark-icon>--> <!-- 预览--> <!-- </div>--> </div> <div class="card-map"> <div ref="flowContainer" class="card-body"> <super-flow v-if="dispose" ref="superFlow" :draggable="type == 1" :linkaddable="type == 1" :origin="origin" :graph-menu="graphMenuList" :node-menu="nodeMenuList" :link-menu="linkMenuList" :node-list="nodeList" :link-list="linkList" > <template v-slot:node="{ meta }"> <div :id="meta.id" class="flow-node" @mouseup="nodeMouseUp"> {{ meta.name }} </div> </template> </super-flow> </div> </div> <div class="page-footer"> <el-button :class="commonField.resetClass" :size="commonField.smallSize" @click="goBack" >返回 </el-button> <el-button v-if="type == 1" :class="commonField.queryClass" :size="commonField.smallSize" @click="handleSubmit" >保存变更</el-button > </div> <addDialog ref="addDialog" :dialog-manager="dialogManager" :type="type" :form="form" @add="addChild" ></addDialog> </div> </template> <script> import flowRunder from '@/mixins/flowRunder' const drawerType = { node: 0, link: 1 } import { saveWhere, saveLine, nodeUpdate, nodeAdd, getNodeList } from '@/api/ae/plan' import { fromSchemas } from './source' import addDialog from './addDialog.vue' import { machineAllList } from '@/api/system/type' import SuperFlow from 'vue-super-flow' import commonField from '@/utils/commonField' import 'vue-super-flow/lib/index.css' export default { name: 'AeEngineModelForm', dicts: ['table_flag'], components: { SuperFlow, addDialog }, mixins: [flowRunder], props: { type: { type: [String, Number], default: '' } }, data() { return { source: [], head: {}, form: { type: Object, default: () => { return { businessId: 0, linkId: '', //创建人 createBy: '', //创建时间 createDate: '', flag: '1', //产线名称 proLineName: '', //产线简称 proLineShortName: '', //部门id deptId: '', //工序总数 gxNum: '', //部门名称 deptName: '', //班总数 teamNum: '', //系总数 systemNum: '', //产线ID proLineId: '', //权重 weight: '', postNum: '' } } }, dispose: true, nodeList: [], fromSchemas, model: { gxDisplayType: 'direction' }, dialogManager: { dialogVisible: false, loading: false, title: '添加托盘位' }, engineModelList: [], matchList: [], isEdit: false, linkList: [ ], // 线条右键菜单 linkMenu: [ [ { label: '删除', selected: link => { link.remove() } }, { label: '编辑', selected: link => { this.drawerConf.open(drawerType.link, link) } } ] ], // 线条样式 linkBaseStyle: { color: '#FF0000', // line 颜色 hover: '#FF0000', // line hover 的颜色 textColor: '#666666', // line 描述文字颜色 textHover: '#FF0000', // line 描述文字 hover 颜色 font: '14px Arial', // line 描述文字 字体设置 参考 canvas font dotted: false, // 是否是虚线 lineDash: [4, 4], // 虚线时生效 background: 'rgba(255,255,255,0.6)' // 描述文字背景色 }, dragConf: {}, graphMenuList: [ [ // { // label: '添加托盘位', // disable(graph) { // return this.type == 0 // }, // selected: (graph, coordinate) => { // this.dialogManager.dialogVisible = true // this.dialogManager.title = '添加托盘位' // this.dialogManager.graph = graph // this.model = { // prolineGraphId: this.$route.query.businessId, // gxDisplayType: 'direction' // } // } // } ] ], // 字体样式 fontList: ['14px Arial', 'italic small-caps bold 12px arial'] } }, computed: { rules() {}, commonField() { return commonField } }, mounted() { this.isEdit = false // document.addEventListener('mousemove', this.docMousemove) document.addEventListener('mouseup', this.docMouseup) this.$once('hook:beforeDestroy', () => { // document.removeEventListener('mousemove', this.docMousemove) document.removeEventListener('mouseup', this.docMouseup) }) this.dispose = false getNodeList({ aeProlineInfoId: this.$route.query.businessId }).then(res => { this.nodeList = [] const nodeList = [] res.data.body.map(v => { nodeList.push({ // width: v.gxDisplayType === 2 ? 140 : 60, // height: v.gxDisplayType === 2 ? 60 : 140, width: Number(v.wide), height: Number(v.high), coordinate: v.xyAxis ? JSON.parse(v.xyAxis) : [], id: v.businessId, meta: { prop: 'start', id: v.businessId, name: v.trayName, data: v } }) }) this.$nextTick(() => { this.head = res.data.head this.nodeList = nodeList if (res.data.lineAxis) { this.linkList = JSON.parse(res.data.lineAxis.lineAxisJson) this.linkId = res.data.lineAxis.businessId } console.log('this.linkList',this.linkList) console.log('this.linkId',this.linkId) this.dispose = false this.$nextTick(() => { this.dispose = true }) }) }) }, methods: { goBack() { if (this.type == 1 && this.isEdit) { this.$confirm( '请确认是否立即返回,返回后变更内容将不再保存。', '提示', { confirmButtonText: '确认', cancelButtonText: '取消', showClose: false, type: 'warning', cancelButtonClass: 'cancelBtn', confirmButtonClass: 'submitBtn' } ).then(() => { this.$router.go(-1) }) } else { this.$router.go(-1) } }, nodeMouseUp(evt) { this.dragConf = evt.target.id evt.preventDefault() }, docMouseup(e) { console.log('docMouseup') const { clientX, clientY } = e console.log(e) // const conf = this.dragConf // conf.isDown = false // if (conf.isMove) { const { top, right, bottom, left } = this.$refs.flowContainer.getBoundingClientRect() // // 判断鼠标是否进入 flow container if ( clientX > left && clientX < right && clientY > top && clientY < bottom ) { // console.log(123) } else { if (e.target._prevClass === 'flow-node') { this.nodeList.map(i => { if (i.id === this.dragConf) { i.coordinate = [0, 0] this.dispose = false this.$nextTick(() => { this.dispose = true }) } }) } } // // 获取拖动元素左上角相对 super flow 区域原点坐标 // const coordinate = this.$refs.superFlow.getMouseCoordinate( // clientX - conf.offsetLeft, // clientY - conf.offsetTop // ) // // 添加节点 // this.$refs.superFlow.addNode({ // coordinate, // ...conf.info // }) // } // conf.isMove = false // } // if (conf.ele) { // conf.ele.remove() // conf.ele = null // } }, addItem() { this.dialogManager.dialogVisible = true this.dialogManager.title = '添加托盘位' this.dialogManager.graph = this.$refs.superFlow.graph this.model = { prolineGraphId: this.$route.query.businessId, gxDisplayType: 'direction' } }, handleSee() { this.$emit('see') }, async handleSubmit() { if (this.isEdit) { this.$confirm('请确认是否立即保存,保存后立即生效。', '提示', { confirmButtonText: '确认', cancelButtonText: '取消', showClose: false, type: 'warning' }).then(() => { this.save() this.$router.go(-1) }) } else { this.save() this.$router.go(-1) } }, async save() { const data = this.$refs.superFlow.toJSON().nodeList data.map(async v => { const item = v.meta.data item.id = v.meta.id item.xyAxis = JSON.stringify(v.coordinate) const res = await saveWhere(item) console.log(res) }) const rsave = await saveLine({ lineAxisJson: JSON.stringify(this.$refs.superFlow.toJSON().linkList), businessId: this.linkId, aeProlineInfoId: this.$route.query.businessId }) this.$message.success('保存成功') }, async addChild(e, call) { const item = JSON.parse(JSON.stringify(e)) console.log('item',item) item.gxDisplayType = item.gxDisplayType == 'direction' ? 1 : 2 item.isCrossLineEquipment = item.isCrossLineEquipment === 1 ? true : false console.log(item) let error = false if (item.belowAeProlineGxList && item.belowAeProlineGxList.length) { item.belowAeProlineGxList.map(i => { if (!i.direction) { error = true } }) } if (error) { this.$message.warning('未选择展示位置') this.dialogManager.loading = false return } if (item.aeToolList && item.aeToolList.length) { item.aeToolList.map(i => { if (!i.direction) { error = true } }) } if (error) { this.$message.warning('未选择岗位OP') this.dialogManager.loading = false return } if ( item.aboveAeEquipmentInfoList && item.aboveAeEquipmentInfoList.length ) { item.aboveAeEquipmentInfoList.map(i => { if (!i.direction) { error = true } }) } if (error) { this.$message.warning('未选择展示位置') this.dialogManager.loading = false return } item.prolineInfoId = this.$route.query.businessId item.aeEquipmentInfo = item.aeEquipmentInfo && item.aeEquipmentInfo.length ? item.aeEquipmentInfo[0] : {} console.log(item) let res this.isEdit = true if (item.businessId) { res = await nodeUpdate(item) this.nodeList.map(v => { if (v.meta.id == item.businessId) { const data = res.data v.meta.data = data v.width = Number(item.wide) v.height = Number(item.high) } }) } else { res = await nodeAdd(item) const data = res.data let node if (item.gxDisplayType === 2) { node = { width: Number(item.wide), height:Number(item.high), meta: { prop: 'start', id: data.businessId, name: data.trayName, data: data } } } else { node = { width: Number(item.wide), height:Number(item.high), meta: { prop: 'start', id: data.businessId, name: data.trayName, data: data } } } this.dialogManager.graph.addNode(node) } this.dialogManager.dialogVisible = false this.dialogManager.loading = false call() this.form = { aeEquipmentInfo: [], aboveAeEquipmentInfoList: [], belowAeProlineGxList: [], aeToolList: [], isRFID: true, trayNum: '', isLight: true, isFrom: true, isRed: true, isYellow: true, aeProlineTray: { trayNum: '' }, isCrossLineEquipment: 1, prolineInfoId: this.$route.query.businessId } }, linkDesc(link) { return link.meta ? link.meta.desc : '' }, getMachineAllList() { machineAllList().then(res => { this.matchList = res.data }) }, handleChangeEngineMode(index) { const item = this.engineModelList.find(item => item.labelId === index) this.form.aeEngineModelId = item.modelNameId this.form.aeEngineModelBatch = item.exhaust this.form.carModel = item.carModel this.form.carModelCode = item.carModelCode }, getEngineModel() { // queryAeEngineModelName().then(res => { // this.engineModelList = res.data // }) }, ruleFun() { this.$refs.form.validate(valid => { if (valid) { this.$emit('requiredFun') } }) } } } </script> <style lang="scss" scoped> .ellipsis { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; word-wrap: break-word; } .super-flow-base-demo { width: 100%; margin: 0 auto; background-color: #fff; .show-flow { padding: 23px 26px; } .super-flow__node { .flow-node { color: #030c3e; display: flex; justify-content: center; align-items: center; font-weight: bold; background: #fdfdfd; box-shadow: 0 1px 4px 0 #333399; border-radius: 4px; } } } .card_class { width: 50%; &-data { height: 45vh; overflow: auto; } } .process_title { height: 22px; line-height: 22px; border-left: 4px solid #333399; margin-top: 10px; padding-left: 15px; font-family: Alibaba PuHuiTi; font-weight: 500; font-size: 18px; margin-bottom: 1rem; color: #333399; font-style: normal; } ::v-deep { .super-flow__node { border-radius: 7px; } } .show-map { padding: 0px 26px; display: flex; justify-content: space-between; } .card-map { width: 1522px; height: 476px; overflow: scroll; } .card-body { width: 5760px; height: 2100px; margin-left: 25px; background-position: center; background-size: 100% 100%; //overflow: scroll; background: #f7f7fb; } .common-btn { display: flex; align-items: center; justify-content: center; color: #333399; font-size: 18px; } .page-footer { margin: 20px; text-align: right; } </style> 现在代码是这样的,super-flow插件现在连接点只能固定在上下左右的中心位置,如何自定义连接点位置
07-04
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

UnknownBody

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值