mlsanityData to 7 Oct 2026

Can Vision-Language Models Handle Long-Context Code? An Empirical Study on Visual Compression

arXiv 2602.00746 ↗First posted 31 Jan 2026cs.SE cs.CVcited by 5

On the map: Multimodal LLMs / vision-language models → Visual token pruning and efficiency

Abstract (arXiv)

Large Language Models (LLMs) struggle with long-context code due to window limitations. Existing textual code compression methods mitigate this via selective filtering but often disrupt dependency closure, causing semantic fragmentation. To address this, we introduce LongCodeOCR, a visual compression framework that renders code into compressed two-dimensional image sequences for Vision-Language Models (VLMs). By preserving a global view, this approach avoids the dependency breakage inherent in filtering. We systematically evaluate LongCodeOCR against the state-of-the-art LongCodeZip across four benchmarks spanning code summarization, code question answering, and code completion. Our results demonstrate that visual code compression serves as a viable alternative for tasks requiring global understanding. At comparable compression ratios (~1.7×), LongCodeOCR improves CompScore on Long Module Summarization by 36.85 points over LongCodeZip. At a 1M-token context length with Glyph (a specialized 9B VLM), LongCodeOCR maintains higher accuracy than LongCodeZip while operating at about 4× higher compression. Moreover, compared with LongCodeZip, LongCodeOCR drastically reduces compression-stage overhead (reducing latency from ~4.3 hours to ~1 minute at 1M tokens). Finally, our results characterize a fundamental coverage--fidelity trade-off: visual code compression retains broader context coverage to support global dependencies, yet faces fidelity bottlenecks on exactness-critical tasks; by contrast, textual code compression preserves symbol-level precision while sacrificing structural coverage.

Key facts. Cited by 5 papers in the map (data through 7 Oct 2026). Placed in Visual token pruning and efficiency, one of 16 directions in Multimodal LLMs / vision-language models. Builds on 34 of its 41 references that are in the map. First posted on arXiv 31 Jan 2026.

Builds on

34 of 41 references.

References · 34

  1. 2017Attention Is All You Needcited by 59,932
  2. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  3. 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,611
  4. 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,383
  5. 2020Longformer: The Long-Document Transformercited by 3,362
  6. 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,830
  7. 2020Big Bird: Transformers for Longer Sequencescited by 1,673
  8. 2020Rethinking Attention with Performerscited by 1,584
  9. 2020Linformer: Self-Attention with Linear Complexitycited by 1,462
  10. 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,378
  11. 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,085
  12. 2023YaRN: Efficient Context Window Extension of Large Language Modelscited by 584
22 more
  1. 2023LongLLMLingua: Accelerating and Enhancing LLMs in Long Context Scenarios via Prompt Compressioncited by 443
  2. 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 357
  3. 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 355
  4. 2023RepoBench: Benchmarking Repository-Level Code Auto-Completion Systemscited by 346
  5. 2023LooGLE: Can Long-Context Language Models Understand Long Contexts?cited by 200
  6. 2024Leave No Context Behind: Efficient Infinite Context Transformers with Infini-attentioncited by 194
  7. 2023CrossCodeEval: A Diverse and Multilingual Benchmark for Cross-File Code Completioncited by 181
  8. 2024xRAG: Extreme Context Compression for Retrieval-augmented Generation with One Tokencited by 123
  9. 2023LongCoder: A Long-Range Pre-trained Language Model for Code Completioncited by 110
  10. 2023ChatUniTest: A Framework for LLM-Based Test Generationcited by 94
  11. 2025SWE-Debate: Competitive Multi-Agent Debate for Software Issue Resolutioncited by 52
  12. 2025Glyph: Scaling Context Windows via Visual-Text Compressioncited by 49
  13. 2024Long Code Arena: a Set of Benchmarks for Long-Context Code Modelscited by 48
  14. 2023ALGO: Synthesizing Algorithmic Programs with LLM-Generated Oracle Verifierscited by 41
  15. 2025LongCodeZip: Compress Long Context for Code Language Modelscited by 38
  16. 2025LongCodeBench: Evaluating Coding LLMs at 1M Context Windowscited by 37
  17. 2024RepoQA: Evaluating Long Context Code Understandingcited by 35
  18. 2022Diet Code Is Healthy: Simplifying Programs for Pre-trained Models of Codecited by 24
  19. 2026AgentOCR: Reimagining Agent History via Optical Self-Compressioncited by 22
  20. 2025Vision-centric Token Compression in Large Language Modelcited by 21
  21. 2024Leveraging Visual Tokens for Extended Text Contexts in Multi-Modal Learningcited by 17
  22. 2025LONGCODEU: Benchmarking Long-Context Language Models on Long Code Understandingcited by 13

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 5.

5 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2025LLMC+: Benchmarking Vision-Language Model Compression with a Plug-and-play Toolkit
  2. 2025VTCBench: Can Vision-Language Models Understand Long Context with Vision-Text Compression?
  3. 2026Seeing is Coding: On the Effectiveness of Vision Language Models in Code Understanding
  4. 2026VLZip: Unified Visual and Textual Compression for Interleaved Long-Context Modeling
  5. 2026VisCo: Leveraging Large Language Models as Intrinsic Encoders for Visual Token Compression
  6. 2026ZeroSense:How Vision matters in Long Context Compression
  7. 2025FCoT-VL:Advancing Text-oriented Large Vision-Language Models with Efficient Visual Token Compression
  8. 2026Training Long-Context Vision-Language Models Effectively with Generalization Beyond 128K Context