arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2511.05313cs.LG
收藏

可控高效语言模型

Controllably Efficient Language Models

New York University(纽约大学)

Jatin Prakash, Aahlad Puli, Rajesh Ranganath

AI总结:

研究提出可控高效语言模型CAT,通过关注压缩序列块解码,能在训练时控制推理成本与质量的权衡,测试时无需重新训练,使用密集注意力作混合器可匹配多种高效模型,在长上下文理解任务中表现出色且吞吐量高。

摘要:

变压器中注意力机制的大量推理成本促使了高效序列混合器的发展,如稀疏和滑动窗口注意力、卷积和线性注意力。然而这些方法常牺牲质量,特别是上下文召回率。我们提出了具有推理成本可控性的元序列混合器——压缩与注意力变压器(CAT)。它通过关注压缩后的序列块来解码令牌块,压缩和解码可使用任何现有序列混合器。从压缩序列解码可节省计算和内存,块大小决定质量-成本权衡的操作点。重要的是,一次性训练多个块大小的CAT可在测试时控制权衡,无需重新训练。使用密集注意力作为混合器时,CAT能以可比推理成本在实际长上下文召回中匹配10种高效模型,在长上下文理解基准测试中表现出色,且生成吞吐量比密集变压器高1.4 - 3.7倍。

英文摘要:

The substantial inference costs of attention in transformers motivated the development of efficient sequence mixers: namely sparse and sliding window attention, convolutions and linear attention. Although these approaches result in impressive reductions in inference costs, they often trade-off with quality, specifically in-context recall. Apriori fixing this quality-cost tradeoff at training time means being suboptimal from the get-go: some downstream applications might fundamentally require more memory for in-context recall, while other tasks may require lower latency and memory. We propose a conceptually simple meta-sequence mixer with inference-cost controllability: the Compress & Attend Transformer (CAT). CAT decodes chunks of tokens by attending to compressed chunks of the sequence so far. Both compression and decoding can use any existing sequence mixer. Decoding from the compressed sequence yields compute and memory savings, with chunk size setting the operating point on the quality-cost trade-off. Importantly, training CAT across multiple chunk sizes at once unlocks test-time control of this trade-off without any retraining, all in a single model. Instantiated with the most basic choice, dense attention as the mixer, CAT surprisingly suffices to match 10 popular and diverse efficient models (linear, hybrids, sparse) on real-world long-context recall at comparable inference costs, all from a single trained model. CAT further performs competitively on long-context understanding benchmarks while providing 1.4-3.7x higher generation throughput than a dense transformer. Code is at: https://github.com/rajesh-lab/cat-transformer

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑