Code Llama's 16K Context: Training for Long Code
Built on Llama 2, Code Llama was fine-tuned on 500 billion code-specific tokens, utilizing Long Context Fine-Tuning (LCFT) with 16,384-token sequences and RoPE scaling to enable stable generation up to 100,000 tokens.
The top 3
- Code Llama's Specialized Long Code Training Data: Code Llama was fine-tuned on an extensive 500 billion token dataset, primarily comprising publicly available code, with specific sampling strategies to expose the model to 16,384-token sequences and teach it long-range code dependencies.
- RoPE Scaling: Code Llama's Context Extension Method: Code Llama's 16K context, and its ability to extrapolate up to 100K tokens, was achieved through advanced RoPE (Rotary Positional Embeddings) scaling, specifically by extending the base period θ from 10,000 to 1,000,000 during fine-tuning.
- Training Boosts Code Llama's Long-Range Problem Solving: Specialized training for long code sequences significantly improves Code Llama's ability to understand and generate coherent code across complex, multi-file projects, enhancing debugging and code completion within its 16K context.
Sources
Open the full topic