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.


翻译:基于注意力机制的Transformer架构彻底变革了自然语言处理(NLP)领域,在几乎所有NLP任务中都取得了重大突破。然而,其巨大的内存与计算需求仍然阻碍了在可穿戴设备和物联网(IoT)单元等超受限设备上的部署,这类设备的可用内存通常仅为数兆字节。为应对这一挑战,我们提出了EmbBERT——一种专为极致效率而架构设计的微型语言模型(TLM)。该模型集成了紧凑的嵌入层、精简的前馈块以及高效的注意力机制,共同确保了在严格内存预算下的最优性能。通过对极端边缘场景的重新设计,我们证明了高度简化的Transformer架构在严苛资源限制下仍能保持卓越效能。EmbBERT仅需2 MB总内存,其准确率性能可与需要$\mathbf{10\times}$内存预算的先进(SotA)模型相媲美。在精心构建的TinyNLP基准测试和GLUE评测集上的大量实验证实,EmbBERT达到了与更大规模SotA模型相当的竞争性准确率,并持续优于同尺寸的BERT和MAMBA缩减版本。此外,我们验证了模型对8位量化的鲁棒性——该技术进一步将内存占用降至仅781 kB,并展示了EmbBERT架构在亚兆字节至数十兆字节范围内的可扩展性。最后,我们通过消融实验证明了所有组件及预训练流程的积极贡献。所有代码、脚本与模型检查点均已公开以确保可复现性:https://github.com/RiccardoBravin/tiny-LLM。

0
下载
关闭预览

相关内容

【CVPR2023】BiFormer:基于双层路由注意力的视觉Transformer
专知会员服务
35+阅读 · 2023年3月20日
最新《注意力机制与深度学习结合》综述论文
专知会员服务
76+阅读 · 2021年6月17日
注意力机制介绍,Attention Mechanism
专知会员服务
172+阅读 · 2019年10月13日
一文读懂自注意力机制:8大步骤图解+代码
新智元
153+阅读 · 2019年11月26日
深度学习的下一步:Transformer和注意力机制
云头条
56+阅读 · 2019年9月14日
注意力机制可解释吗?这篇ACL 2019论文说……
机器之心
11+阅读 · 2019年6月16日
【干货】注意力机制(Attention)最新综述论文及相关源码
GAN生成式对抗网络
11+阅读 · 2018年11月16日
深度学习中的注意力机制
人工智能头条
16+阅读 · 2017年11月2日
国家自然科学基金
1+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
7+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
11+阅读 · 2012年12月31日
Arxiv
0+阅读 · 2月16日
VIP会员
相关基金
国家自然科学基金
1+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
7+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
11+阅读 · 2012年12月31日
Top
微信扫码咨询专知VIP会员