Code-Embed-v2: A Compact Multilingual Code Embedding Model Fine-Tuned from UniXcoder

We describe Code-Embed-v2, a 129.5M-parameter bi-encoder for code search, fine-tuned from UniXcoder-base on the CodeSearchNet train split in six programming languages (Python, JavaScript, Go, Java, Ruby, PHP). Training runs three one-epoch stages: SimCSE on functions, a multiple-negatives ranking loss on docstring-function pairs with in-batch negatives, and a Matryoshka variant of the same loss at six output sizes from 64 to 1536 dimensions. A two-layer projection head maps mean-pooled 768-dimensional backbone states to 1536-dimensional unit vectors. The maximum input length is 1,024 tokens. On the official MTEB evaluation the model scores 0.5475 on MTEB(Code, v1), 0.5343 on CoIR and 0.4362 on CoREB(v1), against 0.3657, 0.3356 and 0.3531 for UniXcoder-base run through the same harness. It improves on the base model on 16 of 18 tasks. Three of the evaluated tasks are built from CodeSearchNet and are therefore in-distribution. Retraining the same recipe on CoRNStack, with no CodeSearchNet data, matches these three scores (mean 0.7182 against 0.7242) but keeps less than a third of the gain on the other 15 tasks (0.3613 against 0.4677, base 0.3202). Quality at truncated dimensions is not measured and is left as an open item.

Authors

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-11-25
DOI
https://doi.org/10.5281/zenodo.24527107
Primary Topic
Software Engineering Research
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
preprint

Code-Embed-v2: A Compact Multilingual Code Embedding Model Fine-Tuned from UniXcoder

Divakant Pandey
Zenodo (CERN European Organization for Nuclear Research)
Software Engineering Research
preprint

Code-Embed-v2: A Compact Multilingual Code Embedding Model Fine-Tuned from UniXcoder

Divakant Pandey
preprint en

Abstract

We describe Code-Embed-v2, a 129.5M-parameter bi-encoder for code search, fine-tuned from UniXcoder-base on the CodeSearchNet train split in six programming languages (Python, JavaScript, Go, Java, Ruby, PHP). Training runs three one-epoch stages: SimCSE on functions, a multiple-negatives ranking loss on docstring-function pairs with in-batch negatives, and a Matryoshka variant of the same loss at six output sizes from 64 to 1536 dimensions. A two-layer projection head maps mean-pooled 768-dimensional backbone states to 1536-dimensional unit vectors. The maximum input length is 1,024 tokens. On the official MTEB evaluation the model scores 0.5475 on MTEB(Code, v1), 0.5343 on CoIR and 0.4362 on CoREB(v1), against 0.3657, 0.3356 and 0.3531 for UniXcoder-base run through the same harness. It improves on the base model on 16 of 18 tasks. Three of the evaluated tasks are built from CodeSearchNet and are therefore in-distribution. Retraining the same recipe on CoRNStack, with no CodeSearchNet data, matches these three scores (mean 0.7182 against 0.7242) but keeps less than a third of the gain on the other 15 tasks (0.3613 against 0.4677, base 0.3202). Quality at truncated dimensions is not measured and is left as an open item.

Zenodo (CERN European Organization for Nuclear Research)
Software Engineering Research
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon