arXiv:2503.01776cs.LGcs.AI2025-03ICML被引 26

用稀疏编码实现可变长度嵌入,高效又精准。

Beyond Matryoshka: Revisiting Sparse Coding for Adaptive Representation

  • 用轻量级自编码与对比目标,将预训练嵌入稀疏化到高维激活空间
  • 在图像、文本、多模态任务上,精度和检索速度均大幅优于MRL
  • 训练时间仅为MRL的几分之一,适合实际系统部署

许多大规模系统依赖高质量深度表示(嵌入)来支持检索、搜索和生成建模等任务。近期提出的马特里什卡表示学习(MRL)虽能实现可变嵌入长度,但需完整重训练,且在短长度下性能明显下降。本文表明,稀疏编码是实现自适应表示的更优方案,仅需极低开销即可保持更高保真度。我们提出对比稀疏表示(CSR),将预训练嵌入稀疏化至高维但选择性激活的特征空间。通过轻量级自编码与任务感知对比目标,CSR在不同稀疏度下均保持语义质量,支持灵活且低成本的推理。在图像、文本及多模态基准上的大量实验表明,CSR在准确率与检索速度上持续超越MRL,常达显著差距,同时将训练时间压缩至MRL的极小部分。结果确立稀疏编码在效率与保真度并重的实际应用中,是强大的自适应表示学习范式。代码已开源:https://github.com/neilwen987/CSR_Adaptive_Rep

原文摘要 · Abstract (English)

Many large-scale systems rely on high-quality deep representations (embeddings) to facilitate tasks like retrieval, search, and generative modeling. Matryoshka Representation Learning (MRL) recently emerged as a solution for adaptive embedding lengths, but it requires full model retraining and suffers from noticeable performance degradations at short lengths. In this paper, we show that sparse coding offers a compelling alternative for achieving adaptive representation with minimal overhead and higher fidelity. We propose Contrastive Sparse Representation (CSR), a method that sparsifies pre-trained embeddings into a high-dimensional but selectively activated feature space. By leveraging lightweight autoencoding and task-aware contrastive objectives, CSR preserves semantic quality while allowing flexible, cost-effective inference at different sparsity levels. Extensive experiments on image, text, and multimodal benchmarks demonstrate that CSR consistently outperforms MRL in terms of both accuracy and retrieval speed-often by large margins-while also cutting training time to a fraction of that required by MRL. Our results establish sparse coding as a powerful paradigm for adaptive representation learning in real-world applications where efficiency and fidelity are both paramount. Code is available at https://github.com/neilwen987/CSR_Adaptive_Rep

稀疏编码自适应表示嵌入优化高效推理

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。