Research map / Large language models / Retrieval and knowledge
Cost-efficient Knowledge-based Question Answering with Large Language Models
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Proposes Coke, a multi-armed bandit strategy that routes each KBQA question to either LLMs or small knowledge-graph models under a cost budget, combining cluster-level Thompson Sampling, contextual linear bandits, and a cost-regret penalty.
Problem
KBQA with LLMs is costly and LLMs lack domain-specific knowledge, while small KG-based models are cheap but weaker overall; no principled way exists to jointly trade off accuracy and API/call cost when choosing among models per question.
Approach
Model per-question model selection as a bandit: cluster-level Thompson Sampling chooses between the LLM cluster and the KGM cluster, a contextual linear bandit (RoBERTa question embeddings) picks the expert arm within the cluster, and a cost-regret term penalizes arms that waste budget on failed answers.
Key results
- Coke reaches 0.824 IHtest accuracy on CSQA and 0.908 test accuracy on OBQA versus GPT-4's 0.802 and 0.902, with up to 20.89% API fee savings vs GPT-4 on CSQA.
- On MedQA, Coke with HamQA, Llama2 and Llama3 arms achieves 0.692 test accuracy vs Llama3 8B's 0.691, with 0.66% fewer calls.
- Coke matches GPT-4 accuracy at roughly 60% of budget on CSQA and OBQA according to the budget study.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| Use Coke's question-specific model selection instead of GPT-4 alone | Coke · CommonsenseQA, OpenBookQA, MedQA | accuracy: + 2.56%; + 2.74%; + 1.12%; + 0.67%; + 0.95%; + 1.03% | Helped |
| Use Coke's question-specific model selection instead of GPT-4 alone | Coke · CommonsenseQA, OpenBookQA, MedQA | API cost saving: - 15.14%; - 20.89%; - 5.33%; - 11.02%; - 2.11%; - 4.32% | Helped |
| Add cluster-level accuracy expectation (E_c) (ablation) | Coke · CommonsenseQA, OpenBookQA, MedQA | cost saving: - 47.59%; - 32.10%; - 30.51% | Helped |
| Add cluster-level accuracy expectation (E_c) (ablation) | Coke · CommonsenseQA, OpenBookQA, MedQA | accuracy: 0.750; 0.855; 0.607 | Helped |
| Add context-aware expert expectation (E_a) (ablation) | Coke · CommonsenseQA, OpenBookQA, MedQA | accuracy: 0.801; 0.880; 0.760 | Helped |
| Add context-aware expert expectation (E_a) (ablation) | Coke · CommonsenseQA, OpenBookQA, MedQA | cost saving: - 15.42%; - 21.16%; - 1.07% | Mixed |
| Add cost regret (R_a) (ablation) | Coke · CommonsenseQA, OpenBookQA, MedQA | accuracy: 0.800; 0.898; 0.684 | Helped |
| Add cost regret (R_a) (ablation) | Coke · CommonsenseQA, OpenBookQA, MedQA | cost saving: - 6.26%; - 3.31%; - 15.98% | Helped |
Surprising findings
- Removing the cost-regret term on CSQA yields only a small accuracy drop but lower cost savings, while removing the cluster expectation on CSQA and OBQA reduces cost savings by 30-48%.
- Llama2 (7b) and Llama3 (8b) underperform traditional KGMs on CSQA and OBQA, so LLM arms were only used on MedQA.
Limitations
- On MedQA, where KGMs are weak, the policy must call LLMs frequently, so cost savings are small (4.32% vs GPT-4).
- Accuracy-cost tradeoff depends on a hyperparameter lambda and budget B that must be tuned.
- Reported improvement figures are inconsistent in the text (e.g., 2.03% vs 2.56% on CSQA) and the 'Coke' rows report only per-dataset best results.
Experimental setup
Datasets: CommonsenseQA OpenBookQA MedQA-USMLE
Benchmarks: CommonsenseQA OpenBookQA MedQA-USMLE
Metrics: accuracy cost saving (API fees $) cost saving (calls) Pareto frontier error rate vs budget
Baselines: Bert-base Bert-large RoBERTa-large MHGRN QA-GNN HamQA JointLK GreaseLM GrapeQA GPT-3 GPT-3.5 GPT-4
Builds on: Thompson Sampling LinUCB-style contextual bandits QA-GNN HamQA
Closest papers by meaning
- FlexKBQA: A Flexible LLM-Powered Framework for Few-Shot Knowledge Base Question Answering (AAAI 2024 · similarity 0.90)
- Code-Style In-Context Learning for Knowledge-Based Question Answering (AAAI 2024 · similarity 0.89)
- Large Language Model Cascades with Mixture of Thought Representations for Cost-Efficient Reasoning (ICLR 2024 · similarity 0.89)
- Promoting Knowledge Base Question Answering by Directing LLMs to Generate Task-relevant Logical Forms (AAAI 2025 · similarity 0.89)
- KBQA-o1: Agentic Knowledge Base Question Answering with Monte Carlo Tree Search (ICML 2025 · similarity 0.89)
- Harnessing Large Language Models for Knowledge Graph Question Answering via Adaptive Multi-Aspect Retrieval-Augmentation (AAAI 2025 · similarity 0.88)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
