/ Модель

Характеристики

Лицензия
MIT
Библиотека
model2vec
Опубликована
19 ноя 2026

blink-code-16M

ЭмбеддингиТекст → embedding6 профессий

Компактная статическая модель Minish, создающая эмбеддинги кода и запросов для быстрого семантического поиска по исходному коду.

170скачиваний за 30 дней7лайковвеса обновлены28 ноя 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Эмбеддинги» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

blink-code-16M — компактная статическая модель эмбеддингов для поиска по исходному коду, разработанная Minish. Она преобразует текстовые запросы и фрагменты кода в векторы с помощью таблицы из 62 500 токенов размерностью 256 и усреднения эмбеддингов токенов. Модель содержит 16 млн параметров и предназначена для быстрого поиска без вычислительно затратной трансформерной архитектуры.

Модель подходит для поиска кода по описанию задачи, поиска похожего кода, поиска по вопросам и нахождения изменений кода по сообщениям коммитов. В README приведены результаты на CoIR, RTEB(Code) и CodeEditSearch; модель показывает сильные результаты на ряде задач, но уступает BM25 на отдельных наборах, в том числе SWE-bench и некоторых задачах поиска. Обучение включало дистилляцию CodeRankEmbed, снижение размерности и контрастивное обучение. Репозиторий использует формат safetensors и библиотеку model2vec. Лицензия — MIT.

Сценарии применения

  • поиск фрагментов кода по описанию задачи
  • поиск похожих участков исходного кода
  • поиск кода по вопросам программистов
  • поиск изменений кода по сообщениям коммитов
  • построение семантического поиска по коллекции репозиториев

Ограничения

Статическая модель использует усреднение эмбеддингов токенов и не имеет активных параметров трансформера, что ограничивает её возможности по сравнению с контекстными моделями. Результаты зависят от набора данных: на некоторых задачах BM25 показывает лучшие значения.

Для каких профессий подходит6

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

blink-code-16M is a fast static embedding model for code retrieval by Minish: a single 62,500 × 256 token embedding table (16.0M parameters, 64MB in float32) with mean pooling. It supersedes potion-code-16M-v2: it's the same size and better on every benchmark we measured, improving CoIR from 40.67 to 46.82. Static models are models without any active parameters; all model parameters are just embedding parameters. Because of this, they are many orders of magnitude faster than transformers. Although this comes at a cost, this cost is much lower than you would expect.

Usage

With model2vec:

from model2vec import StaticModel

model = StaticModel.from_pretrained("minishlab/blink-code-16M")
embeddings = model.encode(["read a json file in python", "def load(path):\n    with open(path) as f:\n        return json.load(f)"])

With model2vec-rs

use anyhow::Result;
use model2vec_rs::model::StaticModel;

fn main() -> Result<()> {
    let model = StaticModel::from_pretrained(
        "minishlab/blink-code-16M",
    )?;

    let sentences = vec![
        "read a json file".to_string(),
        "fn read_json(path: &str) -> Value".to_string(),
    ];

    let embeddings = model.encode(&sentences);
    println!("Generated {} embeddings.", embeddings.len());

    Ok(())
}

With Sentence Transformers:

from sentence_transformers import SentenceTransformer

model = SentenceTransformer("minishlab/blink-code-16M")
embeddings = model.encode(["read a json file in python", "def load(path):\n    with open(path) as f:\n        return json.load(f)"])

Results

CoIR mean against RTEB(Code) mean for blink-code-16M, BM25 and the potion-code models

All scores are nDCG@10 from mteb 2.27.1.

CoIR

CoIR is the standard code retrieval benchmark: 10 tasks covering text-to-code, code-to-code, code-to-text and code Q&A.

ModelMeanAppsCodeSearchNetCodeFeedbackMTCodeFeedbackSTCodeSearchNetCCCodeTransContestCodeTransDLCosQAStackOverflowText2SQL
blink-code-16M46.826.0853.5951.7265.8751.4257.3138.3424.3464.0355.45
BM2542.314.7640.8659.1968.1553.9747.7834.4218.7570.2624.94
potion-code-16M-v240.675.0546.3446.5054.4043.7048.5533.4824.3960.1344.12
potion-code-16M38.784.1143.1045.0952.2443.0945.4032.8122.1958.1041.66

The potion-code models ship with a 512-token cap in their tokenizer, which mteb applies: potion-code-16M-v2's card reports 39.08 with it, against 40.67 here without it.

Summary

  • Mean: blink-code-16M scores 46.82, 6.15 points above potion-code-16M-v2 and 4.51 above BM25.
  • By task: it's best on 5 of 10 tasks. BM25 is best on CodeFeedbackMT, CodeFeedbackST, CodeSearchNetCC and StackOverflow, and potion-code-16M-v2 on CosQA (24.39 against 24.34).

RTEB(Code)

RTEB(Code) is the code part of the Retrieval Embedding Benchmark. None of it is in our training data.

  • DS1000: data science tasks to their solution (pandas, numpy, matplotlib, scikit-learn, scipy).
  • HumanEval and MBPP: a programming problem to its Python solution.
  • WikiSQL: a question about a table to its SQL query.
  • FreshStack: programming tasks to their solution in Python, JavaScript or Go.
  • SWE-bench: a GitHub issue to the source files that need changing to resolve it (SWE-bench Verified).

We use the public English tasks. Apps is left out (it is in CoIR above) and Code1 is one of RTEB's private sets.

ModelMeanDS1000HumanEvalMBPPWikiSQLFreshStackSWE-bench
blink-code-16M34.6729.1764.8456.7530.9422.923.39
BM2529.9041.4538.4711.6452.1627.897.76
potion-code-16M-v229.2120.8355.3151.5322.9621.143.50
potion-code-16M27.3420.1449.9547.0322.5421.552.83

Summary

  • Mean: blink-code-16M scores 34.67, against 29.90 for BM25 and 29.21 for potion-code-16M-v2.
  • By task: it's far ahead on HumanEval and MBPP, where a short description has to find code it shares few words with (MBPP: 56.75 against 11.64 for BM25). BM25 is best on DS1000, WikiSQL, FreshStack and SWE-bench.
  • Against potion-code-16M-v2: better on 5 of 6 tasks; SWE-bench is below 4 for both.

CodeEditSearch

CodeEditSearch retrieves a code change (a diff) from its commit message, 1,000 commits per language from CommitPackFT. Seven of the 13 languages (TypeScript, C, C++, Rust, Swift, Scala, Shell) are not in our training data.

ModelMeanPythonJSTSGoRubyJavaPHPCC++RustSwiftScalaShell
blink-code-16M49.5853.154.554.752.654.051.750.741.441.844.249.647.548.8
potion-code-16M-v246.5051.651.250.549.350.649.547.237.436.443.747.844.245.0
potion-code-16M45.0649.750.149.647.249.348.346.136.534.343.847.140.643.4
BM2544.3948.747.847.948.248.941.341.335.037.944.039.344.652.0

Summary

  • Mean: blink-code-16M scores 49.58, against 46.50 for potion-code-16M-v2 and 44.39 for BM25.
  • Languages we didn't train on: it beats potion-code-16M-v2 on all 13 languages, including the seven unseen ones; the largest gains are on C++ (+5.4), TypeScript (+4.2) and C (+4.0). BM25 is best on Shell.

Hybrid search with BM25

Combining blink-code-16M and BM25 with hybrid search gives the following results. We take the top 100 documents from each, scale each query's scores to [0, 1] (min-max) and average them with equal weight.

ModelCoIRRTEB(Code)CodeEditSearch
blink-code-16M + BM2549.3636.0054.71
blink-code-16M46.8234.6749.58
BM2542.3129.9044.39

The combination adds 2.54 points on CoIR, 1.33 on RTEB(Code) and 5.13 on CodeEditSearch over blink-code-16M alone.

Training

We followed a four-step procedure, starting from potion-code-16M-v2's recipe.

1. Tokenizer and distillation

We train a 62,500-token uncased WordPiece tokenizer on 1.2M queries and documents from CornStack (Go, Java, JavaScript, PHP, Python and Ruby) plus the 4.1M texts of the CoIR train splits. We then distill CodeRankEmbed into it with Model2Vec, reducing the dimensions to 256 with PCA and applying SIF weighting.

2. Tokenlearn

We then distill CodeRankEmbed into the model with Tokenlearn, on 1.2M CornStack documents and queries embedded by CodeRankEmbed.

3. Contrastive training

We train with a contrastive loss (in-batch negatives plus one hard negative per pair) for 3 epochs, with batch size 4096, learning rate 0.05 and a cosine schedule, on 4.5M triplets from two datasets we built for this model:

  • coir-train-hard-negatives (2.09M): query and document pairs from the train splits of the CoIR tasks, with hard negatives mined in two rounds. We first mine them with CodeRankEmbed and train on them with this recipe. We then mine them again with the model this produces and train once more: a static model's negatives are closer to what is actually hard for a static model than those of a transformer (see the ablation below).
  • cornstack-hard-negatives (2.4M, 400k per language): triplets from CornStack, using the highest-scoring of CornStack's own mined negatives that still scores below the document.

Decontamination. CoIR's train and test splits share queries and documents, so we remove every triplet whose query is a CoIR test query, or whose document or negative is a relevant CoIR test document (matched after whitespace normalization). This removes 19,073 CoIR train pairs (0.9%) and 6 CornStack triplets. See the dataset cards for details.

4. Weight averaging

The final model is 20% of the Tokenlearn model from step 2 and 80% of the contrastive model from step 3.

Ablation

To show the effect of each step of our training process, this table shows how much each one adds on our benchmarks (in brackets: the change from the row above). Each row adds one thing to the row above it.

StepCoIRRTEB(Code)CodeEditSearchsemble
1. Distill CodeRankEmbed32.6125.0935.720.559
2. + Our code tokenizer with an expanded vocabulary34.50 (+1.89)23.82 (-1.27)39.82 (+4.10)0.609 (+0.050)
3. + Tokenlearn40.03 (+5.53)26.75 (+2.93)44.23 (+4.41)0.638 (+0.029)
4. + Contrastive training on CornStack42.60 (+2.57)33.41 (+6.66)49.81 (+5.58)0.653 (+0.015)
5. + CoIR train pairs45.92 (+3.32)34.60 (+1.19)49.58 (-0.23)0.642 (-0.011)
6. + Hard negatives from CodeRankEmbed46.19 (+0.27)34.42 (-0.18)49.20 (-0.38)0.644 (+0.002)
7. + Hard negatives re-mined with the step-6 model46.74 (+0.55)34.88 (+0.46)49.20 (0.00)0.643 (-0.001)
8. + Weight averaging46.82 (+0.08)34.67 (-0.21)49.58 (+0.38)0.652 (+0.009)

semble is our code search library; we run only its semantic benchmark, to show the isolated effect of the model. We don't include semble results for the other models because trained models all saturate around 0.65, but we include it here as a control task for the effect of each step.

Library Authors

Model2Vec was developed by the Minish team consisting of Stephan Tulkens and Thomas van Dongen.

Citation

Please cite the Model2Vec repository if you use this model in your work.

@software{minishlab2024model2vec,
  author       = {Stephan Tulkens and {van Dongen}, Thomas},
  title        = {Model2Vec: Fast State-of-the-Art Static Embeddings},
  year         = {2024},
  publisher    = {Zenodo},
  doi          = {10.5281/zenodo.17270888},
  url          = {https://github.com/MinishLab/model2vec},
  license      = {MIT}
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · model2vec

Можно запустить

Подбираем GPU…

Ревизия весов
7cdb353

0 моделей