DOI: https://doi.org/10.1007/s10664-026-10809-3
تاريخ النشر: 2026-02-10
المؤلف: Zeming Dong وآخرون
الموضوع الرئيسي: أبحاث هندسة البرمجيات
نظرة عامة
تقدم البحث GenCode، وهو إطار جديد لت augmentation البيانات يهدف إلى تعزيز تدريب نماذج فهم الشيفرة. على الرغم من التقدم في نماذج الشيفرة المدربة مسبقًا، لا يزال مجال augmentation البيانات لبيانات الشيفرة غير مستكشف بشكل كاف. يعمل GenCode على نموذج توليد واختيار، حيث يقوم أولاً بتوليد مرشحين جدد للشيفرة باستخدام تقنيات augmentation متنوعة ثم يختار المرشحين الأكثر تأثيرًا بناءً على درجات تأثيرهم. تم تقييم الإطار عبر أربع مهام لفهم الشيفرة وأظهر أداءً متفوقًا مقارنةً بالطريقة الرائدة MixCode، محققًا زيادة في الدقة المتوسطة بنسبة 2.92% وتحسينًا بنسبة 4.90% في القوة المضادة لنماذج الشيفرة المدربة مسبقًا. بالنسبة لنماذج اللغة الكبيرة الخاصة بالشيفرة، حقق GenCode زيادة متوسطة في الدقة بنسبة 0.93% وزيادة بنسبة 0.98% في القوة الطبيعية.
في الختام، يمثل GenCode الإطار الأول الذي يستخدم نهج التوليد والاختيار لتحسين نماذج فهم الشيفرة. الفرضية الأساسية هي أن البيانات الأقل ثقة تكون أكثر فائدة لتدريب النموذج. من خلال استخدام مشغلات augmentation البيانات الذرية، يقوم GenCode بتوليد بيانات تدريب مرشحة ويختار تلك التي تحتوي على أعلى قيم خسارة للتدريب. تؤكد نتائج التقييم أن GenCode لا ينتج فقط نماذج أكثر دقة وقوة من MixCode ولكن أيضًا يبرز أهمية درجات التأثير في تعزيز فعاليته.
مقدمة
في مقدمة هذه الورقة البحثية، يبرز المؤلفون الأهمية المتزايدة للتعلم العميق (DL) في مهام فهم الشيفرة، مثل اكتشاف نسخ الشيفرة وتصنيف البرامج، التي تفوقت على تقنيات هندسة البرمجيات التقليدية. على الرغم من التقدم في تمثيل الشيفرة وهياكل النماذج، لا يزال إعداد بيانات تدريب عالية الجودة يمثل تحديًا حاسمًا، وغالبًا ما يتطلب جهدًا بشريًا كبيرًا وخبرة في المجال. يشير المؤلفون إلى أن تقنيات augmentation البيانات الحالية، على الرغم من كونها مفيدة، لها قيود في تعزيز دقة النموذج وقوته، مما يستدعي الحاجة إلى طرق أكثر فعالية.
لمعالجة هذه الفجوة، يقترح المؤلفون GenCode، وهو إطار جديد يعتمد على التوليد والاختيار ل augmentation البيانات لفهم الشيفرة. يعمل GenCode في مرحلتين: يقوم بتوليد مرشحين للتدريب باستخدام طرق augmentation متنوعة، بما في ذلك إعادة هيكلة الشيفرة التي تحافظ على المعنى و augmentation النصوص التي تكسر التركيب، ثم يختار عينات قيمة بناءً على درجات التأثير المستمدة من قيم خسارة النموذج. تشير نتائج التجارب الشاملة إلى أن GenCode يحسن بشكل كبير دقة نماذج الشيفرة المدربة مسبقًا بنسبة تصل إلى 3.63% مقارنةً بأساليب التدريب التقليدية ويعزز القوة بمعدل 8.42%. تستكشف الدراسة أيضًا تأثير استراتيجيات درجات التأثير المختلفة وطرق اختيار البيانات، وتخلص إلى أن GenCode يتفوق على تقنيات augmentation الحالية ويقدم رؤى قيمة في تحسين بيانات التدريب لنماذج الشيفرة.
الطرق
تحدد قسم المنهجية تصميم البحث والتقنيات التحليلية المستخدمة في الدراسة. استخدم المؤلفون نهجًا كميًا، حيث استخدموا طرقًا إحصائية لتحليل البيانات المجمعة من عينة سكانية. تم تشغيل المتغيرات الرئيسية وقياسها باستخدام أدوات موثوقة، مما يضمن موثوقية وصحة النتائج.
تم إجراء تحليل البيانات باستخدام أدوات البرمجيات، مع إيلاء اهتمام خاص لتطبيق تحليل الانحدار لتحديد العلاقات بين المتغيرات المستقلة والتابعة. تم تقييم أهمية النتائج باستخدام قيم p، مع تحديد عتبة عند p < 0.05 لتحديد الأهمية الإحصائية. شملت المنهجية أيضًا وصفًا تفصيليًا لعملية أخذ العينات، مما يضمن أن العينة كانت تمثل السكان الأكبر، مما يعزز قابلية تعميم النتائج.
المناقشة
في قسم المناقشة من الورقة البحثية، يؤكد المؤلفون على أهمية تقنيات تمثيل الشيفرة في تحويل الشيفرة المصدرية إلى تنسيقات مناسبة للشبكات العصبية العميقة (DNNs). يصنفون الطرق الحالية إلى تمثيلات قائمة على التسلسل وتمثيلات قائمة على الرسم البياني، مع تسليط الضوء على تطبيقاتها في مهام مثل تصنيف البرامج الآلي واكتشاف نسخ الشيفرة. يركز المؤلفون على معالجة بيانات الشيفرة واستخدام نماذج مدربة مسبقًا قوية ونماذج لغة كبيرة خاصة بالشيفرة (LLMs) التي أظهرت أداءً ملحوظًا في مهام فهم الشيفرة.
تستكشف الورقة أيضًا استراتيجيات augmentation البيانات المصممة خصيصًا للشيفرة، مشيرةً إلى أنه على الرغم من أن الطرق التقليدية مثل إعادة هيكلة الشيفرة أظهرت فعالية محدودة في تعزيز تدريب النموذج، فإن التقنيات الأحدث مثل MixCode أثبتت أنها أكثر فائدة. ومع ذلك، فإن قابلية تطبيق MixCode مقيدة بمهام التصنيف بسبب اعتمادها على تسميات مشفرة بتنسيق one-hot. لمعالجة هذه القيود، يقترح المؤلفون إطارًا جديدًا لت augmentation الشيفرة يكون متعدد الاستخدامات وفعالًا عبر مهام مختلفة. كما يستكشفون قوة نماذج الشيفرة، مميزين بين القوة الطبيعية والقوة المضادة، ويستخدمون دراسات تجريبية للتحقق من نتائجهم. من الجدير بالذكر أنهم يثبتون وجود علاقة إيجابية بين قيم الخسارة لبيانات التدريب ودقة نماذج الشيفرة الناتجة، مما يشير إلى أن العينات ذات الخسارة العالية يمكن أن تكون مفيدة لتدريب النموذج، خاصة في المراحل المبكرة من التدريب. هذه الرؤية تؤثر على تصميم إطار augmentation البيانات الخاص بهم، الذي يعطي الأولوية لاختيار العينات المفيدة لتعزيز أداء النموذج.
القيود
تسلط القيود المفروضة على نماذج الشيفرة المدروسة، على الرغم من تحقيقها دقة تزيد عن 90% في مهام مختلفة، الضوء على المخاوف بشأن قوتها. على وجه الخصوص، لا تزال أداء نماذج اللغة الكبيرة (LLMs) في اكتشاف النسخ دون المستوى الأمثل، كما يتضح من دقة Chat-GPT التي تبلغ 0.784 فقط لاكتشاف أزواج Java-Java، كما أفاد Khajezade وآخرون (2024). بالإضافة إلى ذلك، في المهام التي تتضمن توزيعات فئات واسعة، مثل مجموعة بيانات Java250 المستخدمة في هذا البحث، تواجه LLMs تحديات في التنبؤ بدقة بالتسميات بسبب ضرورة تضمين العديد من أدلة التسميات ضمن المطالبات. وهذا يشير إلى أنه على الرغم من أن النماذج تظهر دقة عالية، فإن تطبيقها العملي في السيناريوهات المعقدة محدود.
DOI: https://doi.org/10.1007/s10664-026-10809-3
Publication Date: 2026-02-10
Author(s): Zeming Dong et al.
Primary Topic: Software Engineering Research
Overview
The research introduces GenCode, a novel data augmentation framework aimed at enhancing the training of code understanding models. Despite the advancements in pre-trained code models, the area of data augmentation for code data remains underexplored. GenCode operates on a generation-and-selection paradigm, where it first generates new code candidates using various augmentation techniques and subsequently selects the most impactful candidates based on their influence scores. The framework was evaluated across four code understanding tasks and demonstrated superior performance compared to the state-of-the-art method MixCode, achieving an average accuracy increase of 2.92% and a 4.90% improvement in adversarial robustness for pre-trained code models. For code-specific large language models, GenCode yielded an average accuracy enhancement of 0.93% and a 0.98% increase in natural robustness.
In conclusion, GenCode represents the first framework utilizing a generation-and-selection approach to improve code understanding models. The underlying hypothesis is that less confident data is more beneficial for model training. By employing atomic data augmentation operators, GenCode generates candidate training data and selects those with the highest loss values for training. The evaluation results affirm that GenCode not only produces more accurate and robust models than MixCode but also highlights the significance of influence scores in enhancing its effectiveness.
Introduction
In the introduction of this research paper, the authors highlight the growing significance of deep learning (DL) in code understanding tasks, such as code clone detection and program classification, which have outperformed traditional software engineering techniques. Despite advancements in code representation and model architectures, the preparation of high-quality training data remains a critical challenge, often requiring substantial human effort and domain expertise. The authors note that existing data augmentation techniques, while useful, have limitations in enhancing model accuracy and robustness, prompting the need for more effective methods.
To address this gap, the authors propose GenCode, a novel generation-and-selection-based data augmentation framework for code understanding. GenCode operates in two stages: it generates training candidates using various augmentation methods, including semantic-preserving code refactoring and syntax-breaking text augmentation, and then selects valuable samples based on influence scores derived from model loss values. The results of comprehensive experiments indicate that GenCode significantly improves the accuracy of pre-trained code models by up to 3.63% compared to traditional training methods and enhances robustness by an average of 8.42%. The study also explores the impact of different influence score strategies and data selection methods, concluding that GenCode outperforms existing augmentation techniques and provides valuable insights into optimizing training data for code models.
Methods
The methodology section outlines the research design and analytical techniques employed in the study. The authors utilized a quantitative approach, employing statistical methods to analyze the data collected from a sample population. Key variables were operationalized and measured using validated instruments, ensuring reliability and validity in the findings.
Data analysis was conducted using software tools, with specific attention given to the application of regression analysis to identify relationships between the independent and dependent variables. The significance of the results was assessed using p-values, with a threshold set at p < 0.05 to determine statistical significance. The methodology also included a detailed description of the sampling process, ensuring that the sample was representative of the larger population, thereby enhancing the generalizability of the results.
Discussion
In the discussion section of the research paper, the authors emphasize the significance of code representation techniques in transforming source code into formats suitable for Deep Neural Networks (DNNs). They categorize existing methods into sequence-based and graph-based representations, highlighting their applications in tasks such as automated program classification and code clone detection. The authors focus on the preprocessing of code data and the utilization of powerful pretrained models and code-specific large language models (LLMs) that have demonstrated remarkable performance in code understanding tasks.
The paper also explores data augmentation strategies tailored for code, noting that while traditional methods like code refactoring have shown limited effectiveness in enhancing model training, newer techniques such as MixCode have proven more beneficial. However, MixCode’s applicability is restricted to classification tasks due to its reliance on one-hot encoded labels. To address these limitations, the authors propose a novel code augmentation framework that is versatile and effective across various tasks. They further investigate the robustness of code models, distinguishing between natural and adversarial robustness, and employ empirical studies to validate their findings. Notably, they establish a positive correlation between the loss values of training data and the accuracy of the resulting code models, suggesting that high-loss samples can be informative for model training, particularly in the early stages of training. This insight informs the design of their data augmentation framework, which prioritizes the selection of informative samples to enhance model performance.
Limitations
The limitations of the studied code models, despite achieving over 90% accuracy in various tasks, highlight concerns regarding their robustness. Specifically, the performance of large language models (LLMs) in clone detection remains suboptimal, as evidenced by Chat-GPT’s Precision of only 0.784 for Java-Java pair detection, as reported by Khajezade et al. (2024). Additionally, in tasks involving extensive class distributions, such as the Java250 dataset utilized in this research, LLMs face challenges in accurately predicting labels due to the necessity of incorporating numerous label guides within the prompts. This indicates that while the models demonstrate high accuracy, their practical application in complex scenarios is limited.
