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

Attention Visualization

इसे भी कहा जाता है: Attention Maps, Attention Heatmap
Attention weights को heatmaps के रूप में प्रदर्शित करके यह visualize करना कि एक Transformer मॉडल किस पर "ध्यान देता है"। प्रत्येक query token के लिए, attention map दिखाता है कि वह हर दूसरे token को कितना weight देता है। उच्च weights (चमकीले धब्बे) मज़बूत attention इंगित करते हैं — मॉडल उन tokens को वर्तमान computation के लिए अत्यधिक प्रासंगिक मानता है।

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

Attention visualization एक Transformer के अंदर झाँकने और उसके reasoning को समझने का सबसे सहज तरीका है। जब एक मॉडल "le chat noir" का "the black cat" में अनुवाद करता है, तो attention maps दिखाते हैं कि "black" "noir" पर और "cat" "chat" पर ज़ोरदार ध्यान देता है। यह मॉडल के व्यवहार को debug करने, विफलताओं को समझने, और attention कैसे काम करता है इसकी अंतर्ज्ञान बनाने में मदद करता है।

गहन अध्ययन

Attention weight matrix प्रत्येक head और layer के लिए (seq_len × seq_len) है। Visualize करने के लिए: एक layer और head चुनें, matrix को heatmap के रूप में प्रदर्शित करें जहाँ row i दिखाती है कि token i किन tokens पर ध्यान देता है। चमकीली cells का मतलब उच्च attention है। Multi-head attention के लिए, आप individual heads (प्रत्येक विभिन्न patterns में विशेषज्ञ है) या heads में औसत (समग्र attention distribution) visualize कर सकते हैं।

Attention Maps क्या दिखाते हैं (और क्या नहीं)

Attention maps दिखाते हैं कि एक head अपना output compute करते समय किन tokens पर विचार करता है, लेकिन वे सीधे नहीं दिखाते कि मॉडल क्या "समझता" है या उसने निर्णय क्यों लिया। उच्च attention का मतलब "महत्वपूर्ण" नहीं है — कुछ heads बिना semantic अर्थ के punctuation या positional patterns पर ध्यान देते हैं। Attention maps वर्णनात्मक (मॉडल ने क्या देखा) हैं, व्याख्यात्मक (उसने निर्णय क्यों लिया) नहीं। वे एक उपयोगी debugging tool हैं, पूर्ण व्याख्या नहीं।

Tools

BertViz Transformer मॉडलों के लिए interactive attention visualizations प्रदान करता है। Ecco और Captum PyTorch मॉडलों के लिए attention-based interpretability प्रदान करते हैं। API के माध्यम से accessed LLMs के लिए, कुछ providers attention weights या log-probabilities लौटाते हैं जो आंशिक visualization सक्षम करते हैं। Image generation में, cross-attention maps दिखाते हैं कि कौन से image regions किन prompt शब्दों से मेल खाते हैं — यह समझने के लिए उपयोगी है कि मॉडल ने objects कहाँ क्यों रखे।

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

← सभी शब्द
← Attention Automation →
ESC