التاليالدليل التالي
الاهتمام بالاستعلام المتعدد
لغة الذكاء الاصطناعي
دليل اللغة AI
Grouped-Query Attention (GQA) shares key/value heads across groups of query heads.
استمع إلى هذا الدليلرواه الذكاء الاصطناعي · ~1 min
The original GQA paper studies this as a tradeoff between multi-head and multi-query attention for decoder inference.
The GQA paper proposes grouping query heads so multiple query heads share key/value heads. MHA has one key/value head per query head; MQA shares a single key/value head across all queries; GQA lies between them. The paper evaluates GQA on language modeling and machine translation tasks and reports quality closer to MHA with inference speed closer to MQA in its experiments. It also reports uptraining existing MHA models using about 5% of original pretraining compute. These claims are limited to the paper’s models, tasks and setup.
Comparing MHA, GQA and MQA head sharing.
Estimating KV-cache size from the number of query heads and key/value groups.
Reading the paper’s reported quality/speed tradeoff on evaluated language-model tasks.
Reviewing the paper’s uptraining recipe for converting an MHA checkpoint to GQA.
Benchmark head-sharing choices on the target model and hardware. The original paper’s quality/speed results do not establish universal serving speedups or negligible quality loss across all systems.
رسالة إخبارية مجانية
ثلاث قصص تم التحقق منها بواسطة الذكاء الاصطناعي كل صباح من أيام الأسبوع، مكتوبة باللغة الإنجليزية البسيطة. مجاني للأبد، بدون إعلانات.
بريد إلكتروني واحد كل يوم من أيام الأسبوع. إلغاء الاشتراك بنقرة واحدة. نحن لا نبيع أو نشارك عنوانك أبدًا.
اختبر نفسك
تعليقات فورية على كل إجابة، وشهادة قابلة للمشاركة مع معرف يمكن التحقق منه بمجرد اجتياز الدورة التدريبية.
دعم تعليم الذكاء الاصطناعي المجاني. AI Understanding هي منظمة 501(c)(3) غير ربحية - لا إعلانات ولا نظام حظر الاشتراك غير المدفوع على الإطلاق. قم بالتبرع
Grouped-Query Attention (GQA) shares key/value heads across groups of query heads. The original GQA paper studies this as a tradeoff between multi-head and multi-query attention for decoder inference.
تحتفظ GQA برؤوس استعلام منفصلة ولكنها تسمح لكل مجموعة منها بمشاركة مجموعة واحدة من المفاتيح ورؤوس القيمة، مما يؤدي إلى تقليص ذاكرة التخزين المؤقت لـ KV.
متعدد الرؤوس يعطي كل رأس كيلو فولت خاص به؛ يشترك الاستعلام المتعدد في كيلو فولت واحد لجميع الرؤوس؛ تقع GQA في الوسط مع عدد قليل من مجموعات KV.
تظهر المدخرات في وقت التوليد، حيث تكون قراءة ذاكرة التخزين المؤقت KV هي التكلفة السائدة لعرض النطاق الترددي للذاكرة.
32 رأس استعلام مقسمة على 8 مجموعات KV مشتركة تعطي تقريبًا أربعة أضعاف تقليل المفاتيح والقيم المخزنة مؤقتًا.
The GQA paper reports quality closer to multi-head attention (MHA) with inference speed closer to multi-query attention (MQA) in its evaluated tasks. This is an empirical result, not a universal guarantee.
استمر في التعلم
تم اختيار المزيد من الأدلة لهذا الموضوع
التاليالدليل التالي
الاهتمام بالاستعلام المتعدد
لغة الذكاء الاصطناعي