Linear attention transformers have become a strong alternative to softmax attention due to their efficiency. However, linear attention tends to be less expressive and results in reduced accuracy compared to softmax attention. To bridge the accuracy gap between softmax attention and linear attention, we manipulate Mamba-2, a very strong linear attention variant. We first simplify Mamba-2 down to its most fundamental and important components, evaluating which specific choices make it most accurate. From this simplified Mamba variant (Mamba-2S), we improve the A-mask and increase the order of the hidden state, resulting in a method, which we call 2Mamba, that is nearly as accurate as softmax attention, yet much more memory efficient for long context lengths. We also investigate elements to Mamba-2 that help surpass softmax attention accuracy. Code is provided for all our experiments.
Simple data balancing achieves competitive worst-group-accuracy
CentraleSupélec(中央理工-高等电力学院);Université Paris-Saclay(巴黎萨克雷大学);INRIA - PSL(法国国家信息与自动化研究所-巴黎文理研究大学);Mila(米拉人工智能研究所);Université de Montréal(蒙特利尔大学);Facebook AI Research(脸书人工智能研究院);INRIA(法国国家信息与自动化研究所)
Cambridge University(剑桥大学);University of Florence(佛罗伦萨大学);Politecnico di Torino(都灵理工大学);University of Picardie Jules Verne(皮卡第儒勒-凡尔纳大学);University of South Pacific(南太平洋大学)
Multi-Complexity-Loss DNAS for Energy-Efficient and Memory-Constrained Deep Neural Networks
University of Bologna(博洛尼亚大学);Politecnico di Torino(都灵理工大学)
神经架构搜索(NAS)越来越受欢迎,以自动探索深度学习(DL)架构的准确性与计算复杂性的权衡。当针对微小的边缘设备时,DL部署的主要挑战是匹配严格的内存约束,因此大多数NAS算法将模型大小视为复杂性度量。其他方法通过权衡推理操作的准确性和数量来减少DL模型的能量或延迟。能量和内存很少被同时考虑,特别是低搜索成本的差分NAS(DNAS)解决方案。我们克服了这一限制,提出了第一个DNAS,直接解决最现实的情况下,从设计师的角度来看:共同优化的准确性和能源(或延迟)的内存约束下,由目标硬件。我们通过在训练期间将两个复杂度相关的损失函数与独立强度相结合来做到这一点。通过对MLPerf Tiny基准测试套件中的三个边缘相关任务进行测试,我们在能量与精度空间中获得了丰富的Pareto架构集,内存占用限制范围为基线网络的75%至6.25%。当部署在商业边缘设备STM NUCLEO-H743 ZI 2上时,我们的网络在相同的内存限制下,能耗范围为2.18倍,准确度为4.04%,并将能耗降低高达2.2倍,相对于基线的准确度下降可以忽略不计。