Zubnet AIसीखेंWiki › Context Length Extension
बुनियादी ढांचा

Context Length Extension

इसे भी कहा जाता है: YaRN, NTK Scaling, RoPE Scaling
ऐसी techniques जो language models को training के दौरान देखी गई sequences से लंबी sequences handle करने में सक्षम बनाती हैं। 4K tokens पर trained model को उसकी positional encoding (आमतौर पर RoPE) में modifications और longer sequences पर short fine-tuning के combination से 32K या 128K तक extend किया जा सकता है। यह scratch से long sequences पर training की भारी cost से बचाता है।

यह क्यों मायने रखता है

Context length extension ही कारण है कि models केवल दो वर्षों में 4K से 128K से 1M+ context windows तक गए हैं। Million-token sequences पर scratch से model train करने की cost prohibitive होगी। Extension techniques shorter sequences पर trained models को adapt करके long-context models को व्यावहारिक बनाती हैं, जिसके लिए original training compute का केवल एक fraction चाहिए।

गहन अध्ययन

Core challenge: RoPE (Rotary Position Embeddings) rotation angles का उपयोग करके position encode करता है। Training length से परे positions पर, ये angles ऐसे extrapolations बन जाते हैं जो model ने कभी नहीं देखे, जिससे attention patterns टूट जाते हैं। Extension techniques modify करती हैं कि positions rotation angles में कैसे map होती हैं ताकि longer sequences model की trained range में angles produce करें।

NTK-Aware Scaling

NTK-aware interpolation (Neural Tangent Kernel) RoPE frequencies को non-uniformly adjust करता है: high-frequency components (local patterns के लिए महत्वपूर्ण) preserve किए जाते हैं जबकि low-frequency components (position-dependent) interpolate किए जाते हैं। यह model की local patterns (word order, syntax) handle करने की ability preserve करता है जबकि global position encoding के लिए range extend करता है। यह एक-line code change है जो length extrapolation को dramatically improve करता है।

YaRN

YaRN (Yet another RoPE extensioN) NTK-aware interpolation को attention temperature correction और extended-length data पर small amount of fine-tuning (आमतौर पर कुछ hundred steps) के साथ combine करता है। यह original context length की 4–8x minimal quality degradation के साथ handle करने वाले models produce करता है। अधिकांश open-source long-context models (जैसे long-context Llama या Mistral variants) YaRN या similar techniques का उपयोग करते हैं। Fine-tuning step crucial है — scaling alone कुछ हद तक काम करता है, लेकिन target length पर fine-tuning quality को significantly improve करता है।

संबंधित अवधारणाएँ

← सभी शब्द
← Contamination Contrastive Learning →