轻量语言模型PLM通过软硬件协同设计,实现边缘设备高效推理。
PLM: Efficient Peripheral Language Models Hardware-Co-Designed for Ubiquitous Computing
- 采用多头隐式注意力与平方ReLU激活,提升推理时的稀疏性以降低内存占用。
- 在GSM8K任务上提升9%,编码任务提升11%,通用任务提升2%。
- 专为手机、树莓派等边缘设备优化,激活参数最少,适合实时应用。
尽管大语言模型(LLMs)的规模定律持续得到验证,但其推理需求与边缘设备资源受限之间存在根本矛盾,制约了边缘智能发展。本文提出一种外设语言模型(Peripheral Language Model, PLM),通过软硬件协同设计,在模型架构与边缘系统约束间实现联合优化。PLM采用多头隐式注意力机制,并使用平方ReLU激活函数以促进稀疏性,显著降低推理峰值内存占用。训练阶段整合开源数据集,实施多阶段训练策略,实证验证了温升-稳定-衰减-恒定(WSDC)学习率调度器的有效性;并通过引入基于人类反馈的强化学习(RLHF)与ARIES偏好学习方法,结合两阶段监督微调(SFT),使模型在通用任务中性能提升2%,GSM8K任务提升9%,编程任务提升11%。评估显示,PLM在公开数据训练的小模型中表现最优,且激活参数数量最少。在消费级GPU、移动设备及树莓派上的部署结果进一步验证其适用于边缘场景。PLM系列模型已开源:https://github.com/plm-team/PLM。
原文摘要 · Abstract (English)
While scaling laws have been continuously validated in large language models (LLMs) with increasing model parameters, the inherent tension between the inference demands of LLMs and the limited resources of edge devices poses a critical challenge to the development of edge intelligence. Recently, numerous small language models have emerged, aiming to distill the capabilities of LLMs into smaller footprints. However, these models often retain the fundamental architectural principles of their larger counterparts, still imposing considerable strain on the storage and bandwidth capacities of edge devices. In this paper, we introduce the PLM, a Peripheral Language Model, developed through a co-design process that jointly optimizes model architecture and edge system constraints. The PLM utilizes a Multi-head Latent Attention mechanism and employs the squared ReLU activation function to encourage sparsity, thereby reducing peak memory footprint during inference. During training, we collect and reorganize open-source datasets, implement a multi-phase training strategy, and empirically investigate the Warmup-Stable-Decay-Constant (WSDC) learning rate scheduler. Additionally, we incorporate Reinforcement Learning from Human Feedback (RLHF) by adopting the ARIES preference learning approach. Following a two-phase SFT process, this method yields performance gains of 2% in general tasks, 9% in the GSM8K task, and 11% in coding tasks. In addition to its novel architecture, evaluation results demonstrate that PLM outperforms existing small language models trained on publicly available data while maintaining the lowest number of activated parameters. Furthermore, deployment across various edge devices, including consumer-grade GPUs, mobile phones, and Raspberry Pis, validates PLM's suitability for peripheral applications. The PLM series models are publicly available at https://github.com/plm-team/PLM.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。