Salesforce/codegen-16B-mono cover image

Salesforce/codegen-16B-mono

CodeGen is a family of autoregressive language models for program synthesis, trained on a Python programming language dataset. The models are capable of extracting features from given natural language and programming language texts, and calculating the likelihood of them. They are intended for and best at program synthesis, that is, generating executable code given English prompts. The evaluation results show that CodeGen achieves state-of-the-art performance on two code generation benchmarks, HumanEval and MTPB.

CodeGen is a family of autoregressive language models for program synthesis, trained on a Python programming language dataset. The models are capable of extracting features from given natural language and programming language texts, and calculating the likelihood of them. They are intended for and best at program synthesis, that is, generating executable code given English prompts. The evaluation results show that CodeGen achieves state-of-the-art performance on two code generation benchmarks, HumanEval and MTPB.

Public
$0.0005 / sec
2k

Input

text to generate from

maximum length of the newly generated generated text.If not set or None defaults to model's max context length minus input length. (Default: 512, 1 ≤ max_new_tokens ≤ 100000)

Temperature

temperature to use for sampling. 0 means the output is deterministic. Values greater than 1 encourage more diversity (Default: 0.7, 0 ≤ temperature ≤ 100)

Sample from the set of tokens with highest probability such that sum of probabilies is higher than p. Lower values focus on the most probable tokens.Higher values sample more low-probability tokens (Default: 0.9, 0 < top_p ≤ 1)

Sample from the best k (number of) tokens. 0 means off (Default: 0, 0 ≤ top_k < 100000)

Repetition Penalty

repetition penalty. Value of 1 means no penalty, values greater than 1 discourage repetition, smaller than 1 encourage repetition. (Default: 1, 0.01 ≤ repetition_penalty ≤ 5)

Up to 16 strings that will terminate generation immediately. Please separate items by comma

Num Responses

Number of output sequences to return. Incompatible with streaming (Default: 1, 1 ≤ num_responses ≤ 2)

How to format the response 2

Presence Penalty

Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. (Default: 0, -2 ≤ presence_penalty ≤ 2)

Frequency Penalty

Positive values penalize new tokens based on how many times they appear in the text so far, increasing the model's likelihood to talk about new topics. (Default: 0, -2 ≤ frequency_penalty ≤ 2)

You need to login to use this model

Output

I have this dream about the day I got a job at a tech company. I just woke up on a plane. I sat down on the floor and started getting work done. After getting up around 6 p.m., I looked around and

CodeGen (CodeGen-Mono 16B)

Model description

CodeGen is a family of autoregressive language models for program synthesis from the paper: A Conversational Paradigm for Program Synthesis by Erik Nijkamp, Bo Pang, Hiroaki Hayashi, Lifu Tu, Huan Wang, Yingbo Zhou, Silvio Savarese, Caiming Xiong. The models are originally released in this repository, under 3 pre-training data variants (NL, Multi, Mono) and 4 model size variants (350M, 2B, 6B, 16B).

The checkpoint included in this repository is denoted as CodeGen-Mono 16B in the paper, where "Mono" means the model is initialized with CodeGen-Multi 16B and further pre-trained on a Python programming language dataset, and "16B" refers to the number of trainable parameters.

Training data

This checkpoint (CodeGen-Mono 16B) was firstly initialized with CodeGen-Multi 16B, and then pre-trained on BigPython dataset. The data consists of 71.7B tokens of Python programming language. See Section 2.1 of the paper for more details.

Training procedure

CodeGen was trained using cross-entropy loss to maximize the likelihood of sequential inputs. The family of models are trained using multiple TPU-v4-512 by Google, leveraging data and model parallelism. See Section 2.3 of the paper for more details.

Evaluation results

We evaluate our models on two code generation benchmark: HumanEval and MTPB. Please refer to the paper for more details.

Intended Use and Limitations

As an autoregressive language model, CodeGen 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.

BibTeX entry and citation info

@article{Nijkamp2022ACP,
  title={A Conversational Paradigm for Program Synthesis},
  author={Nijkamp, Erik and Pang, Bo and Hayashi, Hiroaki and Tu, Lifu and Wang, Huan and Zhou, Yingbo and Savarese, Silvio and Xiong, Caiming},
  journal={arXiv preprint},
  year={2022}
}