Many defects violate project rules that the code itself does not reveal, such as layering constraints or required tests. We study whether LLM coding agents repair such violations better when an external checker reports them, with their location and a repair goal. Three models, a small, medium and large model, driven by an AI agent, worked on 25 pull requests with 31 planted defects in ten open-source projects, plus 5 correct controls, five times alone and five times with findings from CodeAssure (CA), a commercial checker. We also compare with GitHub Copilot code review, and compare CodeAssure's detection with nine free static-analysis tools run out of the box, including Semgrep and SonarQube Community. Counting a run as repaired only when the repaired code also compiles and keeps its feature, CA findings raised the repair rate from 26% to 69% for the smallest model, from 46% to 90% for the medium model and from 45% to 93% for the largest model (pull-request-level p < 0.001), and from 39% to 84% over all runs. Every Java, TypeScript and Python repair compiled. We found that agents often cleared a defect by deleting a newly added file. Metrics based on whether the defect is gone count feature deletion as a success. The largest model alone did so in 44 of 125 runs. CA includes a check for deleted files that largely prevents this. In an ablation with the check turned off, removals rose from 9 to 65 out of 375 runs and the repair rate fell to 54% (small), 70% (medium) and 85% (large model). The CA workflow also outperformed Copilot code review (p < 0.001). Together, the free tools detected 8 of the 31 defects, and CA detected all 31. With CA, the medium model repaired 90% of runs, against 45% for the largest model alone, at about one fifth of the mean cost per run ($0.17 against $0.91).
An agent can remain operational after a model, tool, or user-context change while losing capabilities required at its destination. We define agent calibration as qualification against a versioned deployment contract. The contract specifies basic capabilities and end-to-end reachability, technical and professional precision, and acceptance by intended users. For each requirement, a source-to-destination map records what must be preserved, transformed, added, or retired. Experts supply benchmarks, positive and negative examples, annotated trajectories, and cost limits. These instruments guide changes to prompts and context, tool calls and other harness settings, or an external compact policy while the foundation model remains frozen. Candidate revisions are evaluated against fixed acceptance criteria using independent evidence. We compare the costs of maintaining a harness with and without an external policy, including annotation, training, serving, review, and rework. Three diagnostic audits illustrate the limits of aggregate scores. On a 100-item intent task, each model solved cases the other missed. In a 60-record synthetic financial reporting fixture, five records passed a numeric proxy but failed the reporting contract. In a target-only WebMall snapshot, quota interruptions affected 132 of 171 attempts. These observations motivate paired reruns, checkpoint replay, and separate measurement of repaired and newly failed cases. We specify controlled experiments to test whether calibration increases accepted deliveries at a given cost.
Existing benchmarks for large language models (LLMs) in hardware design evaluate downstream artifacts such as generated RTL, assertions, or testbenches. When a model fails, it may have misread the specification or understood it and failed to write the code. We present SpecRead, a benchmark that isolates specification comprehension from generation ability. SpecRead v2.2 contains 383 questions over 10 open-source OpenTitan IP blocks in four types: exact retrieval, cross-section reasoning, contradiction detection in mutated specifications, and spec-RTL consistency checking, plus 41 distractor controls and 41 consistent-RTL controls. Type-4 items use real RTL mutations retained only when Icarus Verilog simulation shows a behavioral change. A with-spec vs. without-spec ablation suggests the questions require the excerpt rather than training recall alone, though it does not rule out memorization of the unmutated source text helping a model spot mutations. Ministral-3B scores 33.7% overall (129/383). On t3, verdict-plus-location accuracy is 48.0% with a 51.2% distractor false-positive rate. On t4, the violation-vs.-compliant decision is effectively degenerate (MCC -0.06, balanced accuracy 49.5%), flagging all 41 consistent-RTL controls; location accuracy remains measurable at 79.2%. Layered scoring suggests, as a hypothesis, that the fine-grained violation taxonomy is the hard part, though the category labels are not independently validated. A rule-table prompting intervention on a 60-question sample lowers accuracy on every type except t2 (tied). SpecRead is automatically scorable by deterministic checks, with gray-zone cases counted wrong under the conservative main scoring, regenerable for type-3 items via mutation injection, and built exclusively from public sources.
A live update can preserve the topology and output of a large language model (LLM) workflow while bypassing a filter's queue and concurrency limits. A background task can use the old version after its caller returns. AiFlow links construction, invocation and retirement through an executable contract. Each admitted request captures an action bound to the checked operators. The service certifies the call's terminal outcome and the release of its registered work. Once new calls can no longer capture the version, the owner checks these certificates and remaining local resources before retirement. Strict publication pauses admission while old calls drain. Deferred publication can admit calls to the successor before its predecessor retires. We evaluated two stateless linear workflows in one Java virtual machine. Under strict publication, we repeated three injected fault scenarios three times per check configuration. An observation counted as contained if neither unguarded execution nor premature replacement occurred. With construction or completion checking alone, six of nine fault observations met this criterion. With both checks, all nine did. A separately implemented coordinator matched AiFlow on the lifecycle outcome, service call count and reclamation decision in all 24 tested pairs. With updates every 400 ms, deferred publication met the 500 ms deadline more often at both loads. We measured the share of all offered requests that met the deadline on the latest scheduled version due at return. Strict publication led at 80 requests/s and deferred publication at 20 requests/s. Both policies use the same local evidence for retirement.
When many coding agents work in one repository at once, software engineers are left to judge a collective through its parts. Review examines one change at a time, yet a change can incorporate a fault introduced by another, and repairing the originating change then no longer repairs the repository. To keep human judgment at the centre of agentic software development, we need models of what agents do together. This paper joins complexity theory with software evolution to build one. We model how a fault spreads among open changes as a branching process over contention, the relation between two changes that are open at the same time and modify a common file. As with the reproduction number of an epidemic, spread sustains itself once each faulty change passes the fault, on average, to more than one other. Each repository has a reference threshold, the crossing probability per contention link above which spread would sustain itself in a random graph with the repository's contention degrees. We reconstructed contention among 33,105 agent-authored pull requests in 2,731 repositories. Thirteen repositories with reference thresholds below 5% contained 42.5% of the changes. There, a fault that crossed one contention link in twenty would sustain spread under the model. The structural conditions for propagation are in place where much agent-authored work happens. Reviewing each change separately cannot reveal these conditions. Engineers also need to know where concurrent work exposes a repository to spreading faults, which they can compute from records they already keep.
Architectural Knowledge Management (AKM) is crucial for software development and Architectural Decision Records (ADR), an important artifact of AKM, provide a structured approach to capture Architectural Design Decisions (ADD). However, their adoption is limited due to the manual effort involved and insufficient tool support. Prior work shows that LLMs can support ADD generation, though basic prompting yields suboptimal results. This paper explores how LLMs can support architects in two complementary tasks: generating ADDs from Decision Contexts, and generating complete ADRs from titles. We propose Domain-specific Retrieval Augmented Few-shot Tuning (DRAFT), a novel approach that integrates Retrieval Augmented Few-shot Generation with Fine-tuning to generate. DRAFT operates in two phases: an offline phase that fine-tunes a model using retrieval-augmented prompts derived from historical ADRs, and an online phase that generates decisions or complete ADRs by combining retrieved examples with the fine-tuned model. Evaluated on 4344 ADRs across multiple LLMs using standard NLP metrics, DRAFT consistently produces outputs better aligned with real-world ADRs. A human evaluation with the authors and external architects, however, shows no uniformly preferred approach. DRAFT also maintains practical efficiency, reduces dependence- dence on proprietary models, and addresses organizational concerns around privacy, resource constraints, and inference costs.
The proliferation of large language models (LLMs) and Artificial Intelligence (AI) in real-world applications has heightened the need for systematic, safety-oriented deployment frameworks. Existing approaches typically prioritize the construction of datasets and risk cards around the LLM and AI architecture itself, yet they provide scant consideration for the specific use-case that drives model selection. This omission is problematic because any practical AI deployment begins with a detailed use-case description that informs the assessment of contextual hazards. In this paper, we introduce a structured pipeline that, given a use-case, automatically produces a tailored dataset and an accompanying risk card. The process ensures that identified risks are tightly coupled to the use-case, and it offers traceable evidence from peer-reviewed literature to substantiate each risk to use-case relationship. Prior claim-verification methods (FActScore, FactReasoner) have been validated for factual claims. Risk-relevance is a hypothetical claim about possible harm, and whether evidence retrieval can meaningfully assess such claims remains untested. Literature-Informed Testbed for Mapping Use-cases and Synthesizing (LITMUS) risk cards are the first systematic attempt to characterize this adaptation. We evaluated the pipeline using the MIT Risk Taxonomy and achieved a 0.91 F1-score with a list of 320 samples from the benchmark risk dataset that was considered. These results demonstrate the effectiveness of our approach in generating robust, evidence-based risk assessments for LLM deployments.
Ranking functions are a fundamental technique for proving loop termination, but synthesizing them remains challenging and often requires substantial expertise. Despite considerable progress in their automated synthesis, existing approaches remain limited in their effectiveness. We propose RAINFALL, a neuro-symbolic framework that tightly integrates large language models (LLMs) with symbolic verification. To our best knowledge, RAINFALL is the first to employ a generate-verify-refine paradigm for LLM-based ranking function synthesis. RAINFALL formulates ranking function synthesis as a constrained code-completion task, inserting placeholders into the input program that the LLM must fill in four predefined slots per loop. The resulting program is checked by a symbolic verifier. Successful verification yields a valid ranking function, while verification failures produce diagnostics that are translated into natural-language feedback to guide iterative refinement. We evaluate RAINFALL on two public benchmark suites comprising 358 terminating C programs. Using DeepSeek-V4.1-Flash, RAINFALL synthesizes verified ranking functions for 333 programs (93.02%), outperforming all evaluated baselines. Notably, it solves 22 more programs than PROTON 2.1, the winner of the SV-COMP 2026 Termination Category. Combining RAINFALL with PROTON 2.1 further increases the success rate to 96.65% (346/358 programs). Ablation studies demonstrate the contributions of placeholder contracts, few-shot examples, symbolic verification, and diagnostic feedback, while experiments across different LLMs establish the broader applicability of the framework.
Ensuring the correctness of LLM-generated code is a core challenge for modern software engineering. Benchmarks for agentic code generation check correctness with held-out test suites, which are inherently incomplete and increasingly susceptible to memorization. Formal verification avoids both problems, but existing work covers only standalone tasks whose specifications are given as input, not real issues, which touch large repositories and state intent in vague natural language. We present BenchProofer, a pipeline that turns a coding task with a known correct patch into a formally verified one: it writes a specification for the new code, summarizes the existing functions that code calls with axioms, and admits an instance only after mechanical and adversarial gates agree. Applying it to SWE-bench Verified yields SWE-Proof, 500 real issues whose correctness is formally verified rather than tested, and it extends to SWE-bench Pro. Evaluating Claude Opus 4.8, we find that verification catches what tests miss: nearly a third of test-passing patches admit counterexamples, which a structured natural-language specification does not fix, while a correct formal one lifts resolution from 85% to 95%. Writing that specification is the hard part: an agent that must write its own gains nothing over an unaided baseline, and only 56% of those specifications pass our audit. The usual failure is faithfulness, where a specification constrains part of the required behavior and leaves the rest free. Specification quality also tracks the outcome, failing on 92% of unresolved instances against 51% of resolved ones, making faithful specification synthesis a concrete open problem. Code is available at https://github.com/amazon-science/BenchProofer.
Reusing verification artefacts requires identifying structural and semantic similarities across programs and their specifications. In this paper, we focus on graph construction as a foundational step toward this goal. We present a pipeline that converts imperative programs and their annotations into typed, attributed graphs. Our experiments cover datasets including C with ACSL, Java with JML, and Dafny programs. The pipeline integrates abstract syntax tree parsing with semantic embeddings derived from models such as SentenceTransformer and CodeBERT. This enables the generation of graph representations that capture both structural relationships and semantic context. Our results show that consistent graph representations can be constructed across different languages and annotation styles. This work provides a practical basis for future steps in semantic enrichment and approximate graph matching for scalable verification artefact reuse.
Resolving a repository-level issue typically requires a software-engineering (SWE) agent to localize the faulty code, reproduce the failure, and patch the code. Reinforcement learning trains such agents from a single test result on the final patch, while on-policy self-distillation (OPSD) adds token-level supervision from a teacher with privileged evidence, exposing the full reference patch at every step. Neither provides stage-specific guidance for localization or reproduction. We propose SWE-Ladder, which turns the verified repair of each training instance into stage-specific evidence: the changed files and lines for localization, the fail-to-pass tests for reproduction, and the diff for patching. A rule-based router assigns each step of an end-to-end rollout to a stage based on its tool call, a frozen teacher sees only the matching evidence, and the stages are distilled in repair order while GRPO optimizes the full trajectory. With Qwen3-4B-Instruct-2507 on SWE-bench Verified under the R2E-Gym scaffold, SWE-Ladder improves pass@1 from 9.6% to 16.4%, compared with 10.4% for GRPO and 12.4% for OPSD with the full patch. Under the OpenHands scaffold, it improves pass@1 from 13.0% to 17.6%. Reversing the stage order under R2E-Gym reduces pass@1 to 11.4%.
코딩 에이전트를 위한 긴 컨텍스트 가지치기는 효율적인 컨텍스트 관리를 위한 핵심 기술이었다. SWE-Pruner와 같은 기존 컨텍스트 가지치기 방법은 별도의 코드 분류기를 부착하여 이를 구현하지만, 우리는 에이전트가 도구 출력을 읽을 때 코드 컨텍스트의 관련성을 나타내는 내부 표현을 스스로 인코딩한다는 사실을 발견했다. 이 발견에 기반하여, 에이전트 내부에서 도구 출력을 직접 가지치기하는 SWE-Pruner Pro를 제안한다. 구체적으로, 작은 헤드가 에이전트 자체의 내부 표현을 각 줄에 대한 유지 또는 가지치기 레이블로 변환하며, 각 도구 출력의 줄 수에 맞춘 길이 인식 임베딩을 사용한다. 두 개의 오픈 가중치 백본과 네 개의 멀티턴 벤치마크에서 SWE-Pruner Pro는 작업 품질을 유지하면서 프롬프트 및 완성 토큰의 최대 39%를 절약하며, 추론 오버헤드는 제한적이다. 특히 MiMo-V2-Flash에서 SWE-Pruner Pro는 SWE-Bench Verified 해결률을 +3.8% 높이고 장문맥 Oolong 정확도를 +2.2 포인트 향상시킨다.
Coding agents face new challenges in game development, where they must produce code that is not only syntactically correct but also consistent with engine-managed lifecycle, state, and networking behavior. Existing game-development benchmarks, however, do not combine assertions over engine-based runtime states with cross-client consistency, failing to evaluate how well generated code adheres to the desired behavioral specifications. To address these limitations, we present GameEngineBench, a benchmark of 110 C++ implementation tasks derived from 9 existing Unreal Engine 5 projects. Each task requires an agent to implement missing behavior within an established gameplay architecture. We also introduce Full-Session Verification, a testing framework that injects hidden tests after the agent finishes and evaluates the resulting implementation inside Play-in-Editor (PIE) sessions, with networked client worlds in 71 tasks. The tests evaluate Unreal's game loop, actor lifecycle, subsystems, and replication stack while directly inspecting runtime state. In 53 tasks, 119 tests additionally inspect a distinct client world to determine whether the authoritative server state is correctly replicated. To our knowledge, this is the first coding benchmark to evaluate cross-client replication. Across 11 model-harness configurations, the best-scoring configuration achieves 46.4% pass@1, while 43 tasks remain unsolved by every evaluated configuration. These results demonstrate that compilation and shallow verification overestimate agents' ability to implement behavior that remains correct during full engine execution.
Large language models (LLMs) are accelerating register-transfer level (RTL) development, but ensuring the correctness of generated designs remains a major challenge. Existing LLM-driven workflows rely heavily on simulation-based verification, which provides limited correctness guarantees, and often offer little insight into the design decisions behind the generated RTL. We present a framework for LLM-guided, correct-by-construction RTL generation that combines the generative capabilities of LLMs with the mathematical rigor of stepwise refinement. The framework translates natural-language requirements into a formal hardware contract and progressively refines the contract into an implementation. At each refinement step, the LLM proposes a design decision, while the refinement engine applies the corresponding transformation only after formally verifying its correctness. The resulting program is formally verified against the contract and then translated into synthesizable RTL. The recorded derivation allows every line of generated RTL to be traced back to the design decisions and requirements that motivated it. Beyond generating verified implementations, the framework provides reliable verification feedback and reusable design experience, laying the foundation for self-improving hardware generation.
Predicting the next scheduler event of a concurrent program is ill-posed as single-label classification: repeated runs from the same trace prefix produce different, equally valid next events. We formulate next-event prediction for concurrent Go programs as estimating an empirical next-event distribution obtained from repeated executions, and release a benchmark with 945 training examples from hand-written and generated programs and 798 held-out predictions on 54 real-world GoKer bug kernels from systems such as CockroachDB, Kubernetes, gRPC and etcd. We fine-tune Qwen2.5-Coder-7B with low-rank adapters under a cross-entropy objective and a KL-to-empirical-distribution objective and compare them with zero-shot models and trivial baselines. The outcome is a neutral-to-negative result. The fine-tuned adapters (re-evaluated: 36.3% cross-entropy, 33.6% KL; originally reported 36.2% and 35.8%) are statistically indistinguishable from always predicting the majority event (35.5%), and an event n-gram model reaches 33-34%. Because each held-out prompt carries labels from about five runs, no deterministic predictor can exceed 58.9% top-1 accuracy, so we report macro-F1, balanced accuracy, per-class recall, program-clustered confidence intervals and binned calibration measured directly on both adapters. A sensitivity study with 100 runs per program shows that five-run targets are noisy (mean total-variation distance 0.24 from a 100-run reference), which plausibly limits what the KL objective can learn. Rare event types are essentially never predicted. A select-block goroutine-leak signature follows from scheduler semantics rather than learning. We release the data, adapters and tooling.
LLM agents mis-call tools, and the natural guess is that the model failed to see the right tool in a crowded harness. We show the opposite through a lens concurrent work sets aside -- the model's attention to labeled tool-definition segments. On real BFCL failures, by per-candidate attention argmax the model attends most to the correct tool 80% of the time (vs. 21% chance), and the gold is the under-attended segment on only 10%: it looks at the right tool and still picks wrong. This directly refutes the intuitive "crowded-harness / lost-in-the-middle" explanation: the failure is at the decision readout, not the harness, and we pin it there three ways. (1) Input vs. readout: repairing the prompt (reordering or duplicating the gold tool) recovers <=23% of failures, while readout-side interventions recover 59-91%. (2) Representation-invariance: two gold-pointed interventions in different representations -- an additive attention-logit bias and a residual-stream steering vector -- recover largely the same failures (per-task Jaccard 0.865 pooled, 0.79-0.91 per model), so the bottleneck is localized to the readout independent of which representation is poked. (3) A training-free, gold-free selector: per-segment attention closes most of the gold-free-vs-oracle gap on BFCL (+11.9 pts pooled function-name selection vs. +17.9-pt oracle headroom) and adds +14.9 pts on Seal-Tools; every model positive (exact McNemar p<=8e-4 each). Scopes differ: the causal attention-bias dose-response is bidirectional and monotonic on 10 mask-honoring models (3-32B), the full 0.5-32B span carrying only the correlational diagnostic; the deployable selector is evaluated on 5 single-turn models and does not yet transfer to a multi-turn loop.
Software vulnerability detection is critical for ensuring software security and reliability. Despite recent advances in deep learning, real-world vulnerability datasets suffer from two severe challenges: frequency imbalance and difficulty imbalance. We reinterpret these challenges from an embedding geometry perspective, observing that such imbalances induce geometric distortions in hyperspherical representation space. To address this issue, we propose MARGIN, a metric-based framework that learns discriminative vulnerability representations through adaptive margin metric learning and hyperspherical prototype modeling. MARGIN dynamically adjusts geometric regularization according to the distribution structure estimated by the von Mises-Fisher concentration, aligning the probability mass of embedding distributions with their corresponding Voronoi cells, thereby reducing geometric distortion and yielding more stable decision boundaries. Extensive experiments on public vulnerability datasets show that MARGIN consistently outperforms strong baselines, achieving notable improvements in classification and detection, especially on challenging, imbalanced datasets. Further analysis demonstrates that MARGIN produces more structured embedding geometries, improving robustness, interpretability, and generalization.
Harnesses are now central to coding-agent performance, mediating how models interact with tools and execution environments. Yet harness engineering remains a manual craft, because automating it faces a heterogeneous action space across editable components, voluminous trajectories that bury actionable signal, and edits whose effect is hard to attribute. We introduce Agentic Harness Engineering (AHE), a closed loop that addresses these challenges through three matched observability pillars: (1) component observability gives every editable harness component a file-level representation so the action space is explicit and revertible; (2) experience observability distills millions of raw trajectory tokens into a layered, drill-down evidence corpus that an evolving agent can actually consume; and (3) decision observability pairs every edit with a self-declared prediction, later verified against the next round's task-level outcomes. Together, these pillars turn every edit into a falsifiable contract, so harness evolution proceeds autonomously without collapsing into trial-and-error. Empirically, ten AHE iterations lift pass@1 on Terminal-Bench 2 from 69.7% to 77.0%, surpassing the human-designed harness Codex-CLI (71.9%) and the self-evolving baselines ACE and TF-GRPO. The frozen harness transfers without re-evolution: on SWE-bench-verified it tops aggregate success at 12% fewer tokens than the seed, and on Terminal-Bench 2 it yields +5.1 to +10.1pp cross-family gains across three alternate model families, indicating the evolved components encode general engineering experience rather than benchmark-specific tuning. Ablations localize the gain to tools, middleware, and long-term memory rather than the system prompt, suggesting factual harness structure transfers while prose-level strategy does not.
Automated Program Repair (APR) seeks to generate correct patches for buggy programs, but recent Large Language Model (LLM)-based repair systems remain sensitive to superficial code changes and often rely on coarse test outcomes during iterative repair. We propose DynaFix, an LLM-based APR framework that integrates execution-level dynamic information into a closed-loop repair workflow. The distinguishing feature of DynaFix lies not in using execution-level information per se, but in repeatedly updating and exploiting such information throughout the iterative repair process. In each repair round, DynaFix uses ByteTrace to collect variable states, branch paths, and call stacks, incorporates these runtime signals into structured prompts, validates generated patches through re-execution, and feeds the resulting updated traces into subsequent repair iterations. This process grounds patch generation in concrete execution behavior rather than static code alone. We evaluate DynaFix on Defects4J v2.0, the Real-World Benchmark, and a code perturbation benchmark, Defects4J-Trans. DynaFix repairs 236 single-function Defects4J bugs with GPT-4 and 186 with GPT-4o, including 23 bugs not fixed by existing baselines. On Defects4J-Trans, DynaFix achieves 15.6%-32.1% higher aggregate repair counts than ReinFix and shows higher repair retention under semantics-preserving transformations. It also reduces token consumption by 60%-70% compared with state-of-the-art LLM-based APR methods. These results show that repeatedly updating and exploiting execution-level information throughout iterative repair can substantially improve the effectiveness, robustness, and cost efficiency of LLM-based program repair.
Ensuring that code accurately reflects the algorithms and methods described in research papers is critical for maintaining credibility and fostering trust in AI research. This paper presents a novel system designed to verify code implementations against the algorithms and methodologies outlined in corresponding research papers. Our system employs Retrieval-Augmented Generation to extract relevant details from both the research papers and code bases, followed by a structured comparison using Large Language Models. This approach improves the accuracy and comprehensiveness of code implementation verification while contributing to the transparency, explainability, and reproducibility of AI research. By automating the verification process, our system reduces manual effort, enhances research credibility, and ultimately advances the state of the art in code verification.