Zubnet AIसीखेंWiki › Logits
मूल तत्व

Logits

इसे भी कहा जाता है: Raw Scores, Pre-Softmax Outputs
वे raw, unnormalized scores जो model softmax function द्वारा probabilities में convert होने से पहले output करता है। Language model के लिए, logits vocabulary में प्रति token एक value वाला vector है — higher values उन tokens को indicate करते हैं जिन्हें model अधिक likely मानता है। Logits model का सबसे informative output हैं, final probability distribution से अधिक जानकारी रखते हैं।

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

Logits को समझने से आपको समझ आता है कि models कैसे "सोचते" हैं। Temperature, top-p, और top-k sampling सभी logits पर operate करते हैं। Image generation में classifier-free guidance logits manipulate करता है। Logit bias (specific tokens में offsets जोड़ना) आपको model behavior steer करने देता है। यदि आप basic chat से परे AI applications बना रहे हैं, तो आपको अंततः logits के साथ directly काम करना होगा।

गहन अध्ययन

Model की final layer size V (vocabulary size, आमतौर पर 32K–128K) का vector produce करती है। प्रत्येक element उस token के लिए logit है। Softmax इन्हें probabilities में convert करता है: P(token_i) = exp(logit_i) / ∑ exp(logit_j)। Softmax से पहले, logits कोई भी real number हो सकते हैं — positive, negative, या zero। 10 बनाम 5 का logit मतलब model पहले token को लगभग e^5 ≈ 150x अधिक likely मानता है।

Logit Manipulation

कई techniques सीधे logits पर काम करती हैं। Temperature softmax से पहले सभी logits को T से divide करता है (T<1 sharpen करता है, T>1 flatten करता है)। Top-k k highest के अलावा सभी logits zero out करता है। Top-p (nucleus sampling) उन tokens के logits zero out करता है जिनकी cumulative probability p exceed करने वाले smallest set के बाहर हैं। Logit bias specific tokens के logits में fixed offset जोड़ता है — "JSON" के logit में +10 जोड़ना model को JSON से शुरू करने का strongly prefer कराता है। Repetition penalty recently generated tokens के logits reduce करता है।

Log-Probabilities

अधिकांश APIs generated tokens के साथ log-probabilities (softmax output का log) return कर सकती हैं। ये useful हैं: model confidence measure करने (low log-prob = uncertain), outputs calibrate करने (क्या 90%-confident predictions 90% समय correct हैं?), और LLMs से classifiers बनाने (different completions के log-probs compare करें) के लिए। Log-probs extreme values के लिए raw probabilities से अधिक numerically stable हैं।

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

← सभी शब्द
← llama.cpp LoRA →