NESA: تحليل البرامج الثابتة الرمزية العصبية العلائقية NESA: Relational Neuro-Symbolic Static Program Analysis

شارك:
المجلة: Proceedings of the ACM on software engineering.، المجلد: 3، العدد: 0
DOI: https://doi.org/10.1145/3808161
تاريخ النشر: 2026-06-30
المؤلف: Chengpeng Wang وآخرون
الموضوع الرئيسي: تقنيات اختبار البرمجيات وتصحيح الأخطاء

نظرة عامة

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

تظهر تقييمات NESA فعاليته، حيث حقق نتائج تنافسية مقارنة بالتقنيات الحالية. على سبيل المثال، في مهمة مخصصة لاكتشاف ثغرات التلوث على TaintBench، حقق NESA دقة بنسبة 66.27%، واسترجاع بنسبة 78.57%، ودرجة F1 تبلغ 0.72، متفوقًا على معيار صناعي بمقدار 0.20 في درجة F1. بالإضافة إلى ذلك، نجح NESA في تحديد 13 خطأ في تسرب الذاكرة في العالم الحقيقي، والتي تم معالجتها لاحقًا من قبل المطورين. تشير النتائج إلى أن NESA لا يعزز فقط قابلية استخدام التحليل الثابت ولكن أيضًا يساهم في تقديم رؤى قيمة حول دمج LLMs مع منهجيات التحليل الرمزي.

مقدمة

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

تقترح الورقة نهجًا جديدًا يسمى تحليل البرامج الثابتة العصبي الرمزي العلاقي (NESA)، الذي يستفيد من نماذج اللغة الكبيرة (LLMs) لتجاوز هذه التحديات. يقوم NESA بتفكيك مشكلات التحليل المعقدة إلى مشكلات فرعية أبسط، مما يقلل من خطر الهلوسات – الإيجابيات أو السلبيات الكاذبة التي يمكن أن تنشأ من LLMs. يقدم المؤلفون لغة سياسة شبيهة بـ Datalog تجمع بين العلاقات الرمزية والعصبية، مما يسمح بتوليف فعال للتحليل النحوي والدلالي. تظهر تقييمات NESA نتائج مثيرة للإعجاب، حيث تحقق دقة بنسبة 91.50% واسترجاع بنسبة 84.61% في تقطيع البرامج، وتتفوق على الأدوات الحالية في اكتشاف الأخطاء وتحديد الثغرات. تشمل المساهمات الرئيسية تطوير إطار تحليل قابل للتخصيص وخالي من التجميع واستراتيجيات تقييم مبتكرة لتعزيز الأداء مع تقليل هلوسات LLM.

النتائج

تظهر نتائج NESA (التحليل الثابت المعزز بالعصبية) درجة عالية من الاستقرار، حيث تبقى الانحرافات المعيارية للدقة والاسترجاع ضمن 3% عبر مهام مختلفة عند درجة حرارة 0. يُعزى هذا الاستقرار إلى عوامل غير حتمية طفيفة في عملية فك الشفرات الجشعة، مثل كسر التعادل وتقريب الأعداد العشرية. تعتبر معاملات التباين لتكاليف الرموز المدخلة والمخرجة منخفضة بشكل ملحوظ، حيث تصل إلى 0.001 و0.05 على التوالي، مما يشير إلى أن الرموز المدخلة تتأثر بشكل أساسي بهيكل البرنامج وقوالب التحفيز، بينما تظهر الرموز المخرجة تباينًا أكبر بسبب الاختلافات في التفكير المتسلسل (CoT). بالإضافة إلى ذلك، يتم تحديد معامل تباين تكلفة الوقت عند 0.2، ويتأثر بشكل كبير بعوامل خارجية مثل ظروف الشبكة وحمل الخادم.

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

نقاش

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

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

Journal: Proceedings of the ACM on software engineering., Volume: 3, Issue: 0
DOI: https://doi.org/10.1145/3808161
Publication Date: 2026-06-30
Author(s): Chengpeng Wang et al.
Primary Topic: Software Testing and Debugging Techniques

Overview

The research paper introduces NESA, a compositional neuro-symbolic framework designed to enhance static program analysis by enabling compilation-free and customizable approaches. Traditional static analysis methods face limitations due to their reliance on compilation and lack of flexibility. NESA addresses these challenges by utilizing large language models (LLMs) in conjunction with a specialized analysis policy language, a restricted form of Datalog. This framework allows users to decompose complex analysis tasks into simpler sub-problems, focusing on manageable syntactic and semantic properties of smaller code snippets. By employing lazy and incremental prompting, NESA significantly reduces hallucinations associated with LLMs, leading to improved performance in tasks such as program slicing and bug detection.

Evaluation of NESA demonstrates its efficacy, achieving competitive results compared to existing techniques. For instance, in a customized taint vulnerability detection task on TaintBench, NESA attained a precision of 66.27%, a recall of 78.57%, and an F1 score of 0.72, outperforming an industrial benchmark by 0.20 in F1 score. Additionally, NESA successfully identified 13 real-world memory leak bugs, which were subsequently addressed by developers. The findings suggest that NESA not only enhances the usability of static analysis but also contributes valuable insights into the integration of LLMs with symbolic analysis methodologies.

Introduction

The introduction of the research paper discusses the significance of static program analysis in software development, highlighting its applications in program optimization, bug detection, and repair. Despite advancements in precision and efficiency, the adoption of static analyzers in industry remains limited due to two primary constraints: reliance on complete source code for compilation and insufficient customization options for developers. These limitations hinder the integration of static analysis tools into development workflows.

The paper proposes a novel approach called the relational neuro-symbolic static program analysis (NESA), which leverages large language models (LLMs) to overcome these challenges. NESA decomposes complex analysis problems into simpler sub-problems, thereby reducing the risk of hallucinations—false positives or negatives that can arise from LLMs. The authors introduce a Datalog-like policy language that combines symbolic and neural relations, allowing for effective synthesis of syntactic and semantic analysis. The evaluation of NESA demonstrates impressive results, achieving 91.50% precision and 84.61% recall in program slicing, and outperforming existing tools in bug detection and vulnerability identification. Key contributions include the development of a customizable, compilation-free analysis framework and innovative evaluation strategies to enhance performance while mitigating LLM hallucinations.

Results

The results of the NESA (Neural Enhanced Static Analysis) demonstrate a high degree of stability, with standard deviations of precision and recall remaining within 3% across various tasks at temperature 0. This stability is attributed to minor nondeterministic factors in the greedy decoding process, such as tie-breaking and floating-point rounding. The coefficients of variation for input and output token costs are notably low, capped at 0.001 and 0.05, respectively, indicating that input tokens are primarily influenced by the program structure and prompt templates, while output tokens show greater variability due to differences in Chain of Thought (CoT) reasoning. Additionally, the time cost’s coefficient of variation is limited to 0.2, largely affected by external factors like network conditions and server load.

Despite these promising results, NESA faces several limitations. Hallucination remains a significant challenge, particularly in accurately inferring program facts, which can undermine the overall analysis. The computational overhead associated with invoking the LLM multiple times for large-scale projects poses scalability issues. Furthermore, the current syntax of the analysis policy language restricts its applicability, as it only supports program values derived from expressions and lacks context-sensitive analysis capabilities. Future work aims to address these limitations by fine-tuning LLMs with traditional static analysis data to reduce hallucinations, employing smaller, task-specific models to alleviate computational overhead, and expanding symbolic relations to enhance context-sensitive analysis.

Discussion

In this discussion section, the authors address the limitations of current static analysis techniques, particularly their reliance on compilation and lack of customization support. They highlight that mainstream analyzers, such as FlowDroid and Infer, struggle with incomplete programs and require specific compilation configurations, which complicates their use across diverse development environments. Additionally, a significant portion of developers report dissatisfaction with existing tools due to their inability to meet specific needs, necessitating either the creation of new tools or extensive modifications to existing ones.

To overcome these challenges, the authors propose a novel approach to static program analysis that is both compilation-free and customizable, leveraging large language models (LLMs) for analysis via prompting. They introduce NESA, a neuro-symbolic framework that decomposes static analysis problems into manageable sub-problems, thereby reducing the likelihood of hallucinations—errors that arise when LLMs generate incorrect outputs. The authors emphasize the importance of a systematic solution to mitigate these hallucinations, which involves the use of lazy and incremental prompting strategies to optimize the analysis process while minimizing computational costs. Through this innovative approach, they aim to enhance the effectiveness and accessibility of static program analysis tools for developers.