arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.27063cs.LGcs.AIcs.CLcs.ITcs.SEmath.IT
收藏

迈向一种算法相似性的度量

Towards a Measure of Algorithm Similarity

Shairoz Sohail, Taher Ali

AI总结:

针对算法差异判定不可计算且概念模糊的问题,提出EMOC框架将算法实现嵌入特征空间,并构建PACD数据集,验证了其在算法聚类、近似重复检测及LLM生成程序多样性量化等下游任务中的有效性。

摘要:

给定针对同一问题的两种算法,我们能否判定它们是否存在实质差异?在最一般的情况下,该问题是不可计算的;而在经验层面上,相互竞争的相似性概念也使其变得模糊。然而,在许多应用(如克隆检测或程序合成)中,需要一种实用且一致的相似性度量标准。我们回顾了现有的等价与相似性概念,并引入了EMOC:一个评估-内存-操作-复杂度(Evaluation-Memory-Operations-Complexity)框架,该框架将算法实现嵌入到适用于下游任务的特征空间中。我们编译了PACD,这是一个包含三个问题经验证的Python实现的数据集,并表明EMOC特征支持算法类型的聚类与分类、近似重复项的检测,以及对LLM生成程序多样性的量化。我们发布了用于计算EMOC嵌入的代码、数据和工具,以促进可复现性及未来关于算法相似性的研究。

英文摘要:

Given two algorithms for the same problem, can we determine whether they are meaningfully different? In full generality, the question is uncomputable, and empirically it is muddied by competing notions of similarity. Yet, in many applications (such as clone detection or program synthesis) a pragmatic and consistent similarity metric is necessary. We review existing equivalence and similarity notions and introduce EMOC: An Evaluation-Memory-Operations-Complexity framework that embeds algorithm implementations into a feature space suitable for downstream tasks. We compile PACD, a curated dataset of verified Python implementations across three problems, and show that EMOC features support clustering and classification of algorithm types, detection of near-duplicates, and quantification of diversity in LLM-generated programs. Code, data, and utilities for computing EMOC embeddings are released to facilitate reproducibility and future work on algorithm similarity.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑