arXiv:2607.29637v1 cs.CV

CodeShrink: 효율적인 멀티모달 코드 이해를 위한 적응형 시각적 압축

CodeShrink: Adaptive Visual Compression for Efficient Multimodal Code Understanding

Wenxin Tang, Jingyu Xiao, Zhenyu Liu, Zipeng Xie, Junliang Liu, Wang Luo, Yuan Jiang, Yintong Huo, Michael Lyu

제출 2026-07-31

한국어 초록

소스 코드를 이미지로 렌더링하는 것은 멀티모달 대규모 언어 모델(MLLM)의 입력 비용을 줄이는 유망한 방안을 제공합니다. 이미지 해상도를 조절하면 시각적 토큰(token) 비용과 콘텐츠 충실도 간의 절충(trade-off)을 조율할 수 있습니다. 그러나 해상도 스케일링(scaling)만으로는 두 가지 비효율 원인을 간과하게 됩니다. 바로 줄 바꿈과 들여쓰기로 인해 발생하는 공백 영역과 현재 지시사항과 무관한 코드 영역입니다. 또한 최적의 압축 설정은 입력, 작업, 모델에 따라 달라지므로 고정 비율 전략에는 한계가 있습니다. 본 논문에서는 세 가지 구성 요소로 이루어진 적응형 시각적 압축 프레임워크인 CodeShrink를 제안합니다. 공백 제거 렌더링(Blank-Free Rendering)은 공백 의존적 레이아웃을 조밀한 레이아웃과 명시적 구조 마커로 대체하여 레이아웃으로 인해 발생하는 토큰을 제거합니다. 적응형 압축 구성(Adaptive Compression Configuration)은 강화학습(reinforcement learning)으로 학습된 경량 에이전트(agent)를 활용하여 토큰 효율성과 가독성의 균형을 맞추는 입력별 설정을 예측합니다. 주요 토큰 선택(Dominant Token Selection)은 지시사항과 코드 이미지를 함께 분석하여 추론(inference) 과정에서 작업과 무관한 시각적 토큰을 가지치기(pruning)합니다. 저자들은 코드 질의응답, 클론 탐지, 코드 완성 작업에서 CodeShrink를 평가합니다. CodeShrink는 압축되지 않은 텍스트 전용 입력과 대등하거나 이를 능가하면서도 시각적 토큰 사용량을 최대 71.2%까지 줄이며, 세 가지 작업 모두에서 텍스트 기반 및 시각적 압축 베이스라인을 일관되게 능가합니다. 이러한 결과는 레이아웃 압축, 적응형 구성, 지시사항 인식 가지치기를 결합함으로써 멀티모달 코드 이해를 더욱 효율적으로 만들 수 있음을 보여줍니다. 코드는 https://github.com/vinsontang1/CodeShrink 에서 확인할 수 있습니다.

원문 초록

Rendering source code as images offers a promising way to reduce the input costs of Multimodal Large Language Models (MLLMs). Adjusting image resolution can trade visual token cost against content fidelity. However, resolution scaling alone overlooks two sources of inefficiency: blank regions created by line breaks and indentation, and code regions irrelevant to the current instruction. Moreover, the best compression setting varies across inputs, tasks, and models, limiting fixed-ratio strategies. We propose CodeShrink, an adaptive visual compression framework with three components. Blank-Free Rendering replaces whitespace-dependent layouts with compact layouts and explicit structural markers, removing layout-induced tokens. Adaptive Compression Configuration uses a lightweight agent trained with reinforcement learning to predict a per-input setting that balances token efficiency and readability. Dominant Token Selection jointly analyzes the instruction and code image to prune task-irrelevant visual tokens during inference. We evaluate CodeShrink on code question answering, clone detection, and code completion. CodeShrink reduces visual token use by up to 71.2\% while matching or exceeding uncompressed text-only inputs, and consistently outperforms text-based and visual compression baselines across all three tasks. These results show that combining layout compaction, adaptive configuration, and instruction-aware pruning can make multimodal code understanding more efficient. Our code is available at https://github.com/vinsontang1/CodeShrink.

제출 이력

확인된 버전만 표시합니다. 전체 제출 이력은 arXiv 원문에서 확인하세요.

  1. arXiv:2607.29637v1제출 시각 미확인

함께 살펴볼 논문

공통 태그를 근거로 연결했습니다. 실제 인용 관계나 논문의 우수성을 뜻하지 않습니다.

공통 태그로 연결된 공개 논문이 아직 없습니다.

토론

이 논문과 연결된 포럼 글이 아직 없습니다.