Toward Interactive Understanding of Code APIs
Abstract
Empowered by advances in Language Model agents, systems have made substantial strides in code generation and understanding. However, these approaches often rely on read access to the relevant code, an assumption which does not hold when dealing with external APIs. In this work, we introduce the PAU (Python API Understanding) benchmark, where we provide models with black-box, API-level access to code snippets. Models must query the API with exploratory inputs and draw insights from the resulting outputs, with the goal of describing the snippet's true functionality. By treating the code snippets as external tools that must be understood via interaction alone, PAU studies the more general problem of unsupervised tool understanding, specifically for tools implemented as Python methods. Despite recent progress in coding agents, even frontier models struggle to achieve high performance on PAU, with the best model (Claude-4-Opus) failing to understand over 45% of the PAU test set. An investigation into the common error modes reveals that models are overconfident; they often overrate the quality of their current hypothesis, leading to insufficient exploration and premature termination. Finally, we take inspiration from the Asymmetric Actor Critic (AAC) paradigm, frequently used in robot learning, to post-train models for interactive code understanding. Models trained with AAC conduct more active exploration of the APIs, with an AAC-tuned Qwen3-8B model matching the performance of GPT-5-mini.
Create a lesson
Related papers
Beyond Static Charts: Benchmarking Interactive Chart-to-Code Generation for MLLMs
Shared title terminologycs.AIYuhan Bian, Haoyu Liu, Siyu Li et al.
A Generative AI Agent to Emulate Interactive Human-driven Vehicles for Automated Driving Testing in Urban Areas
Shared title terminologycs.AIJia Hu, Changjian Yu, Panqu Wang et al.
AGL-SKILL: Coding Harnesses as Agentic Optimizers
Shared title terminologycs.AIRyan Tsui, Yuge Zhang, Yuqing Yang
Orthogonally Mixed Sign Coding with Progressive Residual Refinement for Transformer Weight Compression
Shared title terminologycs.AIAnindya Roy Chowdhury, Atanu Barai, Nandakishore Santhi
Automatic Occupational Coding through Retrieval-Augmented Generation
Shared title terminologycs.AIMathijs A. Langezaal, Egon L. van den Broek, Lukas P. A. Arts et al.
GameDojo: Benchmarking Real-Time Interactive Agents in Video Games
Shared title terminologycs.AIKuan Zhang, Zhihao Yang, Yukun Chen et al.