추론에서 해결까지: LLM 내부 코드 추론 라이프사이클 분석
From Brewing to Resolution: Tracing the Internal Lifecycle of Code Reasoning in LLMs
일반적인 정확도 지표는 LLM이 변수 추적에는 성공하지만 의미적으로 동일한 반복문에서는 실패하는 이유를 설명하지 못합니다. 본 연구에서는 모델이 먼저 답변을 '추론(brew)'하고, 이후 여러 레이어에서 선형적으로 복구 가능하게 되지만 자체 디코딩되기 전에 네 가지 해결 결과('해결됨', '과도 처리됨', '오류 해결됨', '미해결됨') 중 하나로 분기되는 내부 코드 추론 라이프사이클을 연구합니다. 이 라이프사이클을 이해하는 것은 중요합니다. 왜냐하면 유사한 작업 정확도는 표면적인 평가로는 감지할 수 없는 근본적으로 다른 오류 모드를 숨길 수 있기 때문입니다. 본 연구에서는 레이어별 선형 탐색과 컨텍스트 제거 디코딩(CSD)을 결합한 이중 진단 프레임워크를 소개하고, Qwen, Llama 및 DeepSeek 아키텍처의 16개 모델에 걸쳐 6가지 코드 추론 작업 유형에 적용했습니다. 네 가지 결과 모두 모든 작업 유형에서 상당한 비율을 차지합니다. 전체적으로 '해결됨'의 비율은 41.5%에 불과하며, 여러 작업에서는 30% 미만입니다. 구조, 깊이 및 연산자에 대한 통제된 실험을 통해 작업별 오류 병목 현상이 드러났습니다. 예를 들어, 함수 호출 해결률은 호출 깊이가 1에서 3으로 증가함에 따라 61.1%에서 2.5%로 급격히 감소합니다. 아키텍처 및 규모에 관계없이 '추론' 구조는 안정적이며, 모든 16개 모델에서 정규화된 추론 지속 시간은 24~42% 사이입니다. 반면 해결 성공률은 모델의 능력과 관련이 있습니다. 이는 본 연구에서 사용한 디코더 전용 Transformer 계열 모델에서 '추론' 구조가 안정적인 경험적 규칙이라는 것을 시사하는 반면, 해결 성공률은 능력, 규모 및 훈련 상태와 함께 변동합니다. 코드: https://github.com/euyis1019/llm-brewing
Standard accuracy metrics cannot explain why LLMs handle variable tracking but fail on semantically equivalent loops. We study an internal lifecycle of code reasoning in which models first brew the answer, making it linearly recoverable many layers before it becomes self-decodable, and then diverge into one of four resolution outcomes: Resolved, Overprocessed, Misresolved, or Unresolved. Understanding this lifecycle matters because similar task accuracies can mask fundamentally different failure modes that surface-level evaluation cannot detect. We introduce a dual diagnostic framework pairing layer-wise linear probing with Context-Stripped Decoding (CSD) and apply it to six code-reasoning task families across 16 models spanning Qwen, Llama, and DeepSeek architectures. All four outcomes carry substantial mass in every task family: overall Resolved is only 41.5%, with multiple tasks below 30%. Controlled sweeps over structure, depth, and operators expose task-specific failure bottlenecks: Function Call Resolved plunges from 61.1% to 2.5% as call depth increases from one to three. Across architectures and scales, the brewing scaffold remains stable, with normalized brewing duration 24-42% across all 16 models, while resolution success varies with capability. This indicates that the scaffold is a stable empirical regularity across the tested decoder-only Transformer families, whereas resolution success covaries with capability, scale, and training. Code: https://github.com/euyis1019/llm-brewing
No Analysis Report Yet
This paper hasn't been analyzed by Gemini yet.
Log in to request an AI analysis.