\section{Learning Repair Utility}
\label{sec:method}
\paragraph{Action outcomes.}
Fix a repair policy $\pi$, its execution scaffold, and a repair budget $B$. For a candidate $x$, action $a$, and sampling seed $r$, let $Y(x,a,r)\in\{0,1\}$ denote the official final outcome. Define
\begin{align}
q_a(x)&=\Pr\bigl(Y(x,a,R)=1\mid x,\pi,B\bigr),\\
c_a(x)&=\E\bigl[C(x,a,R)\mid x,\pi,B\bigr].
\end{align}
For submission, $Y$ is the current patch's verdict. For another action, $Y$ is the verdict after its actual bounded execution. This distinction prevents the logged terminal outcome of an unrelated trajectory from being used as the label for an intervention that was never performed.
For each available nonterminal action, the collection procedure restores the same candidate, executes the action with two prescribed seeds, and records the outcome and resource measurements. Restart intentionally changes the starting code to the pristine repository. Reusing seed identifiers across actions controls the sampling configuration; it does not make different prompts consume identical random draws or eliminate stochastic variance.
\paragraph{Model.}
We adapt Qwen3-0.6B \citep{yang2025qwen3technicalreport} with rank-16 low-rank updates to its attention projections. The hidden state of the final nonpadding input token, $h_\theta(x)$, feeds two linear heads. The first returns five logits $z_a(x)$ with probabilities $\widehat q_a(x)=\sigma(z_a(x))$. The second returns nonnegative log-cost estimates
\begin{align}
\widehat\ell_a(x)&=\operatorname{softplus}(v_a^\top h_\theta(x)+b_a),
\\ \widehat c_a(x)&=\exp(\widehat\ell_a(x))-1.
\end{align}
The output is produced in one forward pass without decoding answer tokens. The five probabilities are separate Bernoulli estimates, not a softmax over actions. A state can be repairable by several actions, and high success probability does not require the other actions to receive low probability.
\paragraph{Supervision.}
For each candidate and action, $\bar y_{ia}$ averages the judged outcomes across the prescribed seed pair, and $\bar c_{ia}$ averages the measured normalized cost. Submission has one outcome. Let $m_{ia}$ indicate a complete correctness target and $u_{ia}$ indicate an available cost target. The implemented loss is
\begin{align}
\mathcal L_i={}&
\frac{\sum_a m_{ia}\,\operatorname{BCE}(z_{ia},\bar y_{ia})}{\max(1,\sum_a m_{ia})}\notag
\\ &+
\frac{\sum_a u_{ia}\,\operatorname{Huber}(\widehat\ell_{ia},\log(1+\bar c_{ia}))}{\max(1,\sum_a u_{ia})}.
\end{align}
We average over states with usable supervision. Outcome masking and cost masking are separate: a failed grader can make correctness unavailable even when the resources consumed by the action are known. The default optimizer uses learning rate $10^{-4}$, effective batch size 32, and at most five epochs. Development predictive loss selects the checkpoint; three training seeds are specified for the main comparison.
\paragraph{Cost and action choice.}
The initial policy objective normalizes output generation and public-test service time as
\begin{equation}
C=\frac{N_{\mathrm{new}}}{8192}+\frac{T_{\mathrm{pretest}}}{300}.
\end{equation}
This quantity is a control objective, not a dollar price or a measure of total compute. Raw measurements separately retain input tokens, output tokens, public-test CPU time, repair time, available repair CPU time, setup time, final-grading time, and decision latency. Candidate-generation cost is shared by the compared downstream choices and is reported for the full workflow.
The controller selects
\begin{equation}
a^*(x)=\argmax_{a\in\mathcal A(x)}
\bigl[\widehat q_a(x)-\lambda\widehat c_a(x)\bigr].
\end{equation}
The available-action mask is applied before selection. A fixed grid $\lambda\in\{0,0.02,0.05,0.1,0.2\}$ is evaluated on development data. The selection rule seeks the lowest observed-cost operating point whose observed development success lies within two percentage points of the best eligible fixed policy or supplied frozen reference policy. If no point satisfies the tolerance, the implementation retains $\lambda=0$ and records that the development gate was not met. The resulting threshold is frozen before test predictions. This development rule does not establish a distribution-free risk guarantee.
\paragraph{Correctness-based comparator.}
To isolate the learning target, a matched model predicts only whether the current patch passes. A training-only empirical transition kernel $K_a(y)=\Pr(Y_a=1\mid Y_{\mathrm{submit}}=y)$ maps this estimate to action success:
\begin{equation}
\widehat q_a^{\mathrm{corr}}(x)
=(1-\widehat p(x))K_a(0)+\widehat p(x)K_a(1).
\end{equation}
The submission entries are fixed to $K_{\mathrm{submit}}(0)=0$ and $K_{\mathrm{submit}}(1)=1$. Nonterminal entries use a symmetric beta prior with pseudocounts $(0.5,0.5)$. Both controllers use the same action menu and cost-selection rule. The action-outcome model can condition repairability on the complete observed state, whereas the comparator compresses that dependence into current correctness and an aggregate recovery kernel. Their paired comparison is the primary test of the method.
完整资料 / TEX_4_METHOD
4_method · 完整稿件源码
paper-jev/paper/sections/4_method.tex
公开内容 SHA-256 ee4bd2700439e84804f284e49f89982a852d7eba664b30b7ff5911d8915d8b63