CodeGen2.5 is a family of autoregressive language models for program synthesis.
Building upon CodeGen2, the model is trained on StarCoderData for 1.4T tokens, achieving competitive results compared to StarCoderBase-15.5B with less than half the size.
Like CodeGen2, this model is capable of infilling, and supports multiple programming languages.
We then further train on Python, then on instruction data. We release all the models as follows:
CodeGen2.5-7B-multi (this repo): Trained on StarCoderData. Licensed under Apache-2.0.
CodeGen2.5-7B-mono: Further trained on additional Python tokens. Licensed under Apache-2.0.
CodeGen2.5-7B-instruct: Further trained from CodeGen2.5-7B-mono on instruction data. Research purposes only.
How to use
This model can be easily loaded using the AutoModelForCausalLM functionality.
Pre-requisite
Please install OpenAI tiktoken for the tokenizer.
pip install tiktoken==0.4.0
Causal sampling (code autocompletion)
For regular causal sampling, simply generate completions given the context:
You might want to truncate the model output with <eom>.
Evaluation results
We evaluate our models on HumanEval and HumanEval-Infill.
Please refer to the blog for more details.
Intended use and limitations
As an autoregressive language model, CodeGen2.5 is capable of extracting features from given natural language and programming language texts, and calculating the likelihood of them.
However, the model is intended for and best at program synthesis, that is, generating executable code given English prompts, where the prompts should be in the form of a comment string. The model can complete partially-generated code as well.
Attribution & Other Requirements
The pretraining dataset of the model was filtered for permissive licenses only.
Nevertheless, the model can generate source code verbatim from the dataset.
The code's license might require attribution and/or other specific requirements that must be respected.
The data provider BigCode provides a search index that lets you search through the pretraining data to identify where generated code came from and apply the proper attribution to your code.
BibTeX entry and citation info
Please cite CodeGen2 paper:
bibtex
1@article{Nijkamp2023codegen2,
2 title={CodeGen2: Lessons for Training LLMs on Programming and Natural Languages},
3 author={Nijkamp, Erik and Hayashi, Hiroaki and Xiong, Caiming and Savarese, Silvio and Zhou, Yingbo},
4 journal={arXiv preprint},
5 year={2023}
6}