arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2405.17337cs.CLcs.AI
收藏

基于大语言模型的成本高效知识型问答

Cost-efficient Knowledge-based Question Answering with Large Language Models

The Hong Kong Polytechnic University(香港理工大学);Rice University(莱斯大学)

Junnan Dong, Qinggang Zhang, Chuang Zhou, Hao Chen, Daochen Zha, Xiao Huang

AI总结:

提出Coke策略,将KBQA建模为多臂老虎机问题,结合LLM与小模型,在基准上节省20.89%GPT-4费用并提升2.74%准确率。

摘要:

基于知识的问答(KBQA)在许多需要领域知识的场景中被广泛使用。大语言模型(LLMs)为KBQA带来了机遇,但其成本显著更高,且在预训练期间缺乏领域特定知识。我们受到启发,将LLMs与知识图谱上的先前小模型(KGMs)相结合,以兼顾推理准确性和成本节约。然而,这仍然具有挑战性,因为准确性和成本在优化中作为两个不同的指标难以轻易结合。此外,由于不同模型在不同知识领域表现优异,模型选择也很费力。为此,我们提出了Coke,一种针对LLMs的KBQA的新型成本高效策略,将其建模为一个定制化的多臂老虎机问题,以在有限预算内最小化对LLMs的调用。我们首先使用聚类级汤普森采样来制定对KGM或LLM的准确性期望。然后优化一个上下文感知策略,以根据问题语义进一步区分专家模型。整体决策受到根据历史失败支出的成本遗憾的约束。大量实验展示了Coke的优越性能,它在基准数据集上实现了高达20.89%的GPT-4费用节省,同时准确率提高了2.74%,推动了帕累托前沿。

英文摘要:

Knowledge-based question answering (KBQA) is widely used in many scenarios that necessitate domain knowledge. Large language models (LLMs) bring opportunities to KBQA, while their costs are significantly higher and absence of domain-specific knowledge during pre-training. We are motivated to combine LLMs and prior small models on knowledge graphs (KGMs) for both inferential accuracy and cost saving. However, it remains challenging since accuracy and cost are not readily combined in the optimization as two distinct metrics. It is also laborious for model selection since different models excel in diverse knowledge. To this end, we propose Coke, a novel cost-efficient strategy for KBQA with LLMs, modeled as a tailored multi-armed bandit problem to minimize calls to LLMs within limited budgets. We first formulate the accuracy expectation with a cluster-level Thompson Sampling for either KGMs or LLMs. A context-aware policy is optimized to further distinguish the expert model subject to the question semantics. The overall decision is bounded by the cost regret according to historical expenditure on failures. Extensive experiments showcase the superior performance of Coke, which moves the Pareto frontier with up to 20.89% saving of GPT-4 fees while achieving a 2.74% higher accuracy on the benchmark datasets.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑