SeqPE: محول مع ترميز موضع تسلسلي SeqPE: Transformer With Sequential Position Encoding

شارك:
المجلة: IEEE Transactions on Pattern Analysis and Machine Intelligence، المجلد: 48، العدد: 10
DOI: https://doi.org/10.1109/tpami.2026.3695094
PMID: https://pubmed.ncbi.nlm.nih.gov/42160247
تاريخ النشر: 2026-05-20
المؤلف: Huayang Li وآخرون
الموضوع الرئيسي: نمذجة الموضوعات

نظرة عامة

تقدم البحث SEQPE، وهو إطار ترميز موحد وقابل للتعلم بالكامل لمواقع Transformers، يعالج قيود الترميز التقليدي للمواقع (PEs) في التكيف وقابلية التوسع. يستخدم SEQPE مشفر مواقع تسلسلي خفيف الوزن ويقدم هدفين للتنظيم: هدف تبايني لمواءمة مسافات الترميز مع دالة المسافة المحددة مسبقًا، وخسارة تقطير المعرفة لتعزيز أداء الاستقراء. تظهر النتائج التجريبية أن SEQPE يتفوق على معايير قوية في نمذجة اللغة، والإجابة على الأسئلة ذات السياق الطويل، وتصنيف الصور ثنائية الأبعاد، مما يظهر قابلية تعلم وتكيف متفوقة، وقدرات قوية على الاستقراء السياقي دون الحاجة إلى تعديلات معمارية واسعة النطاق.

طرق

في هذا القسم، يقدم المؤلفون طريقة جديدة لترميز المواقع تتميز بثلاث خصائص أساسية. أولاً، تُظهر الطريقة قابلية التعلم والتكيف، مما يسمح لها بالتعامل بفعالية مع مهام متنوعة. ثانيًا، تُظهر الاستقراء السياقي، مما يمكّن النموذج من التعميم على تسلسلات أطول من تلك التي تم رؤيتها أثناء التدريب. أخيرًا، تم تصميم النهج ليكون قابلًا للتوسع إلى بيانات بأبعاد تعسفية، مما يتطلب الحد الأدنى من التدخل اليدوي الإضافي. تعزز هذه الخصائص مجتمعة من تعددية استخدام النموذج وأدائه عبر تطبيقات متنوعة.

نتائج

تشير النتائج إلى أن نموذج SEQPE يظهر ميزة ملحوظة في قدرات التعميم، كما يتضح من درجاته المتوسطة المتفوقة على مجموعة اختبار Wikitext-103 مقارنة بمعايير ROPE وALIBI. على وجه التحديد، يتفوق SEQPE على كلا المعايير من حيث التعقيد ودرجات EM، كما هو موضح في الجدول 2. من الجدير بالذكر أنه بينما يزيد تعقيد الاستقراء لـ ALIBI بشكل كبير مع تسلسلات من 8K رموز، يحافظ SEQPE على تعقيد مستقر، مما يبرز قابليته للتكيف في المهام اللاحقة.

تحليل إضافي في الجدول 3 يكشف أن SEQPE يتفوق باستمرار على جميع المعايير في الدقة المتوسطة عبر دقة مختلفة. على الرغم من أن معيار NOPE يظهر أداءً مستقرًا عند دقة أكبر، إلا أن ROPE2D-MIX يظهر فقط تحسينات طفيفة عند دقات معينة (مثل 320 و384) ولكنه يفشل في الحفاظ على هذه الفوائد عند دقات أعلى. بالمقابل، الأداء المتسق لـ SEQPE عبر دقات مختلفة يبرز قدرته القوية على التعميم.

نقاش

في هذا القسم، يناقش المؤلفون بنية ووظيفة نظام جديد لترميز المواقع لـ Vision Transformers (VT)، والذي يُطلق عليه SEQPE (مشفر المواقع التسلسلي). تعالج شبكة VT الصور عن طريق تقسيمها إلى رقع متداخلة، والتي يتم تحويلها بعد ذلك إلى رموز باستخدام طبقات متعددة الانتباه. على عكس Transformers التقليدية، يعيد SEQPE تشكيل هذه الرموز إلى شبكة مكانية، مما يسمح بإجراء عمليات التلافيف التي تحاكي الهيكل الهرمي للشبكات العصبية التلافيفية (CNNs). يبرز المؤلفون كفاءة نهجهم، الذي يتطلب فقط تمريرة واحدة للأمام والخلف عبر الشبكة، على عكس الطرق السابقة التي تتطلب استخراج رقع متعددة من نفس الصورة.

يقدم المؤلفون هدفين رئيسيين للتدريب لتعزيز مساحة التمثيل لـ SEQPE: هدف مواءمة المسافة الذي يضمن أن المواقع الأقرب تنتج ترميزات أكثر تشابهًا، وهدف تقطير المعرفة الذي يهدف إلى تحسين الأداء على المواقع خارج التوزيع (OOD). يجادلون بأنه بينما يساعد هدف مواءمة المسافة في منع انهيار الترميزات، يسهل هدف تقطير المعرفة نقل الأنماط المتعلمة من المواقع داخل التوزيع إلى المواقع خارج التوزيع. يتم التحقق من فعالية SEQPE من خلال تجارب واسعة عبر مهام متنوعة، بما في ذلك نمذجة اللغة، والإجابة على الأسئلة، وتصنيف الصور، مما يظهر تحسينات كبيرة في قابلية التكيف وقدرات الاستقراء مقارنة بالطرق الحالية.

Journal: IEEE Transactions on Pattern Analysis and Machine Intelligence, Volume: 48, Issue: 10
DOI: https://doi.org/10.1109/tpami.2026.3695094
PMID: https://pubmed.ncbi.nlm.nih.gov/42160247
Publication Date: 2026-05-20
Author(s): Huayang Li et al.
Primary Topic: Topic Modeling

Overview

The research presents SEQPE, a unified and fully learnable position encoding framework for Transformers, addressing limitations of traditional position embeddings (PEs) in adaptability and scalability. SEQPE employs a lightweight sequential position encoder and introduces two regularization objectives: a contrastive objective for aligning embedding distances with a predefined position-distance function, and a knowledge distillation loss for enhancing extrapolation performance. Experimental results show that SEQPE outperforms strong baselines in language modeling, long-context question answering, and 2D image classification, demonstrating superior learnability, adaptability, and robust context extrapolation capabilities without requiring extensive architectural modifications.

Methods

In this section, the authors present a novel position encoding method characterized by three fundamental properties. Firstly, the method demonstrates learnability and adaptability, allowing it to effectively handle various tasks. Secondly, it exhibits context extrapolation, enabling the model to generalize to sequences longer than those seen during training. Lastly, the approach is designed to be extensible to data of arbitrary dimensions, requiring minimal additional manual intervention. These properties collectively enhance the model’s versatility and performance across diverse applications.

Results

The results indicate that the SEQPE model exhibits a notable advantage in generalization capabilities, as evidenced by its superior average scores on the Wikitext-103 test set compared to the ROPE and ALIBI baselines. Specifically, SEQPE outperforms both baselines in terms of perplexity and EM scores, as shown in Table 2. Notably, while ALIBI’s extrapolation perplexity significantly increases with sequences of 8K tokens, SEQPE maintains stable perplexity, highlighting its adaptability in downstream tasks.

Further analysis in Table 3 reveals that SEQPE consistently outperforms all baselines in average accuracy across varying resolutions. Although the NOPE baseline demonstrates stable performance at larger resolutions, the ROPE2D-MIX shows only slight improvements at specific resolutions (e.g., 320 and 384) but fails to sustain these benefits at higher resolutions. In contrast, SEQPE’s consistent performance across different resolutions underscores its robust generalization capability.

Discussion

In this section, the authors discuss the architecture and functionality of a novel position encoding scheme for Vision Transformers (VT), termed SEQPE (Sequential Position Encoder). The VT network processes images by dividing them into overlapping patches, which are then transformed into tokens using multi-attention layers. Unlike traditional Transformers, SEQPE reshapes these tokens into a spatial grid, allowing for convolutional operations that simulate the hierarchical structure of Convolutional Neural Networks (CNNs). The authors highlight the efficiency of their approach, which requires only a single forward and backward pass through the network, as opposed to previous methods that necessitate multiple patch extractions from the same image.

The authors introduce two key training objectives to enhance the representation space of SEQPE: a distance alignment objective that ensures closer positions yield more similar embeddings, and a knowledge distillation objective aimed at improving performance on out-of-distribution (OOD) positions. They argue that while the distance alignment objective helps prevent the collapse of embeddings, the knowledge distillation objective facilitates the transfer of learned patterns from in-distribution to OOD positions. The effectiveness of SEQPE is validated through extensive experiments across various tasks, including language modeling, question answering, and image classification, demonstrating significant improvements in adaptability and extrapolation capabilities compared to existing methods.