Paper Reading AI Learner

DomAgent: Leveraging Knowledge Graphs and Case-Based Reasoning for Domain-Specific Code Generation

2026-03-22 22:39:32
Shuai Wang, Dhasarathy Parthasarathy, Robert Feldt, Yinan Yu

Abstract

Large language models (LLMs) have shown impressive capabilities in code generation. However, because most LLMs are trained on public domain corpora, directly applying them to real-world software development often yields low success rates, as these scenarios frequently require domain-specific knowledge. In particular, domain-specific tasks usually demand highly specialized solutions, which are often underrepresented or entirely absent in the training data of generic LLMs. To address this challenge, we propose DomAgent, an autonomous coding agent that bridges this gap by enabling LLMs to generate domain-adapted code through structured reasoning and targeted retrieval. A core component of DomAgent is DomRetriever, a novel retrieval module that emulates how humans learn domain-specific knowledge, by combining conceptual understanding with experiential examples. It dynamically integrates top-down knowledge-graph reasoning with bottom-up case-based reasoning, enabling iterative retrieval and synthesis of structured knowledge and representative cases to ensure contextual relevance and broad task coverage. DomRetriever can operate as part of DomAgent or independently with any LLM for flexible domain adaptation. We evaluate DomAgent on an open benchmark dataset in the data science domain (DS-1000) and further apply it to real-world truck software development tasks. Experimental results show that DomAgent significantly enhances domain-specific code generation, enabling small open-source models to close much of the performance gap with large proprietary LLMs in complex, real-world applications. The code is available at: this https URL.

Abstract (translated)

大语言模型(LLMs)在代码生成方面展现出卓越能力。然而,由于大多数LLMs基于公共领域语料训练,直接将其应用于实际软件开发往往成功率较低,因为这些场景通常需要领域特定知识。特别是,领域特定任务通常需要高度专业化的解决方案,而这些方案在通用LLMs的训练数据中往往代表性不足或完全缺失。为应对这一挑战,我们提出了DomAgent——一个自主编码代理,它通过结构化推理和定向检索,使LLMs能够生成领域适配代码,从而弥合这一差距。DomAgent的核心组件是DomRetriever,这是一个新颖的检索模块,通过结合概念理解与经验案例,模拟人类学习领域特定知识的方式。它动态整合自上而下的知识图谱推理与自下而上的基于案例的推理,实现结构化知识与代表性案例的迭代检索与综合,以确保上下文相关性和广泛的任务覆盖。DomRetriever既可作为DomAgent的组成部分运行,也可独立与任何LLM配合使用,实现灵活的领域适配。我们在数据科学领域的开放基准数据集(DS-1000)上评估了DomAgent,并将其进一步应用于真实的卡车软件开发任务。实验结果表明,DomAgent显著提升了领域特定代码生成能力,使小型开源模型在复杂现实应用中大幅缩小了与大型专有LLMs的性能差距。代码已公开于:此https链接。

URL

https://arxiv.org/abs/2603.21430

PDF

https://arxiv.org/pdf/2603.21430.pdf


Tags
3D Action Action_Localization Action_Recognition Activity Adversarial Agent Attention Autonomous Bert Boundary_Detection Caption Chat Classification CNN Compressive_Sensing Contour Contrastive_Learning Deep_Learning Denoising Detection Dialog Diffusion Drone Dynamic_Memory_Network Edge_Detection Embedding Embodied Emotion Enhancement Face Face_Detection Face_Recognition Facial_Landmark Few-Shot Gait_Recognition GAN Gaze_Estimation Gesture Gradient_Descent Handwriting Human_Parsing Image_Caption Image_Classification Image_Compression Image_Enhancement Image_Generation Image_Matting Image_Retrieval Inference Inpainting Intelligent_Chip Knowledge Knowledge_Graph Language_Model LLM Matching Medical Memory_Networks Multi_Modal Multi_Task NAS NMT Object_Detection Object_Tracking OCR Ontology Optical_Character Optical_Flow Optimization Person_Re-identification Point_Cloud Portrait_Generation Pose Pose_Estimation Prediction QA Quantitative Quantitative_Finance Quantization Re-identification Recognition Recommendation Reconstruction Regularization Reinforcement_Learning Relation Relation_Extraction Represenation Represenation_Learning Restoration Review RNN Robot Salient Scene_Classification Scene_Generation Scene_Parsing Scene_Text Segmentation Self-Supervised Semantic_Instance_Segmentation Semantic_Segmentation Semi_Global Semi_Supervised Sence_graph Sentiment Sentiment_Classification Sketch SLAM Sparse Speech Speech_Recognition Style_Transfer Summarization Super_Resolution Surveillance Survey Text_Classification Text_Generation Time_Series Tracking Transfer_Learning Transformer Unsupervised Video_Caption Video_Classification Video_Indexing Video_Prediction Video_Retrieval Visual_Relation VQA Weakly_Supervised Zero-Shot