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
- code2vec vs BERT-Large
- code2vec vs DARTS (second order) (PTB)
- code2vec vs GPT-1
- code2vec vs TrellisNet-MoS (1.4x larger) PTB
- code2vec vs (ensemble): AWD-LSTM-DOC (fin) × 5 (WT2)
- code2vec vs (ensemble): AWD-LSTM-DOC (fin) × 5 (PTB)
| Model | Provider | Released | Params | Context | Input $/1M | Output $/1M | ECI |
|---|---|---|---|---|---|---|---|
| BERT-Largeopen | Google DeepMind | Oct 2018 | 340M | — | — | — | — |
| DARTS (second order) (PTB)open | Google DeepMind | Jun 2018 | 23M | — | — | — | — |
| GPT-1open | OpenAI | Jun 2018 | 117M | — | — | — | — |
| TrellisNet-MoS (1.4x larger) PTBopen | Carnegie Mellon University (CMU) | Oct 2018 | 34M | — | — | — | — |
| (ensemble): AWD-LSTM-DOC (fin) × 5 (WT2)open | NTT Communication Science Laboratories | Aug 2018 | 185M | — | — | — | — |
| (ensemble): AWD-LSTM-DOC (fin) × 5 (PTB)open | NTT Communication Science Laboratories | Aug 2018 | — | — | — | — | — |
| TF-LM-discourse LSTM (WT2)open | ESAT - PSI | May 2018 | — | — | — | — | — |
| TF-LM-discourse LSTM (PTB)open | ESAT - PSI | May 2018 | — | — | — | — | — |
More models from Meta
All Meta models →| Model | Released | Params | Context | Input $/1M | Output $/1M |
|---|---|---|---|---|---|
| Muse Spark 1.3 Contributor | Sep 2026 | — | 1M | $0.1 | $0.2 |
| Llama-3.3-70B-Instructopen | Dec 2024 | 71B | 128K | $0.71 | $0.71 |
| Muse Spark Openopen | Oct 2026 | 816B | 1M | $1.25 | $4.25 |
| Muse Spark 1.2 | Aug 2026 | — | 1M | $0.1 | $0.2 |
| Muse Wonder | Oct 2026 | — | 1M | $4 | $20 |
| Muse Spark 1.1 | Apr 2026 | — | 1M | $1.25 | $4.25 |
| Llama 4 Maverickopen | Apr 2025 | 402B | 512K | $0.35 | $1 |
| Llama 4 Scoutopen | Apr 2025 | 109B | 320K | $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.