EmbBERT在2MB内存下实现类BERT的性能,适合超低资源设备部署。
EmbBERT: Attention Under 2 MB Memory
- 通过精简嵌入层、前馈模块和注意力机制,构建极小语言模型。
- 仅用2MB内存即达到SOTA模型10倍内存下的准确率水平。
- 支持8位量化至781KB,适用于可穿戴设备等边缘场景。
基于注意力机制的Transformer架构已彻底改变自然语言处理,推动了几乎所有NLP任务的重大突破。然而,其巨大的内存与计算需求仍阻碍其在可穿戴设备和物联网(IoT)等超受限设备上的部署,这些设备可用内存仅为几兆字节。为解决此问题,我们提出EmbBERT,一种专为极致效率设计的微型语言模型(TLM)。该模型集成紧凑嵌入层、简化前馈块及高效注意力机制,在严格内存预算下实现最优性能。通过面向极端边缘的重构,我们证明高度简化的Transformer架构在严苛资源约束下依然表现优异。EmbBERT仅需2MB总内存,性能媲美需10倍内存的先进模型。在精选的TinyNLP基准与GLUE套件上,实验证明EmbBERT达到竞争性准确率,显著优于同规模的BERT和MAMBA裁剪版本。此外,模型对8位量化具有鲁棒性,内存可进一步降至781KB,且架构在亚兆字节至数十兆字节范围内具备可扩展性。消融实验表明所有组件及预训练流程均具正向贡献。所有代码、脚本与检查点均已公开,确保可复现性:https://github.com/RiccardoBravin/tiny-LLM。
原文摘要 · Abstract (English)
Transformer architectures based on the attention mechanism have revolutionized natural language processing (NLP), driving major breakthroughs across virtually every NLP task. However, their substantial memory and computational requirements still hinder deployment on ultra-constrained devices such as wearables and Internet-of-Things (IoT) units, where available memory is limited to just a few megabytes. To address this challenge, we introduce EmbBERT, a tiny language model (TLM) architecturally designed for extreme efficiency. The model integrates a compact embedding layer, streamlined feed-forward blocks, and an efficient attention mechanism that together enable optimal performance under strict memory budgets. Through this redesign for the extreme edge, we demonstrate that highly simplified transformer architectures remain remarkably effective under tight resource constraints. EmbBERT requires only 2 MB of total memory, and achieves accuracy performance comparable to the ones of state-of-the-art (SotA) models that require a $\mathbf{10\times}$ memory budget. Extensive experiments on the curated TinyNLP benchmark and the GLUE suite confirm that EmbBERT achieves competitive accuracy, comparable to that of larger SotA models, and consistently outperforms downsized versions of BERT and MAMBA of similar size. Furthermore, we demonstrate the model resilience to 8-bit quantization, which further reduces memory usage to just 781 kB , and the scalability of the EmbBERT architecture across the sub-megabyte to tens-of-megabytes range. Finally, we perform an ablation study demonstrating the positive contributions of all components and the pre-training procedure. All code, scripts, and checkpoints are publicly released to ensure reproducibility: https://github.com/RiccardoBravin/tiny-LLM.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。