Lune

ACM MM2024Top-tier venue

AdaCoder: Adaptive Prompt Compression for Programmatic Visual Question Answering

Mahiro Ukai, Shuhei Kurita, Atsushi Hashimoto, Yoshitaka Ushiku, Nakamasa Inoue

Abstract

Visual question answering aims to provide responses to natural language questions given visual input. Recently, visual programmatic models (VPMs), which generate executable programs to answer questions through large language models (LLMs), have attracted research interest. However, they often require long input prompts to provide the LLM with sufficient API usage details to generate relevant code. To address this limitation, we propose AdaCoder, an adaptive prompt compression framework for VPMs. AdaCoder operates in two phases: a compression phase and an inference phase. In the compression phase, given a preprompt that describes all API definitions in the Python language with example snippets of code, a set of compressed preprompts is generated, each depending on a specific question type. In the inference phase, given an input question, AdaCoder predicts the question type and chooses the appropriate corresponding compressed preprompt to generate code to answer the question. Notably, AdaCoder employs a single frozen LLM and pre-defined prompts, negating the necessity of additional training and maintaining adaptability across different powerful black-box LLMs such as GPT and Claude. In experiments, we apply AdaCoder to ViperGPT and demonstrate that it reduces token length by 71.1%, while maintaining or even improving the performance of visual question answering.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

1 top-tier paper has cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Learning to Compress Prompts with Gist Tokens cites Language Models are Few-Shot Learners
  • ViUniT: Visual Unit Tests for More Robust Visual Programming cites ViperGPT: Visual Inference via Python Execution for Reasoning
  • ViUniT: Visual Unit Tests for More Robust Visual Programming cites Language Models are Few-Shot Learners
  • Tree of Thoughts: Deliberate Problem Solving with Large Language Models cites Language Models are Few-Shot Learners
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers1

  1. ViUniT: Visual Unit Tests for More Robust Visual ProgrammingArtemis Panagopoulou, Honglu Zhou, Silvio Savarese, Caiming Xiong et al.CVPR 2025

Builds on23

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. Tree of Thoughts: Deliberate Problem Solving with Large Language ModelsShunyu Yao, Dian Yu, Jeffrey Zhao, Izhak Shafran et al.NeurIPS 2023 · 5,068 citations
  3. ViperGPT: Visual Inference via Python Execution for ReasoningDídac Surís, Sachit Menon, Carl VondrickICCV 2023 · 732 citations
  4. Learning to Compress Prompts with Gist TokensJesse Mu, Xiang Li, Noah D. GoodmanNeurIPS 2023 · 488 citations
  5. PoWER-BERT: Accelerating BERT Inference via Progressive Word-vector EliminationSaurabh Goyal, Anamitra Roy Choudhury, Saurabh Raje, Venkatesan T. Chakaravarthy et al.ICML 2020 · 260 citations

Related papers

  1. Visual Program Distillation with Template-Based AugmentationMichal Shlapentokh-Rothman, Yu-Xiong Wang, Derek HoiemEMNLP Findings 2025 · 1 citation
  2. PropTest: Automatic Property Testing for Improved Visual ProgrammingJaywon Koo, Ziyan Yang, Paola Cascante-Bonilla, Baishakhi Ray et al.EMNLP Findings 2024 · 1 citation
  3. Inference Optimal VLMs Need Fewer Visual Tokens and More ParametersKevin Y. Li, Sachin Goyal, João D. Semedo, J. Zico KolterICLR 2025
  4. D-CoDe: Scaling Image-Pretrained VLMs to Video via Dynamic Compression and Question DecompositionYiyang Huang, Yizhou Wang, Yun FuEMNLP 2025
  5. Analyzing Modular Approaches for Visual Question DecompositionApoorv Khandelwal, Ellie Pavlick, Chen SunEMNLP 2023 · 2 citations
Dusk over the sea between two cliffs drawn in fine vertical lines