Skip to content
llmmodels
Chat LLMOpen weightsHistorical

code2vec

by Meta · Oct 30, 2018

code2vec is an open-weight chat llm from Meta, released Oct 30, 2018.

Provider
Meta
Released
Oct 30, 2018
Type
Chat LLM
Parameters
Undisclosed
Context window
—
Max output
—
Input
text
Output
text
Weights
Open weights
License
Open (permissive)
Knowledge cutoff
—
Status
Historical
Training compute
3.2e+17 FLOP
Training data
14.2M tokens/words

About code2vec

We present a neural model for representing snippets of code as continuous distributed vectors ("code embeddings"). The main idea is to represent a code snippet as a single fixed-length code vector, which can be used to predict semantic properties of the snippet. This is performed by decomposing code to a collection of paths in its abstract syntax tree, and learning the atomic representation of each path simultaneously with learning how to aggregate a set of them. We demonstrate the effectiveness of our approach by using it to predict a method's name from the vector representation of its body.

How to run code2vec

code2vec is an open-weight model. Run it locally with Ollama, LM Studio or llama.cpp (quantized GGUF builds), or serve it on GPUs with vLLM, SGLang or Hugging Face TGI.

code2vec vs alternatives

Alternatives to code2vec
ModelProviderReleasedParamsContextInput $/1MOutput $/1MECI
BERT-LargeopenGoogle DeepMindOct 2018340M————
DARTS (second order) (PTB)openGoogle DeepMindJun 201823M————
GPT-1openOpenAIJun 2018117M————
TrellisNet-MoS (1.4x larger) PTBopenCarnegie Mellon University (CMU)Oct 201834M————
(ensemble): AWD-LSTM-DOC (fin) × 5 (WT2)openNTT Communication Science LaboratoriesAug 2018185M————
(ensemble): AWD-LSTM-DOC (fin) × 5 (PTB)openNTT Communication Science LaboratoriesAug 2018—————
TF-LM-discourse LSTM (WT2)openESAT - PSIMay 2018—————
TF-LM-discourse LSTM (PTB)openESAT - PSIMay 2018—————

More models from Meta

All Meta models →
ModelReleasedParamsContextInput $/1MOutput $/1M
Muse Spark 1.3 ContributorSep 2026—1M$0.1$0.2
Llama-3.3-70B-InstructopenDec 202471B128K$0.71$0.71
Muse Spark OpenopenOct 2026816B1M$1.25$4.25
Muse Spark 1.2Aug 2026—1M$0.1$0.2
Muse WonderOct 2026—1M$4$20
Muse Spark 1.1Apr 2026—1M$1.25$4.25
Llama 4 MaverickopenApr 2025402B512K$0.35$1
Llama 4 ScoutopenApr 2025109B320K$0.1$0.3

Frequently asked questions

Who made code2vec?

code2vec was developed by Meta (Israel,United States of America,France). It was released on Oct 30, 2018.

Is code2vec open source?

Yes. code2vec's weights are publicly available, so you can download and run it yourself.

Sources: epoch · paper. Last updated 2026-11-22.