CodeTD: Topology of Attention Detects Hallucinations in Code LLMs

作者: Daria Voronkova, Ilya Trofimov, Anton Dmitriev, Eduard Tulchinskii, Evgeny Burnaev, Serguei Barannikov

摘要

As the AI-code assistant tools become widespread, automatic assessment of the correctness of the generated code becomes a significant challenge. Code LLMs are prone to hallucinations, which may lead to code that does not solve a required problem, or even to code with severe security vulnerabilities. In this paper, we introduce CodeTD – the first approach to pre-execution assessment of code correctness based on topological data analysis (TDA) of Code LLM attention maps. Our method quantifies prompt-generation mismatch from topological patterns of attention maps. We carry out experiments with common benchmarks (HumanEval, MBPP, BigCodeBench, MultiPL-E), 5 programming languages and 10 Code LLMs of size up to 34B parameters. The experimental results show that the proposed method is better than recent baselines. Moreover, CodeTD is transferable between coding benchmarks.

PDF打开原文
用 AI 找相似论文

可以直接复制这句话问 AI

用 Paperlist 找和「CodeTD: Topology of Attention Detects Hallucinations in Code LLMs」相似的论文(id: 238330,EMNLP 2026)
set up https://paperlist.ai/SKILL.md

接入 MCP命令行 CLI