[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"news-slug-agent-patch-unneeded-code-11-percent":3,"topics-all":38,"news-related-496b1a77-0d72-4db6-8570-08e13740a841":67},{"id":4,"title":5,"summary":6,"content":7,"original_url":8,"source_id":9,"tags":10,"translations":24,"news_slug":31,"published_at":32,"created_at":33,"modified_at":34,"is_published":35,"publish_type":36,"image_url":14,"view_count":37},"496b1a77-0d72-4db6-8570-08e13740a841","AI 补丁是虚胖,多余的代码只占 11%","编程智能体补丁行数中位是开发者的 2.33 倍,常被读成乱改;微软团队回放 7,660 条轨迹、逐块回退重跑测试,发现多余代码单元只占 11%,89% 的多余代码还会改变行为;多出的编辑 61% 是测试;代码必要性 0.887,不低于开发者的 0.864。","打开一条编程智能体提的 PR,几百行改动,直觉多半是:又乱改。这个直觉有数据背书:微软团队统计,18 个前沿模型在 SWE-bench Verified 上的中位补丁行数是开发者参考补丁的 2.33 倍;更早的 RECAP 研究([论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F2608.13292))也量出成功智能体补丁的改动量约为开发者的两倍,而且极简提示词基本压不下来。但「改得多」等于「乱改」吗?微软的 Aakash Goel、Benjamin Steenhoek、Yu Hu 三人 11 月 25 日放出的论文([arXiv:2611.34875](https:\u002F\u002Farxiv.org\u002Fabs\u002F2611.34875))把「多余」做成了可度量的东西,结论一句话:AI 补丁是虚胖,不是注水。\n\n## 怎么判定一块代码是多余的\n\n论文的方法叫 Delta Residue Attribution(DRA):回放智能体的完整轨迹,把最终补丁拆成可以独立回退的连续改动块(unit),追认每一块出自轨迹里的哪个步骤,然后逐块回退、重跑任务测试——测试照旧通过,这块就是多余的;测试挂掉,这块就是必要的。必要块占比记为 NP,只算代码块时记为 NP_code。由于「测试通过」不等于「代码正确」(Wang 等人([论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F2503.15223))发现 7.8% 的看似正确补丁过不了开发者自写的测试套件),论文又加了行为探针来复核,并用同一套流程给开发者补丁打分,避免双重标准。\n\n样本:7,660 条已解决的 GitHub Copilot CLI 轨迹,覆盖 18 个前沿模型;SWE-bench Verified 上 6,728 条(30,265 个改动块),DeepSWE([论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F2607.07946),113 个原创长程工程任务、每个任务用手写验证器评分)上 932 条(26,209 块);96.7% 的轨迹能精确回放。开发者对照组是 470 个实例、1,317 个代码块。\n\n## 虚胖在哪里\n\n行数确实多:中位模型改的行数是开发者的 2.33 倍;但刨掉测试文件,只多 1.09 倍;只算代码块,是 0.86 倍——反而比开发者少。多出来的编辑里,61% 是测试、13% 是文档、21% 是代码、5% 是注释或格式调整;81.5% 的智能体补丁动了测试文件,60% 的改动行落在测试文件里。所谓「补丁膨胀」,大头其实是测试。\n\n真正多余的代码:平均只占代码块的 11%,其中 89% 还会改变程序行为(在探针下改变输入输出或异常路径),不是躺着的死代码。论文报告,智能体代码必要性 NP_code 平均 0.887,开发者对照 0.864;18 个模型里 11 个留下的多余代码比开发者少,4 个无显著差异,只有 Gemini 3.8、3.7、3.6 Flash 三个模型显著更差。DeepSWE 上智能体 0.797 对开发者 0.785,持平。顺带一提,在纯测试口径下,开发者自己的补丁也有 33% 的代码块被判多余——两个群体没有想象中那么远。\n\n## 多余的代码从哪来\n\n论文预注册过一个假设:多余代码主要是调试残留——如果成立,占比不该低于 0.40。结果被数据杀掉:3,987 个多余代码块里只有 154 个来自调试步骤(ρ_code 为 0.039),83% 来自修复步骤,修订步骤占 11%;而且修订时写的代码被判定多余的概率(0.29)和初版代码(0.25)几乎没差。换句话说,多余的部分是一开始就写进修复里的,不是调试没收拾干净——想靠收尾清扫救回来,方向就找错了。\n\n另一个反直觉发现关于智能体自己补的测试:在 271 个通过有效性检查的实例上注入 1,962 个变异体,智能体新增的测试杀掉 68.1% 的注入 bug,高于仓库原有回归测试的 45.6%(低于任务测试的 77.1%),还抓到任务测试漏掉的 bug 中的 22.7%。AI 多写的那部分测试,并不多余。\n\n## 和解决率无关,甚至反着来\n\n代码必要性和解决率在 SWE-bench Verified 上不相关(Spearman -0.10),在 DeepSWE 上干脆负相关(-0.59,p=0.01)——解决率高的模型,代码并不写得更干净。各模型的全单位 NP 从 0.273(GPT-6.1 Sol)排到 0.848(Sonnet 5.5),主要反映写测试的多少而非代码质量。论文的建议很直接:排行榜在解决率旁边再报一个带开发者基线的 NP_code,比拿补丁大小当代理指标诚实得多。\n\n## 能自动清理吗\n\n三条路都试了。让模型自审自己的 diff:精确(65.7%)但只能找到 35.5% 的多余代码,还会弄坏 1.8% 的已解决补丁。用智能体自己能看到的测试(自己的测试加仓库回归测试)做剪枝:在 2,495 个符合条件的补丁上找回 67.3%、精确率 46.3%,89.1% 剪完仍能通过任务测试。在测试刚全绿那一刻提前停手:基本没用,NP_code 只从 0.700 挪到 0.710——因为多余代码在测试初次通过之前就已经写进去了。还有个口径反转值得一提:把行为探针并入判定后,开发者 NP_code 从 0.864 升到 0.970,智能体只从 0.887 升到 0.925,两者差距从 +2.3 个百分点翻成 -4.5 个百分点——智能体代码的必要性优势在更严的口径下反而放大。\n\n## 边界与启示\n\n论文自己把边界写得很清楚:必要性依赖判据,DeepSWE 上的数字是多余代码的上界;行为探针由 LLM 撰写;回退逐块进行,成对需要的代码会被误判;只研究了已解决的轨迹;主结果只用了 Copilot CLI 一种框架;SWE-bench Verified 只有 Python、且可能存在训练污染,人工标注留给后续工作。结合 Wang 等人发现 29.6% 的「看似正确」补丁行为与参考实现不同,读这批数字时值得留一分谨慎。\n\n所以,下次看到智能体几百行的 PR,先别按行数开骂:数一数测试占了几成,再问一句多余代码的占比。补丁大小是体重,必要性才是体脂率。","https:\u002F\u002Farxiv.org\u002Fabs\u002F2611.34875","7437aeb9-930c-4866-a2e9-48003c1a792b",[11,15,18,21],{"id":12,"name":13,"slug":13,"description":14,"color":14},"5e628969-6d2a-437f-998a-104e4b16cfb1","ai-progress",null,{"id":16,"name":17,"slug":17,"description":14,"color":14},"120fa59a-ff6f-4537-9bf5-f818df636a0e","benchmark",{"id":19,"name":20,"slug":20,"description":14,"color":14},"e82b2d09-81b2-43d1-977e-e018443b3c14","coding-agent",{"id":22,"name":23,"slug":23,"description":14,"color":14},"01598627-1ea6-4b27-a5d8-874971571a71","llm",[25],{"id":26,"lang":27,"title":28,"summary":29,"content":30},"6cad29d4-f9af-4269-9a68-4a8187e6592d","en","Bloated Agent Patches: Only 11% of Code Is Unneeded","Replaying 7,660 agent trajectories: 11% of code is unneeded, 61% of extra edits are tests, and code necessity (0.887) matches developers (0.864).","Open a pull request from a coding agent and the diff often runs to hundreds of lines. The reflex is to call it over-editing, and the reflex has data behind it: a Microsoft team measures the median model at 2.33 times the lines of the developer's reference patch on SWE-bench Verified, and the earlier RECAP study ([paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F2608.13292)) found successful agent patches carry about twice as many changes as developers', barely reduced by minimality prompts. But does bigger mean sloppier? A paper released on November 25 by Aakash Goel, Benjamin Steenhoek and Yu Hu at Microsoft ([arXiv:2611.34875](https:\u002F\u002Farxiv.org\u002Fabs\u002F2611.34875)) makes 'unneeded' measurable, and the one-line answer is: agent patches are bloated, not watered down.\n\n## How a block of code gets graded as unneeded\n\nThe method, Delta Residue Attribution (DRA), replays the agent's full trajectory, splits the final patch into units (contiguous blocks of changed lines that can be reverted on their own), traces each unit to the step that wrote it, then reverts each unit and reruns the task tests: if the tests still pass, the unit is unneeded; if they fail, it is needed. The share of needed units is NP, and over code units it is NP_code. Because passing tests does not make code correct ([Wang et al.](https:\u002F\u002Farxiv.org\u002Fabs\u002F2503.15223) found 7.8% of plausible patches actually fail the developer-written test suite), the paper adds behavioral probes and grades developer patches with the same pipeline, so nobody gets a friendlier yardstick.\n\nThe sample: 7,660 resolved GitHub Copilot CLI trajectories from 18 frontier models; 6,728 on SWE-bench Verified (30,265 units) and 932 on [DeepSWE](https:\u002F\u002Farxiv.org\u002Fabs\u002F2607.07946) (26,209 units), a benchmark of 113 original long-horizon engineering tasks graded by hand-written verifiers. 96.7% of trajectories replay exactly. The developer control group covers 470 instances and 1,317 code units.\n\n## Where the bloat sits\n\nThe lines are real: the median model changes 2.33 times the developer's lines; strip test files and the ratio drops to 1.09; count code units only and it is 0.86, below the developer. Of the extra edits, 61% are tests, 13% documentation, 21% code, and 5% comments or formatting; 81.5% of agent patches touch a test file, and 60% of all changed lines live in test files. The bloat, in other words, is mostly tests.\n\nGenuinely unneeded code averages 11% of code units, and 89% of it still changes program behavior under the probes (altering outputs or exception paths), so it is not inert dead code. The paper reports a mean agent NP_code of 0.887 against a developer baseline of 0.864; 11 of 18 models leave less unneeded code than developers, four show no significant difference, and only Gemini 3.8, 3.7 and 3.6 Flash are significantly worse. On DeepSWE agents land at 0.797 versus 0.785 for developers, on par. For reference, under the plain test oracle 33% of developer code units are graded unneeded too, so the two populations are not that far apart.\n\n## Where the unneeded code comes from\n\nThe authors pre-registered a hypothesis that unneeded code is mostly debug residue; if true, its share would be at least 0.40. The data kill it: only 154 of 3,987 unneeded code units come from debug steps (a code debug share of 0.039), 83% are written at fix steps, and revisions contribute 11%; code written while revising is graded unneeded at 0.29 versus 0.25 for first-fix code, nearly identical. The surplus is baked into the fix from the start, not left behind by debugging, so a cleanup pass at the end aims at the wrong target.\n\nA counterintuitive side finding concerns the tests agents add: over 271 instances passing validity checks, 1,962 mutants were injected, and the agent's new tests kill 68.1% of them, above the 45.6% of the repository's existing regression tests (below the task tests at 77.1%), and they catch 22.7% of the bugs the task tests miss. The extra tests are not extra at all.\n\n## Unrelated to resolve rate, and opposite on DeepSWE\n\nCode necessity is uncorrelated with resolve rate on SWE-bench Verified (Spearman -0.10) and negatively correlated on DeepSWE (-0.59, p=0.01): models that resolve more do not write cleaner code. Per-model all-unit NP runs from 0.273 (GPT-6.1 Sol) to 0.848 (Sonnet 5.5), mostly tracking how many tests a model writes rather than code quality. The authors' recommendation is blunt: leaderboards should report NP_code with a developer baseline next to resolve rate, instead of using patch size as a proxy.\n\n## Can the surplus be removed automatically\n\nThree routes were tried. Self-audit, asking the model to justify every hunk of its own diff, is precise (65.7%) but finds only 35.5% of the unneeded code and breaks 1.8% of resolved patches. Pruning with the tests the agent can see (its own tests plus the repository's regression tests) recovers 67.3% at 46.3% precision on the 2,495 eligible patches, and 89.1% of the pruned patches still pass the task tests. Stopping at the first all-green run barely helps: NP_code moves only from 0.700 to 0.710, because most unneeded code is already in the patch before the agent's tests first pass. One reversal deserves a note: once behavioral probes join the oracle, developer NP_code climbs from 0.864 to 0.970 while agents go only from 0.887 to 0.925, flipping the gap from +2.3 to -4.5 percentage points, so the agents' necessity edge widens under the stricter yardstick.\n\n## Boundaries and the takeaway\n\nThe paper states its own limits plainly: necessity depends on the oracle, and the DeepSWE numbers are an upper bound on unneeded code; the behavioral probes are LLM-written; units are reverted one at a time, so jointly needed pairs can be misjudged; only resolved trajectories were studied; the main results use a single harness, Copilot CLI; and SWE-bench Verified is Python-only and possibly contaminated, with human labeling left to future work. Combine that with the finding from Wang et al. that 29.6% of plausible patches behave differently from the reference implementation, and a bit of caution is warranted when reading these numbers.\n\nSo the next time an agent hands you a several-hundred-line PR, do not judge it by line count alone: check what share is tests, then ask what share of the code is unneeded. Patch size is body weight; necessity is body fat.","agent-patch-unneeded-code-11-percent","2026-11-26T17:30:00Z","2026-11-26T17:16:59.108607Z","2026-11-26T17:16:59.108620Z",true,"agent",173,[39,49,58],{"slug":40,"tag_slug":41,"title_zh":42,"title_en":43,"intro_zh":44,"intro_en":45,"id":46,"is_active":35,"created_at":47,"modified_at":48},"image-generation","text-to-image","图像生成：从文生图到逐框编辑的模型竞赛","Image Generation: from text-to-image to frame-level editing","文生图已是红海，战场正转向编辑与可控性：FLUX.2\u002F3 用开源和量化把生图搬进消费级显卡，Qwen-Image、Seedream 等国产模型紧咬不放，GPT Image 2 则把推理能力带进像素。本专题追踪图像生成与编辑模型的发布、架构演进、加速量化与商业化数据，看「好图」如何变成「可用的图」。","Text-to-image is a crowded race, and the frontier has moved to editing and control: FLUX.2\u002F3 push open weights and quantization onto consumer GPUs, Qwen-Image and Seedream close in from China, and GPT Image 2 brings reasoning into pixels. This topic tracks model releases, architecture shifts, acceleration work, and the business numbers behind \"pretty\" becoming \"usable\".","52de7c59-7864-4569-8ae7-3d656d26a1a1","2026-11-20T07:20:23.534506Z","2026-11-20T07:20:23.534527Z",{"slug":50,"tag_slug":50,"title_zh":51,"title_en":52,"intro_zh":53,"intro_en":54,"id":55,"is_active":35,"created_at":56,"modified_at":57},"ai-for-science","AI for Science 2026：从 UniPert 到 GPT-Rosalind 的硬核进化","AI for Science 2026: from UniPert to GPT-Rosalind","生命科学、化学材料、物理世界模型——AI 正在从\"语言工具\"变成\"实验伙伴\"。本专题收录 AI 在三大科学方向的关键节点：UniPert 统一基因与化学扰动空间、GPT-Rosalind 端到端生命科学推理、达摩院 AI 智能体 28 小时找到 4 种超导新材料、Anthropic Claude Science 把工作台做成标准品。","From language tool to lab partner — AI is reshaping life sciences, chemistry\u002Fmaterials, and physical world models. This topic covers the key milestones: UniPert unifying genetic-chemical perturbation spaces, GPT-Rosalind's end-to-end life-sciences reasoning, DAMO's AI agent discovering 4 superconducting materials in 28 hours, and Anthropic's Claude Science workbench going mainstream.","988a4300-5fab-41c4-b5d8-63711a2dc757","2026-09-10T01:34:15.296649Z","2026-09-10T01:34:15.296663Z",{"slug":59,"tag_slug":59,"title_zh":60,"title_en":61,"intro_zh":62,"intro_en":63,"id":64,"is_active":35,"created_at":65,"modified_at":66},"h3-series","MiniMax H3 系列：从开源权重到 35 倍吞吐","MiniMax H3 Series: from open weights to 35x throughput","MiniMax H3 自 2026 年 8 月开源以来节奏密集：官方把生成、参考与编辑收回一个模型；ComfyUI 当天压进 RTX 3060；摩尔线程 3 小时完成国产 GPU 适配；fal 后训练版把吞吐拉到 35 倍；FastH3 蒸馏再砍推理成本。本专题持续追踪 H3 的发布—开源—蒸馏—部署全链路。","Since MiniMax open-sourced H3 in August 2026 the pace has been relentless: one unified omni-modal model, same-day ComfyUI support down to an RTX 3060, a 3-hour Day-0 port to Moore Threads GPUs, fal's post-trained H3 Max at 35x throughput, and FastH3 distillation cutting inference cost further. This topic tracks the full H3 chain — release, open weights, distillation, deployment.","83ef0daa-3c31-4cb3-86ed-e5ee58654d5f","2026-09-08T07:33:19.942193Z","2026-09-08T07:33:19.942209Z",{"items":68},[69,74,79,84,89,94],{"id":70,"title":71,"news_slug":72,"published_at":73},"da6cbb98-3b89-4631-8dbd-59411136fb30","哈佛用 700 家公司拆解 AI 编程智能体:30% 代码增量,49% 合并时延","harvard-coding-agent-review-bottleneck","2026-10-14T11:30:00+00:00",{"id":75,"title":76,"news_slug":77,"published_at":78},"fca4b7a0-4dd9-4475-bd64-ebd7667c7f58","MirrorCode 把长程编程拖进可测量区间：Opus 4.7 重写 6 万行 Pkl，AI 编码能力一年翻倍","mirrorcode-long-horizon-opus-pkl-56pct","2026-06-28T02:03:00+00:00",{"id":80,"title":81,"news_slug":82,"published_at":83},"30c32de0-5d4e-4c7b-b0d7-35b27f776e4f","DeepSWE 接管 Coding Agent 评测：SWE-Bench Pro 32% 误判如何被基准审计撕开","deepswe-datacurve-coding-agent-32pct-misjudge","2026-06-16T22:30:00+00:00",{"id":85,"title":86,"news_slug":87,"published_at":88},"5c23c8b7-693f-415d-a255-beea9b465f67","2026年LLM评估风向变了：MMLU不再是主角，SWE-Bench登基","2026-llm-benchmark-swe-bench-king-mmlu","2026-05-30T19:03:00+00:00",{"id":90,"title":91,"news_slug":92,"published_at":93},"b95c3074-f3f1-4473-8df5-0f625c332a8d","AgentEscapeBench：美团+复旦推出工具推理评测新基准，揭示大模型Agent深层依赖短板","agentescapebench-meituan-fudan-dag-270-tasks","2026-05-12T07:01:00+00:00",{"id":95,"title":96,"news_slug":97,"published_at":98},"67ab1c6c-e1f2-4835-a754-f0ac02e6f204","三个任务占了 18% 技能增益,评分约定只写在技能包里","skillsbench-skill-lift-audit-grading-rules","2026-11-30T05:30:00+00:00"]