코드OCR: 코드 이해에서 비전 언어 모델의 효과성
CodeOCR: On the Effectiveness of Vision Language Models in Code Understanding
February 2, 2026
저자: Yuling Shi, Chaoxiang Xie, Zhensu Sun, Yeheng Chen, Chenxu Zhang, Longfei Yun, Chengcheng Wan, Hongyu Zhang, David Lo, Xiaodong Gu
cs.AI
초록
대규모 언어 모델(LLM)은 소스 코드 이해 분야에서 놀라운 성과를 거두었지만, 소프트웨어 시스템의 규모가 커짐에 따라 계산 효율성이 중요한 병목 현상으로 대두되고 있습니다. 현재 이러한 모델들은 소스 코드를 토큰의 선형 시퀀스로 취급하는 텍스트 기반 패러다임에 의존하고 있어, 컨텍스트 길이와 관련 계산 비용이 선형적으로 증가합니다. 멀티모달 대규모 언어 모델(MLLM)의 급속한 발전은 소스 코드를 렌더링된 이미지로 표현하여 효율성을 최적화할 수 있는 기회를 제공합니다. 의미적 손실 없이 압축하기 어려운 텍스트와 달리, 이미지 모달리티는 본질적으로 압축에 적합합니다. 해상도를 조정함으로써 이미지는 원본 토큰 비용의 일부로 축소될 수 있으면서도 시각 인식 모델이 인식 가능한 상태를 유지합니다. 본 연구는 이러한 접근법의 실현 가능성을 탐구하기 위해 MLLM의 코드 이해 효과에 대한 첫 체계적인 연구를 수행합니다. 실험 결과는 다음과 같음을 보여줍니다: (1) MLLM은 최대 8배 압축을 달성하며 상당한 토큰 감소와 함께 코드를 효과적으로 이해할 수 있다; (2) MLLM은 구문 강조와 같은 시각적 단서를 효과적으로 활용하여 4배 압축 조건에서도 코드 완성 성능을 향상시킬 수 있다; (3) 코드 복제 검출과 같은 코드 이해 작업은 시각적 압축에 대해 탁월한 복원력을 보이며, 일부 압축률에서는 원본 텍스트 입력을 약간 상회하기도 한다. 본 연구의 결과는 코드 이해에서 MLLM의 잠재력과 현재 한계를 동시에 부각하며, 보다 효율적인 추론을 위한 길로써 이미지 모달리티 코드 표현으로의 전환을 지향합니다.
English
Large Language Models (LLMs) have achieved remarkable success in source code understanding, yet as software systems grow in scale, computational efficiency has become a critical bottleneck. Currently, these models rely on a text-based paradigm that treats source code as a linear sequence of tokens, which leads to a linear increase in context length and associated computational costs. The rapid advancement of Multimodal LLMs (MLLMs) introduces an opportunity to optimize efficiency by representing source code as rendered images. Unlike text, which is difficult to compress without losing semantic meaning, the image modality is inherently suitable for compression. By adjusting resolution, images can be scaled to a fraction of their original token cost while remaining recognizable to vision-capable models. To explore the feasibility of this approach, we conduct the first systematic study on the effectiveness of MLLMs for code understanding. Our experiments reveal that: (1) MLLMs can effectively understand code with substantial token reduction, achieving up to 8x compression; (2) MLLMs can effectively leverage visual cues such as syntax highlighting, improving code completion performance under 4x compression; and (3) Code-understanding tasks like clone detection exhibit exceptional resilience to visual compression, with some compression ratios even slightly outperforming raw text inputs. Our findings highlight both the potential and current limitations of MLLMs in code understanding, which points out a shift toward image-modality code representation as a pathway to more efficient inference.