[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"branding":3,"analytics":7,"article-topology-of-attention-maps-flags-code-llm-hallucinations-pre-run":10,"sections":35},{"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":24,"tags":25,"sources":30,"feedback":34,"feedback_at":22,"cost_usd":34,"total_tokens":34},6234,"topology-of-attention-maps-flags-code-llm-hallucinations-pre-run","Topology of Attention Maps Flags Code LLM Hallucinations Pre Run","A new detection method scores code from AI assistants for likely errors before it ever executes, by analyzing the shape of the model's attention patterns.","Researchers have a new way to catch bad AI-generated code before it runs: read the shape of the model's attention.\n\nThe method, called CodeTD, uses topological data analysis - a technique for finding structural patterns in complex data - to examine the attention maps that code-generating LLMs produce while writing. The idea is that when a model's output drifts from what a prompt actually asked for, that mismatch shows up as a detectable pattern in the topology of its attention, before the code is ever compiled or run. The researchers tested it on 10 code LLMs of up to 34 billion parameters, across five programming languages and four standard benchmarks: HumanEval, MBPP, BigCodeBench, and MultiPL-E. CodeTD outperformed recent baseline methods and, notably, transferred well between benchmarks it wasn't tuned on.\n\nThis matters because most hallucination-detection in code assistants still happens after the fact - running the code, checking outputs, hoping the test suite catches the drift. A pre-execution check that works off internal model signals could catch subtly wrong or insecure code earlier in the pipeline, before it reaches a test suite or, worse, a pull request. That's a meaningfully different failure mode than the wrong-fact hallucinations plaguing chatbots, since bad code can carry real security consequences.\n\nWhether this becomes more than a benchmark result depends on cost and integration: attention-map analysis needs access to internals most commercial coding assistants don't expose, and it still has to prove itself against real-world codebases messier than curated eval sets.","[\"code llms\",\"hallucination detection\",\"ai safety\",\"topological data analysis\"]","2026-09-10T04:00:00.000Z","2026-09-10T09:18:58.603Z","2026-09-10T09:19:10.580Z","published",null,[],"ai",[26,27,28,29],"code llms","hallucination detection","ai safety","topological data analysis",[31],{"name":32,"url":33},"arXiv cs.AI","https:\u002F\u002Farxiv.org\u002Fabs\u002F2609.07779",0,{"sections":36},[37,41,45,50,55,60,65,69,74,79,84,89,94,99],{"name":38,"slug":24,"count":39,"latest_published_at":40},"AI",3480,"2026-09-11T04:00:00.000Z",{"name":42,"slug":43,"count":44,"latest_published_at":40},"Security","security",629,{"name":46,"slug":47,"count":48,"latest_published_at":49},"Policy","policy",336,"2026-09-11T00:56:21.000Z",{"name":51,"slug":52,"count":53,"latest_published_at":54},"Deals","deals",179,"2026-06-29T20:02:07.000Z",{"name":56,"slug":57,"count":58,"latest_published_at":59},"Hardware","hardware",153,"2026-09-09T15:12:32.000Z",{"name":61,"slug":62,"count":63,"latest_published_at":64},"Consumer Tech","consumer-tech",99,"2026-09-09T17:27:33.000Z",{"name":66,"slug":67,"count":68,"latest_published_at":40},"Science","science",98,{"name":70,"slug":71,"count":72,"latest_published_at":73},"Software","software",75,"2026-09-10T20:41:21.000Z",{"name":75,"slug":76,"count":77,"latest_published_at":78},"Dev Tools","dev-tools",69,"2026-08-18T04:00:00.000Z",{"name":80,"slug":81,"count":82,"latest_published_at":83},"Startups","startups",55,"2026-09-09T23:14:29.000Z",{"name":85,"slug":86,"count":87,"latest_published_at":88},"Gaming","gaming",43,"2026-09-10T12:18:06.000Z",{"name":90,"slug":91,"count":92,"latest_published_at":93},"General","general",41,"2026-09-08T01:57:23.000Z",{"name":95,"slug":96,"count":97,"latest_published_at":98},"Reviews","reviews",20,"2026-06-24T12:00:01.000Z",{"name":100,"slug":101,"count":102,"latest_published_at":103},"How-To","how-to",6,"2026-06-16T09:00:00.000Z"]