# Knowledge-Graph-Driven Data Synthesis for Low-Resource Software Development: A HarmonyOS Case Study

arXiv: https://arxiv.org/abs/2512.00380 · HTML: https://mlsanity.com/paper/2512.00380/

## Key facts

- Cited by 1 papers in the map (data through 14 Oct 2026).
- Placed in Code and instruction data synthesis, one of 13 directions in Synthetic data and self-improvement for LLMs.
- Builds on 30 of its 57 references that are in the map.
- First posted on arXiv 29 Nov 2025.

## Placed in

- Synthetic data and self-improvement for LLMs / [Code and instruction data synthesis](https://mlsanity.com/synth/code-and-instruction-data-synthesis/)

## Builds on (most cited first, 30 of 30)

- [Language Models are Few-Shot Learners](https://mlsanity.com/paper/2005.14165/) (2020)
- [Evaluating Large Language Models Trained on Code](https://mlsanity.com/paper/2107.03374/) (2021)
- [LlamaFactory: Unified Efficient Fine-Tuning of 100+ Language Models](https://mlsanity.com/paper/2403.13372/) (2024)
- [CodeBERT: A Pre-Trained Model for Programming and Natural Languages](https://mlsanity.com/paper/2002.08155/) (2020)
- [Agentless: Demystifying LLM-based Software Engineering Agents](https://mlsanity.com/paper/2407.01489/) (2024)
- [Magicoder: Empowering Code Generation with OSS-Instruct](https://mlsanity.com/paper/2312.02120/) (2023)
- [DreamCoder: Growing generalizable, interpretable knowledge with wake-sleep Bayesian program learning](https://mlsanity.com/paper/2006.08381/) (2020)
- [Self-planning Code Generation with Large Language Models](https://mlsanity.com/paper/2303.06689/) (2023)
- [LongCoder: A Long-Range Pre-trained Language Model for Code Completion](https://mlsanity.com/paper/2306.14893/) (2023)
- [Large Language Models for Test-Free Fault Localization](https://mlsanity.com/paper/2310.01726/) (2023)
- [When Language Model Meets Private Library](https://mlsanity.com/paper/2210.17236/) (2022)
- [SkCoder: A Sketch-based Approach for Automatic Code Generation](https://mlsanity.com/paper/2302.06144/) (2023)
- [AceCoder: Utilizing Existing Code to Enhance Code Generation](https://mlsanity.com/paper/2303.17780/) (2023)
- [Genetic Instruct: Scaling up Synthetic Generation of Coding Instructions for Large Language Models](https://mlsanity.com/paper/2407.21077/) (2024)
- [Fixing Large Language Models' Specification Misunderstanding for Better Code Generation](https://mlsanity.com/paper/2309.16120/) (2023)
- [Case2Code: Scalable Synthetic Data for Code Generation](https://mlsanity.com/paper/2407.12504/) (2024)
- [ROCODE: Integrating Backtracking Mechanism and Program Analysis in Large Language Models for Code Generation](https://mlsanity.com/paper/2411.07112/) (2024)
- [Can Large Language Models Serve as Evaluators for Code Summarization?](https://mlsanity.com/paper/2412.01333/) (2024)
- [ExploraCoder: Advancing code generation for multiple unseen APIs via planning and chained exploration](https://mlsanity.com/paper/2412.05366/) (2024)
- [Enhancing Code Generation for Low-Resource Languages: No Silver Bullet](https://mlsanity.com/paper/2501.19085/) (2025)
- [LoRA-MGPO: Mitigating Double Descent in Low-Rank Adaptation via Momentum-Guided Perturbation Optimization](https://mlsanity.com/paper/2502.14538/) (2025)
- [UnitCoder: Scalable Iterative Code Synthesis with Unit Test Guidance](https://mlsanity.com/paper/2502.11460/) (2025)
- [Bridging Code Semantic and LLMs: Semantic Chain-of-Thought Prompting for Code Generation](https://mlsanity.com/paper/2310.10698/) (2023)
- [ASTRA: Autonomous Spatial-Temporal Red-teaming for AI Software Assistants](https://mlsanity.com/paper/2508.03936/) (2025)
- [ADC: Enhancing Function Calling Via Adversarial Datasets and Code Line-Level Feedback](https://mlsanity.com/paper/2412.17754/) (2024)
- [Improved IR-based Bug Localization with Intelligent Relevance Feedback](https://mlsanity.com/paper/2501.10542/) (2025)
- [Enhancing Code Generation via Bidirectional Comment-Level Mutual Grounding](https://mlsanity.com/paper/2505.07768/) (2025)
- [ArkAnalyzer: The Static Analysis Framework for OpenHarmony](https://mlsanity.com/paper/2501.05798/) (2025)
- [SynthCoder: A Synthetical Strategy to Tune LLMs for Code Completion](https://mlsanity.com/paper/2508.15495/) (2025)
- [Towards LLM-generated explanations for Component-based Knowledge Graph Question Answering Systems](https://mlsanity.com/paper/2508.14553/) (2025)

## Built on by (most cited first, 1 of 1)

- [Unseen-Codebases-Domain Data Synthesis and Training Based on Code Graphs](https://mlsanity.com/paper/2602.20799/) (2026)

## Abstract (arXiv)

In low-resource framework development (e.g., HarmonyOS), large language models (LLMs) often lack sufficient pre-training exposure, resulting in poor code generation performance. Although they generally preserve programming logic across languages, they frequently fail on framework-specific APIs and syntax, revealing a gap between learned algorithmic knowledge and unfamiliar framework conventions. Consequently, even advanced models such as GPT-4o struggle to produce correct code without prior exposure. Inspired by these challenges, we propose APIKG4Syn, a framework that leverages API knowledge graphs to synthesize API-oriented question-code pairs without requiring executable environments. It incorporates both single-API and multi-API information, with the latter guided by uncertainty estimation (UE) and Monte Carlo Tree Search (MCTS), to construct high-quality fine-tuning data. For evaluation, we select HarmonyOS as a case study due to its accessible documentation and growing ecosystem, and build the first benchmark for its code generation. Experimental results show that fine-tuning Qwen2.5-Coder-7B with APIKG4Syn achieves a pass@1 of 25.00%, outperforming untuned GPT-4o (17.59%). We further observe that larger volumes of data generated by APIKG4Syn consistently lead to better fine-tuning performance, and that the optimal Single-API to Multi-API ratio is 8:2. Ablation studies also confirm the necessity and effectiveness of each component in our framework. These findings highlight the effectiveness of API-oriented data in enhancing LLM performance for low-resource software development scenarios.
