CodeCircuit: 어트리뷰션 그래프를 활용한 LLM 생성 코드의 정확성 추론
CodeCircuit: Toward Inferring LLM-Generated Code Correctness via Attribution Graphs
현재 코드 검증 방식은 실행 기반 단위 테스트나 보조 LLM 평가 모델과 같은 외부 메커니즘에 크게 의존하는데, 이러한 방식은 종종 많은 노동력을 필요로 하거나 평가 모델 자체의 성능에 의해 제한됩니다. 이는 근본적이지만 아직 탐구되지 않은 질문을 제기합니다: LLM의 기능적 정확성을 해당 모델의 내부 계산 구조만으로 평가할 수 있는가? 본 연구의 주요 목표는 모델의 신경망 동역학이 코드 생성 과정에서 논리적 타당성을 예측하는 내부적으로 디코딩 가능한 신호를 포함하는지 조사하는 것입니다. 기계적 해석 가능성에서 영감을 받아, 코드 검증을 모델의 명시적인 알고리즘 경로를 라인 단위 어트리뷰션 그래프로 매핑하는 기계적 진단 작업으로 간주합니다. 복잡한 잔차 흐름을 분해하여 모델 내부 회로 내에서 건전한 추론과 논리적 오류를 구별하는 구조적 특징을 식별하고자 합니다. Python, C++, Java를 대상으로 한 분석 결과, 고유한 정확성 신호가 다양한 구문에 걸쳐 견고함을 확인했습니다. 이러한 내부 그래프의 위상적 특징은 표면적인 휴리스틱보다 정확성을 더 안정적으로 예측하며, 오류가 있는 논리를 수정하기 위한 표적적인 인과적 개입을 가능하게 합니다. 이러한 결과는 내부 검토를 통해 생성된 코드의 정확성을 검증할 수 있는 디코더 가능한 속성을 확립합니다. 관련 코드는 https://github.com/bruno686/CodeCircuit 에서 확인할 수 있습니다.
Current paradigms for code verification rely heavily on external mechanisms-such as execution-based unit tests or auxiliary LLM judges-which are often labor-intensive or limited by the judging model's own capabilities. This raises a fundamental, yet unexplored question: Can an LLM's functional correctness be assessed purely from its internal computational structure? Our primary objective is to investigate whether the model's neural dynamics encode internally decodable signals that are predictive of logical validity during code generation. Inspired by mechanistic interpretability, we propose to treat code verification as a mechanistic diagnostic task, mapping the model's explicit algorithmic trajectory into line-level attribution graphs. By decomposing complex residual flows, we aim to identify the structural signatures that distinguish sound reasoning from logical failure within the model's internal circuits. Analysis across Python, C++, and Java confirms that intrinsic correctness signals are robust across diverse syntaxes. Topological features from these internal graphs predict correctness more reliably than surface heuristics and enable targeted causal interventions to fix erroneous logic. These findings establish internal introspection as a decodable property for verifying generated code. Our code is at https:// github.com/bruno686/CodeCircuit.
No Analysis Report Yet
This paper hasn't been analyzed by Gemini yet.