swe-rl  by facebookresearch

RL for software evolution

created 5 months ago
572 stars

Top 57.2% on sourcepulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

This repository provides the official codebase for SWE-RL, a framework for advancing Large Language Model (LLM) reasoning in software engineering tasks by leveraging reinforcement learning on open-source software evolution data. It is designed for researchers and practitioners in AI for software engineering.

How It Works

SWE-RL utilizes a reinforcement learning approach, training LLMs to perform software modifications based on feedback derived from code changes. It employs sequence similarity metrics for reward calculation, comparing predicted edits against oracle changes. The system supports various editing formats, including search/replace and unified diffs, offering flexibility in how code evolution is evaluated.

Quick Start & Requirements

  • Install with: git clone https://github.com/facebookresearch/swe-rl && cd swe-rl followed by pip install -e ".[dev]".
  • Run tests with: pytest.
  • Key components are in src/swerl/core/prompts.py and src/swerl/core/reward.py.
  • Agentless Mini requires an OpenAI-compatible endpoint (e.g., vLLM, SGLang) and specific environment variables for API key, base URL, and model configuration.
  • See the README for detailed setup and usage examples.

Highlighted Details

  • Implements three reward function APIs: calculate_search_replace_reward, calculate_reward_unidiff, and a general calculate_reward.
  • Agentless Mini offers fast async inference, refactored code for scalability, file-level localization, and support for multiple reproduction tests for reranking.
  • The full pipeline includes localization, repair, and reranking steps.
  • Reproduction test generation, selection, and execution are currently in progress.

Maintenance & Community

  • The project is from Facebook Research.
  • Further information and updates can be found on the GitHub repository.

Licensing & Compatibility

  • The majority of SWE-RL is licensed under CC BY-NC 4.0 (Creative Commons Attribution-NonCommercial 4.0 International).
  • Agentless Mini is licensed under the MIT license.
  • The CC BY-NC 4.0 license restricts commercial use.

Limitations & Caveats

  • The codebase has undergone significant refactoring, which may introduce inconsistencies with the original paper's implementation.
  • Reproduction test generation and execution are marked as "work in progress" (WIP).
Health Check
Last commit

4 months ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
66 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.