arXiv:2409.02727cs.CLcs.IR2024-09被引 26

提出多层可训练池化,显著提升文本相似与检索性能。

Pooling And Attention: What Are Effective Designs For LLM-Based Embedding Models?

  • 用跨注意力融合所有隐藏层输出,改进传统仅用最后一层的池化方法。
  • 在文本相似与检索任务中,新方法统计上优于现有池化策略。
  • 不同任务需不同设计,无通用最优方案,适合作为嵌入模型调参参考。

大语言模型在生成任务中的显著进展,推动了基于LLM的嵌入模型研究。尽管这些模型采用不同的池化与注意力策略,在公开嵌入基准上达到顶尖性能,但其有效设计仍存疑问。由于训练数据、基础模型或训练设置各异,且公开基准评估常未报告统计显著性,导致难以判断具体设计对性能的实际贡献。本研究通过统一训练数据和基础模型,系统比较不同池化与注意力策略。结果表明:双向注意力与可训练池化层在文本相似与信息检索任务中表现更优,但在聚类与分类任务中不如简单的EOS末尾标记池化和默认因果注意力。此外,本文提出一种新池化策略——多层可训练池化(Multi-Layers Trainable Pooling),利用跨注意力网络整合所有隐藏层输出,而非仅最后一层。该方法在文本相似与检索任务中显著优于现有方法,具备统计优势。研究揭示了基于LLM嵌入模型的有效训练策略。

原文摘要 · Abstract (English)

The significant advancements of Large Language Models (LLMs) in generative tasks have led to a growing body of work exploring LLM-based embedding models. While these models, employing different pooling and attention strategies, have achieved state-of-the-art performance on public embedding benchmarks, questions still arise about what constitutes an effective design for LLM-based embedding models. However, these models are often trained on different datasets, using different LLM base models or training settings. Moreover, evaluations on public embedding benchmarks often fail to report statistical significance, making it difficult to determine which designs truly contribute to final performance. This complicates the process for practitioners seeking optimal training recipes for LLM-based embedding models. In this study, we conduct a large-scale experiment by training a series of LLM-based embedding models using the same training data and base model but differing in their pooling and attention strategies. The results show that there is no one-size-fits-all solution: while bidirectional attention and an additional trainable pooling layer outperform in text similarity and information retrieval tasks, they do not significantly surpass simpler designs like EOS-last token pooling and default causal attention in clustering and classification tasks. Furthermore, we propose a new pooling strategy, Multi-Layers Trainable Pooling, which transforms the outputs of all hidden layers, rather than just the last layer, using a cross-attention network. This method proves to be statistically superior in text similarity and retrieval tasks compared to existing pooling methods. Overall, this paper sheds light on effective training strategies for LLM-based embedding models.

嵌入模型池化策略注意力机制

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