lightonai/LateOn-Code-edge
- License
- apache-2.0
- Size
- not mirrored yet
No official torrent yet — requesting it tells the flock what to host next. You cannot seed a catalog-only page.
Cataloged from lightonai/LateOn-Code-edge
All models by lightonai →No official torrent yet — requesting it tells the flock what to host next. You cannot seed a catalog-only page.
Cataloged from lightonai/LateOn-Code-edge
All models by lightonai →
The LateOn-Code collection is composed of PyLate models optimized for code retrieval. These late interaction models are first pre-trained following the methodology of CoRNStack. These pre-trained models are then further fine-tuned on train sets of CoIR using the nv-retriever methodology to mine hard negatives while preventing false negatives.
We started from the two best ColBERT models on the BEIR benchmark for their respective sizes. The first one, LateOn-Code is based on in-house LateOn model, a new version of GTE-ModernColBERT-v1 built on ModernBERT-base (also developed at LightOn). This version underwent significantly deeper training, crossing the 57 mark on BEIR, almost a 2.5-point improvement and is thus SOTA by a large margin. We'll release this base model along with training data and boilerplates in the near future, so stay tuned! The second, LateOn-Code-edge is a smaller model based on the edge-colbert model family from mixedbread, using the smallest variant (Ettin-17M) for maximum efficiency. For more details on the training setup, please refer to our blogpost.
The original CoRNStack data in a format compatible with PyLate can be found here while the fine-tuning data can be found here. Training boilerplates can be found here in the PyLate repository

Pre-trained models achieve very competitive results as the 17M model outperforms the very strong granite-embedding-small-english-r2 by an average of 1.7. This is truly impressive, as the granite model is almost three times bigger (17M vs 48M), but is also a beast on its own in the <100M parameters range. It also outperforms the larger granite variant (149M). The larger version nicely scales by improving over the performance of its little sibling by 6.5 on average.
Although the pre-training results are already very impressive given that they are mostly out-of-domain, running a proper fine-tuning using the training data of CoIR significantly boost the performance of the models. Notably, the 17M model increases from 57.50 to 66.64 (+9.14), getting pretty close to EmbeddingGemma-300M while being 17 times smaller. The larger one increases from 63.77 to 74.12 (+10.35), strongly outperforming EmbeddingGemma-300M and getting closer to strong LLM models such as Qwen3-Embedding-0.6B and C2LLM-0.5B while being much smaller.
Best result across all sizes is underlined. Best within each size category is bolded.
The LateOn-Code family model can easily be used within ColGrep, an easy-to-use search tool that give their powerful search capabilities to coding agent. It has been designed to extend grep capabilities to get the best of both world and is very effective to enhance the quality of the answer while diminishing answer time and tokens consumption. Given the performance of the very light-weight 17M model, it can easily run quickly on any computer.
For more information about ColGrep, please refer to the official documentation
This is a multi-vector (ColBERT-style late interaction) embedding model finetuned from lightonai/LateOn-Code-edge-pretrain on the apps, synthetictext2sql, cosqa, codefeedbackst, codefeedbackmt, stackoverflowqa, codetranscontest, codetransdl, CodeSearchNet_go, CodeSearchNet_java, CodeSearchNet_javascript, CodeSearchNet_php, CodeSearchNet_python, CodeSearchNet_ruby, CodeSearchNet_ccr_go, CodeSearchNet_ccr_java, CodeSearchNet_ccr_javascript, CodeSearchNet_ccr_php, CodeSearchNet_ccr_python and CodeSearchNet_ccr_ruby datasets. It maps sentences & paragraphs to sequences of 48-dimensional dense vectors and can be used for semantic textual similarity using the MaxSim operator.
This model can be used with Sentence Transformers as a multi-vector (ColBERT-style late interaction) retriever via the MultiVectorEncoder:
First install the PyLate library:
Use this model with PyLate to index and retrieve documents. The index uses FastPLAID for efficient similarity search.
Load the ColBERT model and initialize the PLAID index, then encode and index your documents:
Note that you do not have to recreate the index and encode the documents every time. Once you have created an index and added the documents, you can re-use the index later by loading it:
Once the documents are indexed, you can retrieve the top-k most relevant documents for a given set of queries. To do so, initialize the ColBERT retriever with the index you want to search in, encode the queries and then retrieve the top-k documents to get the top matches ids and relevance scores:
If you only want to use the ColBERT model to perform reranking on top of your first-stage retrieval pipeline without building an index, you can simply use rank function and pass the queries and documents to rerank:
['CodeSearchNetPython', 'CodeSearchNetJavascript', 'CodeSearchNetGo', 'CodeSearchNetRuby', 'CodeSearchNetJava', 'CodeSearchNetPhp']pylate.evaluation.pylate_information_retrieval_evaluator.PyLateInformationRetrievalEvaluatorCodeSearchNet_meanpylate.evaluation.code_search_network_evaluator.CodeSearchNetworkEvaluatorpylate.losses.contrastive.Contrastivepylate.losses.contrastive.Contrastivepylate.losses.contrastive.Contrastivepylate.losses.contrastive.Contrastivepylate.losses.contrastive.Contrastivepylate.losses.contrastive.Contrastivepylate.losses.contrastive.Contrastivepylate.losses.contrastive.Contrastivepylate.losses.contrastive.Contrastivepylate.losses.contrastive.Contrastivepylate.losses.contrastive.Contrastivepylate.losses.contrastive.Contrastivepylate.losses.contrastive.Contrastivepylate.losses.contrastive.Contrastivepylate.losses.contrastive.Contrastivepylate.losses.contrastive.Contrastivepylate.losses.contrastive.Contrastivepylate.losses.contrastive.Contrastivepylate.losses.contrastive.Contrastivepylate.losses.contrastive.Contrastiveeval_strategy: stepsper_device_train_batch_size: 128per_device_eval_batch_size: 128learning_rate: 3e-05num_train_epochs: 1bf16: Truedataloader_num_workers: 8accelerator_config: {'split_batches': True, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}overwrite_output_dir: Falsedo_predict: Falseeval_strategy: stepsprediction_loss_only: Trueper_device_train_batch_size: 128per_device_eval_batch_size: 128per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_accumulation_steps: 1eval_accumulation_steps: Nonetorch_empty_cache_steps: Nonelearning_rate: 3e-05weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 1max_steps: -1lr_scheduler_type: linearlr_scheduler_kwargs: {}warmup_ratio: 0.0warmup_steps: 0log_level: passivelog_level_replica: warninglog_on_each_node: Truelogging_nan_inf_filter: Truesave_safetensors: Truesave_on_each_node: Falsesave_only_model: Falserestore_callback_states_from_checkpoint: Falseno_cuda: Falseuse_cpu: Falseuse_mps_device: Falseseed: 42data_seed: Nonejit_mode_eval: Falsebf16: Truefp16: Falsefp16_opt_level: O1half_precision_backend: autobf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonelocal_rank: 0ddp_backend: Nonetpu_num_cores: Nonetpu_metrics_debug: Falsedebug: []dataloader_drop_last: Truedataloader_num_workers: 8dataloader_prefetch_factor: Nonepast_index: -1disable_tqdm: Falseremove_unused_columns: Truelabel_names: Noneload_best_model_at_end: Falseignore_data_skip: Falsefsdp: []fsdp_min_num_params: 0fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}fsdp_transformer_layer_cls_to_wrap: Noneaccelerator_config: {'split_batches': True, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}parallelism_config: Nonedeepspeed: Nonelabel_smoothing_factor: 0.0optim: adamw_torch_fusedoptim_args: Noneadafactor: Falsegroup_by_length: Falselength_column_name: lengthproject: huggingfacetrackio_space_id: trackioddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falsedataloader_pin_memory: Truedataloader_persistent_workers: Falseskip_memory_metrics: Trueuse_legacy_prediction_loop: Falsepush_to_hub: Falseresume_from_checkpoint: Nonehub_model_id: Nonehub_strategy: every_savehub_private_repo: Nonehub_always_push: Falsehub_revision: Nonegradient_checkpointing: Falsegradient_checkpointing_kwargs: Noneinclude_inputs_for_metrics: Falseinclude_for_metrics: []eval_do_concat_batches: Truefp16_backend: autopush_to_hub_model_id: Nonepush_to_hub_organization: Nonemp_parameters:auto_find_batch_size: Falsefull_determinism: Falsetorchdynamo: Noneray_scope: lastddp_timeout: 1800torch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Noneinclude_tokens_per_second: Falseinclude_num_input_tokens_seen: noneftune_noise_alpha: Noneoptim_target_modules: Nonebatch_eval_metrics: Falseeval_on_start: Falseuse_liger_kernel: Falseliger_kernel_config: Noneeval_use_gather_object: Falseaverage_tokens_across_devices: Trueprompts: Nonebatch_sampler: batch_samplerrouter_mapping: {}learning_rate_mapping: {}# macOS / Linuxcurl --proto '=https' --tlsv1.2 -LsSf https://github.com/lightonai/next-plaid/releases/latest/download/colgrep-installer.sh | sh
# Windows (PowerShell)powershell -c "irm https://github.com/lightonai/next-plaid/releases/latest/download/colgrep-installer.ps1 | iex"# Semantic search — find code by meaningcolgrep "function that retries HTTP requests"
# Regex searchcolgrep -e "async fn\s+\w+"
# Hybrid — regex narrows candidates, semantics ranks themcolgrep -e "Result<" "error handling" --include="*.rs"colgrep --install-claude-code# Set the modelcolgrep set-model lightonai/LateOn-Code # default: lightonai/LateOn-Code-edgeColBERT( (0): Transformer({'max_seq_length': 2047, 'do_lower_case': True, 'architecture': 'ModernBertModel'}) (1): Dense({'in_features': 256, 'out_features': 512, 'bias': False, 'activation_function': 'torch.nn.modules.linear.Identity', 'use_residual': False}) (2): Dense({'in_features': 512, 'out_features': 48, 'bias': False, 'activation_function': 'torch.nn.modules.linear.Identity', 'use_residual': False}))pip install "sentence-transformers>=6.0.0"from sentence_transformers import MultiVectorEncoder
model = MultiVectorEncoder("lightonai/LateOn-Code-edge")
query = "Which planet is known as the Red Planet?"documents = [ "Venus is often called Earth's twin because of its similar size and proximity.", "Mars, known for its reddish appearance, is often referred to as the Red Planet.", "Jupiter, the largest planet in our solar system, has a prominent red spot.", "Saturn, famous for its rings, is sometimes mistaken for the Red Planet.",]
query_embeddings = model.encode_query(query)document_embeddings = model.encode_document(documents)print(query_embeddings.shape, document_embeddings[0].shape)# (12, 48) (18, 48)
# MaxSim late-interaction scoring (higher is more relevant)scores = model.similarity(query_embeddings, document_embeddings)print(scores)# tensor([[4.7185, 7.8521, 7.0537, 7.3523]])pip install -U pylatefrom pylate import indexes, models, retrieve
# Step 1: Load the ColBERT modelmodel = models.ColBERT( model_name_or_path="pylate_model_id",)
# Step 2: Initialize the PLAID indexindex = indexes.PLAID( index_folder="pylate-index", index_name="index", override=True, # This overwrites the existing index if any)
# Step 3: Encode the documentsdocuments_ids = ["1", "2", "3"]documents = ["document 1 text", "document 2 text", "document 3 text"]
documents_embeddings = model.encode( documents, batch_size=32, is_query=False, # Ensure that it is set to False to indicate that these are documents, not queries show_progress_bar=True,)
# Step 4: Add document embeddings to the index by providing embeddings and corresponding idsindex.add_documents( documents_ids=documents_ids, documents_embeddings=documents_embeddings,)# To load an index, simply instantiate it with the correct folder/name and without overriding itindex = indexes.PLAID( index_folder="pylate-index", index_name="index",)# Step 1: Initialize the ColBERT retrieverretriever = retrieve.ColBERT(index=index)
# Step 2: Encode the queriesqueries_embeddings = model.encode( ["query for document 3", "query for document 1"], batch_size=32, is_query=True, # # Ensure that it is set to False to indicate that these are queries show_progress_bar=True,)
# Step 3: Retrieve top-k documentsscores = retriever.retrieve( queries_embeddings=queries_embeddings, k=10, # Retrieve the top 10 matches for each query)from pylate import rank, models
queries = [ "query A", "query B",]
documents = [ ["document A", "document B"], ["document 1", "document C", "document B"],]
documents_ids = [ [1, 2], [1, 3, 2],]
model = models.ColBERT( model_name_or_path="pylate_model_id",)
queries_embeddings = model.encode( queries, is_query=True,)
documents_embeddings = model.encode( documents, is_query=False,)
reranked_documents = rank.rerank( documents_ids=documents_ids, queries_embeddings=queries_embeddings, documents_embeddings=documents_embeddings,)@misc{LateOn-Code, title = {LateOn-Code: a Family of State-Of-The-Art Late Interaction Code Retrieval Models}, author = {Chaffin, Antoine}, url = {https://huggingface.co/collections/lightonai/lateon-code}, year = {2026}}@software{next-plaid, title = {NextPlaid, ColGREP: Multi-vector search, from database to coding agents.}, url = {https://github.com/lightonai/next-plaid}, author = {Raphaël Sourty}, year = {2026},}@inproceedings{DBLP:conf/iclr/SureshRXNMDJ25, author = {Tarun Suresh and Revanth Gangi Reddy and Yifei Xu and Zach Nussbaum and Andriy Mulyar and Brandon Duderstadt and Heng Ji}, title = {CoRNStack: High-Quality Contrastive Data for Better Code Retrieval and Reranking}, booktitle = {The Thirteenth International Conference on Learning Representations, {ICLR} 2025, Singapore, April 24-28, 2025}, publisher = {OpenReview.net}, year = {2025}, url = {https://openreview.net/forum?id=iyJOUELYir}, timestamp = {Sun, 25 May 2025 21:25:19 +0200}, biburl = {https://dblp.org/rec/conf/iclr/SureshRXNMDJ25.bib}, bibsource = {dblp computer science bibliography, https://dblp.org}}@inproceedings{li2025coir, title = {Coir: A comprehensive benchmark for code information retrieval models}, author = {Li, Xiangyang and Dong, Kuicai and Lee, Yi Quan and Xia, Wei and Zhang, Hao and Dai, Xinyi and Wang, Yasheng and Tang, Ruiming}, booktitle = {Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)}, pages = {22074--22091}, year = {2025}}@inproceedings{reimers-2019-sentence-bert, title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks", author = "Reimers, Nils and Gurevych, Iryna", booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing", month = "11", year = "2019", publisher = "Association for Computational Linguistics", url = "https://arxiv.org/abs/1908.10084"}@inproceedings{DBLP:conf/cikm/ChaffinS25, author = {Antoine Chaffin and Rapha{"{e}}l Sourty}, editor = {Meeyoung Cha and Chanyoung Park and Noseong Park and Carl Yang and Senjuti Basu Roy and Jessie Li and Jaap Kamps and Kijung Shin and Bryan Hooi and Lifang He}, title = {PyLate: Flexible Training and Retrieval for Late Interaction Models}, booktitle = {Proceedings of the 34th {ACM} International Conference on Information and Knowledge Management, {CIKM} 2025, Seoul, Republic of Korea, November 10-14, 2025}, pages = {6334--6339}, publisher = {{ACM}}, year = {2025}, url = {https://github.com/lightonai/pylate}, doi = {10.1145/3746252.3761608},}