From Code to Low-Code: An LLM-Driven Pipeline for Lifting Code Clones into Reusable Abstractions
Abstract
Low-Code Development Platforms (LCDPs) promise substantial efficiency gains by allowing citizen developers to create applications from reusable building blocks instead of manually writing code. Realizing these benefits, however, depends on having such abstractions in the first place. Therefore, a curated library of reusable components is required, building this library remains a persistent challenge though. Recurring logic is often scattered as duplicated code across different systems in the same domain. Turning it into reusable assets requires language engineers to inspect large amounts of code, distinguish incidental from meaningful similarity, choose an appropriate abstraction mechanism, and implement it correctly. This effort limits the adoption of low-code approaches. To address this, we draw on principles from Low-Code Development (LCD) and Model-Driven Engineering (MDE) and introduce an LLM-driven approach for transforming code clones into reusable abstractions. Our approach combines three stages: (i) a hybrid clone detection pipeline that pairs classical detectors with code embeddings and LLM classifiers; (ii) a human-in-the-loop abstraction stage that proposes a unified abstraction strategy; and (iii) an agentic generation stage that synthesizes and validates concrete artifacts such as parameterized templates, DSL grammars, entity models, and schemas. These artifacts preserve the semantics of the original code while reducing complexity through guided, conversational refinement and automated validation before adoption. This paper is scoped to the lifting itself, that is, stages (ii) and (iii), and treats detection as the upstream supplier of their input. We evaluate these two stages on a codebase drawn from a real-world industry case, assessing the feasibility of the workflow, the division of labor between engineer and model, and the fidelity and reusability of the synthesized abstractions, and report first evidence that LLM-driven lifting can produce adoption-ready artifacts with reduced manual effort.