arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~

依赖引导的代码生成:结构化矩阵分解与一致性引导的细化

Dependency-Guided Code Generation: Structured Matrix Decomposition and Consistency-Guided Refinement

Mingqiao Mo, Yangchen Zeng, Zikai Xiao, Xin Xiao, Wenhua Nie, Zhaolu Kang, Guangyuan Dong, Kai Shu, Hao Zhang, Xiaodong Fan

arXiv 2607.16692首次发表:更新:

发表机构

University of the Chinese Academy of Sciences; ByteDance Inc.; Zhejiang University; National Taiwan University; Peking University; Alibaba Group; Tsinghua University; Liaoning Technical University(中国科学院大学; 字节跳动公司; 浙江大学; 台湾国立大学; 北京大学; 阿里巴巴集团; 清华大学; 辽宁技术大学)

机构由 AI 辅助整理,请以论文原文为准。

AI 中文总结

针对现有代码生成方法无法充分捕捉代码实体依赖关系的问题,提出依赖感知代码生成框架,通过结构化矩阵分解和一致性引导细化生成代码,经实验验证该方法能生成语义对齐和结构保真度更高的代码。

AI 中文摘要

现代软件系统日益复杂,使自动代码生成成为软件工程中的一项基本任务。然而,现有方法往往无法充分捕捉代码实体间复杂的多层次依赖关系,导致生成的代码逻辑不完整或难以集成到实际系统中。为解决此局限,我们提出一个依赖感知代码生成框架,通过基于图的表示明确建模代码实体间的交互。我们将依赖分解为两个互补组件:一个捕获强显式关系的量化矩阵和一个对弱隐式交互建模的稀疏低秩分解。通过交替优化过程有效学习分解。在代码生成期间,将学习到的依赖结构作为约束纳入,确保生成代码的语义连贯和结构一致。此外,我们为强依赖引入稀疏三元组表示,显著提高存储效率和计算可扩展性。大量实验表明,与现有方法相比,我们的方法始终能生成具有更高语义对齐和结构保真度的代码。

英文摘要

The increasing complexity of modern software systems has made automated code generation a fundamental task in software engineering. However, existing approaches often fail to adequately capture the intricate, multi-level dependencies among code entities, leading to generated code that is logically incomplete or difficult to integrate into real-world systems. To address this limitation, we propose a dependency-aware code generation framework that explicitly models interactions among code entities through a graph-based representation. We decompose dependencies into two complementary components: a quantized matrix that captures strong, explicit relations, and a sparse low-rank factorization that models weaker, implicit interactions. The decomposition is efficiently learned via an alternating optimization procedure. During code generation, the learned dependency structure is incorporated as a constraint, ensuring both semantic coherence and structural consistency of the generated code. Furthermore, we introduce a sparse triplet representation for strong dependencies, significantly improving storage efficiency and computational scalability. Extensive experiments demonstrate that our approach consistently produces code with superior semantic alignment and structural fidelity compared to existing methods.

Comments12 pages

论文原文

arXiv 摘要页 · PDF 原文 · HTML 原文

↑