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仅需训练一个小型增强模型即可显著提升黑盒嵌入的性能。我们在标注和未标注数据集上验证了该方法的有效性,展示了其广泛的适用性和高效性。