CODESTRUCT: Code Agents over Structured Action Spaces
- URL: http://arxiv.org/abs/2604.05407v3
- Date: Thu, 16 Apr 2026 06:08:17 GMT
- Title: CODESTRUCT: Code Agents over Structured Action Spaces
- Abstract summary: LLM-based code agents treat repositories as unstructured text, applying edits through brittle matching string.<n>We propose reframing the as a structured action space where agents operate on named AST entities rather than text spans.<n>Our framework, CODESTRUCT, provides readCode for retrieving complete syntactic units and editCode for applying syntax-validated transformations to semantic program elements.
- Score: 14.039220358416104
- License: http://creativecommons.org/licenses/by/4.0/
- Abstract: LLM-based code agents treat repositories as unstructured text, applying edits through brittle string matching that frequently fails due to formatting drift or ambiguous patterns. We propose reframing the codebase as a structured action space where agents operate on named AST entities rather than text spans. Our framework, CODESTRUCT, provides readCode for retrieving complete syntactic units and editCode for applying syntax-validated transformations to semantic program elements. Evaluated on SWE-Bench Verified across six LLMs, CODESTRUCT improves Pass@1 accuracy by 1.2-5.0% while reducing token consumption by 12-38% for most models. Models that frequently fail to produce valid patches under text-based interfaces benefit most: GPT-5-nano improves by 20.8% as empty-patch failures drop from 46.6% to 7.2%. On CodeAssistBench, we observe consistent accuracy gains (+0.8-4.4%) with cost reductions up to 33%. Our results show that structure-aware interfaces offer a more reliable foundation for code agents.
Related papers
- DSEffi-Bench: Demystifying Large Language Models' Capability in Efficient Data Science Code Generation [13.90546553534012]
We introduce DSEffi-Bench, the first benchmark specifically targeting execution efficiency in LLM-generated DS code.<n>We evaluate 16 models across 3 tiers and find that correctness alone fails to characterize efficiency.<n>A human-annotated five-category taxonomy reveals that 79.1% of efficiency deficits extend beyond algorithmic complexity.
arXiv Detail & Related papers (2026-08-31T04:59:26Z) - Fantastic Adaptive Taxonomies and How to Use Them [100.20614173157708]
AdaMAST converts execution traces into a compact, evidence-grounded failure taxonomy.<n>No code is hand-authored, no trace human-annotated.<n>In agent-system search, taxonomy-coded diagnoses of failed candidates outperform free-form.
arXiv Detail & Related papers (2026-07-17T17:41:16Z) - Context-Aware Distillation and Ablation for Text2DSL [78.29352305480285]
We replace prompt-only synthetic generation with context-aware distillation.<n>A teacher large language model operates under an explicitly defined structured context.<n>This scales the verified PolkitBench corpus from 4,204 to 10,073 pairs.
arXiv Detail & Related papers (2026-06-21T16:27:24Z) - Converted, Not Equivalent: Benchmarking Codebase Conversion via Observational Equivalence [56.25095230687242]
Coding agents often over-trust their own local validation routines and declare success on artifacts that satisfy surface checks.<n>This problem is especially acute in conversion, where prior evaluation is outcome-driven.<n>Across blind conversion attempts, the best system reaches 26.7--28.9% overall pass rate despite Spec pass rates up to 91.1%.<n>This suggests that failures stem more from contract-misaligned self-validation than from limited budget or backbone strength.
arXiv Detail & Related papers (2026-05-27T19:57:15Z) - Models Can Model, But Can't Bind: Structured Grounding in Text-to-Optimization [54.749573452394664]
We find that accuracy collapses as instance data grows, even when the formulation itself is simple.<n>We address this via a simple inference-time approach, BIND, which externalizes numeric data to structured files so the model binds data rather than from prompt prompt.<n>We validate our hypothesis by finetuning a model exclusively on binding and show that it outperforms end-to-end SFT and RL across three structurally distinct optimization categories.
arXiv Detail & Related papers (2026-05-20T21:25:41Z) - Constraint-Guided Multi-Agent Decompilation for Executable Binary Recovery [47.704311990064554]
Decompilation is essential for security analysis, malware reverse engineering, and legacy software maintenance.<n>We present a multi-agent framework that transforms decompiled code into re-executable source through Multi-level Constraint-Guided Decompilation (MCGD)<n>Our framework achieves 84-97% re-executability, improving baseline decompiler output by 28-89 percentage points.
arXiv Detail & Related papers (2026-04-27T01:28:11Z) - BRIDGE: Building Representations In Domain Guided Program Verification [67.36686119518441]
BRIDGE decomposes verification into three interconnected domains: Code, Specifications, and Proofs.<n>We show that this approach substantially improves both accuracy and efficiency beyond standard error feedback methods.
arXiv Detail & Related papers (2025-11-26T06:39:19Z) - CodeFuse-CommitEval: Towards Benchmarking LLM's Power on Commit Message and Code Change Inconsistency Detection [8.631593963090985]
Version control relies on commit messages to convey the rationale for code changes, but these messages are often low quality and inconsistent with their diffs-known as message-code inconsistency (MCI)<n>We introduce CODEFUSE-COMMITEVAL, the first benchmark designed for MCI detection using large language models (LLMs)<n>We generate seven types of inconsistent messages through rule-guided mutations of originally consistent commits and apply two-fold validation to verify both positive and negative samples.
arXiv Detail & Related papers (2025-11-25T03:33:57Z) - SLEAN: Simple Lightweight Ensemble Analysis Network for Multi-Provider LLM Coordination: Design, Implementation, and Vibe Coding Bug Investigation Case Study [0.0]
SLEAN operates as a simple prompt bridge between LLMs using.txt templates, requiring no deep technical knowledge for deployment.<n>The three-phase protocol formed by independent analysis, cross-critique, and arbitration, filters harmful AI-generated code suggestions.<n>The file-driven, provider-agnostic architecture enables deployment without specialized coding expertise.
arXiv Detail & Related papers (2025-10-11T04:24:04Z) - Eigen-1: Adaptive Multi-Agent Refinement with Monitor-Based RAG for Scientific Reasoning [53.45095336430027]
We develop a unified framework that combines implicit retrieval and structured collaboration.<n>On Humanity's Last Exam (HLE) Bio/Chem Gold, our framework achieves 48.3% accuracy.<n>Results on SuperGPQA and TRQA confirm robustness across domains.
arXiv Detail & Related papers (2025-09-25T14:05:55Z) - Advancing Retrieval-Augmented Generation for Structured Enterprise and Internal Data [0.0]
Large Language Models (LLMs) have strong generative capabilities.<n>They are limited by static pretraining, short context windows, and challenges in processing heterogeneous data formats.<n>Conventional Retrieval-Augmented Generation (RAG) frameworks address some of these gaps but often struggle with structured and semi-structured data.<n>This work proposes an advanced RAG framework that combines hybrid retrieval strategies using dense embeddings (all-mpnet-base-v2) and BM25, enhanced by metadata-aware filtering with SpaCy NER and cross-encoder reranking.
arXiv Detail & Related papers (2025-07-16T17:13:06Z) - NL in the Middle: Code Translation with LLMs and Intermediate Representations [56.77064674776534]
Large language models (LLMs) produce buggy code translations.<n>One promising avenue to improve translation accuracy is through intermediate representations.<n>We investigate whether LLM-based code translation can benefit from intermediate representations.
arXiv Detail & Related papers (2025-07-11T14:29:21Z) - A Preliminary Study on the Robustness of Code Generation by Large Language Models [40.01096420024215]
We present the first empirical study of LLM-generated code robustness using the CoderEval benchmark.<n>We find that 35.2% of their outputs are less robust than human-written code, with over 90% of deficiencies caused by missing conditional checks.<n>To address these issues, we propose RobGen, a model-agnostic framework that improves robustness without retraining.
arXiv Detail & Related papers (2025-03-26T03:44:03Z) - EquiBench: Benchmarking Large Language Models' Reasoning about Program Semantics via Equivalence Checking [58.15568681219339]
We introduce EquiBench, a new benchmark for evaluating large language models (LLMs)<n>This task directly tests a model's ability to reason about program semantics.<n>We evaluate 19 state-of-the-art LLMs and find that in the most challenging categories, the best accuracies are 63.8% and 76.2%, only modestly above the 50% random baseline.
arXiv Detail & Related papers (2025-02-18T02:54:25Z) - ASPIRO: Any-shot Structured Parsing-error-Induced ReprOmpting for
Consistent Data-to-Text Generation [0.0]
ASPIRO is an approach for structured data verbalisation into short template sentences in zero to few-shot settings.
Unlike previous methods, our approach prompts large language models to directly produce entity-agnostic templates.
arXiv Detail & Related papers (2023-10-27T03:39:51Z) - Benchmarking and Improving Generator-Validator Consistency of Language
Models [82.73914625520686]
inconsistency between generating and validating an answer is prevalent in language models (LMs)
Even GPT-4, a state-of-the-art LM, is GV-consistent only 76% of the time.
We find that this approach improves GV-consistency of Alpaca-30B from 60% to 93%.
arXiv Detail & Related papers (2023-10-03T07:23:22Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.