Functional Consistency of LLM Code Embeddings: A Self-Evolving Data Synthesis Framework for Benchmarking
Zhuohao Li, Wenqing Chen, Jianxing Yu, and Zhichao Lu

TL;DR
This paper introduces a self-evolving data synthesis framework to create diverse benchmarks for evaluating the functional semantic understanding of LLM code embeddings, improving their performance on various code analysis tasks.
Contribution
The paper presents a novel framework for generating diverse code benchmarks that better reflect functional semantics, enhancing the evaluation and training of LLM code embeddings.
Findings
Embedding models improve performance on code tasks with the new datasets
Existing datasets mainly capture syntactic properties of code
The framework enhances the generalization of code embeddings
Abstract
Embedding models have demonstrated strong performance in tasks like clustering, retrieval, and feature extraction while offering computational advantages over generative models and cross-encoders. Benchmarks such as MTEB have shown that text embeddings from large language models (LLMs) capture rich semantic information, but their ability to reflect code-level functional semantics remains unclear. Existing studies largely focus on code clone detection, which emphasizes syntactic similarity and overlooks functional understanding. In this paper, we focus on the functional consistency of LLM code embeddings, which determines if two code snippets perform the same function regardless of syntactic differences. We propose a novel data synthesis framework called Functionality-Oriented Code Self-Evolution to construct diverse and challenging benchmarks. Specifically, we define code examples…
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.
