आगेअगली गाइड
प्रॉम्प्ट-टू-प्रॉम्प्ट क्रॉस-अटेंशन संपादन
विजुअल एआई
भाषा एआई गाइड
Cross-attention lets queries from one representation attend to keys and values from another representation.
इस गाइड को सुनेंएआई-नैरेटेड · ~2 min
It is used to connect source and target sequences or different modalities.
Cross-attention lets queries from one representation attend to keys and values from another. The Transformer uses this in encoder-decoder layers; latent diffusion uses it for text-conditioned generation. Flamingo uses gated cross-attention layers to connect visual features to a language model and is designed to ingest arbitrarily interleaved visual and textual inputs, including images or video. These are architecture-specific examples, not a universal multimodal design. In Flamingo, cross-attention blocks are gated by a tanh-transformed learned scalar initialized to zero; this is an architecture-specific control and not a claim about how often cross-attention is used across multimodal systems.
In an encoder-decoder Transformer, decoder queries attend to encoder outputs.
Latent diffusion models use cross-attention to condition image latents on text embeddings.
Flamingo inserts cross-attention layers so a language model can use visual features.
Different sequence lengths are possible because queries and key-value context need not have matching lengths.
When inspecting a multimodal model, identify which stream supplies queries and which supplies keys and values. Evaluate alignment and failure cases across the relevant modalities. The cited papers do not establish one universal cross-attention design.
मुफ़्त न्यूज़लेटर
हर कार्यदिवस की सुबह तीन सत्यापित एआई कहानियाँ, सादे अंग्रेजी में लिखी गईं। हमेशा के लिए मुफ़्त, कोई विज्ञापन नहीं।
प्रत्येक सप्ताह के दिन एक ईमेल. एक क्लिक में सदस्यता समाप्त करें. हम आपका पता कभी नहीं बेचते या साझा नहीं करते।
स्वयं की जांच करो
प्रत्येक उत्तर पर त्वरित प्रतिक्रिया, और पाठ्यक्रम पास करने के बाद एक सत्यापन योग्य आईडी के साथ एक साझा करने योग्य प्रमाणपत्र।
निःशुल्क एआई शिक्षा का समर्थन करें। AI Understanding एक 501(c)(3) गैर-लाभकारी संस्था है - कोई विज्ञापन नहीं, कोई पेवॉल नहीं। दान करें
Cross-attention lets queries from one representation attend to keys and values from another representation. It is used to connect source and target sequences or different modalities.
क्रॉस-अटेंशन एक अनुक्रम (उदाहरण के लिए, डिकोडर) से प्रश्न खींचता है और एक अलग अनुक्रम (उदाहरण के लिए, एनकोडर) से कुंजियाँ और मान खींचता है, जिससे दोनों को इंटरैक्ट करने का मौका मिलता है।
डिकोडर अपने आंशिक रूप से उत्पन्न आउटपुट से क्वेरी बनाता है, फिर प्रासंगिक इनपुट जानकारी खींचने के लिए कुंजी और मान के रूप में एनकोडर आउटपुट का उपयोग करता है।
चूँकि क्वेरीज़ एक स्रोत से और कुंजियाँ/मान दूसरे से उत्पन्न होती हैं, अनुक्रम स्वतंत्र होते हैं और लंबाई, भाषा या तौर-तरीके में भिन्न हो सकते हैं।
क्रॉस-अटेंशन उत्पन्न छवि के प्रत्येक भाग को टेक्स्ट प्रॉम्प्ट पर ध्यान केंद्रित करने देता है, शब्दों में दृश्यों को आधार बनाता है।
दोनों एक ही स्केल्ड डॉट-प्रोडक्ट ध्यान का उपयोग करते हैं: प्रश्नों और कुंजियों के बीच समानता स्कोर, एक सॉफ्टमैक्स, फिर मूल्यों का एक भारित योग।
सीखते रहो
इस विषय के लिए अधिक मार्गदर्शिकाएँ चुनी गईं
आगेअगली गाइड
प्रॉम्प्ट-टू-प्रॉम्प्ट क्रॉस-अटेंशन संपादन
विजुअल एआई