DOI: https://doi.org/10.1016/j.neucom.2026.133050
تاريخ النشر: 2026-02-12
المؤلف: Melkamu Abay Mersha وآخرون
الموضوع الرئيسي: الذكاء الاصطناعي القابل للتفسير (XAI)
نظرة عامة
تقدم البحث إطار عمل التدرجات المتكاملة الواعية بالسياق (CA-LIG)، الذي يعالج قيود طرق التفسير الحالية لنماذج المحولات. تعتمد الأساليب التقليدية غالبًا على نسب الطبقة النهائية وتفشل في التقاط الاعتماديات بين الرموز، والوعي بالسياق، وتطور الأهمية عبر الطبقات. بالمقابل، يحسب CA-LIG التدرجات المتكاملة على مستوى الطبقة داخل كل كتلة من المحولات ويجمعها مع تدرجات الانتباه الخاصة بالفئة، مما يؤدي إلى خرائط نسب حساسة للسياق تعكس كل من الأدلة الداعمة والمعارضة. يعزز هذا الإطار الموحد من قابلية تفسير اتخاذ القرار في المحولات من خلال تتبع التدفق الهرمي للأهمية.
تظهر التقييمات الواسعة عبر مهام متنوعة – بما في ذلك تحليل المشاعر، واكتشاف خطاب الكراهية في اللغات ذات الموارد المنخفضة، وتصنيف الصور – أن CA-LIG يوفر باستمرار نسبًا أكثر دقة ورؤية أوضح مقارنة بالطرق المعتمدة. إن قدرة الإطار على الحفاظ على الأهمية عبر الطبقات والتقاط الاعتماديات السياقية تؤدي إلى تفسيرات ليست فقط أكثر موثوقية ولكن أيضًا أكثر توافقًا مع الطبيعة الهرمية لهياكل المحولات. بشكل عام، يمثل CA-LIG تقدمًا كبيرًا في قابلية تفسير النماذج العصبية العميقة، مما يعزز الشفافية والموثوقية في التطبيقات المعتمدة على المحولات. سيكون كود التنفيذ متاحًا للجمهور عند قبول الورقة.
مقدمة
تسلط مقدمة الورقة الضوء على أهمية هياكل المحولات المعتمدة، مثل BERT وGPT وT5، في معالجة اللغة الطبيعية الحديثة (NLP) وتطبيقات الذكاء الاصطناعي. تستفيد هذه النماذج من الانتباه الذاتي متعدد الرؤوس، والتمثيلات الهرمية العميقة، والحساب المتوازي القابل للتوسع لالتقاط الاعتماديات بعيدة المدى والتفاعلات الدلالية المعقدة بشكل فعال. على الرغم من نجاحها، فإن الطبيعة الغامضة لنماذج المحولات تطرح تحديات في فهم كيفية تطور تمثيلات الرموز وكيف تؤثر الاعتماديات السياقية على التنبؤات. وقد أدى ذلك إلى زيادة الطلب على تقنيات الذكاء الاصطناعي القابل للتفسير (XAI)، التي تواجه حاليًا قيودًا مثل تحيز الطبقة النهائية، وغياب التفكير المحلي والعالمي الموحد، وعدم كفاية الوعي بالسياق.
لمعالجة هذه التحديات، يقترح المؤلفون إطار عمل التدرجات المتكاملة الواعية بالسياق (CA-LIG)، الذي يهدف إلى تقديم تفسيرات حساسة للسياق لنماذج المحولات. على عكس الأساليب الحالية التي تعتمد فقط على أوزان الانتباه أو تركز على التنبؤات النهائية، يستخدم CA-LIG التدرجات المتكاملة كطريقة النسبة الأساسية، مما يضمن أن تلتزم درجات الأهمية بالخصائص البديهية. يحسب الإطار التدرجات المتكاملة على مستوى الطبقة في كل كتلة من المحولات، ملتقطًا تطور أهمية الرموز عبر النموذج. من خلال دمج تدرجات الانتباه، يجسر CA-LIG بين مساهمات الرموز المحلية والاعتماديات الهيكلية العالمية، مما يؤدي إلى خرائط نسب موقعة تحافظ على الأهمية وتعكس التفكير الداخلي للنموذج. تختتم المقدمة بتحديد مساهمات الدراسة، بما في ذلك تطوير إطار عمل XAI موحد والتحقق من صحته عبر مهام NLP وتطبيقات الرؤية المختلفة.
طرق
يقدم إطار CA-LIG نهجًا جديدًا لتفسير النماذج في هياكل المحولات، ويتكون من أربع مراحل مترابطة. في البداية، يتم حساب التدرجات المتكاملة على مستوى الطبقة في كل كتلة من المحولات لتقييم مساهمة التمثيلات المخفية الوسيطة في تنبؤات النموذج. يتبع ذلك اشتقاق تدرجات الانتباه الخاصة بالفئة لتحليل تدفق المعلومات عبر رؤوس الانتباه والتفاعلات بين الرموز. ثم يتم دمج هذين الإشارتين باستخدام آلية واعية بالسياق، مما يؤدي إلى درجات أهمية موحدة تلخص كل من أهمية الرموز المحلية والاعتماديات الهيكلية العالمية. تتضمن المرحلة النهائية عملية نسبة واعية بالسياق تثبت الدرجات وتحافظ على الأهمية عبر الطبقات، مما ينتج في النهاية خريطة نسب موقعة. يسمح هذا التصميم الشامل لـ CA-LIG بالتقاط تطور وتفاعل الأدلة عبر الهيكل الهرمي لطبقات المحولات بشكل فعال، مما ينتج تفسيرات قابلة للتفسير وحساسة للسياق.
بالمقارنة مع طرق النسبة الحالية مثل التدرجات المتكاملة، والتدرجات المتكاملة الهيسية، وTransformer-LRP، يتميز CA-LIG من خلال دمج التدرجات المتكاملة على مستوى الطبقة مع دمج تدرجات الانتباه الخاصة بالفئة. تسهل هذه الدمج تفسيرات هرمية وواعية بالسياق تتبع تطور الأدلة عبر الطبقات. تم تقييم المنهجية بدقة من خلال التجارب على نماذج المحولات المعتمدة على الترميز عبر مهام NLP متنوعة ومهمة رؤية، مع مقارنة ضد تقنيات التفسير المعتمدة. استخدمت التجارب بذور عشوائية ثابتة لضمان القابلية للتكرار، مع تنفيذ عدة جولات لضمان موثوقية خرائط النسبة. بالإضافة إلى ذلك، تم اختبار CA-LIG في ثلاث تكوينات – التدرجات المتكاملة الواعية بالسياق في الطبقة النهائية، ونهج نسبة طبقي، واستراتيجية تجميع هرمية – مما يظهر مرونته في تفسير سلوك النموذج عبر طبقات مختلفة.
النتائج
تظهر نتائج إطار CA-LIG فعاليته في توليد تفسيرات واعية بالسياق عبر نماذج المحولات ومهام متنوعة. تكشف التصورات النوعية أن CA-LIG يلتقط الاعتماديات السياقية بعيدة المدى، كما يتضح من أدائه على مجموعة بيانات 20 Newsgroups مع نماذج BERT، حيث ينقل الأهمية بشكل متماسك عبر مستندات طويلة. تشير المقارنات الكمية مع الأساليب الأساسية إلى أن CA-LIG ينتج درجات أهمية مستقرة حتى في اللغات ذات الموارد المنخفضة، مثل الأمهرية، ويتفوق في المهام البصرية من خلال التأكيد على المناطق ذات المعنى الدلالي بدلاً من الميزات المتناثرة.
تظهر تحليلات النسبة على مستوى الطبقة أن CA-LIG يعزل بفعالية الكلمات المهمة دلاليًا وي捕ط تدفقات النسبة الأعمق داخل هيكل المحول. على سبيل المثال، يحدد المفاهيم اللاهوتية في مجموعة بيانات 20 Newsgroups وتعبيرات المشاعر في مراجعات IMDB من خلال تجميع الأهمية عبر الطبقات، مما يتجنب التركيز المفرط على الرموز الخاصة مثل [CLS]. تعزز قدرة الإطار على تسليط الضوء على التفاعلات بين الرموز المحددة للموضوع وتقليل وزن العناصر غير ذات الصلة من قابلية التفسير وتتوافق مع التفكير البشري. بشكل عام، يجسر CA-LIG الفجوة بين معالجة اللغة الطبيعية ومهام الرؤية، مما يبرز ضرورة السياق في الذكاء الاصطناعي القابل للتفسير (XAI).
نقاش
في مناقشة تقنيات التفسير لنماذج معالجة اللغة الطبيعية (NLP)، تصنف الورقة الأساليب الحالية إلى خمس مجموعات رئيسية: الأساليب المعتمدة على الاضطراب، والأساليب المعتمدة على النشاط، والأساليب المعتمدة على التدرجات، والأساليب المعتمدة على الانتباه، والأساليب الهجينة. تعد الأساليب المعتمدة على الاضطراب، مثل SHAP وLIME، تعدل ميزات الإدخال لتقييم تأثيرها على تنبؤات النموذج ولكن يمكن أن تكون مكلفة حسابيًا وتنتج نتائج غير متسقة في الهياكل العميقة مثل المحولات. تكافح التقنيات المعتمدة على النشاط، بما في ذلك رسم تنشيط الفئة ونشر الأهمية على مستوى الطبقة، مع النسب الدقيقة بسبب تعقيد هياكل المحولات. توفر الأساليب المعتمدة على التدرجات، مثل التدرجات المتكاملة، نسبًا فعالة ولكن غالبًا ما تفشل في التقاط التطور السياقي لدلالات الرموز عبر الطبقات. تستفيد الأساليب المعتمدة على الانتباه من آليات الانتباه لتصور أهمية الرموز ولكن قد تتجاهل المكونات الحيوية في عملية التفكير الخاصة بالنموذج.
لمعالجة هذه القيود، تقترح الورقة إطار عمل جديد للتدرجات المتكاملة الواعية بالسياق (CA-LIG)، الذي يقوم بتفكيك مساهمات الأهمية عبر كتل المحولات مع الحفاظ على التوافق مع تطور الرموز السياقية. تحسب هذه الطريقة درجات الأهمية الوسيطة في كل طبقة وتدمجها مع إشارات اتجاهية من درجات الانتباه المعتمدة على التدرجات، مما يؤدي إلى تفسيرات أكثر تفصيلًا وقابلية للتفسير. يتم تقييم إطار CA-LIG مقابل المعايير المعتمدة، مما يظهر أداءً متفوقًا في تقديم نسب متماسكة وذات صلة سياقية مقارنة بالأساليب الحالية. تؤكد النتائج على أهمية التقاط تدفق المعلومات الهرمي والتفاعلات السياقية في نماذج المحولات لتعزيز قابلية تفسير تنبؤاتها.
القيود
تسلط قيود إطار CA-LIG الضوء على عدة مجالات للتحسين والبحث المستقبلي. بشكل أساسي، تم تصميم الإطار حاليًا لنماذج الترميز فقط، ولم يتم إجراء أي اختبار على نماذج اللغة المعتمدة على فك التشفير. بالإضافة إلى ذلك، يتم ضبط معامل الدمج $\lambda$ يدويًا، مما يشير إلى الحاجة إلى استراتيجيات أكثر تكيفًا أو قابلة للتعلم لتعزيز وظيفته. على الرغم من أن CA-LIG قد أظهر أداءً قويًا في المهام النصية، إلا أن تطبيقه في مجال الرؤية لا يزال غير مستكشف بشكل كافٍ، مما يتطلب مزيدًا من التجارب عبر نماذج الرؤية المختلفة والمهام ومجموعات البيانات لتقييم فعاليته بشكل شامل.
علاوة على ذلك، لا تتناول الدراسة تحديات تفسير المحولات متعددة الوسائط، لا سيما فيما يتعلق بقضايا قابلية التفسير الناشئة عن مسارات الانتباه عبر الوسائط. تهدف الأعمال المستقبلية إلى معالجة هذه القيود من خلال توسيع إطار CA-LIG ليشمل نماذج المحولات المعتمدة على الرؤية، ونماذج المحولات المعتمدة على فك التشفير، ونماذج المحولات متعددة الوسائط، وتطوير آليات دمج تكيفية، وإجراء تقييمات شاملة عبر السياقات اللغوية والرؤية ومتعددة الوسائط.
DOI: https://doi.org/10.1016/j.neucom.2026.133050
Publication Date: 2026-02-12
Author(s): Melkamu Abay Mersha et al.
Primary Topic: Explainable Artificial Intelligence (XAI)
Overview
The research introduces the Context-Aware Layer-wise Integrated Gradients (CA-LIG) Framework, which addresses the limitations of existing explainability methods for Transformer models. Traditional approaches often rely on final-layer attributions and fail to capture inter-token dependencies, context-awareness, and the evolution of relevance across layers. In contrast, CA-LIG computes layer-wise Integrated Gradients within each Transformer block and integrates these with class-specific attention gradients, resulting in context-sensitive attribution maps that reflect both supportive and opposing evidence. This unified framework enhances the interpretability of Transformer decision-making by tracing the hierarchical flow of relevance.
Extensive evaluations across various tasks—including sentiment analysis, hate speech detection in low-resource languages, and image classification—demonstrate that CA-LIG consistently provides more faithful attributions and clearer visualizations compared to established methods. The framework’s ability to preserve relevance across layers and capture contextual dependencies leads to explanations that are not only more reliable but also more aligned with the hierarchical nature of Transformer architectures. Overall, CA-LIG represents a significant advancement in the interpretability of deep neural models, promoting transparency and trustworthiness in Transformer-based applications. The implementation code will be publicly available upon acceptance of the paper.
Introduction
The introduction of the paper highlights the significance of Transformer-based architectures, such as BERT, GPT, and T5, in modern natural language processing (NLP) and artificial intelligence applications. These models leverage multi-head self-attention, deep hierarchical representations, and scalable parallel computation to effectively capture long-range dependencies and complex semantic interactions. Despite their success, the opaque nature of Transformer models poses challenges in understanding how token representations evolve and how contextual dependencies influence predictions. This has led to an increased demand for eXplainable AI (XAI) techniques, which currently face limitations such as final-layer bias, lack of unified local-global reasoning, and insufficient context awareness.
To address these challenges, the authors propose the Context-Aware Layer-wise Integrated Gradients (CA-LIG) Framework, which aims to provide context-sensitive explanations for Transformer models. Unlike existing methods that rely solely on attention weights or focus on final predictions, CA-LIG employs Integrated Gradients as the primary attribution method, ensuring relevance scores adhere to axiomatic properties. The framework computes Layer-wise Integrated Gradients at each Transformer block, capturing the evolution of token relevance throughout the model. By integrating attention gradients, CA-LIG bridges local token contributions with global structural dependencies, resulting in signed, relevance-conserving attribution maps that reflect the model’s internal reasoning. The introduction concludes by outlining the contributions of the study, including the development of a unified XAI framework and its validation across various NLP tasks and vision applications.
Methods
The CA-LIG framework introduces a novel approach to model interpretation in Transformer architectures, consisting of four interconnected stages. Initially, Layer-wise Integrated Gradients are calculated at each Transformer block to assess the contribution of intermediate hidden representations to the model’s predictions. This is followed by deriving class-specific attention gradients to analyze the flow of information through attention heads and the interactions among tokens. These two signals are then integrated using a context-aware mechanism, resulting in unified relevance scores that encapsulate both local token importance and global structural dependencies. The final stage involves a context-aware attribution process that stabilizes the scores and conserves relevance across layers, ultimately producing a signed attribution map. This comprehensive design allows CA-LIG to effectively capture the evolution and interaction of evidence throughout the hierarchical structure of Transformer layers, yielding interpretable and context-sensitive explanations.
In comparison to existing attribution methods such as Integrated Gradients, Integrated Hessians, and Transformer-LRP, CA-LIG stands out by combining layer-wise Integrated Gradients with class-specific attention-gradient fusion. This integration facilitates hierarchical and context-aware explanations that track evidence evolution across layers. The methodology was rigorously evaluated through experiments on various encoder-based Transformer models across diverse NLP tasks and a vision task, benchmarking against established explainability techniques. The experiments utilized fixed random seeds for reproducibility, with multiple runs to ensure the reliability of attribution maps. Additionally, CA-LIG was tested in three configurations—Context-Aware Integrated Gradients at the final layer, a layered attribution approach, and a hierarchical aggregation strategy—demonstrating its flexibility in interpreting model behavior across different layers.
Results
The results of the CA-LIG framework demonstrate its effectiveness in generating context-aware explanations across various Transformer models and tasks. Qualitative visualizations reveal that CA-LIG captures long-range contextual dependencies, as evidenced by its performance on the 20 Newsgroups dataset with BERT models, where it coherently propagates relevance across lengthy documents. Quantitative comparisons with baseline methods indicate that CA-LIG produces stable relevance scores even in low-resource languages, such as Amharic, and excels in visual tasks by emphasizing semantically meaningful regions rather than scattered features.
Layer-wise attribution analyses show that CA-LIG effectively isolates semantically important words and captures deeper attribution flows within the Transformer’s architecture. For instance, it identifies theological concepts in the 20 Newsgroups dataset and sentiment expressions in IMDB reviews by aggregating relevance across layers, thereby avoiding overemphasis on special tokens like [CLS]. The framework’s ability to highlight interactions among topic-defining tokens and down-weight irrelevant elements enhances interpretability and aligns with human reasoning. Overall, CA-LIG bridges the gap between natural language processing and vision tasks, underscoring the necessity of context in explainable artificial intelligence (XAI).
Discussion
In the discussion of explainability techniques for natural language processing (NLP) models, the paper categorizes existing methods into five main groups: perturbation-based, activation-based, gradient-based, attention-based, and hybrid approaches. Perturbation-based methods, such as SHAP and LIME, modify input features to assess their impact on model predictions but can be computationally intensive and yield inconsistent results in deep architectures like Transformers. Activation-based techniques, including Class Activation Mapping and Layer-wise Relevance Propagation, analyze neuron activations but struggle with fine-grained attributions due to the complexity of Transformer structures. Gradient-based methods, such as Integrated Gradients, provide efficient attributions but often fail to capture the contextual evolution of token semantics across layers. Attention-based methods leverage attention mechanisms to visualize token relevance but may overlook critical components of the model’s reasoning process.
To address these limitations, the paper proposes a novel Context-Aware Layer-wise Integrated Gradient (CA-LIG) framework, which decomposes relevance contributions across Transformer blocks while maintaining alignment with contextual token evolution. This approach computes intermediate relevance scores at each layer and integrates them with directional signals from gradient-weighted attention scores, resulting in more granular and interpretable explanations. The CA-LIG framework is evaluated against established benchmarks, demonstrating superior performance in providing coherent and contextually relevant attributions compared to existing methods. The findings underscore the importance of capturing hierarchical information flow and contextual interactions in Transformer models to enhance the interpretability of their predictions.
Limitations
The limitations of the CA-LIG framework highlight several areas for improvement and future research. Primarily, the framework is currently tailored for encoder-only models, with no testing conducted on decoder-based language models. Additionally, the fusion coefficient $\lambda$ is manually tuned, indicating a need for more adaptive or learnable strategies to enhance its functionality. While CA-LIG has shown strong performance in text-based tasks, its application in the vision domain is still underexplored, necessitating further experiments across various vision models, tasks, and datasets to evaluate its effectiveness comprehensively.
Moreover, the study does not tackle the challenges of multimodal Transformer explainability, particularly regarding the interpretability issues arising from cross-modal attention pathways. Future work aims to address these limitations by expanding the CA-LIG framework to include vision-based, decoder-based, and multimodal Transformer models, developing adaptive fusion mechanisms, and performing extensive evaluations across language, vision, and multimodal contexts.
