CodeShrink: Adaptive Visual Compression for Efficient Multimodal Code Understanding
On the map: Multimodal LLMs / vision-language models → Visual token pruning and efficiency
Abstract (arXiv)
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.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Placed in Visual token pruning and efficiency, one of 16 directions in Multimodal LLMs / vision-language models. Builds on 32 of its 41 references that are in the map. First posted on arXiv 31 Jul 2026.
Builds on
32 of 41 references.
Closest ancestors · 2
Same direction, newest first
- 2024VisionZip: Longer is Better but Not Necessary in Vision Language Models5 Dec
- 2024An Image is Worth 1/2 Tokens After Layer 2: Plug-and-Play Inference Acceleration for Large Vision-Language Models11 Mar
Other references · 30
- 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,084
- 2024DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Modelscited by 8,851
- 2025Qwen3 Technical Reportcited by 8,195
- 2023LongLLMLingua: Accelerating and Enhancing LLMs in Long Context Scenarios via Prompt Compressioncited by 443
- 2024LLMLingua-2: Data Distillation for Efficient and Faithful Task-Agnostic Prompt Compressioncited by 343
- 2025DeepSeek-OCR: Contexts Optical Compressioncited by 174
- 2026Qwen3.5-Omni Technical Reportcited by 146
- 2023LongCoder: A Long-Range Pre-trained Language Model for Code Completioncited by 110
- 2024Interaction2Code: Benchmarking MLLM-based Interactive Webpage Code Generation from Interactive Prototypingcited by 50
- 2025DesignBench: A Comprehensive Benchmark for MLLM-based Front-end Code Generationcited by 41
- 2024MMCode: Benchmarking Multimodal Large Language Models for Code Generation with Visually Rich Programming Problemscited by 38
- 2025LongCodeZip: Compress Long Context for Code Language Modelscited by 38
18 more
- 2025LongCodeBench: Evaluating Coding LLMs at 1M Context Windowscited by 37
- 2022Diet Code Is Healthy: Simplifying Programs for Pre-trained Models of Codecited by 24
- 2024MRWeb: An Exploration of Generating Multi-Page Resource-Aware Web Code from UI Designscited by 23
- 2025SlideCoder: Layout-aware RAG-enhanced Hierarchical Slide Generation from Designcited by 22
- 2026Seeing is Coding: On the Effectiveness of Vision Language Models in Code Understandingcited by 13
- 2024Empowering Agile-Based Generative Software Development through Human-AI Teamworkcited by 12
- 2023GPTCloneBench: A comprehensive benchmark of semantic clones and cross-language clones using GPT-3 model and SemanticCloneBenchcited by 11
- 2025The Hidden Cost of Readability: How Code Formatting Silently Consumes Your LLM Budgetcited by 11
- 2024Natural Is The Best: Model-Agnostic Code Simplification for Pre-trained Large Language Modelscited by 10
- 2026EfficientPosterGen: Semantic-aware Efficient Poster Generation via Token Compression and Accurate Violation Detectioncited by 8
- 2024DesignRepair: Dual-Stream Design Guideline-Aware Frontend Repair with Large Language Modelscited by 6
- 2025EfficientUICoder: A Bidirectional Token Compression Framework for Efficient MLLM-Based UI Code Generationcited by 4
- 2026ComUICoder: Component-based Reusable UI Code Generation for Complex Websites via Semantic Segmentation and Element-wise Feedbackcited by 4
- 2025Envisioning Future Interactive Web Development: Editing Webpage with Natural Languagecited by 3
- 2025Token Sugar: Making Source Code Sweeter for LLMs through Token-Efficient Shorthandcited by 3
- 2026UIBenchKit: A unified toolkit for design-to-code model evaluationcited by 1
- 2026From Runnable to Shippable: Multi-Agent Test-Driven Development for Generating Full-Stack Web Applications from Requirementscited by 1
- 2026VisualRepair: Dynamic Tool Calling and Region Focusing for Visual Software Issue Repaircited by 1
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2025VisionSelector: End-to-End Learnable Visual Token Compression for Efficient Multimodal LLMs
- 2026LensVLM: Selective Context Expansion for Compressed Visual Representation of Text
- 2026Can Vision-Language Models Handle Long-Context Code? An Empirical Study on Visual Compression
- 2026FocusVTC: Efficient and High-Performance Visual Text Compression with Adaptive Resolution
- 2024FocusLLaVA: A Coarse-to-Fine Approach for Efficient and Effective Visual Token Compression
- 2026PixelPrune: Pixel-Level Adaptive Visual Token Reduction via Predictive Coding
- 2025Task-Related Token Compression in Multimodal Large Language Models from an Explainability Perspective
- 2024Efficient Large Multi-modal Models via Visual Context Compression