跳到正文
研踪PaperTrail
← 研踪 PaperTrail

arXiv:2606.07085 · v3

Porting Declarative UI to HarmonyOS: A Heuristic-guided Approach for lightweight LLMs

首次提交 2026-06-05 17:31
版本更新 2026-11-07 20:33
雷达观测 2026-11-10 11:14
arXiv ↗PDF ↗

摘要

As an emerging operating system, HarmonyOS has a significant demand for software migration, where the User Interface (UI) translation accounts for a critical link. However, recent UI development has shifted to declarative paradigms, e.g., Kotlin Jetpack Compose (KJC) for Android, SwiftUI for iOS, and ArkUI for HarmonyOS, making prior translation approaches inapplicable because they target either backend logic or legacy imperative UIs. Thus, related research is limited. To systematically evaluate KJC/SwiftUI-to-ArkUI migration, we build a parallel benchmark of 100 KJC and 100 SwiftUI files across eight scenarios, plus 52 real-world UI pages from nine open-source apps. Evaluating nine direct-translation setups (including diverse LLMs and agents), we find Compilation Success Rate (CSR) spans 0.00%-35.00%; common strategies (reference screenshots and compiler-guided repair) lift capable setups to 94.00%-99.00% CSR but fail on lightweight LLMs. By manually analyzing a 3,102-sample subset, deriving a regular-expression pattern for each failure family, and applying these patterns to generalize the resulting taxonomy to the full 29,593-sample set, we find residual errors rooted in (1) broken structure, (2) nonexistent APIs, and (3) missing resources (e.g., colors, strings, and icons). Accordingly, we propose ArkTrans, a declarative UI translation framework that maps these roots to deterministic structure supply, ArkUI knowledge and resource reference injection via a demonstration example, and iterative repair targeting residual errors, via four steps: Metadata Extraction, Skeleton Construction, LLM-driven Translation, and Compiler-Guided Iterative Repair. With Qwen3.6-27B, ArkTrans raises CSR from 0.00% to 70.00% on KJC and 64.00% on SwiftUI, achieving strong visual fidelity, and attains 65.63%/80.00% CSR on real-world pages, far outperforming the best common strategy at lower token cost.

AI 论文解读

基于摘要 · 非全文审阅

此版本尚未生成 AI 解读。解读由后台任务生成并按论文版本保存,登录后共享已有结果。

版本差异

目前只观测到一个版本,无法比较变化。之后收录新版本时,会在这里对照标题、作者、分类和摘要。

观测到的版本

相邻记录可能跳过中间版本;首次发现 v2 及以上也会标为版本更新。

v3 · 2026-11-07 20:33 · 最新观测版本

Porting Declarative UI to HarmonyOS: A Heuristic-guided Approach for lightweight LLMs

As an emerging operating system, HarmonyOS has a significant demand for software migration, where the User Interface (UI) translation accounts for a critical link. However, recent UI development has shifted to declarative paradigms, e.g., Kotlin Jetpack Compose (KJC) for Android, SwiftUI for iOS, and ArkUI for HarmonyOS, making prior translation approaches inapplicable because they target either backend logic or legacy imperative UIs. Thus, related research is limited. To systematically evaluate KJC/SwiftUI-to-ArkUI migration, we build a parallel benchmark of 100 KJC and 100 SwiftUI files across eight scenarios, plus 52 real-world UI pages from nine open-source apps. Evaluating nine direct-translation setups (including diverse LLMs and agents), we find Compilation Success Rate (CSR) spans 0.00%-35.00%; common strategies (reference screenshots and compiler-guided repair) lift capable setups to 94.00%-99.00% CSR but fail on lightweight LLMs. By manually analyzing a 3,102-sample subset, deriving a regular-expression pattern for each failure family, and applying these patterns to generalize the resulting taxonomy to the full 29,593-sample set, we find residual errors rooted in (1) broken structure, (2) nonexistent APIs, and (3) missing resources (e.g., colors, strings, and icons). Accordingly, we propose ArkTrans, a declarative UI translation framework that maps these roots to deterministic structure supply, ArkUI knowledge and resource reference injection via a demonstration example, and iterative repair targeting residual errors, via four steps: Metadata Extraction, Skeleton Construction, LLM-driven Translation, and Compiler-Guided Iterative Repair. With Qwen3.6-27B, ArkTrans raises CSR from 0.00% to 70.00% on KJC and 64.00% on SwiftUI, achieving strong visual fidelity, and attains 65.63%/80.00% CSR on real-world pages, far outperforming the best common strategy at lower token cost.

查看此版本解读 →查看此版本原文 ↗