I/O graph

Code

jina-embeddings-v2-base-code

Task

Vector

Pareto front
30M100M300M1B3.0B10B40506070bge-base-en-v1.5bge-m3bge-small-en-v1.5CodeRankEmbedCodeSage-baseCodeSage-largeCodeSage-large-v2CodeSage-smallCodeXEmbed-7BContrievere5-base-v2e5-mistral-7b-instructe5-small-v2granite-embedding-engli…granite-embedding-small…gte-base-en-v1.5gte-modernbert-basegte-Qwen2-1.5B-instructjina-code-embeddings-0.…jina-embeddings-v3jina-embeddings-v4modernbert-embed-baseNV-Embed-v2SFR-Embedding-2_RSFR-Embedding-Code-2B_RSFR-Embedding-Code-400M…snowflake-arctic-embed-…UniXcoderParameters (log)nDCG@10
This model
On the front
Jina AI
Other
CoIR
52.24
Parameters
161M
Rank by score
19 / 31
Pareto front
Behind it
Value distribution
AUC 0.8156
Corpus
Translation pairs
Doc retrieval
Code
0.7500.000.200.400.600.80
Related10.9%
Hard negative1.5%
Unrelated1.0%
Recommended cutoffs
FPR 0.1 · 0.579
FPR 0.01 · 0.750
FPR 0.001 · 0.806
FPR 0.0001 · 0.839
balanced · 0.369
AUC
0.8156
Noise ceiling
0.805
Recall cliff
0.204
Pairs measured
119 / 11k
Vector components
-0.160.040.25
σ 0.0361 · 183k values
Embedding geometry
0768
Per-dimension mean, hover for a range
Noise floor
0.404
Effective dims
43 / 768
Choose models to compare

Overview

jina-embeddings-v2-base-code is a 161M-parameter code embedding model that maps programming code across 30 languages into a shared 768-dimensional semantic space. With an 8,192-token context window, it was the first Jina embedding model to support whole-function and multi-file code retrieval without truncation. It led nine out of fifteen CodeNetSearch benchmarks at release.

Methods

The model uses a transformer-based encoder with 161M parameters, trained on diverse programming language datasets with emphasis on Python, JavaScript, Java, PHP, Go, and Ruby. The 8,192-token context window (via ALiBi positional encodings) enables processing of entire functions and small files in a single forward pass. Training included contrastive pretraining on code-text pairs (natural language descriptions paired with code implementations) followed by supervised fine-tuning on code retrieval datasets with hard-negative mining. The 768-dimensional embeddings capture both syntactic structure and semantic meaning, enabling cross-language code matching where functionally equivalent code in different languages maps to nearby regions of the embedding space.

Performance

At release, the model led nine of fifteen CodeNetSearch benchmarks, outperforming Microsoft and Salesforce code embedding models while maintaining a more efficient 307MB footprint. Its 8,192-token context was 4–16× larger than competing code embedding models, enabling retrieval over entire files and complex code blocks. Cross-language code understanding was a particular strength, matching functionally equivalent snippets across different programming languages. In 2026, jina-code-embeddings-0.5b and jina-code-embeddings-1.5b supersede this model with autoregressive backbones, 32K context, and significantly higher retrieval accuracy.

Best Practice

Use for code search, documentation retrieval, and code reuse in monolingual or cross-language codebases. For documents exceeding 8,192 tokens, implement chunking at function or class boundaries. The model integrates with vector databases (Qdrant, Weaviate, MongoDB) and RAG frameworks. For new code-search projects, prefer jina-code-embeddings-1.5b (1.5B params, 32K context, SOTA accuracy) or jina-code-embeddings-0.5b (494M params, edge-friendly). CUDA-capable GPU recommended for production. Strongest performance on Python, JavaScript, Java, PHP, Go, and Ruby; supports 30+ languages with graceful degradation.

Blogs that mention this model