CodeOCR: コード理解におけるビジョン言語モデルの有効性について
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.