[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"branding":3,"analytics":7,"article-tree-like-selfplay-boosts-secure-code-generation-for-llms":10,"sections":41},{"siteName":4,"siteTagline":5,"publisherName":4,"contactEmail":6},"The Revision","Tech news, decoded.","editor@therevision.news",{"gaMeasurementId":8,"adsenseClientId":9},"G-ZW2MV82GYR","ca-pub-8533917693782264",{"article":11},{"id":12,"slug":13,"title":14,"dek":15,"body_md":16,"tags_json":17,"published_at":18,"created_at":19,"updated_at":20,"status":21,"review_note":22,"review_notes":23,"image_url":22,"persona_id":22,"persona_name":22,"section":30,"tags":31,"sources":36,"feedback":40,"feedback_at":22,"cost_usd":40,"total_tokens":40},1410,"tree-like-selfplay-boosts-secure-code-generation-for-llms","Teaching LLMs to Write Secure Code by Playing Against Themselves","A new training framework forces code-generating models to explore vulnerable paths before shipping, cutting unseen security flaws by nearly a quarter.","A research team has built a training framework that forces code-generating AI to confront its own security mistakes before they ship.\n\nThe framework, called Tree-like Self-Play (TSP), reframes code generation as a sequential decision game rather than a single pass\u002Ffail judgment. Standard training methods like supervised fine-tuning evaluate an entire generated sequence — which means a single bad token buried in otherwise good code can slide through unnoticed. TSP instead builds a decision tree at each generation step, comparing a secure \"golden path\" against vulnerable branches right at the moment a wrong choice would introduce a flaw. Tested on CodeLlama-7B, the approach lifted the model's secure code pass rate to 75.8%, up from 57.0% with standard fine-tuning.\n\nThe more striking result is what happens outside the training distribution. TSP cut vulnerabilities in Common Weakness Enumeration categories the model had never seen during training by 24.5%, and security reasoning learned from C and C++ transferred to Python, Go, and JavaScript. That cross-language generalization suggests the model is picking up something closer to general security logic rather than memorizing fixes for known-bad patterns — which, if it holds, is a meaningfully different kind of progress.\n\nThe usual caveat applies: CodeLlama-7B is a relatively small model, and the gap between a curated security benchmark and the average enterprise codebase full of legacy quirks is wide enough to stay skeptical about what these numbers mean in production.","[\"llm\",\"code security\",\"ai research\",\"secure coding\"]","2026-06-16T04:00:00.000Z","2026-06-17T08:17:56.526Z","2026-06-19T13:16:46.721Z","published",null,[24],{"id":25,"reviewer":26,"round":27,"reason":28,"status":29},"editor-r1","editor",1,"Add a clear concluding paragraph that summarizes the news and its implications.","resolved","ai",[32,33,34,35],"llm","code security","ai research","secure coding",[37],{"name":38,"url":39},"arXiv cs.AI","https:\u002F\u002Farxiv.org\u002Fabs\u002F2606.03489",0,{"sections":42},[43,47,52,57,62,67,72,77,82,87,92,97,102,107],{"name":44,"slug":30,"count":45,"latest_published_at":46},"AI",7165,"2026-11-16T14:00:00.000Z",{"name":48,"slug":49,"count":50,"latest_published_at":51},"Security","security",1141,"2026-11-15T17:15:13.000Z",{"name":53,"slug":54,"count":55,"latest_published_at":56},"Deals","deals",682,"2026-11-16T14:45:47.000Z",{"name":58,"slug":59,"count":60,"latest_published_at":61},"Policy","policy",631,"2026-11-16T09:43:00.000Z",{"name":63,"slug":64,"count":65,"latest_published_at":66},"Consumer Tech","consumer-tech",384,"2026-11-16T14:33:02.000Z",{"name":68,"slug":69,"count":70,"latest_published_at":71},"Hardware","hardware",347,"2026-11-16T13:28:40.000Z",{"name":73,"slug":74,"count":75,"latest_published_at":76},"Science","science",236,"2026-11-14T20:54:14.000Z",{"name":78,"slug":79,"count":80,"latest_published_at":81},"Software","software",179,"2026-11-16T10:35:16.000Z",{"name":83,"slug":84,"count":85,"latest_published_at":86},"Startups","startups",162,"2026-11-13T17:32:35.000Z",{"name":88,"slug":89,"count":90,"latest_published_at":91},"General","general",131,"2026-11-16T11:14:41.000Z",{"name":93,"slug":94,"count":95,"latest_published_at":96},"Dev Tools","dev-tools",127,"2026-11-11T19:00:44.000Z",{"name":98,"slug":99,"count":100,"latest_published_at":101},"Gaming","gaming",113,"2026-11-16T11:47:03.000Z",{"name":103,"slug":104,"count":105,"latest_published_at":106},"Reviews","reviews",38,"2026-10-20T12:00:00.000Z",{"name":108,"slug":109,"count":110,"latest_published_at":111},"How-To","how-to",10,"2026-11-14T23:45:00.000Z"]