AI Briefing
KO

CodeParrot: Training a Code Model

·2021.12.08 09:00

Key point

This introduces the dataset construction and training methodology behind CodeParrot, a Python code generation model released by HuggingFace.

Details

CodeParrot is a large-scale Python code generation model based on GPT-2 that, similar to GitHub CoPilot, provides code suggestions to programmers.

Dataset Construction and Cleaning The team utilized 180GB (20 million files) of Python data extracted from GitHub dumps on Google BigQuery. Discovering that data duplication severely impacts model performance, they removed duplicates and cleaned the data to build the 50GB codeparrot-clean dataset.

Tokenizer and Model Initialization To efficiently split code tokens, they newly trained a code-specific tokenizer based on the existing GPT-2 tokenizer. The model follows the GPT-2 Large (1.5B parameters) configuration, and for numerical stability, applied the scale_attn_by_layer_idx and reorder_and_upcast_attn settings.

Training Efficiency To efficiently process the large-scale dataset, they used the streaming=True option to stream the necessary samples in real time during training, rather than downloading the entire dataset.

This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.

Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.