用向量注入知识,让大模型高效调用外部信息。
Efficient Knowledge Feeding to Language Models: A Novel Integrated Encoder-Decoder Architecture
- 用隐空间向量整合检索与生成,无需额外提示
- 仅用少量参数就达到LLaMA-3等模型性能
- 适合资源受限场景下的知识增强应用
本文提出一种新型集成编码器-解码器架构,通过在统一框架内融合检索与生成过程,高效向语言模型(LLMs)注入知识。尽管检索增强生成(RAG)能弥补训练数据不足的问题,但受限于令牌长度和检索系统准确性。本文引入上下文向量(ICV),利用大模型的潜在嵌入构建捕捉任务关键信息的向量,并直接作用于模型隐状态,从而增强生成能力而不增加提示中的示例数量。实验表明,该方法在问答、信息检索等任务中优于标准上下文学习与微调,且仅需极小参数量即达到LLaMA-3、Gemma、Phi-3等模型的竞争力,显著降低计算成本与内存需求。相比微调,该方法缩短提示长度,更易控制,突破令牌限制,具备更高计算效率。
原文摘要 · Abstract (English)
This paper introduces a novel approach to efficiently feeding knowledge to language models (LLMs) during prediction by integrating retrieval and generation processes within a unified framework. While the Retrieval-Augmented Generation (RAG) model addresses gaps in LLMs' training data and knowledge limits, it is hindered by token limit restrictions and dependency on the retrieval system's accuracy. Our proposed architecture incorporates in-context vectors (ICV) to overcome these challenges. ICV recasts in-context learning by using latent embeddings of LLMs to create a vector that captures essential task information. This vector is then used to shift the latent states of the LLM, enhancing the generation process without adding demonstration examples to the prompt. ICV directly integrates information into the model, enabling it to process this information more effectively. Our extensive experimental evaluation demonstrates that ICV outperforms standard in-context learning and fine-tuning across question-answering, information retrieval, and other tasks. This approach mitigates the limitations of current RAG models and offers a more robust solution for handling extensive and diverse datasets. Despite leveraging a fraction of the parameters, our ICV-enhanced model achieves competitive performance against models like LLaMA-3, Gemma, and Phi-3, significantly reducing computational costs and memory requirements. ICV reduces prompt length, is easy to control, surpasses token limitations, and is computationally efficient compared to fine-tuning.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。