Semantic architectures for domain-specific programming AI agents: lessons from a JavaScript semantic assistant
摘要
This work proposes a semantic ontology-based dataset leveraging fine tuning large language model to facilitate JavaScript debugging and domain-specific code generation. Ontology is used to train the model with a dataset that has an exact or logical relationship between JavaScript syntax elements. The system gains deep subject knowledge with the help of a formal linked database, producing a high-quality QandA dataset from it, and employing parameter-efficient fine-tuning of a base LLM (LLaMA-3B). The fine-tuned model is assessed through a strict framework for domain competency. Code correctness, logical consistency, adaptability, and error detection efficiency metrics were used for evaluation. Experimental results show that the ontology-augmented model performs much better across all measures than baseline generic LLaMA model. Baseline here refers to a model refined on non-ontology data, and retrieval-based techniques. Logical verification and comparisons of fine-tuning techniques (BitFit, LoRA, and standard tuning) is provided. For performance contextualization, an additional benchmark against a cutting-edge code model (CodeLlama) is provided. The enhanced outcomes show that using ontologies to incorporate structured semantic knowledge can result in significant improvements in domain-specific code comprehension, providing a repeatable route for creating specialized programming AI systems. For reproducibility, the implementation and resources (ontology, SPARQL queries, code) are made publicly accessible.