What problem does it solve? Pre-trained transformer models like LLaMA and Mistral are limited to their original context windows (e.g., 2048 tokens), making them unable to process long documents such as books, codebases, or extended conversations without expensive retraining. ## Core Features & Use Cases - Positional Encoding Implementations: Provides working code for RoPE (Rotary Position Embeddings) and ALiBi (Attention with Linear Biases) for new model architectures. - Context Extension Methods: Covers YaRN, Position Interpolation, and linear/dynamic RoPE scaling to extend existing models to 32k-128k+ tokens with minimal fine-tuning (400-1000 steps). - Fine-tuning & Evaluation Guides: Includes data preparation, training configurations, perplexity evaluation, and passkey retrieval testing for long-context models. - Use Case: Extend a LLaMA-2-7B model from 2k to 32k tokens by configuring YaRN rope_scaling and fine-tuning for 400 steps on long documents from PG-19. ## Quick Start Extend my LLaMA-2-7B model to handle 32k token documents using YaRN scaling and show me the fine-tuning configuration.