التاليالدليل التالي
انزلاق النافذة الاهتمام
لغة الذكاء الاصطناعي
دليل اللغة AI
Attention combines information from allowed token positions using learned scores and weights.
استمع إلى هذا الدليلرواه الذكاء الاصطناعي · ~3 min
It is a core transformer operation, while attention masks and model architecture determine which positions can contribute to each representation.
The 2017 Attention Is All You Need paper introduced the transformer architecture built around attention rather than recurrence. Attention can be described through queries, keys, and values. A query is compared with keys to produce scores, and normalized weights combine the corresponding value vectors. Self-attention uses representations from the same sequence, while cross-attention can obtain keys and values from a separate encoded sequence. The allowed positions are important: a causal decoder mask prevents a position from using future positions during autoregressive training or generation. It is therefore inaccurate to say that every self-attention layer always reads every token without restrictions. Scaled dot-product attention divides query-key dot products by the square root of the key dimension before softmax. This scaling addresses how score magnitudes grow with dimension under the paper's assumptions. Softmax produces normalized weights over allowed positions, and the weighted value sum becomes the attention output. In a simple scalar illustration, values two and six with weights three-quarters and one-quarter combine to three. Multi-head attention performs several learned projections and attention operations before combining their outputs. It provides capacity to represent different relationships or subspaces without guaranteeing that every head has a unique, human-readable semantic role. Dense full attention involves pairwise interactions that scale quadratically with sequence length. Efficient implementations and alternative attention patterns address different costs; their benefits need measurement for a particular workload.
Using decoder cross-attention to combine information from an encoded source sequence.
Applying causal self-attention when predicting text without looking at later positions.
Comparing learned query-key scores before weighting value vectors.
Evaluating attention implementations for memory use and runtime at a chosen sequence length.
Attention research examines implementations, sparse patterns, shared key-value projections, and hybrid architectures. These techniques change different parts of the computation, so comparisons should report which attention rule is used and what costs are measured. Faster execution or lower memory use should be assessed alongside task quality and the relevant sequence lengths. A model can retain attention while changing its layout or implementation; identifying that distinction helps explain what an optimization actually improves.
رسالة إخبارية مجانية
ثلاث قصص تم التحقق منها بواسطة الذكاء الاصطناعي كل صباح من أيام الأسبوع، مكتوبة باللغة الإنجليزية البسيطة. مجاني للأبد، بدون إعلانات.
بريد إلكتروني واحد كل يوم من أيام الأسبوع. إلغاء الاشتراك بنقرة واحدة. نحن لا نبيع أو نشارك عنوانك أبدًا.
اختبر نفسك
تعليقات فورية على كل إجابة، وشهادة قابلة للمشاركة مع معرف يمكن التحقق منه بمجرد اجتياز الدورة التدريبية.
دعم تعليم الذكاء الاصطناعي المجاني. AI Understanding هي منظمة 501(c)(3) غير ربحية - لا إعلانات ولا نظام حظر الاشتراك غير المدفوع على الإطلاق. قم بالتبرع
Attention combines information from allowed token positions using learned scores and weights. It is a core transformer operation, while attention masks and model architecture determine which positions can contribute to each representation.
Attention uses weighted values, with the permitted context determined by masks and architecture.
"الانتباه هو كل ما تحتاجه" (فاسواني وآخرون، 2017) اقترح المحول الذي يعتمد على الاهتمام بدلا من التكرار.
ينتج كل رمز استعلامًا ومفتاحًا وقيمة؛ تتم مطابقة الاستعلامات مع المفاتيح لترجيح القيم.
يؤدي القياس حسب الجذر التربيعي للبعد الرئيسي إلى منع منتجات النقاط الكبيرة التي قد تدفع softmax إلى تدرجات صغيرة، مما يحافظ على استقرار التدريب.
Dense attention involves pairwise token interactions. Masks restrict permitted positions, but full or causal dense attention still has quadratic interaction growth; the mask changes permitted pairs rather than removing that order of growth.
استمر في التعلم
تم اختيار المزيد من الأدلة لهذا الموضوع
التاليالدليل التالي
انزلاق النافذة الاهتمام
لغة الذكاء الاصطناعي