mlsanityData to 24 Nov 2026

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

arXiv 2610.39519 ↗Submitted 29 Oct 2026cs.SE cs.CL cs.IRcited by 0

Not on the map. Why?

Abstract (arXiv)

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. 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.

Key facts. No citing papers in the map yet (data through 24 Nov 2026). Builds on 49 of its 67 references that are in the map. Submitted 29 Oct 2026.

Builds on

49 of 67 references.

References · 49

  1. 2017A Unified Approach to Interpreting Model Predictionscited by 6,783
  2. 2016"Why Should I Trust You?": Explaining the Predictions of Any Classifiercited by 5,156
  3. 2013Efficient Estimation of Word Representations in Vector Spacecited by 4,529
  4. 2023Code Llama: Open Foundation Models for Codecited by 2,242
  5. 2016Understanding intermediate layers using linear classifier probescited by 1,541
  6. 2025Qwen3 Embedding: Advancing Text Embedding and Reranking Through Foundation Modelscited by 1,507
  7. 2022Text Embeddings by Weakly-Supervised Contrastive Pre-trainingcited by 1,362
  8. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,337
  9. 2024M3-Embedding: Multi-Linguality, Multi-Functionality, Multi-Granularity Text Embeddings Through Self-Knowledge Distillationcited by 1,199
  10. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 926
  11. 2023StarCoder: may the source be with you!cited by 851
  12. 2019Designing and Interpreting Probes with Control Taskscited by 736
37 more
  1. 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 684
  2. 2022MTEB: Massive Text Embedding Benchmarkcited by 680
  3. 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 622
  4. 2022Text and Code Embeddings by Contrastive Pre-Trainingcited by 378
  5. 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 371
  6. 2021Unified Pre-training for Program Understanding and Generationcited by 370
  7. 2023CodeGeeX: A Pre-Trained Model for Code Generation with Multilingual Benchmarking on HumanEval-Xcited by 315
  8. 2019Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networkscited by 287
  9. 2014Understanding image representations by measuring their equivariance and equivalencecited by 256
  10. 2018code2vec: Learning Distributed Representations of Codecited by 255
  11. 2018code2seq: Generating Sequences from Structured Representations of Codecited by 182
  12. 2023LongCoder: A Long-Range Pre-trained Language Model for Code Completioncited by 119
  13. 2024CodeRAG-Bench: Can Retrieval Augment Code Generation?cited by 98
  14. 2021CoSQA: 20,000+ Web Queries for Code Search and Question Answeringcited by 81
  15. 2024CoIR: A Comprehensive Benchmark for Code Information Retrieval Modelscited by 64
  16. 2025Llama-Embed-Nemotron-8B: A Universal Text Embedding Model for Multilingual and Cross-Lingual Taskscited by 54
  17. 2023Look Before You Leap: An Exploratory Study of Uncertainty Measurement for Large Language Modelscited by 46
  18. 2020CC2Vec: Distributed Representations of Code Changescited by 40
  19. 2024CodeXEmbed: A Generalist Embedding Model Family for Multiligual and Multi-task Code Retrievalcited by 38
  20. 2023Code Execution with Pre-trained Language Modelscited by 37
  21. 2020Evaluating Representation Learning of Code Changes for Predicting Patch Correctness in Program Repaircited by 24
  22. 2020InferCode: Self-Supervised Learning of Code Representations by Predicting Subtreescited by 24
  23. 2025Retrieval-Augmented Code Generation: A Survey with Focus on Repository-Level Approachescited by 24
  24. 2015On Invariance and Selectivity in Representation Learningcited by 19
  25. 2025Efficient Code Embeddings from Code Generation Modelscited by 15
  26. 2026MAEB: Massive Audio Embedding Benchmarkcited by 12
  27. 2025Towards an Understanding of Context Utilization in Code Intelligencecited by 11
  28. 2024Understanding the Fundamental Design Decisions of Retrieval-Augmented Generation Systemscited by 9
  29. 2025Towards A Generalist Code Embedding Model Based On Massive Data Synthesiscited by 9
  30. 2025On LLMs' Internal Representation of Code Correctnesscited by 9
  31. 2023TransformCode: A Contrastive Learning Framework for Code Embedding via Subtree Transformationcited by 5
  32. 2024Coding-PTMs: How to Find Optimal Code Pre-trained Models for Code Embedding in Vulnerability Detection?cited by 5
  33. 2021deGraphCS: Embedding Variable-based Flow Graph for Neural Code Searchcited by 4
  34. 2023COMEX: A Tool for Generating Customized Source Code Representationscited by 4
  35. 2024Repository-Level Graph Representation Learning for Enhanced Security Patch Detectioncited by 4
  36. 2023How to get better embeddings with code pre-trained models? An empirical studycited by 2
  37. 2026Enhancing Code Understanding for Impact Analysis by Combining Transformers and Program Dependence Graphscited by 2

Built on by

Not cited yet.