mlsanityData to 7 Oct 2026

Applying RLAIF for Code Generation with API-usage in Lightweight LLMs

arXiv 2406.20060 ↗First posted 28 Jun 2024cs.CLcited by 10

On the map: LLM reasoning → Reasoning for agents, planning and code

also in 1 more
Abstract (arXiv)

Reinforcement Learning from AI Feedback (RLAIF) has demonstrated significant potential across various domains, including mitigating harm in LLM outputs, enhancing text summarization, and mathematical reasoning. This paper introduces an RLAIF framework for improving the code generation abilities of lightweight (<1B parameters) LLMs. We specifically focus on code generation tasks that require writing appropriate API calls, which is challenging due to the well-known issue of hallucination in LLMs. Our framework extracts AI feedback from a larger LLM (e.g., GPT-3.5) through a specialized prompting strategy and uses this data to train a reward model towards better alignment from smaller LLMs. We run our experiments on the Gorilla dataset and meticulously assess the quality of the model-generated code across various metrics, including AST, ROUGE, and Code-BLEU, and develop a pipeline to compute its executability rate accurately. Our approach significantly enhances the fine-tuned LLM baseline's performance, achieving a 4.5% improvement in executability rate. Notably, a smaller LLM model (780M parameters) trained with RLAIF surpasses a much larger fine-tuned baseline with 7B parameters, achieving a 1.0% higher code executability rate.

Key facts. Cited by 10 papers in the map (data through 7 Oct 2026). Placed in Reasoning for agents, planning and code, one of 17 directions in LLM reasoning. Builds on 23 of its 35 references that are in the map. First posted on arXiv 28 Jun 2024.

Builds on

23 of 35 references.

Closest ancestors · 1

Same direction, newest first

  1. 2022Competition-Level Code Generation with AlphaCode8 Feb

Other references · 22

  1. 2020Language Models are Few-Shot Learnerscited by 32,199
  2. 2022Training language models to follow instructions with human feedbackcited by 15,712
  3. 2017Proximal Policy Optimization Algorithmscited by 14,441
  4. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
  5. 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,304
  6. 2023Toolformer: Language Models Can Teach Themselves to Use Toolscited by 4,072
  7. 2021Program Synthesis with Large Language Modelscited by 3,509
  8. 2022Constitutional AI: Harmlessness from AI Feedbackcited by 2,950
  9. 2023ToolLLM: Facilitating Large Language Models to Master 16000+ Real-world APIscited by 1,880
  10. 2021WebGPT: Browser-assisted question-answering with human feedbackcited by 1,722
  11. 2023Gorilla: Large Language Model Connected with Massive APIscited by 1,302
  12. 2021Measuring Coding Challenge Competence With APPScited by 879
10 more
  1. 2017Seq2SQL: Generating Structured Queries from Natural Language using Reinforcement Learningcited by 679
  2. 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 638
  3. 2023WizardMath: Empowering Mathematical Reasoning for Large Language Models via Reinforced Evol-Instructcited by 618
  4. 2023RLAIF vs. RLHF: Scaling Reinforcement Learning from Human Feedback with AI Feedbackcited by 615
  5. 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 468
  6. 2023ToolkenGPT: Augmenting Frozen Language Models with Massive Tools via Tool Embeddingscited by 238
  7. 2020IntelliCode Compose: Code Generation Using Transformercited by 225
  8. 2023HuatuoGPT, towards Taming Language Model to Be a Doctorcited by 211
  9. 2022XLCoST: A Benchmark Dataset for Cross-lingual Code Intelligencecited by 54
  10. 2023Synthetic Imitation Edit Feedback for Factual Alignment in Clinical Summarizationcited by 5

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 3; 2025: 4; 2026: 3.

10 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2024RLEF: Grounding Code LLMs in Execution Feedback with Reinforcement Learning
  2. 2025ACE-RLHF: Automated Code Evaluation and Socratic Feedback Generation Tool using Large Language Models and Reinforcement Learning with Human Feedback
  3. 2024RLSF: Fine-tuning LLMs via Symbolic Feedback
  4. 2026Performance, Efficiency and Collapse -- Advantages and Challenges in Offline Post-training of Code LLMs
  5. 2025R1-Code-Interpreter: LLMs Reason with Code via Supervised and Multi-stage Reinforcement Learning
  6. 2026Efficient Post-training of LLMs for Code Generation With Offline Reinforcement Learning
  7. 2024TeaMs-RL: Teaching LLMs to Generate Better Instruction Datasets via Reinforcement Learning
  8. 2024A Critical Evaluation of AI Feedback for Aligning Large Language Models