A Hybrid Approach for EMF Code Generation:Code Templates Meet Large Language Models
Xiao He, Ru Chen, Zeqing Zhang, Yanling Wang, and Qiuyan Dong

TL;DR
This paper introduces iEcoreGen, a hybrid system combining EMF templates and large language models to improve automated Java code generation, balancing correctness and flexibility.
Contribution
It presents a novel hybrid approach integrating EMF and LLMs for code generation, demonstrating improved accuracy over LLM-only methods.
Findings
Outperforms LLM-only baselines on pass@k metrics
Achieves comparable results to LLMs on compilation@k
Ablation study shows the importance of each component
Abstract
Template-based and LLM-based code generation are both key enablers of automated software development. The former provides correctness guarantees but are rigid for complex requirements, whereas LLMs offer high flexibility at the risk of producing faulty code.This paper proposes iEcoreGen, a hybrid approach that integrates Eclipse Modeling Framework (EMF) and LLMs. In EMF, an Ecore model defines a system structure and acts as a blueprint for code-generation.iEcoreGen decomposes requirements to derive operation specifications, uses EMF's template-based generator to produce initial Java code, and serializes specifications into docstrings. LLMs are then invoked to complete and fix unimplemented methods. We assessed iEcoreGen on twenty code-generation tasks across five LLMs. It surpasses LLM-only baselines on pass@k and performs on par with them on compilation@k. An ablation study clarified…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsModel-Driven Software Engineering Techniques · Software Engineering Research · Software Engineering Techniques and Practices
