Daedalus-150M:专为CPU推理设计的卷积-注意力混合模型

·

研究论文 · 2026/08/24

本文介绍了一种专为CPU推理设计的小型语言模型Daedalus-150M。与传统先构建大模型再压缩到CPU的方法不同,作者首先确定目标(单用户、单token、4位权重、普通CPU),然后选择适配的架构。模型在18个块中仅6个使用全注意力,其余12个使用短卷积,其内存宽度固定为两个时间步,不随对话长度增长,因此三分之二的网络无需重复读取增长的缓存。模型在59.9B tokens上从头训练,在五个任务基准上得分47.31,超过训练数据多3-6倍的GPT-2 124M、Pythia-160M、OPT-125M和GPT-neo-125M,并超过MobileLLM-125M的公开分数(尽管后者使用了1万亿tokens)。验证集每字节比特数为0.8685。为检验架构而非训练方法,作者在相同数据上训练了同等规模的传统全注意力模型,并预先设定获胜条件。混合模型在质量指标上领先0.81%,在下游任务上持平,4位文件小6.3%,在2048 tokens上下文时解码速度快1.76倍,与外部相似规模模型相比快2.08倍。速度优势在空上下文时接近零,随长度增长而增加,符合机制预测。简单带宽计算仅预测1.17倍,因此内存量不能完全解释差距。文章还报告了失败尝试:未缓解的4位质量损失、约一半卷积通道无效且无法移除、词汇量过大。

本文提出了一种针对CPU推理的模型设计新思路,通过架构创新在保持质量的同时显著提升推理速度,并提供了详尽的对比实验和失败分析,对边缘设备上的语言模型部署具有重要参考价值。

Small language models are usually built like large ones and then squeezed onto a CPU afterwards. We did the opposite: we fixed the target first, one user, one token at a time, 4-bit weights, ordinary CPU, and chose the architecture to suit it. The result keeps full attention in only 6 of its 18 blocks. The other 12 use short convolutions whose memory is two timesteps wide no matter how long the conversation gets, so two thirds of the network never re-reads a growing cache. Trained from scratch on 59.9B tokens, the model scores 47.31 on a five-task benchmark against a bar of 42.20 that was fixed before training began. It beats GPT-2 124M, Pythia-160M, OPT-125M and GPT-neo-125M, all trained on three to six times more data, and exceeds MobileLLM-125M's published score despite that model seeing a trillion tokens. Validation bits-per-byte is 0.8685. To check the architecture rather than the training recipe, we trained a conventional all-attention model of the same size on the same data, and wrote down the winning condition before scoring either. The hybrid won the chosen quality metric by 0.81%, matched it on downstream tasks, produced a 6.3% smaller 4-bit file, and decoded 1.76x faster at 2048 tokens of context, 2.08x against an external model of similar size. In every measurement the speed advantage is near zero at an empty context and grows with length, which is what the mechanism predicts and what a merely leaner model would not show. A simple bandwidth calculation predicts only 1.17x, so memory volume alone does not explain the gap. We also report what did not work: an unmitigated 4-bit quality cost, roughly half the convolution channels ending up inert and impossible to remove, and a vocabulary larger than this model size warrants.

阅读原文

参与讨论