Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,84 @@
|
|
1 |
---
|
2 |
license: afl-3.0
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: afl-3.0
|
3 |
---
|
4 |
+
|
5 |
+
# PyCodeGPT
|
6 |
+
A pre-trained GPT model for Python code completion and generation
|
7 |
+
|
8 |
+
## What is it?
|
9 |
+
|
10 |
+
PyCodeGPT is efficient and effective GPT-Neo-based model for python code generation task, which is similar to [OpenAI Codex](https://openai.com/blog/openai-codex/), [Github Copliot](https://copilot.github.com/), [CodeParrot](https://huggingface.co/blog/codeparrot), [AlphaCode](https://deepmind.com/blog/article/Competitive-programming-with-AlphaCode).
|
11 |
+
|
12 |
+
## Training Data
|
13 |
+
Due to the small size of public released dataset, we proposed to collect data from GitHub from scratch. We first crawled 1.2M python-related repositories hosted by GitHub. Then, we used these repository URLs to download all contents of each repository from GitHub. After that, we got 60M raw python files under 1MB with a total size of 330GB. Finally, we carefully designed various strategies of data cleaning to get about 96GB data for training. Please refer to the following table for the details.
|
14 |
+
|
15 |
+
|Model|Repositories|Size and file after filtering|
|
16 |
+
|:------:|:---:|:---:|
|
17 |
+
| CodeParrot | 0.56M | 12GB (compressed), 5.4M |
|
18 |
+
| Codex | 54M | 159GB |
|
19 |
+
| PyCodeGPT | 1.2M | 96GB, 13M |
|
20 |
+
|
21 |
+
|
22 |
+
## Pretrained models
|
23 |
+
|
24 |
+
we aims to train median-large pre-trained models (model size with 110M) based on GPT-Neo:
|
25 |
+
- PyCodeGPT-110M: derived from GPT-Neo 125M with a vocabulary size of 32K.
|
26 |
+
|
27 |
+
## GitHub
|
28 |
+
|
29 |
+
[https://github.com/microsoft/PyCodeGPT](https://github.com/microsoft/PyCodeGPT)
|
30 |
+
|
31 |
+
## Evaluation Results
|
32 |
+
|
33 |
+
Here's our evaluation result on HumanEval dataset:
|
34 |
+
|
35 |
+
Note: our model can have a comparable accuracy with Codex of similar model size.
|
36 |
+
|
37 |
+
|Model|Pass@1|Pass@10|Pass@100|
|
38 |
+
|:------:|:---:|:---:|:---:|
|
39 |
+
|PyCodeGPT-110M |**8.32%** |**13.53%** |**18.3%** |
|
40 |
+
|||||
|
41 |
+
|GPT-Neo 125M |0.75% |1.88% |2.97% |
|
42 |
+
|GPT-Neo 1.3B |4.97% |7.47% |16.3% |
|
43 |
+
|GPT-Neo 2.7B |6.41% |11.27% |21.37% |
|
44 |
+
|GPT-J 6B |11.62% |15.74% |27.74% |
|
45 |
+
|||||
|
46 |
+
|TabNine |2.58% |4.35% |7.59% |
|
47 |
+
|||||
|
48 |
+
|CodeParrot 110M |3.80% |6.57% |12.78% |
|
49 |
+
|CodeParrot 1.5B |3.58% |8.03% |14.96% |
|
50 |
+
|||||
|
51 |
+
|Codex 12M |2.00% |3.62% |8.58% |
|
52 |
+
|Codex 25M |3.21% |7.1% |12.89% |
|
53 |
+
|Codex 42M |5.06% |8.8% |15.55% |
|
54 |
+
|Codex 85M |8.22% |12.81% |22.4% |
|
55 |
+
|Codex 300M |13.17% |20.37% |36.27% |
|
56 |
+
|Codex 679M |16.22% |25.7% |40.95% |
|
57 |
+
|Codex 2.5B |21.36% |35.42% |59.5% |
|
58 |
+
|Codex 12B |28.81% |46.81% |72.31% |
|
59 |
+
|||||
|
60 |
+
|Pretrained Decoder-only 13M (AlphaCode) |1.5% |3.6% |8.6% |
|
61 |
+
|Pretrained Decoder-only 29M (AlphaCode) |3.4% |5.8% |11.2% |
|
62 |
+
|Pretrained Decoder-only 55M (AlphaCode) |4.2% |8.2% |16.9% |
|
63 |
+
|Pretrained Decoder-only 89M (AlphaCode) |4.3% |12.2% |20.0% |
|
64 |
+
|Pretrained Decoder-only 302M (AlphaCode) |11.6% |18.8% |31.8% |
|
65 |
+
|Pretrained Decoder-only 685M (AlphaCode) |14.2% |24.4% |38.8% |
|
66 |
+
|Pretrained Decoder-only 1.1B (AlphaCode) |17.1% |28.2% |45.3% |
|
67 |
+
|||||
|
68 |
+
|PolyCoder 160M |2.13% |3.35% |4.88% |
|
69 |
+
|PolyCoder 400M |2.96% |5.29% |11.59% |
|
70 |
+
|PolyCoder 2.7B |5.59% |9.84% |17.68% |
|
71 |
+
|
72 |
+
=======
|
73 |
+
|
74 |
+
## Reference
|
75 |
+
If you want to use the models, you need to cite our following paper:
|
76 |
+
|
77 |
+
```
|
78 |
+
@inproceedings{CERT,
|
79 |
+
title={{CERT}: Continual Pre-training on Sketches for Library-oriented Code Generation},
|
80 |
+
author={Zan, Daoguang and Chen, Bei and Yang, Dejian and Lin, Zeqi and Kim, Minsu and Guan, Bei and Wang, Yongji and Chen, Weizhu and Lou, Jian-Guang},
|
81 |
+
booktitle={The 2022 International Joint Conference on Artificial Intelligence},
|
82 |
+
year={2022}
|
83 |
+
}
|
84 |
+
```
|