CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learning
Paper · 2022 · Hung Le, Yue Wang, Akhilesh Deepak Gotmare et al.
Summary
A program can look like a plausible solution and still give the wrong answer, run out of time, or fail before it starts. Conventional training for code generation rewards a system for predicting the next token in a reference solution. Once the system writes its own program, it has to continue from the tokens it actually produced, including any mistakes. CodeRL uses fine-tuning to give the generator practice with its own drafts and uses unit tests to judge what those drafts do. A unit test runs a program on a specified input and checks the result against an expected output.
During training, the generator, called the actor, samples complete programs. The authors run the programs and record whether they fail to compile, encounter a runtime error, produce an incorrect result, or pass the tests. A separate network, the critic, learns to predict these outcomes. It supplies a weight for each token, while the observed test outcome determines whether the draft did better or worse than the actor’s greedy answer. Training combines this reinforcement learning objective with continued learning from reference solutions. The main generator is CodeT5-large, a 770M-parameter system that the authors pretrain with a larger Python corpus and an added objective for continuing code from a prefix.
At inference, CodeRL runs new drafts against the examples in the problem statement. If any draft passes, the critic chooses a prefix for the actor to keep while sampling a new continuation. If every draft fails, a repair generator receives the strongest failed candidate or candidates, along with diagnostic information, and attempts a rewrite. This procedure, called Critic Sampling, gives visible tests a role in producing new programs. APPS separately checks the resulting programs against hidden cases, which may expose mistakes that the examples miss.
On the APPS test split, CodeRL with CodeT5-large reports 2.69% pass@1, 6.81% pass@5, and 20.98% pass@1000. Each score is the share of problems solved when the stated number of attempts is available. The authors also observe gains from the training method with GPT-family generators. On the simpler MBPP test split, CodeT5 trained with CodeRL on APPS reaches 63.0% pass@80 without fine-tuning on MBPP, compared with 61.4% for a fine-tuned GPT-137B. These comparisons show what the smaller system achieved with the paper’s combination of pretraining, execution feedback, and sampling. The authors release the improved CodeT5-large checkpoint and the CodeRL implementation. They also call for review by qualified developers because code learned from public repositories can inherit biases and security weaknesses that ordinary functional tests leave unexamined.
Deep dive: CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learning
CodeRL uses unit tests to train code generators and improve their drafts, with results on APPS competition problems and zero-shot transfer to MBPP. · about 40 minutes to read
The problem and its context
A solution has to run
In program synthesis, the input describes a task and the output is a program meant to carry it out. A problem statement can specify the form of its inputs and outputs, include worked examples, and impose constraints that matter once the code runs. A system generating Python for a programming contest has to turn this material into an algorithm, express that algorithm in valid code, and handle the cases the evaluator supplies. Doing well on a straightforward example can require much less work than solving the task within its constraints.
The authors trace the problem back to work that synthesized programs from input and output examples. They describe early systems that used probabilistic methods or worked with restricted programming constructs. Later neural approaches learned from collections of programs, giving the system a basis for preferring certain constructions before it saw a new task. The paper also discusses synthesis in visual domains, where a program can describe a scene, represent a shape, or summarize behavior in a demonstration. Those tasks frequently give the synthesizer a language built around a particular domain, with operations for the objects and actions that the system needs to represent.
CodeRL addresses the branch of synthesis in which a reader can state the task in ordinary language and the answer can use a general-purpose language. Free-form problem descriptions and general-purpose output broaden the task in different ways. An input can bury an important constraint in a long description. The output can use many equivalent implementations or make a mistake anywhere from reading input to computing the answer. A reference solution illustrates a valid implementation, while the evaluator ultimately cares about the behavior of the program the system submits.
Pretrained language models offered a way to start with information learned from existing text and code. The paper describes approaches that frame program synthesis as sequence-to-sequence generation. A system takes a sequence of input tokens representing a problem and generates a sequence of output tokens representing its solution. Earlier work cited by the authors showed promise on basic tasks, whereas competition problems remained difficult. The paper discusses Codex as an example of a GPT-style design that uses a decoder to process both the description and the code. CodeRL’s main experiments use an encoder–decoder design that can process the description separately. Codex
Why the usual training signal falls short
In conventional supervised training, the generator sees the correct beginning of a reference solution and learns to predict the next piece. This procedure is known as teacher forcing. It provides a clear target at each position. At generation time, the system provides its own beginning, so a choice made early in the sequence can affect every choice that follows. It may encounter prefixes it would rarely see in training, including unfinished code that already contains an incorrect assumption. The authors identify this mismatch as a source of accumulating errors.
A separate issue concerns what counts as a correct answer. Two valid programs can use different expressions, variable names, or algorithms. Conversely, a draft that shares substantial text with a reference can misread the input or fail on a single decisive condition. The paper cites studies in which measures based on overlapping tokens correlate poorly with functional correctness. The BLEU score, for example, is a measure of textual overlap. Such measures can be pertinent when a task asks the system to complete a particular piece of code. Whole-program synthesis instead permits any implementation that meets the specification and behaves correctly on the evaluation cases.
The distinction between completion and synthesis shapes the method. A completion system is given part of a program, such as a signature or code around a gap. Research surveyed by the authors used previous programs, structured prediction, and reranking to make completions more relevant or syntactically appropriate. Full synthesis asks for a complete solution without a supplied implementation. CodeRL brings completion back into the process after an initial attempt. If execution gives the system a reason to retain the beginning of a draft, generating a continuation becomes a way to search for an improved full solution.
There was precedent for training sequence generators against a score assigned to the completed output. The paper cites reinforcement learning for translation, where objectives such as BLEU and ROUGE were used to train sequence generators, and work that used a caption evaluation score in image captioning. It also discusses prior actor–critic methods for sequence prediction, in which a generator makes choices and a learned evaluator helps assign feedback. The common challenge is that a score on the completed output does not supply an ordinary derivative through the sequence of discrete choices that produced it. Program execution supplies a score with that property. Sequence-Level Training with Recurrent Neural Networks · Self-critical Sequence Training for Image Captioning
Execution had also been used in synthesis for particular domains. Among the examples the authors discuss is natural language to SQL, where the query can be run to obtain a result. Another precedent that matters here is AlphaCode’s use of example tests to filter and rank candidates. In a filtering procedure, a test changes which existing drafts remain eligible. CodeRL asks whether the outcome can also inform what gets written next. The benchmark setting provides two places to ask that question. During training, the authors can run attempts on problems with known solutions and tests. During evaluation, they can make use of examples that a new problem exposes while leaving its hidden cases to the evaluator. Seq2SQL · AlphaCode
The method, step by step
What the generator and critic each see
CodeRL starts with a system that can already turn a problem description into code. The authors train it on reference solutions before using its attempts as new training data. Some attempts will be correct, others will run with an incorrect result, and others will fail earlier. Running them gives the authors a label for each attempt. They use these labels first to train the critic and then to help adjust the generator. The critic has access to both the task and the candidate, so the judgment it learns concerns the candidate as a solution to that particular task.
The generator is called the actor because it chooses the next token. The term critic covers related roles in training and inference. The training critic learns a classification task with distinct types of failure and provides token weights for the actor’s updates. A separate inference critic learns a binary prediction and helps allocate generation attempts among code prefixes or failed drafts. In either role, a critic score is an estimate learned from examples. Executing the program is the procedure that produces the observed outcome.
How CodeRL trains and generates programs
The steps in order.
Preparing CodeT5 for program generation
The paper builds its main actor from CodeT5, a code-aware encoder–decoder Transformer. The encoder processes the whole input description, so information near its beginning can be represented in light of information near the end. The decoder then writes the answer in sequence. This division suits the form of the task as the authors describe it. Problem statements are natural-language inputs and can be long, while answer programs can be relatively short and have to obey the syntax of a programming language. The CodeT5-large variant has 770M parameters and follows the T5-large architecture. T5
The authors train this variant from scratch using the code-specific tokenization of the original CodeT5. They use 6 programming languages from CodeSearchNet. The original CodeT5 used 8, but the paper reports that the C and C# datasets were unavailable publicly. The authors also compile a Python corpus from public GitHub repositories with permissive licenses. They call it GCPY and report 10.5B tokens, describing it as 10x the size of the CodeSearchNet corpus used in the original CodeT5. The distinction between the corpora matters because the experiments separately ask what changes when more Python data is added. CodeSearchNet
The first pretraining objective is masked span prediction. A span is a contiguous stretch of tokens. The training procedure hides stretches and teaches the system to recover them from the remaining material. The authors keep this objective from CodeT5 and omit identifier-based objectives that required parsing programs into abstract syntax trees. This simplifies the preprocessing needed for that stage. The paper reports that it concatenates examples into sequences of size 512 for masked span prediction and gives 1.1B tokens for the resulting CodeSearchNet data.
The added objective is next-token prediction formulated for the encoder–decoder architecture. The authors draw a split point uniformly within the region from 10% to 90% of each original code sequence. The part before the split goes to the encoder. The remaining part is the target continuation for the decoder. Masked span prediction asks the system to recover missing parts of a code sample, whereas this stage gives it direct practice writing the entire remainder after a supplied prefix. Later, CodeRL makes use of that kind of continuation when it retains the beginning of a candidate and regenerates its ending. Both pretraining objectives use existing code as the target. Execution enters the later CodeRL training procedure.
The authors report running pretraining on 16 A100-40G GPUs for around 21 days. In masked span prediction, 15% of the input is corrupted, the learning rate peaks at 2e-4, and each batch contains 2048 examples. The stage runs for 150 epochs on CodeSearchNet, reported as 10 days, then 10 epochs on GCPY, reported as 5 days. An epoch is a pass through the corresponding training data. Next-token training runs for 10 epochs with batches of 256 and a maximum learning rate of 1e-4, with a reported duration of 6 days. Its maximum input and target lengths are 768 and 600 tokens, respectively. The paper specifies AdamW, with weight decay of 0.05, and reports a linear decay schedule with a warmup of 1000 steps in its general optimizer setup. It specifies separate schedules for downstream fine-tuning. AdamW
Starting from reference solutions
A problem description is denoted by D. A reference program is W, and a program generated by the actor is Ŵ. Each program is a sequence of tokens. The paper reuses T for the length of a sequence even though different programs can have different lengths. At a generation step, the decoder converts its current internal representation into a probability distribution and uses that distribution to choose the next token.
ŵₜ ∼ softmax(Linear(sₜ))
ŵₜ is the generated token at decoding position t. The symbol ∼ means the token is drawn according to the distribution on the right. sₜ is the decoder’s hidden state, an internal vector that summarizes context at that step. Linear maps the state to one score for each item in the output vocabulary. softmax converts those scores into probabilities over that vocabulary.
The supervised objective is cross-entropy. Each training step rewards the system for assigning probability to the reference token given the description and the earlier reference tokens. In token form, the loss is the sum of negative log probabilities.
ℒce(θ) = −∑ₜ log pθ(wₜ | w₁:ₜ₋₁, D)
ℒce is the cross-entropy loss and θ denotes the actor’s parameters. The symbol ∑ₜ sums over token positions t, and log is the logarithm. pθ is the probability distribution produced by the actor. wₜ is the token at position t in the reference W, and w₁:ₜ₋₁ is the reference prefix up to the previous position. The bar introduces the information the probability is conditioned on, which includes the description D. The minus sign makes a lower probability for the correct token contribute a larger loss.
The authors use this objective alone to warm-start the pretrained actor for up to 10 epochs before collecting synthetic programs. Warm-starting means giving the actor a first round of task-specific practice so that the drafts used in later training come from a generator that has already seen problems and worked solutions. At inference, the condition that was a reference prefix during supervised training becomes the actor’s own prefix. CodeRL uses that same kind of prefix when it samples training drafts, so its additional objective can act on sequences the actor is capable of producing.
Turning an execution outcome into a training signal
In the reinforcement learning formulation, the actor defines a stochastic policy, meaning a probability distribution over actions. The action at each step is the selection of a token. The policy then moves to a new context that includes that token. A generation episode ends at the end-of-text token, and the tests supply a return, a numerical judgment of the finished program. Minimizing the negative expected return has the effect of maximizing the expected return.
ℒrl(θ) = −𝔼[ r(Wˢ) ], with Wˢ ∼ pθ
ℒrl is the reinforcement learning loss and θ denotes the actor’s parameters. 𝔼 means expectation, an average over the programs the actor can sample. Wˢ is a sampled program, with s marking its sampled origin. The notation Wˢ ∼ pθ specifies who generates those programs. r maps a finished program to its return, and the negative sign puts reward maximization in the form of loss minimization. The problem description is fixed for a draw from the actor.
The return distinguishes four outcomes. A compile error receives -1.0. A program that reaches execution but encounters a runtime error receives -0.6. A candidate that produces a test failure receives -0.3. Passing the full test set receives +1.0. The ordering gives a program credit for getting further even when it still falls short. These values are chosen by the authors. They encode the desired ordering of outcomes and the relative strength of the feedback used in training.
A test result can change abruptly with a discrete change in code. The actor cannot learn by taking a derivative through the compiler or test harness. Instead, the authors use the REINFORCE policy-gradient estimator. Its gradient acts on the probability of the choices the actor made, with the execution result determining how strongly those choices should count.
∇θ ℒrl(θ) ≈ −𝔼[ r(Wˢ) ∑ₜ ∇θ log pθ(wˢₜ | wˢ₁:ₜ₋₁, D) ]
∇θ is the gradient with respect to the actor’s parameters θ, and ≈ marks the policy-gradient estimate. ℒrl is the reinforcement learning loss. The expectation 𝔼 runs over sampled programs Wˢ drawn from pθ, and r(Wˢ) is the return assigned after testing each program. The sum ∑ₜ runs over the generated token positions. wˢₜ is the chosen token at step t, while wˢ₁:ₜ₋₁ is the program prefix sampled before that step. The conditional probability pθ depends on that prefix and on D, the problem description. Taking log and summing the per-token terms expresses the log probability of the complete sequence through the actor’s successive decisions. The minus sign again reflects the loss convention.
Comparing each draft with a greedy answer
The return provides a useful ordering but can produce a noisy gradient when estimated from a batch of samples. To reduce that problem, the authors obtain a comparison program by greedy decoding. Greedy decoding chooses the most probable token at each step. The resulting program has its own execution outcome, which gives a baseline for judging sampled alternatives on the same task.
∇θ ℒrl(θ) ≈ −𝔼[ (r(Wˢ) − r(Wᵇ)) ∑ₜ ∇θ log pθ(wˢₜ | wˢ₁:ₜ₋₁, D) ]
Wᵇ is the baseline program and r(Wᵇ) is its test return. Wˢ and r(Wˢ) are the sampled program and its return. Their difference is positive when the sampled program earns a better outcome and negative when it earns a worse one. 𝔼 averages over the sampled programs. ∇θ ℒrl(θ) is the gradient of the actor’s reinforcement learning loss with respect to θ. The sum ∑ₜ collects the gradient of the log conditional probability for the sampled token wˢₜ at each position t, using the sampled prefix wˢ₁:ₜ₋₁ and task D. The symbols ≈ and − indicate the estimate and the negative-loss convention, respectively.
A draft can therefore earn positive relative feedback even if it fails. Suppose the greedy answer cannot compile and the sampled answer runs but produces an incorrect output. The execution categories place the sampled program ahead of the greedy one. If their outcomes are the same, the relative return contributes no update for that sample. The paper notes that the greedy baseline is independent of the particular sampled action, which is what allows the baseline subtraction in this estimator without changing its expected gradient. A separate change, described next, deliberately reweights the token contributions.
Learning a different weight for each token
A single program-level result can be too coarse for training. A compilation failure can come from a small syntax mistake, while large stretches of the program may be sound. The baseline tells the actor how the draft compared with its greedy answer, but the same difference would still multiply the contribution of every token. A score based on matching the reference prefix would be more specific to position and would reintroduce the problem of judging alternative implementations by their text. The authors instead train a critic on the outcomes of complete programs and use its internal representations to vary the weight across positions.
To collect critic training data, they freeze the warm-started actor and sample drafts from it. They run each draft against the corresponding tests and label it with the observed category. They also include reference programs and assign those examples the passing label by default. The critic sees the problem description together with the program and learns to classify it as CompileError, RuntimeError, FailedTest, or PassedTest. The paper uses CodeT5-small critics with CodeT5 actors and GPT2-small critics with GPT-family actors.
ℒcritic(φ) = −log pφ(u | Wˢ, D)
ℒcritic denotes the critic’s classification loss and φ denotes its trainable parameters. pφ is the critic’s conditional distribution over outcome labels. u is the observed test outcome assigned to the program Wˢ for description D. The bar separates the label being predicted from the inputs. The logarithm log and leading minus sign make a low probability on the observed label costly. For a reference example, the inputs instead contain the reference program and the target is the assigned passing label.
The critic represents each program token with a hidden state. For a prediction about the whole program, it applies max pooling over token positions, taking the largest value in each dimension across the program. A linear layer and softmax then turn that pooled representation into probabilities.
û = softmax(Linear(Pooling(h₁, …, hₜ, …, h_T)))
û is the critic’s distribution over possible outcomes for the program. hₜ is its contextual hidden state at token position t, and h₁ through h_T cover the sequence of length T. The ellipses stand for the intervening token positions. Pooling takes the maximum across positions for each hidden dimension, Linear computes a score for each outcome, and softmax normalizes those scores as probabilities.
For the actor update, the authors read the critic before pooling. They apply the classifier to an individual token state and look up the probability of the outcome that the complete program actually received. This lookup is important. A token belonging to a failed program can get a high weight because its state strongly indicates that kind of failure. The sign of the update comes from the relative return computed with the tests.
q̂φ(wˢₜ) = softmax(Linear(hₜ))[u]
q̂φ is the weight the learned critic with parameters φ assigns to the sampled token wˢₜ. hₜ is the hidden state for that token at position t. Linear maps the state to outcome scores and softmax converts them to a distribution. The brackets [u] select the probability assigned to the observed outcome u. The hat marks the weight as an estimate. The critic has program-level supervision, so this score expresses the classifier’s response at a position instead of a separately observed test result for the token.
∇θ ℒrl(θ) ≈ −𝔼[ (r(Wˢ) − r(Wᵇ)) ∑ₜ q̂φ(wˢₜ) ∇θ log pθ(wˢₜ | wˢ₁:ₜ₋₁, D) ]
∇θ ℒrl(θ) is the gradient of the actor’s reinforcement learning loss with respect to its parameters θ. 𝔼 averages over the sampled program Wˢ, drawn from the actor distribution pθ. r(Wˢ) and r(Wᵇ) are the observed returns of the sample and the greedy baseline Wᵇ. The sum ∑ₜ runs over each token position t. q̂φ(wˢₜ) is the learned critic weight on the sampled token at that position. The remaining gradient concerns the log probability of that token given the preceding sampled tokens wˢ₁:ₜ₋₁ and the problem D. The approximate equality describes the estimator, and the leading minus sign puts the update in loss form.
In practice, the authors approximate the expectation for an optimization step with a single sampled program. The corresponding expression uses the same terms and drops the outer average.
∇θ ℒrl(θ) ≈ −(r(Wˢ) − r(Wᵇ)) ∑ₜ q̂φ(wˢₜ) ∇θ log pθ(wˢₜ | wˢ₁:ₜ₋₁, D)
Here Wˢ is the particular program drawn for the estimate. Wᵇ is its greedy comparison program, and r supplies the tested return of each. q̂φ supplies the position-specific weight from the critic with parameters φ. The sum ∑ₜ collects the contributions over positions t. pθ is the actor’s probability of the sampled token wˢₜ given its earlier sampled tokens wˢ₁:ₜ₋₁ and D. log is the logarithm, and ∇θ differentiates with respect to actor parameters θ. The result estimates the gradient of ℒrl for that step.
Once the critic is trained, the authors fine-tune the actor with equal weights on cross-entropy and reinforcement learning. The reference loss continues to reward valid target continuations in the training set. The reinforcement learning loss adds practice on the actor’s own continuations and responds to their measured behavior. An attempt may therefore influence the actor even when it is an imperfect solution and would make a poor supervised target.
Deciding what to regenerate at inference
On a new problem, the actor first produces a batch of complete candidates. In the Critic Sampling implementation, the batch size N is 200. The paper uses nucleus sampling, which draws a token from a group of likely tokens whose probabilities together reach a chosen threshold. Allowing several plausible choices at each position helps the first batch cover different continuations. Each candidate is then run against examples extracted from the problem description. The set 𝒫 contains the candidates that pass those examples, and ℱ contains those that fail.
A member of 𝒫 has survived the examples, which makes it a reasonable source of a prefix. The authors still expect some of these candidates to fail on unseen cases. Their refinement step looks for a beginning worth retaining and gives the actor further chances to write the rest. It uses a separate critic with parameters φtest, trained as a binary classifier with the labels FailedTest and PassedTest. This critic scores the prefix ending at each position of an example-passing program.
q̂φtest(wₜ) = pφtest(û = PassedTest | w₁:ₜ, D)
q̂φtest(wₜ) is the score assigned at position t of the candidate. pφtest is the probability from the inference critic with parameters φtest. The event û = PassedTest is the predicted passing outcome. w₁:ₜ denotes the candidate prefix through wₜ, including that token, and D is the description. The score is conditioned on the prefix and the description. It estimates how promising the prefix is as the beginning of a solution. The unit tests themselves run complete candidates.
The method first finds the position with the highest passing score, called tmax, and keeps the beginning through that position. If the selected prefix contains a position where the failing probability exceeds the passing probability, the procedure cuts the prefix further at that point and discards the material to its right. The actor then sees the selected prefix as fixed context and samples a continuation through the end-of-text token. The procedure can reuse each seed to produce several fresh endings. The paper describes allocating N/|𝒫| copies per seed, where N is the batch size and |𝒫| is the number of example-passing programs that supply seeds. The resulting batch keeps the original size. Since each completion starts partway through a program, the authors point out that refinement decodes only the continuation.
Repairing a batch that has no passing draft
When 𝒫 is empty, the method has no example-passing program from which to choose a prefix. It uses the binary inference critic to rank the complete drafts in ℱ by their estimated passing probability. Though all of these programs have already failed the visible examples, the score gives a way to decide which failures are worth handing to the repair generator.
q̂φtest(Wᶠᵃⁱˡ) = pφtest(û = PassedTest | Wᶠᵃⁱˡ, D)
Wᶠᵃⁱˡ is a full program that failed the visible tests. q̂φtest(Wᶠᵃⁱˡ) is its ranking score. pφtest is the binary critic’s probability distribution, with parameters φtest, and û = PassedTest names the outcome whose probability is selected. The bar indicates conditioning on the failed program and the problem description D.
CodeRL sends the highest-ranked M drafts to a separate sequence-to-sequence repair generator. Its input includes the description, the failed program, the observed outcome category, and finer error information extracted from the compiler or runtime trace, such as a syntax or index error. The repair generator is trained with failed synthetic drafts from the same pool used for reinforcement learning. For each one, the corresponding reference program serves as the target. A repair can therefore involve a substantial rewrite. The training task is to generate a whole solution given the buggy draft and its diagnostics.
ℒceᵣₑₚₐᵢᵣ(ω) = −∑ₜ log pω(wₜ | w₁:ₜ₋₁, D, Wᶠᵃⁱˡ, u, c)
ℒceᵣₑₚₐᵢᵣ is the repair generator’s cross-entropy loss and ω denotes its parameters. The sum ∑ₜ runs over target positions t. pω is the generator’s conditional probability of reference token wₜ. The conditioning inputs are the preceding reference tokens w₁:ₜ₋₁, the description D, the failed program Wᶠᵃⁱˡ, the outcome category u, and the error subtype c. The negative logarithm −log penalizes low probability on the reference token.
At inference the repair generator can produce N/M versions per selected draft, with N the upsampled batch size and M the number of drafts selected. The repaired candidates go through the visible tests, and passing candidates can then provide seeds for refinement. The general procedure allows feedback to be used repeatedly. For the experiments, the authors cap repair and refinement at one round each when used. Hidden APPS tests serve as the final evaluator. The branch into repair, the choice of prefix, and the decision to regenerate all use information available before that evaluation.
Experiments and results
APPS asks for complete Python solutions
APPS collects programming problems from coding websites. It contains 10,000 problems with a 50-50 train-test split. The paper reports an average of 23.2 accepted Python solutions and 21.2 unit tests per problem. The average problem description is 293.2 words and the average solution is 18.0 lines. Those lengths help explain why the authors distinguish the work of interpreting the description from the work of writing the program. A relatively short answer can depend on details spread across a much longer input.
APPS groups tasks by difficulty. The main experimental setup gives 3639 Introductory problems with 2639/1000 for training and testing, 5000 Interview problems with 2000/3000, and 1361 Competition problems with 361/1000. The difficulty labels let the authors examine competition performance separately from the aggregate. They use the original APPS preprocessing for reading problem statements and count a program as correct only when it passes the full test suite for the problem.
For the APPS supervised warm start, the CodeT5 actor uses a batch size of 64. The learning rate rises from 0 to 2e-5 over the first 500 steps, then decays polynomially with power 0.5 to 1e-5 by the end of 10 epochs. The authors report around 30 hours on one A100 for this stage. Maximum source and target lengths are 600 and 512 tokens, respectively. These figures describe the warm start. The later procedure uses sampled candidates, trains the critic, and combines the two actor objectives.
The main metric, pass@k, asks what share of problems can be solved with k generated candidates per problem. A problem is solved when at least one candidate passes all its evaluation tests. The metric therefore changes its question as k changes. With a small candidate budget, the system has to place a working solution among very few attempts. With a large budget, an uncommon successful candidate can still solve the problem. A pass@1000 result describes this broader search and should be read with its budget attached.
The paper also reports n@k. Here k is still the number of generated candidates, but the evaluator considers a subset of n after filtering. The visible examples are a way to decide which programs enter the filtered pool. This metric brings selection into the comparison. A filtered pool can contain many programs that are indistinguishable on the examples, even though only some handle hidden cases. Consequently, an improvement in the supply of successful candidates can appear more strongly in pass@k than in the result for a small retained subset.
How APPS results depend on the number of attempts
The APPS comparison includes GPT2, GPT-Neo, and GPT3 from the benchmark’s earlier evaluations, along with Codex and AlphaCode. The paper says that the usual setup for the pretrained baselines is supervised APPS fine-tuning, with Codex and GPT3 as exceptions. It discusses Codex’s result as a few-shot comparison, meaning it received examples in context without APPS fine-tuning. The comparisons thus put several available systems on the same benchmark while retaining differences in how they were prepared and how they select programs.
On the APPS test split, CodeRL with CodeT5 achieves 2.69% pass@1 and 6.81% pass@5. With the larger budget of 1000 candidates, the reported result is 20.98% pass@1000. The authors present these as new best results in their comparison. They also report filtered results of 8.48% 1@k and 12.62% 5@k. Those are the paper’s headline n@k figures. The symbols 1 and 5 identify how many filtered candidates are considered, while k refers to the generation budget for the corresponding comparison.
The paper describes CodeRL at k=1000 as comparable to AlphaCode at k=50000. This is a comparison of solving performance at reported generation budgets. CodeRL spends additional computation on checking examples, scoring candidates, and in some cases generating repairs or continuations. Some regenerated candidates begin from an existing prefix. A candidate count gives a useful measure of the breadth of search, while the mix of generation and evaluation operations determines its actual cost.
The authors also contrast Codex’s aggregate filtered performance at n@1000 with its difficulty on the Interview and Competition subsets. Their interpretation is that task-specific fine-tuning helps bridge the gap between broadly pretrained code generation and the requirements of harder APPS tasks. Because the systems in the main comparison differ in several respects, the paper turns to controlled experiments with the same backbone to investigate the contribution of its training objective.
MBPP tests transfer to shorter tasks
MBPP, or Mostly Basic Programming Problems, also asks for Python programs. Its tasks tend to be short natural-language requests. It contains 974 instances, with 374/90/500 for training, validation, and testing, and 10 instances reserved for few-shot learning. Each task has 1 reference solution averaging 6.8 lines and 3 tests expressed as assertions. An assertion specifies a condition that the program’s output must satisfy. The tests used in this comparison are included in the prompt. This follows the format of the earlier MBPP study. Program Synthesis with Large Language Models
The key transfer result uses CodeT5 trained on APPS and then applied to the MBPP test split without fine-tuning on MBPP. This is the sense in which the paper calls the experiment zero-shot. The generator still sees the problem and its assertions at inference. The APPS-trained CodeT5 baseline reaches 60.2% pass@80 on MBPP. CodeRL raises the reported result to 63.0% under that transfer setup. The fine-tuned GPT-137B baseline reaches 61.4% pass@80. The comparison with the APPS-trained CodeT5 baseline is especially informative about adding CodeRL under the transfer setup. The much larger GPT system provides a comparison with a different training and model configuration.
Pass@80 on the MBPP test split
CodeRL transferred from APPS leads the reported CodeT5 transfer and fine-tuned GPT baselines.
The numbers
| System or setting | pass@80 % |
|---|---|
| CodeT5 transferred from APPS | 60.2 |
| Fine-tuned GPT-137B | 61.4 |
| CodeRL with CodeT5 transferred from APPS (this paper) | 63.0 |
The appendix describes a separate set of experiments involving direct MBPP fine-tuning. Its schedule for CodeT5 is 60 epochs at a constant learning rate of 2e-5 with a batch size of 32, reported to take less than 30 mins on one A100. The maximum source and target lengths are 382 and 306 tokens. The appendix reports 46.8% pass@80 for CodeT5-770M and 40.6% for GPT-8B in its comparison with direct fine-tuning. It also reports that increasing the number of attempts yields 81.8% pass@1000 for CodeT5 with CodeRL. The larger-budget result concerns how often the system can produce a valid answer somewhere among many candidates.
The MBPP appendix gives another detail about the generation conditions. The authors say their CodeT5 candidates benefited from a sampling temperature of 1.2, compared with 0.5 for the GPT baseline in the earlier study. Temperature changes how concentrated the distribution is before a choice is sampled. A higher setting allows more exploration among alternative tokens. A result at a fixed candidate count consequently reflects both the learned generator and the sampling configuration used to draw its answers.
What the additional benchmarks evaluate
The authors use CodeXGLUE to examine whether the revised pretraining recipe makes CodeT5-large a useful starting point outside the main synthesis tests. It includes tasks that turn code into a description, generate code from text, or transform one piece of code into another. The authors follow that benchmark’s use of BLEU, CodeBLEU, and exact match. On a large majority of the tasks they assess, they report setting new best results. These runs use conventional supervised fine-tuning, so they are evidence about the pretrained backbone and the chosen task setups.
The appendix also evaluates CodeT5 on MathQA-Python and GSM8K-Python. In these experiments, the output is a Python program that expresses the arithmetic steps for a word problem and produces its answer. MathQA-Python has 19,209/2,822/1,883 instances for training, validation, and testing. The paper gives 7,473 training problems and 1,319 testing problems for GSM8K. CodeT5 undergoes 20 epochs of fine-tuning in batches of 64 at a learning rate of 2e-5, and sampling uses the nucleus method at temperature 1.2 at inference. It reports that CodeT5 outperforms most GPT baselines on both benchmarks. As described, these experiments evaluate fine-tuned CodeT5 on a related form of synthesis. The central evidence for CodeRL’s execution-based training comes from the APPS and MBPP comparisons.
What the ablations show
Comparing ways to reward a generated program
The authors vary the return estimates while holding the CodeT5-770M backbone fixed. For the comparisons of returns and training objectives, they evaluate pass@1 and pass@5 with beam search. Beam search keeps several promising partial sequences in play as it decodes. Using the same decoding procedure across these variants allows differences in the scores to be interpreted in light of the training changes.
The weakest return variant in the authors’ account uses the absolute execution score without the greedy comparison. All failing categories then carry a negative return, even if a sampled attempt advances beyond what the generator would ordinarily produce for the task. The relative baseline changes this. An unsuccessful program can receive encouraging feedback if it improves on the greedy sample. The comparison supports using performance relative to an existing answer as a training signal.
Another variant gives every token the same relative return and omits the critic. The authors use a Python indentation mistake to explain the weakness of uniform weighting. A local formatting problem can render the program invalid even if much of the solution is sound. Treating the entire sequence uniformly spreads the same update across every decision that produced it. The experiments also consider a rule-based critic that gives tokens progressively smaller weights from the start of the sequence to the end. This rule introduces positional variation without learning to read the code. The learned critic with relative returns does best on both pass@1 and pass@5 in the reported comparison. The result supports learning the weights from code and test outcomes over assuming that position alone determines which choices matter.
Combining synthetic attempts with reference programs
To isolate the loss functions, the authors start with CodeT5 and GPT-Neo generators that have already been trained on references for up to 10 epochs. They then compare ways of continuing training. With reinforcement learning alone, the authors observe vanishing gradients during fine-tuning and report deterioration in benchmark performance. The result is evidence about this particular continuation of training from a supervised checkpoint.
Continuing with only cross-entropy on reference programs also degrades test performance in the comparison, even when training loss improves. The authors interpret that divergence as overfitting to the training data. Their epoch-by-epoch analysis of CodeT5 variants shows the same problem usually after epoch 10 in this setup. There is a tension between refining the fit to known solutions and improving the ability to solve problems outside the training split.
The authors also ask whether the benefit could come simply from seeing more examples produced by the actor. They try adding synthetic programs as supervised targets and treating them all as correct, regardless of execution outcome. This helps GPT-Neo on pass@5 in the reported comparison, while in the other cases the critic-based use of the samples works better. The result gives some credit to training on generated code while showing why its quality matters. Combining reference cross-entropy with the test-weighted objective gives the more consistent improvements across CodeT5 and GPT-Neo on pass@1 and pass@5.
Separating training gains from an inference search
For the APPS Competition subset, the authors compare CodeT5 and GPT-J with and without CodeRL training. They use nucleus sampling alone and omit Critic Sampling during this analysis. That design matters because gains can then appear without the repair generator or the selection of prefixes from visible tests. The paper describes consistent improvements with both backbones and says the gains become more pronounced as k increases over the tested range from 1 to 200. The figures track pass@k as well as filtered results with n set to 1 or 5.
The authors attribute the pattern to training on programs drawn from the actor’s own distribution. At a larger generation budget, the evaluator draws more chances from that distribution, and the paper reports a greater observed effect from the training change. The experiment supports a change in the usefulness of the sampled candidate set. It does not separately establish which properties of that set changed, such as the variety of algorithms or the frequency of near-duplicate candidates.
Comparing refinement and repair
The inference ablation holds CodeT5 as the base and varies which parts of Critic Sampling are available. Refinement alone improves results overall, although its impact on 1@1000 is smaller. The authors explain that generating further completions from promising prefixes can enlarge the pool that passes the examples. When evaluation considers only a small subset of that pool, the presence of new correct candidates does not automatically give them a better chance of being retained. Their proposed avenue for improving these filtered results is an additional ranking step that helps identify stronger candidates within the enlarged pool. Training Verifiers to Solve Math Word Problems
Adding repair helps on problems whose initial candidates all fail the examples. The authors report that repair and refinement together give the best overall improvement across the tested metrics, with a particularly clear gain on pass@1000. They also vary how many failed drafts the system chooses to repair. The best overall setting uses M=1. The paper reports deteriorating performance as the tested setting moves from M=2 to M=4, with pass@200 as the exception. Because the batch allocation per draft is N/M, taking more drafts into repair gives each draft fewer opportunities for a successful rewrite. In this setup, giving the critic’s top choice more attempts generally works better than spreading the same batch across more starting points.
How much of the gain comes from a stronger starting point
The pretraining comparisons use APPS fine-tuning with cross-entropy alone for up to 12 epochs. This keeps the return choices and inference repair procedure out of the comparison. The authors report that scaling CodeT5 from 60M to 770M parameters improves synthesis. At the larger size, they also compare the data and objective choices. Adding GCPY raises pass@1 from 1.3 to 1.56 and pass@5 from 1.72 to 2.06 on APPS. Adding next-token pretraining raises pass@5 from 2.06 to 2.9. Those comparisons explain why the full system’s performance should be understood in light of the backbone changes as well as execution feedback.
APPS pass@5 by CodeT5 pretraining recipe
Adding Python data improves supervised synthesis, and adding next-token pretraining improves it further.
The numbers
| System or setting | pass@5 % |
|---|---|
| CodeSearchNet with masked spans | 1.72 |
| Added GitHub Python data | 2.06 |
| Added next-token pretraining (this paper) | 2.9 |
The epoch analysis follows the supervised variants during fine-tuning. In general, the larger Python corpus and the additional objective improve performance across the epochs the authors examine. This makes the stronger starting point visible before the actor receives an execution-based update. It also provides context for the loss ablation. A better pretrained backbone can improve supervised synthesis while still showing declining held-out results if supervised training is continued in this setup.
What changes in the actual programs
The authors compare the outcomes of 200 sampled programs per APPS test problem under CodeT5 with and without CodeRL. They check example tests and hidden tests separately. CodeRL increases the share of programs that pass and decreases the share that run but fail a test. The increase in passes is more pronounced on Introductory problems. Compile errors also become less common, with a clearer change on Interview and Competition problems. Runtime errors can occupy a larger share once fewer programs are stopped at compilation. The categories reveal where a program stops as well as whether it ultimately counts as a success.
An appendix analysis examines compile and runtime failures in batches of 200 CodeRL programs per APPS test task. The authors describe syntax errors as accounting for more than 90% of compilation errors. The reported figures are 4% for incorrect tab tokens and 5% for incorrect indentation levels. Among runtime failures, they identify indexing problems, inappropriate values, and mismatched data types as frequent categories. They trace many of these errors to the handling of test inputs. This gives a concrete account of a bottleneck that remains after the actor has become better at generating programs that compile.
One interview problem asks for a greatest common divisor involving factorials. The supervised CodeT5 draft computes the greatest common divisor of the inputs themselves. The CodeRL draft without Critic Sampling reads the mathematical task correctly but computes the factorials separately and times out on extreme inputs. The refined solution uses the factorial of the smaller input and passes the hidden tests. This example shows how the evaluation can distinguish misunderstanding the request from writing a mathematically suitable approach that takes too long for the test cases.
The appendix shows several other paths through the method. One candidate is correct without Critic Sampling. Another passes the examples and can be refined to handle hidden cases by changing the order of conditional branches. A case with no passing initial candidates goes through repair and then refinement, yielding a program that passes the hidden tests. The authors also show a task where the final candidate still times out after revision and argue that the code would need a more substantial change. These cases illustrate the kinds of changes the procedure sometimes makes and the kinds of initial errors it can leave in place.
Limitations
Limits identified by the authors
The authors emphasize the gap between visible examples and hidden tests. A program can produce exactly the expected outputs for the examples and still fail a corner case. In their outcome analysis, programs pass the example tests more readily than the hidden ones. For CodeRL, this matters twice. Visible tests provide the initial signal about which programs are worth continuing, and a passing example suite can send a draft into refinement even when its underlying approach is wrong. The paper discusses augmenting example tests by varying input and output pairs as a possible way to improve the signal.
The authors also report that generated programs can still fail to meet user requirements. Their interpretation is that a user gains some control by specifying desired behavior through both the description and tests. The strength of that control depends on the behaviors the tests capture. In MBPP, the evaluators show the assertions directly in the prompt. The authors point out that this can occasionally encourage a generator to hard-code an answer for a tested input. They retain the format so the comparison follows the earlier benchmark protocol.
The critic imposes a training cost in addition to the actor. According to the authors, a small GPT-2 critic can predict errors on synthetic examples with greater than 75% accuracy, and fine-tuning it costs little relative to pretraining the actor. The figure concerns classification of generated-program outcomes. Inference also carries costs for test execution, critic scoring, and additional generation. Preserving a prefix reduces the number of tokens that need to be decoded during refinement, and the reported experiments limit the number of repair and refinement rounds.
CodeRL optimizes behavior captured by the functional tests, while the authors identify other properties a deployed system would have to address. Public repositories can contain insecure code, and learned generators can reproduce weak security practices. The paper also notes the potential for biased code and toxic comments and calls for verification by qualified human developers. It discusses preference-based training and controlled decoding as directions for influencing qualities such as fairness, reliability, and security. They are proposed directions rather than properties established by the benchmark scores. Training Language Models to Follow Instructions with Human Feedback
What follows from the setup
A pass score establishes that at least one generated program meets the evaluator’s test criterion for the counted problem. Even a comprehensive hidden suite remains a finite set of executions. The paper’s successful efficiency example establishes that a particular revised program handled the larger cases used by APPS. The candidate budgets likewise shape the reported outcome. A strong result at pass@1000 shows that the search can reach working programs when given that many attempts. The filtered metrics and the small-budget results answer the separate question of how readily successful answers can be selected or produced within tighter limits.
The authors test for overlap from APPS training solutions into MBPP by comparing normalized lines of code. They remove comments, normalize whitespace, and omit lines that occur more than twice in MBPP so that ubiquitous lines carry less weight. They report that 12.6% of the MBPP programs have more than half their lines matched somewhere in APPS training data. They also report no overlap for 514 out of 974 programs, and at most 3 overlapping lines for 90.9% of programs. When requiring consecutive matches, they find no more than 2 consecutive shared lines. This check addresses verbatim or near-verbatim reuse as measured by normalized lines. The same task can be expressed with different code or different wording, and the comparison concerns APPS training solutions instead of the full GitHub pretraining corpus. Zero-shot consequently describes the absence of MBPP fine-tuning in that run.
The critic’s supervision also sets a limit on what the learned token scores mean. Classification labels apply to entire programs. A high weight at a position indicates how the classifier responds to the representation there. It does not establish that changing that token would fix a failure or cause one. That distinction matters when a bad algorithm produces a perfectly valid-looking prefix. Continuing from it can preserve decisions that need revision. The appendix’s unresolved timeout provides an example where the regenerate-and-test loop did not reach the change the task required.
Finally, the portability claim has concrete evidence and a defined scope. The training method is applied to multiple generator backbones, and the two primary benchmarks both involve Python. The top-line comparisons also bring together changes in pretraining, model size, training objective, and inference. The controlled comparisons support contributions from several of those choices. The paper’s evidence for their combined effect is strongest for the benchmark tasks and test access it actually evaluates.
What came after
Later work that cites CodeRL pursues several ways of using feedback after a first attempt. Some papers put execution inside the process of generating and revising code. Others study feedback that can be written in ordinary language, ask how systems should be evaluated when they revise their answers, or treat execution results as something a benchmark can ask a system to predict. These directions can be compared through a distinction central to CodeRL. A feedback signal can guide training, select among existing candidates, or provide information for generating a new answer.
Execution, training, and refinement
Execution-based Code Generation using Deep Reinforcement Learning takes up the link between executing code and using reinforcement learning to improve generation. That places it close to the training side of CodeRL, where a complete program yields an external judgment and learning adjusts the choices that produced it. The shared question is how to train for the behavior of generated code when correctness can be checked only after the code has been assembled and run. Execution-based Code Generation using Deep Reinforcement Learning
RLEF also brings execution feedback into reinforcement learning for code. Its focus on grounding code generation in the results of execution connects it to CodeRL’s move from reference-token likelihood to test-informed training. In CodeRL specifically, the return categories and the critic’s token weights divide that job between an observed signal and a learned estimate. This distinction provides a way to compare methods in the same line of work without assuming they use the same form of reward. RLEF
OpenCodeInterpreter connects code generation with execution and refinement. That combination concerns the other place CodeRL uses tests, after the first batch has been written. CodeRL gives a concrete example of how to connect those stages, with testing opening a path to either rewriting a failed program or extending the prefix of a promising one. OpenCodeInterpreter’s stated focus continues the investigation of systems in which executing a draft supplies information for the next generation step. OpenCodeInterpreter
Self-Edit approaches the problem as fault-aware editing. The connection is particularly close to CodeRL’s repair branch, where the next generator receives an existing attempt and information about its failure. Both frame faulty code as material the system can work from. This framing makes the form of the error information consequential, because the reviser has to decide which parts of the draft it can reuse and which parts need a change. Self-Edit
Debugging and the information available to a reviser
Teaching Large Language Models to Self-Debug puts debugging generated code at the center of the task. CodeRL’s repair procedure gives the system a program that has been tried and a report associated with the failure. Self-debugging extends the same broad question of how a code generator can use an initial answer as a starting point for correction. The term debugging shifts attention towards understanding the fault in the current program, alongside generating a replacement. Teaching Large Language Models to Self-Debug
Debug like a Human studies debugging through step-by-step verification of runtime execution. The level of detail in the feedback distinguishes this direction from a pass or fail judgment over a completed run. CodeRL’s observed program categories summarize outcomes, and its token weights are inferred from those labels. Checking runtime execution step by step instead makes intermediate behavior an explicit part of the debugging question. That matters when the final symptom can be produced by several different earlier mistakes. Debug like a Human
CRITIC takes self-correction into a tool-interactive setting. The connection to CodeRL is the role of information obtained outside the original generation. In CodeRL that information comes from running code on tests. A tool-interactive critique frames this more generally as a way for a system to gather evidence before revising its answer. It brings attention to what a tool can verify and how a generated correction should respond to that evidence. CRITIC
Self-Refine explores iteration with self-feedback. Its focus makes the source of the feedback a useful point of comparison. CodeRL’s inference procedure uses observed example outcomes to route candidates, supported by a learned critic. Self-Refine puts the system’s own feedback at the center of iterative revision. Reflexion also explores feedback expressed in language, framing it as verbal reinforcement for agents. These works put the content of a critique or reflection in the foreground, whereas CodeRL’s training return is numerical and its repair input can include diagnostic information about a specific code failure. Self-Refine · Reflexion
Evaluating whether correction succeeds
Is Self-Repair a Silver Bullet for Code Generation? turns the effectiveness of self-repair into the question under study. CodeRL already shows why a definition of success matters. A later draft may repair compilation, correct an example failure, or finally satisfy the hidden tests. Those are distinguishable outcomes, and extra attempts can improve the chance of finding a solution even if revision is unreliable on any individual draft. The later work’s evaluation question is closely related to CodeRL’s comparison between generation alone, refinement, and repair followed by refinement. Is Self-Repair a Silver Bullet for Code Generation?
When Can LLMs Actually Correct Their Own Mistakes? examines the broader self-correction literature critically. CodeRL provides an example for thinking about the conditions of a correction claim. Its procedure has access to visible test outcomes, uses a separately trained critic, and has a budget for generating additional candidates. The final judgment is made with a different test suite on APPS. A survey asking when correction works can distinguish these experimental ingredients from the fact that a system produced a revised answer. When Can LLMs Actually Correct Their Own Mistakes?
CRUXEval makes code reasoning, understanding, and execution the subjects of benchmark evaluation. Its relationship to CodeRL lies in the role assigned to execution. CodeRL uses executed behavior to judge generated solutions and decide how some of them should be revised. CRUXEval treats understanding code and its execution as abilities to evaluate in their own right. The difference separates producing an executable answer from reasoning about what code will do, two abilities that matter at different points in a system that writes, checks, and revises programs. CRUXEval
Fields, topics and concepts
Shelves 6The field of science this work belongs to (OpenAlex fields).Computer Science · 19,503 worksArtificial Intelligence · 18,805 worksArts and Humanities · 17,959 worksLanguage and Linguistics · 17,789 worksInformation Systems · 1,888 worksComputer Science Applications · 184 works
Topics 1Research subjects and languages the work is about.Code & programming languages · 194 works
Cite
Cite as Hung Le, Yue Wang, Akhilesh Deepak Gotmare, Silvio Savarese and Steven C. H. Hoi. 2022. CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learning. arXiv:2207.01780.
@misc{le2022coderl,
title = {{CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learning}},
author = {Hung Le, Yue Wang, Akhilesh Deepak Gotmare, Silvio Savarese and Steven C. H. Hoi},
year = {2022},
doi = {10.48550/arxiv.2207.01780},
eprint = {2207.01780},
archivePrefix = {arXiv},
url = {https://doi.org/10.48550/arxiv.2207.01780}
}References
- J. Austin, A. Odena, M. Nye, M. Bosma, H. Michalewski, D. Dohan, E. Jiang, C. Cai, M. Terry, Q. Le, et al. Program synthesis with large language models. arXiv preprint arXiv:2108.07732, 2021. our card
- G. A. Aye, S. Kim, and H. Li. Learning autocompletion from real-world datasets. In 2021 IEEE/ACM 43rd International Conference on Software Engineering: Software Engineering in Practice (ICSE-SEIP), pages 131–139. IEEE, 2021. OpenAlex ↗ · Scholar ↗
- D. Bahdanau, P. Brakel, K. Xu, A. Goyal, R. Lowe, J. Pineau, A. Courville, and Y. Bengio. An actor-critic algorithm for sequence prediction. arXiv preprint arXiv:1607.07086, 2016. our card
- M. Balog, A. L. Gaunt, M. Brockschmidt, S. Nowozin, and D. Tarlow. Deepcoder: Learning to write programs. arXiv preprint arXiv:1611.01989, 2016. OpenAlex ↗ · Scholar ↗
- S. Bengio, O. Vinyals, N. Jaitly, and N. Shazeer. Scheduled sampling for sequence prediction with recurrent neural networks. Advances in neural information processing systems, 28, 2015. our card
- S. Black, G. Leo, P. Wang, C. Leahy, and S. Biderman. Gpt-neo: Large scale autoregressive language modeling with mesh-tensorflow. URL https://doi. org/10.5281/zenodo, 5297715, 2021. OpenAlex ↗ · Scholar ↗
- T. Brown, B. Mann, N. Ryder, M. Subbiah, J. D. Kaplan, P. Dhariwal, A. Neelakantan, P. Shyam, G. Sastry, A. Askell, et al. Language models are few-shot learners. Advances in neural information processing systems, 33:0 1877–1901, 2020. our card
- M. Bruch, M. Monperrus, and M. Mezini. Learning from examples to improve code completion systems. In Proceedings of the 7th joint meeting of the European software engineering conference and the ACM SIGSOFT symposium on the foundations of software engineering, pages 213–222, 2009. OpenAlex ↗ · Scholar ↗
- R. Bunel, M. Hausknecht, J. Devlin, R. Singh, and P. Kohli. Leveraging grammar and reinforcement learning for neural program synthesis. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id=H1Xw62kRZ. our card
- M. Chen, J. Tworek, H. Jun, Q. Yuan, H. P. d. O. Pinto, J. Kaplan, H. Edwards, Y. Burda, N. Joseph, G. Brockman, et al. Evaluating large language models trained on code. arXiv preprint arXiv:2107.03374, 2021a. our card
- Q. Chen, J. Lacomis, E. J. Schwartz, G. Neubig, B. Vasilescu, and C. Le Goues. VarCLR: Variable semantic representation pre-training via contrastive learning. In International Conference on Software Engineering, ICSE '22, 2022. OpenAlex ↗ · Scholar ↗
- X. Chen, D. Song, and Y. Tian. Latent execution for neural program synthesis beyond domain-specific languages. Advances in Neural Information Processing Systems, 34, 2021b. OpenAlex ↗ · Scholar ↗
- C. Clement, D. Drain, J. Timcheck, A. Svyatkovskiy, and N. Sundaresan. PyMT5: multi-mode translation of natural language and python code with transformers. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 9052–9065, Online, Nov. 2020. Association for Computational Linguistics. . URL https://aclanthology.org/2020.emnlp-main.728. our card
- K. Cobbe, V. Kosaraju, M. Bavarian, J. Hilton, R. Nakano, C. Hesse, and J. Schulman. Training verifiers to solve math word problems. arXiv preprint arXiv:2110.14168, 2021. our card
- J. Devlin, J. Uesato, S. Bhupatiraju, R. Singh, A.-r. Mohamed, and P. Kohli. Robustfill: Neural program learning under noisy i/o. In International conference on machine learning, pages 990–998. PMLR, 2017. our card
- K. Ellis, D. Ritchie, A. Solar-Lezama, and J. Tenenbaum. Learning to infer graphics programs from hand-drawn images. Advances in neural information processing systems, 31, 2018. OpenAlex ↗ · Scholar ↗
- K. Ellis, M. Nye, Y. Pu, F. Sosa, J. Tenenbaum, and A. Solar-Lezama. Write, execute, assess: Program synthesis with a repl. Advances in Neural Information Processing Systems, 32, 2019. our card
- Z. Feng, D. Guo, D. Tang, N. Duan, X. Feng, M. Gong, L. Shou, B. Qin, T. Liu, D. Jiang, and M. Zhou. CodeBERT: A pre-trained model for programming and natural languages. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 1536–1547, Online, Nov. 2020. Association for Computational Linguistics. . URL https://aclanthology.org/2020.findings-emnlp.139. our card
- Y. Ganin, T. Kulkarni, I. Babuschkin, S. A. Eslami, and O. Vinyals. Synthesizing programs for images using reinforced adversarial learning. In International Conference on Machine Learning, pages 1666–1675. PMLR, 2018. OpenAlex ↗ · Scholar ↗
- S. Gulwani, W. R. Harris, and R. Singh. Spreadsheet data manipulation using examples. Communications of the ACM, 550 (8):0 97–105, 2012. OpenAlex ↗ · Scholar ↗
- D. Guo, A. Svyatkovskiy, J. Yin, N. Duan, M. Brockschmidt, and M. Allamanis. Learning to complete code with sketches. In International Conference on Learning Representations, 2021. OpenAlex ↗ · Scholar ↗
- K. Guu, P. Pasupat, E. Liu, and P. Liang. From language to programs: Bridging reinforcement learning and maximum marginal likelihood. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1051–1062, Vancouver, Canada, July 2017. Association for Computational Linguistics. . URL https://aclanthology.org/P17-1097. our card
- B. A. Hammond Pearce, B. Tan, B. Dolan-Gavitt, and R. Karri. An empirical cybersecurity evaluation of github copilot’s code contributions. arXiv preprint arXiv:2108.09293, 2021. OpenAlex ↗ · Scholar ↗
- D. Hendrycks, S. Basart, S. Kadavath, M. Mazeika, A. Arora, E. Guo, C. Burns, S. Puranik, H. He, D. Song, and J. Steinhardt. Measuring coding challenge competence with apps. NeurIPS, 2021. our card
- H. Husain, H. Wu, T. Gazit, M. Allamanis, and M. Brockschmidt. Codesearchnet challenge: Evaluating the state of semantic code search. CoRR, abs/1909.09436, 2019. our card
- J. Johnson, B. Hariharan, L. Van Der Maaten, J. Hoffman, L. Fei-Fei, C. Lawrence Zitnick, and R. Girshick. Inferring and executing programs for visual reasoning. In Proceedings of the IEEE International Conference on Computer Vision, pages 2989–2998, 2017. our card
- A. Joulin and T. Mikolov. Inferring algorithmic patterns with stack-augmented recurrent nets. Advances in neural information processing systems, 28, 2015. OpenAlex ↗ · Scholar ↗
- V. Konda and J. Tsitsiklis. Actor-critic algorithms. Advances in neural information processing systems, 12, 1999. OpenAlex ↗ · Scholar ↗
- B. Krause, A. D. Gotmare, B. McCann, N. S. Keskar, S. Joty, R. Socher, and N. F. Rajani. GeDi: Generative discriminator guided sequence generation. In Findings of the Association for Computational Linguistics: EMNLP 2021, pages 4929–4952, Punta Cana, Dominican Republic, Nov. 2021. Association for Computational Linguistics. . URL https://aclanthology.org/2021.findings-emnlp.424. our card
- T. D. Kulkarni, W. F. Whitney, P. Kohli, and J. Tenenbaum. Deep convolutional inverse graphics network. Advances in neural information processing systems, 28, 2015. OpenAlex ↗ · Scholar ↗
- K. Kurach, M. Andrychowicz, and I. Sutskever. Neural random-access machines. arXiv preprint arXiv:1511.06392, 2015. our card
- Y. Li, D. Choi, J. Chung, N. Kushman, J. Schrittwieser, R. Leblond, T. Eccles, J. Keeling, F. Gimeno, A. D. Lago, et al. Competition-level code generation with alphacode. arXiv preprint arXiv:2203.07814, 2022. our card
- C. Liang, M. Norouzi, J. Berant, Q. V. Le, and N. Lao. Memory augmented policy optimization for program synthesis and semantic parsing. Advances in Neural Information Processing Systems, 31, 2018. OpenAlex ↗ · Scholar ↗
- P. Liang, M. I. Jordan, and D. Klein. Learning programs: A hierarchical bayesian approach. In Proceedings of the 27th International Conference on Machine Learning (ICML-10), pages 639–646, 2010. OpenAlex ↗ · Scholar ↗
- T. P. Lillicrap, J. J. Hunt, A. Pritzel, N. Heess, T. Erez, Y. Tassa, D. Silver, and D. Wierstra. Continuous control with deep reinforcement learning. arXiv preprint arXiv:1509.02971, 2015. our card
- C.-Y. Lin. Rouge: A package for automatic evaluation of summaries. Text Summarization Branches Out, 2004. our card
- Y. Liu, J. Wu, Z. Wu, D. Ritchie, W. T. Freeman, and J. B. Tenenbaum. Learning to describe scenes with programs. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id=SyNPk2R9K7. OpenAlex ↗ · Scholar ↗
- I. Loshchilov and F. Hutter. Decoupled weight decay regularization. In ICLR (Poster). OpenReview.net, 2019. our card
- S. Lu, D. Guo, S. Ren, J. Huang, A. Svyatkovskiy, A. Blanco, C. B. Clement, D. Drain, D. Jiang, D. Tang, G. Li, L. Zhou, L. Shou, L. Zhou, M. Tufano, M. Gong, M. Zhou, N. Duan, N. Sundaresan, S. K. Deng, S. Fu, and S. Liu. Codexglue: A machine learning benchmark dataset for code understanding and generation. In NeurIPS Datasets and Benchmarks, 2021. OpenAlex ↗ · Scholar ↗
- Z. Manna and R. J. Waldinger. Toward automatic program synthesis. Communications of the ACM, 140 (3):0 151–165, 1971. OpenAlex ↗ · Scholar ↗
- E. Nijkamp, B. Pang, H. Hayashi, L. Tu, H. Wang, Y. Zhou, S. Savarese, and C. Xiong. A conversational paradigm for program synthesis. arXiv preprint arXiv:2203.13474, 2022. OpenAlex ↗ · Scholar ↗
- L. Ouyang, J. Wu, X. Jiang, D. Almeida, C. L. Wainwright, P. Mishkin, C. Zhang, S. Agarwal, K. Slama, A. Ray, et al. Training language models to follow instructions with human feedback. arXiv preprint arXiv:2203.02155, 2022. our card
- K. Papineni, S. Roukos, T. Ward, and W.-J. Zhu. Bleu: a method for automatic evaluation of machine translation. In Proceedings of the 40th annual meeting on association for computational linguistics, pages 311–318. Association for Computational Linguistics, 2002. our card
- E. Parisotto, A.-r. Mohamed, R. Singh, L. Li, D. Zhou, and P. Kohli. Neuro-symbolic program synthesis. arXiv preprint arXiv:1611.01855, 2016. our card
- G. Poesia, A. Polozov, V. Le, A. Tiwari, G. Soares, C. Meek, and S. Gulwani. Synchromesh: Reliable code generation from pre-trained language models. In International Conference on Learning Representations, 2022. URL https://openreview.net/forum?id=KmtVD97J43e. OpenAlex ↗ · Scholar ↗
- A. Radford, J. Wu, R. Child, D. Luan, D. Amodei, I. Sutskever, et al. Language models are unsupervised multitask learners. OpenAI blog, 10 (8):0 9, 2019. OpenAlex ↗ · Scholar ↗
- C. Raffel, N. Shazeer, A. Roberts, K. Lee, S. Narang, M. Matena, Y. Zhou, W. Li, and P. J. Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. J. Mach. Learn. Res., 21:0 140:1–140:67, 2020. our card
- M. Ranzato, S. Chopra, M. Auli, and W. Zaremba. Sequence level training with recurrent neural networks. In Y. Bengio and Y. LeCun, editors, 4th International Conference on Learning Representations, ICLR 2016, San Juan, Puerto Rico, May 2-4, 2016, Conference Track Proceedings, 2016. URL http://arxiv.org/abs/1511.06732. our card
- V. Raychev, M. Vechev, and E. Yahav. Code completion with statistical language models. In Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 419–428, 2014. OpenAlex ↗ · Scholar ↗
- S. Ren, D. Guo, S. Lu, L. Zhou, S. Liu, D. Tang, N. Sundaresan, M. Zhou, A. Blanco, and S. Ma. Codebleu: a method for automatic evaluation of code synthesis. arXiv preprint arXiv:2009.10297, 2020. OpenAlex ↗ · Scholar ↗
- Z. Ren, X. Wang, N. Zhang, X. Lv, and L.-J. Li. Deep reinforcement learning-based image captioning with embedding reward. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 290–298, 2017. OpenAlex ↗ · Scholar ↗
- S. J. Rennie, E. Marcheret, Y. Mroueh, J. Ross, and V. Goel. Self-critical sequence training for image captioning. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7008–7024, 2017. our card
- R. Robbes and M. Lanza. How program history can improve code completion. In 2008 23rd IEEE/ACM International Conference on Automated Software Engineering, pages 317–326. IEEE, 2008. OpenAlex ↗ · Scholar ↗
- P. D. Summers. A methodology for lisp program construction from examples. Journal of the ACM (JACM), 240 (1):0 161–175, 1977. OpenAlex ↗ · Scholar ↗
- S.-H. Sun, H. Noh, S. Somasundaram, and J. Lim. Neural program synthesis from diverse demonstration videos. In J. Dy and A. Krause, editors, Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pages 4790–4799. PMLR, 10–15 Jul 2018. URL https://proceedings.mlr.press/v80/sun18a.html. OpenAlex ↗ · Scholar ↗
- R. S. Sutton. Temporal credit assignment in reinforcement learning. PhD thesis, University of Massachusetts Amherst, 1984. OpenAlex ↗ · Scholar ↗
- R. S. Sutton and A. G. Barto. Reinforcement learning: An introduction. MIT press, 2018. OpenAlex ↗ · Scholar ↗
- R. S. Sutton, D. McAllester, S. Singh, and Y. Mansour. Policy gradient methods for reinforcement learning with function approximation. Advances in neural information processing systems, 12, 1999. OpenAlex ↗ · Scholar ↗
- A. Svyatkovskiy, S. K. Deng, S. Fu, and N. Sundaresan. Intellicode compose: Code generation using transformer. In Proceedings of the 28th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering, pages 1433–1443, 2020. OpenAlex ↗ · Scholar ↗
- A. Svyatkovskiy, S. Lee, A. Hadjitofi, M. Riechert, J. V. Franco, and M. Allamanis. Fast and memory-efficient neural code completion. In 2021 IEEE/ACM 18th International Conference on Mining Software Repositories (MSR), pages 329–340. IEEE, 2021. OpenAlex ↗ · Scholar ↗
- Y. Tian, A. Luo, X. Sun, K. Ellis, W. T. Freeman, J. B. Tenenbaum, and J. Wu. Learning to infer and execute 3d shape programs. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id=rylNH20qFQ. OpenAlex ↗ · Scholar ↗
- D. Trivedi, J. Zhang, S.-H. Sun, and J. J. Lim. Learning to synthesize programs as interpretable and generalizable policies. Advances in Neural Information Processing Systems, 34:0 25146–25163, 2021. OpenAlex ↗ · Scholar ↗
- A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser, and I. Polosukhin. Attention is all you need. Advances in neural information processing systems, 30, 2017. our card
- R. Vedantam, C. Lawrence Zitnick, and D. Parikh. Cider: Consensus-based image description evaluation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4566–4575, 2015. our card
- R. J. Waldinger and R. C. Lee. Prow: A step toward automatic program writing. In Proceedings of the 1st international joint conference on Artificial intelligence, pages 241–252, 1969. OpenAlex ↗ · Scholar ↗
- B. Wang and A. Komatsuzaki. GPT-J-6B: A 6 Billion Parameter Autoregressive Language Model. https://github.com/kingoflolz/mesh-transformer-jax, May 2021. OpenAlex ↗ · Scholar ↗
- X. Wang, W. Chen, J. Wu, Y.-F. Wang, and W. Y. Wang. Video captioning via hierarchical reinforcement learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4213–4222, 2018. OpenAlex ↗ · Scholar ↗
- Y. Wang, W. Wang, S. R. Joty, and S. C. H. Hoi. Codet5: Identifier-aware unified pre-trained encoder-decoder models for code understanding and generation. In EMNLP (1), pages 8696–8708. Association for Computational Linguistics, 2021. OpenAlex ↗ · Scholar ↗
- M. White, C. Vendome, M. Linares-Vásquez, and D. Poshyvanyk. Toward deep learning software repositories. In 2015 IEEE/ACM 12th Working Conference on Mining Software Repositories, pages 334–345. IEEE, 2015. OpenAlex ↗ · Scholar ↗
- R. J. Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 80 (3):0 229–256, 1992. OpenAlex ↗ · Scholar ↗
- J. Wu, J. B. Tenenbaum, and P. Kohli. Neural scene de-rendering. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), July 2017. OpenAlex ↗ · Scholar ↗
- J. Xu, D. Ju, M. Li, Y.-L. Boureau, J. Weston, and E. Dinan. Recipes for safety in open-domain chatbots. arXiv preprint arXiv:2010.07079, 2020. our card
- X. Xu, C. Liu, and D. Song. SQLNet: Generating structured queries from natural language without reinforcement learning, 2018. URL https://openreview.net/forum?id=SkYibHlRb. our card
- J. Yang, S. E. Reed, M.-H. Yang, and H. Lee. Weakly-supervised disentangling with recurrent transformations for 3d view synthesis. Advances in neural information processing systems, 28, 2015. OpenAlex ↗ · Scholar ↗
- P. Yin and G. Neubig. A syntactic neural model for general-purpose code generation. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 440–450, Vancouver, Canada, July 2017. Association for Computational Linguistics. . URL https://aclanthology.org/P17-1041. our card
- V. Zhong, C. Xiong, and R. Socher. Seq2SQL: Generating structured queries from natural language using reinforcement learning, 2018. URL https://openreview.net/forum?id=Syx6bz-Ab. our card
This page in Markdown https://md.research.elamur.ai/free/en/papers/le-2022-coderl-mastering-code-generation-through/