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.
Figures & tables
RQ
Evaluation
Intent
RQ1
Algorithm-Tag Prediction
Measure recoverability of functional abstraction in frozen embeddings.
RQ1
Author Attribution
Measure recoverability of implementation fidelity in frozen embeddings.
RQ2
Cross-Language Functional Retrieval
Test whether code with the same problem tags is retrieved across languages.
RQ2
Cross-Task Author Retrieval
Test whether code by the same author is retrieved.
RQ3
Controlled Transformation Analysis
Measure how controlled implementation changes move embeddings.
TABLE I : Overview of our evaluations.
Category
Controlled change
Data and Declaration
Modify literals, initialization patterns, declarations, or value-preserving container forms.
Control Flow
Rewrite loops, branches, and condition structure while preserving the executed behavior.
Function
Restructure helper boundaries and abstraction structure while preserving the externally tested API.
Dead/Bogus Code
Insert semantically inert code such as unreachable branches or unused helpers.
Format & Rename
Modify lexical and layout cues such as local identifiers, whitespace, wrapping, and comments.
TABLE II : Controlled implementation transformations.
Fig. 1 : An example of implementation changes from our study. The original program’s for-loop was replaced by a while-loop.
TABLE III : Unified model pool. Models are grouped by official positioning and sorted by release year within each group. Parameter counts follow official documentation when available; a dash indicates no public parameter count.
Model
C++
Java
Python
Doubao-Large
0.542
0.505
0.518
CodeR
0.518
0.532
0.512
Voyage-Code-3
0.514
0.530
0.515
Qwen3-4B
0.490
0.512
0.488
Qwen3-8B
0.487
0.504
0.498
Jina-Code-1.5B
0.484
0.497
0.495
TABLE IV : Algorithm-tag prediction sample-F1 by language. Rows are sorted by the three-language average.
Model
C++
Java
Python
TE3-Large
0.988
0.977
0.978
Llama-Embed-8B
0.990
0.969
0.945
Ada-002
0.988
0.935
0.940
TE3-Small
0.968
0.962
0.926
BGE-M3
0.917
0.954
0.924
Doubao-Large
0.923
0.924
0.921
TABLE V : Author-attribution macro-F1 by language. Rows are sorted by the three-language average.
Fig. 2 : Same-problem versus same-author Hit@10 across the 14 models. Circles denote code-focused models, squares denote general-purpose models, the line is a linear fit.
Model
Functional
Author
CodeR
0.996
0.481
Qwen3-8B
0.991
0.323
Qwen3-4B
0.990
0.332
Voyage-Code-3
0.985
0.471
Jina-Code-1.5B
0.985
0.338
Qwen3-0.6B
0.942
0.413
TABLE VI : Hit@10 for cross-language retrieval. Functional retrieval ranks implementations in other languages; author retrieval ranks same-author implementations.
Data/Decl.
Control
Function
Dead/Bogus
Format/Rename
Model
low
med.
high
low
med.
high
low
med.
high
low
med.
high
low
med.
high
CodeR
1.717
4.601
10.209
1.460
3.344
7.282
4.227
7.838
15.403
4.123
10.032
22.136
3.262
5.926
12.204
Qwen3-8B
1.085
2.481
4.392
1.013
2.033
3.656
1.688
3.355
6.434
2.373
5.263
8.684
2.805
4.268
7.620
Qwen3-4B
1.090
2.392
4.168
0.995
2.039
3.479
1.725
3.465
6.416
2.086
4.919
10.526
3.134
4.589
7.407
Voyage-Code-3
0.605
1.704
3.794
0.558
1.390
2.853
0.959
2.321
5.370
1.733
3.881
8.935
1.572
2.413
5.080
Jina-Code-1.5B
1.706
5.181
10.053
1.269
3.121
6.888
2.617
6.426
14.370
3.942
11.361
27.248
2.670
4.063
9.306
TABLE VII : Scaled cosine distance from each original program to its test-passing transformed version, averaged over languages. low ( 0≤r≤0.33 ), med. ( 0.33<r≤0.66 ), and high ( r>0.66 ) denote transformation strength.