Retrieval Augmented Generation (RAG) has emerged as an effective solution for mitigating hallucinations in Large Language Models (LLMs). The retrieval stage in RAG typically involves a pre-trained embedding model, which converts queries and passages into vectors to capture their semantics. However, a standard pre-trained embedding model may exhibit sub-optimal performance when applied to specific domain knowledge, necessitating fine-tuning. This paper addresses scenarios where the embeddings are only available from a black-box model. We introduce Model augmented fine-tuning (Mafin) -- a novel approach for fine-tuning a black-box embedding model by augmenting it with a trainable embedding model. Our results demonstrate that Mafin significantly enhances the performance of the black-box embeddings by only requiring the training of a small augmented model. We validate the effectiveness of our method on both labeled and unlabeled datasets, illustrating its broad applicability and efficiency.
翻译:检索增强生成(RAG)已成为缓解大型语言模型(LLMs)幻觉问题的有效方案。在RAG的检索阶段,通常使用预训练嵌入模型将查询和段落转换为向量以捕获其语义。然而,当应用于特定领域知识时,标准预训练嵌入模型可能表现欠佳,需要进行微调。本文针对嵌入仅能从黑盒模型获取的场景,提出了一种名为模型增强微调(Mafin)的新方法——通过引入可训练嵌入模型对黑盒嵌入模型进行增强微调。实验结果表明,仅需训练一个小型增强模型,Mafin即可显著提升黑盒嵌入的性能。我们基于标注和非标注数据集验证了该方法的有效性,证明其具有广泛的适用性和高效性。