《讲习班-长上下文大模型进展与挑战-苏州大学.pdf》由会员分享,可在线阅读,更多相关《讲习班-长上下文大模型进展与挑战-苏州大学.pdf(73页珍藏版)》请在三个皮匠报告上搜索。
1、长上下文大模型长上下文大模型进展与挑战进展与挑战李俊涛报告内容1.1.什么是长上下文模型?什么是长上下文模型?3.3.长上下文大模型前沿与挑战长上下文大模型前沿与挑战2.2.如何训练长上下文模型如何训练长上下文模型?2.1 建模建模2.2 数据数据2.3 评测评测大模型上下文输入长度Source:Google Blog 2023DecClaude3-200K Mistral-7B-0.2-32KJulyClaude-2-100K Baichuan2-192K NovGPT4 Turbo-128K 2022NovChatGPT-3.5-16KAprChatGLM2-32K MPT-65K Sep
2、Qwen1.5-32K 闭源模型开源模型2024JulyMistral Nemo-128KMarGLM-4-long-1MMayGemini1.5 Pro-10MGemini1.0 Pro-32KMeta-Llama 3.1-128KYi-6B-200K Deepseek-V2-128K p 在众多场景越来越重要(复杂场景、部署便捷性、高效计算)长文档处理(RAG)代码助手工具调用长历史对话多模态输入处理“See”More“Memory”More“Think”More“Speak”More长上下文大模型使用场景什么是长上下文模型?“A long context model,in the rea
3、lm of natural language processing,refers to a type of language model that is capable of processing and understanding extensive sequences of text,far beyondthe typical context window size that standard large language models(LLMs)can handle.”相对模糊相对模糊的概念的概念“10 million tokens at once is already close to
4、 the thermal limit of our Tensor Processing Units we dont know where the limit is yet,and the model might be capable of even more as the hardware continues to improve”Google Blog,Gemini TeamAdvancing transformer architecture in long-context large language models:A comprehensive surveyJ.arXiv preprin
5、t arXiv:2311.12351,2023.报告内容1.1.什么是长上下文模型?什么是长上下文模型?3.3.长上下文大模型前沿与挑战长上下文大模型前沿与挑战2.2.如何训练长上下文模型如何训练长上下文模型?2.1 建模建模2.2 数据数据2.3 评测评测汇报目录p 长上下文能力对齐 监督微调(SFT)强化学习(RL)开源短上下文强模型(Llama2-4K,Llama3-8K)具有长上下文窗口的模型(32K)强长上下文模型p 上下文窗口扩展 相对位置编码(RPE)旋转位置编码(RoPE)位置内插(PI)与外推(PE)建模绝对位置编码(APE):!+0+1#+2$+%+3&+相对位置编码(RP
6、E):!#$#%3 1 1 基于Transformer 的模型依赖位置编码来确定每个token的位置,相对位置编码额外关注相对位置关系上下文窗口扩展 位置编码上下文窗口扩展 相对位置编码ALiBi函数:!,#=$!%&($p线性偏差线性偏差注意力使输入长度外推成为可能注意力使输入长度外推成为可能(ALiBiALiBi)(ICLR 2022)优点优点简单而有效,MPT(2023)模型上下文窗口达到65K缺点缺点单向:无法识别左右相对位置权值随序列长度增加而严重衰减%,=,-/4|min-2 1,-4+log -/4logmax-/4-4,p Bucket相对位置编码首次提出于T5(JMLR,20