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

基于循环语言模型的线性时间与常数内存文本嵌入

Linear-Time and Constant-Memory Text Embeddings Based on Recurrent Language Models

Dynatrace Research(DynaTrace研究)

Tobias Grantner, Emanuel Sallinger, Martin Flechl

AI总结:

本文提出基于循环架构的高效文本嵌入方法,通过垂直分块推理策略实现线性时间复杂度和常数内存使用,验证了Mamba2等模型在文本嵌入任务中的有效性。

摘要:

基于Transformer的嵌入模型存在二次计算和线性内存复杂度,限制了其在长序列中的应用。本文提出循环架构作为高效替代方案,引入垂直分块推理策略,使嵌入生成速度与内存使用在输入长度超过垂直分块大小后变为常数。通过微调Mamba2模型,证明其作为通用文本嵌入器的可行性,在多种基准测试中表现优异,同时内存占用显著低于基于Transformer的模型。通过实验证明所提出推理策略适用于Mamba2、RWKV和xLSTM模型,确认了不同架构间一致的运行时间-内存权衡,确立了循环模型作为高效嵌入生成替代方案的潜力。

英文摘要:

Transformer-based embedding models suffer from quadratic computational and linear memory complexity, limiting their utility for long sequences. We propose recurrent architectures as an efficient alternative, introducing a vertically chunked inference strategy that enables fast embedding generation with memory usage that becomes constant in the input length once it exceeds the vertical chunk size. By fine-tuning Mamba2 models, we demonstrate their viability as general-purpose text embedders, achieving competitive performance across a range of benchmarks while maintaining a substantially smaller memory footprint compared to transformer-based counterparts. We empirically validate the applicability of our inference strategy to Mamba2, RWKV, and xLSTM models, confirming consistent runtime-memory trade-offs across architectures and establishing recurrent models as a compelling alternative to transformers for efficient embedding generation.

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

↑