Code-Style In-Context Learning for Knowledge-Based Question Answering
Not on the map. Why?
Abstract (arXiv)
Current methods for Knowledge-Based Question Answering (KBQA) usually rely on complex training techniques and model frameworks, leading to many limitations in practical applications. Recently, the emergence of In-Context Learning (ICL) capabilities in Large Language Models (LLMs) provides a simple and training-free semantic parsing paradigm for KBQA: Given a small number of questions and their labeled logical forms as demo examples, LLMs can understand the task intent and generate the logic form for a new question. However, current powerful LLMs have little exposure to logic forms during pre-training, resulting in a high format error rate. To solve this problem, we propose a code-style in-context learning method for KBQA, which converts the generation process of unfamiliar logical form into the more familiar code generation process for LLMs. Experimental results on three mainstream datasets show that our method dramatically mitigated the formatting error problem in generating logic forms while realizing a new SOTA on WebQSP, GrailQA, and GraphQ under the few-shot setting. The code and supplementary files are released at https://github.com/Arthurizijar/KB-Coder .
Key facts. Cited by 13 papers in the map (data through 14 Oct 2026). Builds on 23 of its 34 references that are in the map. First posted on arXiv 9 Sep 2023.
Builds on
23 of 34 references.
References · 23
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2022Self-Consistency Improves Chain of Thought Reasoning in Language Modelscited by 5,708
- 2023A Survey of Large Language Modelscited by 2,576
- 2017Billion-scale similarity search with GPUscited by 2,497
- 2021SimCSE: Simple Contrastive Learning of Sentence Embeddingscited by 2,173
- 2022Least-to-Most Prompting Enables Complex Reasoning in Large Language Modelscited by 1,407
- 2022When Not to Trust Language Models: Investigating Effectiveness of Parametric and Non-Parametric Memoriescited by 1,128
- 2020MPNet: Masked and Permuted Pre-training for Language Understandingcited by 981
- 2022Atlas: Few-shot Learning with Retrieval Augmented Language Modelscited by 952
- 2022Binding Language Models in Symbolic Languagescited by 228
11 more
- 2019PullNet: Open Domain Question Answering with Iterative Retrieval on Knowledge Bases and Textcited by 184
- 2020Beyond I.I.D.: Three Levels of Generalization for Question Answering on Knowledge Basescited by 171
- 2023Knowledge-Augmented Language Model Prompting for Zero-Shot Knowledge Graph Question Answeringcited by 119
- 2021RnG-KBQA: Generation Augmented Iterative Ranking for Knowledge Base Question Answeringcited by 86
- 2022DecAF: Joint Decoding of Answers and Logical Forms for Question Answering over Knowledge Basescited by 84
- 2023Few-shot In-context Learning for Knowledge Base Question Answeringcited by 74
- 2023CodeIE: Large Code Generation Models are Better Few-Shot Information Extractorscited by 68
- 2022TIARA: Multi-grained Retrieval for Robust Question Answering over Large Knowledge Basescited by 59
- 2022ArcaneQA: Dynamic Program Induction and Contextualized Encoding for Knowledge Base Question Answeringcited by 48
- 2020SPARQA: Skeleton-based Semantic Parsing for Complex Questions over Knowledge Basescited by 47
- 2023Make a Choice! Knowledge Base Question Answering with In-Context Learningcited by 8
Built on by
Citing papers per year: 2024: 4; 2025: 8; 2026: 1.
13 papers.
Sort:
By area:
- 2025Two Heads are Better Than One: Test-time Scaling of Multi-agent Collaborative Reasoningcited by 29
- 2024QueryAgent: A Reliable and Efficient Reasoning Framework with Environmental Feedback-based Self-Correctioncited by 27
- 2025KBQA-o1: Agentic Knowledge Base Question Answering with Monte Carlo Tree Searchcited by 22
- 2024Temporal Knowledge Graph Question Answering: A Surveycited by 9
- 2024Thinking with Knowledge Graphs: Enhancing LLM Reasoning Through Structured Datacited by 6
- 2025KBQA-R1: Reinforcing Large Language Models for Knowledge Base Question Answeringcited by 3
- 2025K-DeCore: Facilitating Knowledge Transfer in Continual Structured Knowledge Reasoning via Knowledge Decouplingcited by 2
- 2025EMRModel: A Large Language Model for Extracting Medical Consultation Dialogues into Structured Medical Recordscited by 1
- 2025Style2Code: A Style-Controllable Code Generation Framework with Dual-Modal Contrastive Representation Learningcited by 1
- 2025Pandora: Leveraging Code-driven Knowledge Transfer for Unified Structured Knowledge Reasoningcited by 1
- 2025SEAL: Self-Evolving Agentic Learning for Conversational Question Answering over Knowledge Graphscited by 1
- 2024A Learn-Then-Reason Model Towards Generalization in Knowledge Base Question Answeringcited by 0
1 more
- 2026Graph Query Generation with Constraint-guided Large Language Agents9 Apr 2026
- 2025KBQA-R1: Reinforcing Large Language Models for Knowledge Base Question Answering10 Dec 2025
- 2025SEAL: Self-Evolving Agentic Learning for Conversational Question Answering over Knowledge Graphs4 Dec 2025
- 2025K-DeCore: Facilitating Knowledge Transfer in Continual Structured Knowledge Reasoning via Knowledge Decoupling21 Sep 2025
- 2025Pandora: Leveraging Code-driven Knowledge Transfer for Unified Structured Knowledge Reasoning25 Aug 2025
- 2025Style2Code: A Style-Controllable Code Generation Framework with Dual-Modal Contrastive Representation Learning26 May 2025
- 2025EMRModel: A Large Language Model for Extracting Medical Consultation Dialogues into Structured Medical Records23 Apr 2025
- 2025Two Heads are Better Than One: Test-time Scaling of Multi-agent Collaborative Reasoning14 Apr 2025
- 2025KBQA-o1: Agentic Knowledge Base Question Answering with Monte Carlo Tree Search31 Jan 2025
- 2024Thinking with Knowledge Graphs: Enhancing LLM Reasoning Through Structured Data14 Dec 2024
- 2024A Learn-Then-Reason Model Towards Generalization in Knowledge Base Question Answering20 Jun 2024
- 2024Temporal Knowledge Graph Question Answering: A Survey20 Jun 2024
- 2025Two Heads are Better Than One: Test-time Scaling of Multi-agent Collaborative Reasoningcited by 29
- 2024QueryAgent: A Reliable and Efficient Reasoning Framework with Environmental Feedback-based Self-Correctioncited by 27
- 2024Thinking with Knowledge Graphs: Enhancing LLM Reasoning Through Structured Datacited by 6
- 2025K-DeCore: Facilitating Knowledge Transfer in Continual Structured Knowledge Reasoning via Knowledge Decouplingcited by 2
- 2025Pandora: Leveraging Code-driven Knowledge Transfer for Unified Structured Knowledge Reasoningcited by 1
- 2025SEAL: Self-Evolving Agentic Learning for Conversational Question Answering over Knowledge Graphscited by 1
- 2024A Learn-Then-Reason Model Towards Generalization in Knowledge Base Question Answeringcited by 0
- 2025SEAL: Self-Evolving Agentic Learning for Conversational Question Answering over Knowledge Graphs4 Dec 2025
- 2025K-DeCore: Facilitating Knowledge Transfer in Continual Structured Knowledge Reasoning via Knowledge Decoupling21 Sep 2025
- 2025Pandora: Leveraging Code-driven Knowledge Transfer for Unified Structured Knowledge Reasoning25 Aug 2025
- 2025Two Heads are Better Than One: Test-time Scaling of Multi-agent Collaborative Reasoning14 Apr 2025
- 2024Thinking with Knowledge Graphs: Enhancing LLM Reasoning Through Structured Data14 Dec 2024
- 2024A Learn-Then-Reason Model Towards Generalization in Knowledge Base Question Answering20 Jun 2024
- 2024QueryAgent: A Reliable and Efficient Reasoning Framework with Environmental Feedback-based Self-Correction18 Mar 2024
- 2024Temporal Knowledge Graph Question Answering: A Surveycited by 9
- 2025KBQA-R1: Reinforcing Large Language Models for Knowledge Base Question Answeringcited by 3
- 2025EMRModel: A Large Language Model for Extracting Medical Consultation Dialogues into Structured Medical Recordscited by 1
- 2025Style2Code: A Style-Controllable Code Generation Framework with Dual-Modal Contrastive Representation Learningcited by 1
- 2025KBQA-R1: Reinforcing Large Language Models for Knowledge Base Question Answering10 Dec 2025
- 2025Style2Code: A Style-Controllable Code Generation Framework with Dual-Modal Contrastive Representation Learning26 May 2025
- 2025EMRModel: A Large Language Model for Extracting Medical Consultation Dialogues into Structured Medical Records23 Apr 2025
- 2024Temporal Knowledge Graph Question Answering: A Survey20 Jun 2024