Lost in the Latent Space: How Code Embeddings Represent Functional Intent and Implementation Fidelity

Lu Sun, Yuheng Huang, Lei Ma, Zhijie Wang
10/29/2026
cs.SEcs.CLcs.IR

No confident code implementation found for this paper.

Abstract

Code embedding models have become a key building block for many software engineering applications, yet their internal representations remain poorly understood. Existing evaluations tend to focus on downstream task performance, offering limited insight into whether a single embedding can support both functional abstraction and implementation-sensitive analysis.

Show full abstract

To address this gap, we present a large-scale empirical study of 14 state-of-the-art code embedding models. We evaluate their representational behavior through three complementary analyses: supervised probing for functional abstraction and implementation fidelity, zero-shot retrieval experiments to assess geometric similarity, and controlled perturbation experiments that measure embedding responses to semantics-preserving code transformations. The results reveal a consistent abstraction-fidelity tension: models that better preserve stylistic and structural signals tend to do so at the expense of semantic generalization, while models with similar retrieval performance can nevertheless respond very differently to the same implementation changes. Overall, our findings suggest that a single universal code representation remains out of reach, motivating more representation-aware evaluation, selection, and deployment of code embedding models in software engineering.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{sun2026lost,
  title  = {Lost in the Latent Space: How Code Embeddings Represent Functional Intent and Implementation Fidelity},
  author = {Lu Sun and Yuheng Huang and Lei Ma and Zhijie Wang},
  year   = {2026},
  eprint = {2610.39519},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2610.39519v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2610.39519.svg)](https://codeofpaper.com/paper/2610.39519)

Discussion