首页 > 其他分享 >Proj. CDeepFuzz Paper Reading: Checker Bug Detection and Repair in Deep Learning Libraries

Proj. CDeepFuzz Paper Reading: Checker Bug Detection and Repair in Deep Learning Libraries

时间:2024-11-13 23:29:24浏览次数:1  
标签:Repair code Deep Detection added commit message bug change

3. TensorGuard: A RAG-Based Multi-agent framework to detect and fix DL Checker Bugs

RAG Design

relevant contextual information from a large corpus of code changes
Input: the root cause of the checker bug queried
Output: code change
Based on:
Sentence-transformers + all-MiniLM-L6-v2 as the embedding model, converts the documents to a 384-dimensional dense vector space
batch size: 50, chromadb

Checker Bug Detection Agent

COT, Zero-Shot, Few-Shot(随机选两个样例)

TABLE V: Prompt template for bug detection agent (COT).

“prompt”: You are an AI trained to detect bugs in a deep-learning
library based on commit messages and code changes. Your task
is to determine whether a given commit introduces a bug or not.
Follow the steps below to reason through the problem and arrive at
a conclusion.
1. Understand the commit message: Analyze the commit message
to understand the context and purpose of the code change.
{commit message}
2. Review the code change: Examine the deleted and
added lines of code to identify the modifications made.
{code removed}{code added}
3. Identify potential issues: Look for any missing, improper, or
insufficient checkers within the code change. Checkers may include
error handling, input validation, boundary checks, or other safety
mechanisms.
4. Analyze the impact: Consider the impact of the identified issues
on the functionality and reliability of the deep learning libraries.
5. Make a decision: Based on the above analysis, decide whether
the commit introduces a bug or not.
6. Output the conclusion: Generate a clear output of “YES” if the
commit introduces a bug, or “NO” if it does not.
“output”: {Decision}

TABLE VI: Prompt template for bug detection agent (Zero Shot).

“prompt”: You are an AI trained to detect bugs in a deep-learning
library based on commit messages and code changes. Your task
is to determine whether a given commit introduces a bug or not.
Follow the steps below to reason through the problem and arrive at
a conclusion.
Commit message: {commit message}
Code change: {code removed}{code added}
“output”: {Decision}

TABLE VII: Prompt template for bug detection agent (Few Shot).

“prompt”: You are an AI trained to detect bugs in a deep-learning
library based on commit messages and code changes. Your task
is to determine whether a given commit introduces a bug or not.
Follow the steps below to reason through the problem and arrive at
a conclusion.
Example Checker Bug One:
Commit message: {commit message}
Code change: {code removed}{code added}
Example Checker Bug Two:
Commit message: {commit message}
Code change: {code removed}{code added}
Task:
Commit message: {commit message}
Code change: {code removed}{code added}
“output”: {Decision}

Root Cause Analysis Agent

TABLE VIII: Prompt template for root cause analysis agent.

“prompt”: Please describe the root cause of the bug based on the
following commit message:{commit message}
“output”: {Root causes}

Patch Generation Agent

TABLE IX: Prompt template for patch generation agent.

“prompt”: You are given a bug explanation and an external context
for fixing a checker bug. Please think step by step and generate a
patch to fix the bug in the code snippet. Please neglect any issues
related to the indentation in the code snippet. Fixing indentation
is not the goal of this task. If you think the given pattern can be
applied, generate the patch.
Example One: {code removed} {code added}
Example Two: {code removed} {code added}
Bug explanation: {bug explanation}
Retrieved context: {retrieved knowledge}
Code snippet: {code snippet}
“output”: {Think steps}{Patch}

标签:Repair,code,Deep,Detection,added,commit,message,bug,change
From: https://www.cnblogs.com/xuesu/p/18544992

相关文章

  • deepin v23玩游戏体验
    现在是2024年11月13日。首先安装steam,发现安装有问题,需要借助其他工具来安装,安装包安装也会有问题。需要先安装flatpak,然后使用flatpak安装steam,教程是这个链接:https://bbs.deepin.org/post/259598flathub.org网站里你进去后搜索steam,点击install会发现下载了一个com.valvesoftware.Steam.flatpakref的文件,......
  • DeepMind今日发布并开源其最先进AI蛋白质预测工具AlphaFold3程序代码
    “迟来总比没有好”!GoogleDeepMind今日向充满期待的学术界公开了其最新人工智能蛋白质预测软件的源代码。尽管部分科学家对DeepMind耗费六个月时间才公布代码表示不满,但绝大多数科研人员对此表示欢迎。5月8日,DeepMind在《自然》杂志上发表文章,宣布推出了AlphaFold3,该技术......
  • AFPN: Asymptotic Feature Pyramid Network for Object Detection-afpn
    paper可以借鉴的点:下采样和上次样融合两个不同尺度特征图fromcollectionsimportOrderedDictimporttorchimporttorch.nnasnnimporttorch.nn.functionalasFdefBasicConv(filter_in,filter_out,kernel_size,stride=1,pad=None):ifnotpad:p......
  • 大模型--训练加速之deepspeed demo-13
    目录1.config.json2.main.py3.start.sh1.config.json{"train_batch_size":4,"steps_per_print":2000,"optimizer":{"type":"Adam","params":{"lr":0.001,......
  • 合并果子 / [USACO06NOV] Fence Repair G
    题目描述在一个果园里,多多已经将所有的果子打了下来,而且按果子的不同种类分成了不同的堆。多多决定把所有的果子合成一堆。每一次合并,多多可以把两堆果子合并到一起,消耗的体力等于两堆果子的重量之和。可以看出,所有的果子经过 n−1n−1 次合并之后,就只剩下一堆了。多多在......
  • 语义分割实战——基于DeepLabv3+神经网络头发分割系统源码
       第一步:准备数据头发分割数据,总共有1050张图片,里面的像素值为0和1,所以看起来全部是黑的,不影响使用第二步:搭建模型DeepLabV3+的网络结构如下图所示,主要为Encoder-Decoder结构。其中,Encoder为改进的DeepLabV3,Decoder为3+版本新提出的。1.1、Encoder在Encoder部分,主要......
  • deepin-installer.conf的内容
    -[General]%23%20repair_script_points=deepin-livecd-relaunchCDROM=/lib/live/mount/mediumDISTRIBUTION=debianDI_AVATAR=/var/lib/AccountsService/icons/1.pngDI_BOOTLOADER=/dev/sdaDI_COMPONENT_PACKAGES=DI_COMPONENT_UNINSTALL=DI_CRYPT_PASSWD=DI_CUR_RE......
  • MMdetection 问题报错 mmdet/evaluation/metrics/coco_metric.py data[‘category_id
    方案一:有人说在自己定义的conifg文件中增加 metainfo={'classes':('class1','class2','class2',),'palette':[(220,20,60),(221,11,22),(221,11,42),]}方案二:修改mmdet/evaluation/metrics文件的内......
  • 【人脸伪造检测】Spatial-Phase Shallow Learning: Rethinking Face Forgery Detectio
    一、研究动机[!note]创新点:利用相位谱实现伪造检测,并且证明了卷积模型可以提取隐性特征。由于上采样是伪造模型的关键步骤,这篇论文通过相位信息检测上采样的伪影。对比之前的频率模型:F3-Net:通过离散余弦变换后的统计特征实现伪造检测二、检测模型可学习的知识点......
  • 【人脸伪造检测后门攻击】 Exploring Frequency Adversarial Attacks for Face Forger
    一、研究动机​ 现有的后门攻击方法生成的对抗样本容易被识别,只是在空间域增加了扰动。为此,作者提出了一种频率对抗性攻击的方法,在频域中增加了对抗性的扰动DCT,接着利用融合模块对不同频段的能量进行微调,有效的避免了在空间范围攻击的冗余噪声:FGSM,PGD,最终通过逆变换生成对抗样......