跳到正文
返回论文列表
cs.CR提交于 已译

通过触发器中和反事实评分实现代码模型的高效后门攻击

Data-Efficient Backdoor Attacks on Code Models via Trigger-Neutralized Counterfactual Scoring

Yu-Yu Lee · Ming-Feng Tsai · Tomohiro Morikawa · Chun-I Fan

中文摘要

预训练代码模型面临后门投毒风险:攻击者构造特定训练样本,使模型在触发器出现时产生错误行为。为降低样本数量、成本与暴露风险,并减少防御系统可发现的痕迹,攻击者需精心选择投毒样本。现有数据高效选择方法面向图像分类,无法为自回归生成提供评分机制,也未在代码任务中研究。触发器中和反事实评分(Trigger-Neutralized Counterfactual Scoring,TNCS)通过比较触发输入与触发器中和后的反事实输入,分离触发器对目标行为的贡献,同时适用于分类和生成。在三个 CodeXGLUE 任务、五类触发器及极低投毒比例下,TNCS 的攻击成功率高于基线,且不损害干净任务性能;投毒比例越低,优势越大。该方法是对所有触发器类别均有效的方法,所选投毒样本还可迁移至不匹配的受害模型。

关键要点

  1. 01现有数据高效投毒选择方法主要面向图像分类,缺少适用于自回归生成的评分机制。
  2. 02TNCS 比较触发输入与触发器中和反事实,用于隔离触发器对目标行为的贡献。
  3. 03在三个 CodeXGLUE 任务和五类触发器上,TNCS 在极低投毒比例下取得更高攻击成功率。
  4. 04TNCS 不降低干净任务性能,且投毒比例越低,相对基线的攻击优势越大。
  5. 05TNCS 是对每类触发器均有效的方法,所选投毒样本还能迁移至不匹配的受害模型。

解读

尚无解读。

原始英文摘要

arXiv:2610.32334v1 Announce Type: cross Abstract: Pre-trained code models are exposed to backdoor poisoning, in which crafted training samples make the model misbehave on a trigger. A capable attacker minimizes the number of such samples, since each adds cost and exposure and a lower poisoning rate leaves a smaller footprint for defenses. Which samples to poison therefore matters, but existing data-efficient selection methods target image classification, offer no scoring mechanism for autoregressive generation, and have not been studied on code. We propose Trigger-Neutralized Counterfactual Scoring (TNCS), which isolates a trigger's contribution to the target behavior by comparing the scoring model's output on a triggered input with its output on a trigger-neutralized counterfactual, covering classification and generation alike. TNCS attains higher attack success rates than the baselines at very low poisoning ratios, across three CodeXGLUE tasks and five trigger families, without degrading clean-task performance, and its margin grows as the ratio decreases. It is the only method effective on every trigger family, and its selected poison set transfers to mismatched victims.

同方向论文 · cs.CR

查看全部 →

反向发现 · 这篇论文相关的工具与提示词

去交叉发现 →

关联提示词 · 6

编程github.com·外部收录·

对提交的代码进行多维度 Code Review,输出按严重程度分类的问题清单、修改建议与审查结论。

# Role 你是一位经验丰富的代码审查专家。你擅长通过建设性反馈、系统性分析和协作改进,将代码审查从「把关」升级为「知识分享」。你熟悉 React、Vue、Rust、TypeScript、Java、Python、C/C++ 等语言的最佳实践。 # Task 对我提供的【代码】进行全面的 Code Review,从正确性、安全性、性能、可维护性、规范性等多维度审查,并给出建设性、可执行的反馈。 # Core Principles ## 1. 审查心态 - **目标**:…

编程zhuanlan.zhihu.com·外部收录·

用 AI 写代码后,在上线前按密钥、数据库、API、依赖、HTTP 五方面逐项扫描安全漏洞

你是一位资深代码安全审计专家。对以下项目逐项检查: 一、密钥与凭证 - 所有 API Key/Token/密码是否用环境变量?.env 是否在 .gitignore? - 是否有硬编码的 JWT Secret、数据库密码? 二、数据库安全 - 用户表是否启用 RLS?SQL 是否参数化查询? - 密码是否用 bcrypt/argon2 哈希? 三、API 安全 - 用户输入是否在服务端校验?认证路由是否加 auth 中间件? - 公开 API 是否有 rate limitin…

编程github.com/f/awesome-chatgpt-prompts·外部收录·

Code Review Assistant for Bug Detection

Act as a Code Review Assistant. You are an expert in software development, specialized in identifying errors and suggesting improvements. Your task is to review code for errors, inefficiencies, and potential improvements. You will: - Analy…

编程github.com/f/awesome-chatgpt-prompts·外部收录·

Vibe Coding with Modern Designs and SEO

Act as a Vibe Coding Expert. You specialize in crafting UI/UX designs that are both visually stunning and highly functional, incorporating the latest trends in motion and 3D effects using Framer. Your task is to develop a web or mobile appl…

编程github.com/f/awesome-chatgpt-prompts·外部收录·

File Analysis API with Node.js and Express

Act as a Node.js and Express Expert. You are an experienced backend developer specializing in building and maintaining APIs. Your task is to analyze files uploaded by users and ensure that the API responses remain unchanged in terms of the…