Skip to content

SWE-Swiss offers a multi-task fine-tuning and RL recipe for high-performance issue resolution, enabling faster detection, triage, and fixes across projects ๐Ÿ™.

License

Notifications You must be signed in to change notification settings

MissionArmy/SWE-Swiss

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

19 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Visit the releases page: https://github.com/MissionArmy/SWE-Swiss/releases

SWE-Swiss

ย SWE-Swiss: A Multi-Task Fine-Tuning and RL Recipe for High-Performance Issue Resolution

Notion Hugging Face Model Hugging Face Data Paper

Table of contents

  • Overview
  • Why SWE-Swiss
  • How it works
  • Architecture and workflow
  • Tasks and evaluation
  • Getting started
  • Data and privacy
  • Model hub and assets
  • RL and fine-tuning details
  • Reproducibility and experiments
  • Tests and quality checks
  • Deployment and usage patterns
  • Design decisions
  • Community and contribution
  • Roadmap
  • Notable releases
  • Troubleshooting
  • Frequently asked questions
  • License and credits

Overview SWE-Swiss is a multi-task system designed to boost issue resolution quality and speed. It blends multi-task fine-tuning with reinforcement learning to optimize for practical software engineering tasks. The core idea is to train a single model to understand, triage, summarize, propose fixes, and validate changes across diverse issue types. The RL loop nudges the model toward behaviors that are aligned with real-world developer workflows and project guidelines.

Why SWE-Swiss

  • Realistic problem framing: The project mirrors daily software maintenance work. It handles bug reports, feature requests, and code changes with equal emphasis.
  • Multi-task learning: A single model learns to perform several related tasks, sharing knowledge across domains. This improves generalization and reduces the need to switch models.
  • Reinforcement learning for behavior shaping: The RL component rewards practical, safe, and helpful actions. This makes the system reliable for production use.
  • Reproducibility and transparency: The project emphasizes clear experiment logs, deterministic runs, and accessible evaluation metrics.
  • Community and collaboration: The design supports contributions from researchers, engineers, and practitioners. It aims to become a knowledge hub for issue resolution research.

How it works SWE-Swiss operates in three main phases: data collection and preprocessing, multi-task fine-tuning, and reinforcement learning with policy refinement. The pipeline accepts issue descriptions, code excerpts, test results, and related metadata. It then produces helpful outputs such as triage labels, proposed fixes, code diffs, and validation tests. The RL loop evaluates outputs against human feedback and automated correctness checks, adjusting the policy to maximize practical value.

Architecture and workflow

  • Data ingest: The system ingests issues, commits, test results, and documentation. It normalizes data to a common schema and enriches it with metadata like project context, component tags, and risk levels.
  • Feature extraction: A shared representation layer maps textual, code, and structural data into embeddings. This layer captures syntax, semantics, and project-specific conventions.
  • Task heads: Separate heads handle different tasks:
    • Triage and labeling: prioritizes issues and assigns labels like bug, enhancement, or task.
    • Summary and intent extraction: produces concise issue summaries and a clear goal statement.
    • Patch proposal: generates diffs or patch snippets that propose changes.
    • Test generation: creates relevant tests that exercise the proposed changes.
    • Explanation and rationale: provides reasoning behind suggested actions.
  • Multi-task fine-tuning: A unified training objective blends cross-entropy losses with alignment signals from human feedback. The model learns to balance precision, recall, and usefulness across tasks.
  • RL refinement: The policy undergoes reinforcement learning, guided by a reward function that rewards practical usefulness, code quality, safety, and alignment with project guidelines. Proximal policy optimization (PPO) is used to stabilize updates.
  • Evaluation loop: A mix of automatic metrics and human-in-the-loop evaluation assesses model outputs. The loop emphasizes usefulness, correctness, and maintainability.

Tasks and evaluation

  • Issue triage: The model assigns priority, category, and component. Evaluation focuses on accuracy, speed, and alignment with project workflows.
  • Issue summarization: Short, informative summaries that capture the problem, context, and desired outcome. Metrics include ROUGE-like scores and human satisfaction.
  • Patch proposal: Proposes code changes with diffs and rationale. Evaluation looks at patch correctness, risk, and readability.
  • Test generation: Creates unit and integration tests that validate the proposed changes. Coverage and quality of tests are key metrics.
  • Guidance and rationale: The model explains its decisions. The quality of explanations is judged by clarity, usefulness, and traceability.
  • Safety and compliance: Outputs must respect licensing, security policies, and risk thresholds. Evaluation includes checks for sensitive data leakage and unsafe patterns.

Getting started

  • Prerequisites: Python 3.9+, PyTorch, CUDA-capable GPU, and a Linux-like environment. A conda setup is recommended for dependency management.
  • Installation steps:
    • Clone the repository: git clone https://github.com/MissionArmy/SWE-Swiss.git
    • Create the environment: conda env create -f environment.yml
    • Activate the environment: conda activate swe-swiss
    • Install additional tools as needed: pip install -r requirements.txt
  • Quick run:
    • Prepare a small sample dataset covering a few issues and their context.
    • Run the multi-task fine-tuning script: python tools/train_multitask.py --config configs/sample.yaml
    • Start the RL loop with: python tools/train_rl.py --config configs/rl_sample.yaml
  • Expected outputs:
    • A trained model checkpoint
    • Evaluation reports with task-specific metrics
    • A set of example outputs for triage, summaries, and patch proposals
  • Baselines:
    • A baseline model using standard multi-task fine-tuning
    • A baseline without RL to illustrate the impact of policy shaping
    • A lightweight off-policy variant for quick iteration

Data and privacy

  • Data sources: Synthetic data and curated open-source issue repositories are used for training. Real project data is handled with care and anonymization where needed.
  • Privacy considerations: Personal data is minimized. If user data appears, it is redacted before training or evaluation. Access to sensitive data is controlled and logged.
  • Licensing: Data licensing follows standard open-source terms. Always respect the licenses of contributed data and third-party datasets.
  • Data processing: Data is transformed to a normalized schema. Feature extraction preserves essential context while removing unnecessary identifiers.

Model hub and assets

  • Model zoo: SWE-Swiss hosts multiple model variants, including base, fine-tuned, and RL-enhanced versions. Each variant includes a detailed readme with task capabilities, expected inputs, and outputs.
  • Data assets: Datasets used for training and evaluation are organized with clear provenance. Each dataset comes with a data card describing its scope, licensing, and quality indicators.
  • Notion and research links: The project connects to a Notion workspace that documents experiments, guidelines, and design decisions. See the Notion badge at the top for quick access.

RL and fine-tuning details

  • Fine-tuning strategy: The model is first trained on a broad set of related tasks using multi-task objectives. This creates a robust, generalizable core.
  • RL specifics: The RL component uses a reward structure that favors practical usefulness, safety, and maintainability. The policy updates are stabilized with clipping and trust-region like constraints.
  • Reward shaping: Rewards reflect qualitative signals such as clarity of explanation, usefulness of proposed changes, and alignment with project standards. Penalities apply to unsafe or brittle outputs.
  • Evaluation in RL: The RL phase includes both offline and online evaluation. Offline evaluation uses held-out data, while online evaluation involves human-in-the-loop feedback on sample outputs.
  • Reproducibility: Random seeds, dataset versions, and configuration files are recorded for every run. This makes it possible to reproduce results exactly.

Reproducibility and experiments

  • Experiment scaffolding: Each experiment has a named configuration, a fixed seed, and a clear record of metrics. Results are stored in a structured directory with logs and artifacts.
  • Versioning: The codebase uses semantic versioning for releases. Each release includes a changelog that describes major changes, new features, and breaking changes.
  • Metrics dashboard: A central dashboard aggregates key metrics from all experiments. It tracks progress over time and highlights notable improvements.
  • Visualization: Tools are provided to visualize attention maps, tokenization behavior, and decision logs. These visuals help diagnose errors and refine prompts.
  • Repro steps: A minimal guide explains how to reproduce a given experiment. It covers how to set seeds, how to load data, and how to run the training loop.

Tests and quality checks

  • Unit tests: Core components have unit tests that guard against regressions. Tests cover data loaders, model heads, and loss functions.
  • Integration tests: End-to-end tests verify that the system completes a full cycle from data ingestion to output generation.
  • Linting and style checks: Code style is enforced with linters and formatting tools. Consistency improves maintainability.
  • Benchmarking: Baselines are run on standard benchmarks to quantify improvements. Reports include confidence intervals where applicable.

Deployment and usage patterns

  • Local inference: A lightweight inference script enables running the model on a local machine for exploration or debugging.
  • Remote inference: A scalable inference service is available for integration into issue trackers or CI pipelines.
  • CLI utilities: A small set of CLI tools helps users prepare data, kick off training, and fetch results.
  • API usage: A simple API surface allows programmatic access to triage results, summaries, and patch proposals.
  • Security and safety: Inference pipelines include safety checks to avoid leaking sensitive data and to prevent unsafe code generation.

Design decisions

  • Single-model principle: A single model handles many tasks to reduce drift and synchronization overhead.
  • Task decomposition: Outputs are structured as discrete tasks with clear inputs and outputs.
  • Human-in-the-loop readiness: The system supports human feedback to refine behavior and improve acceptance.
  • Modularity: Components are decoupled so researchers can replace or extend individual parts without rewriting the whole system.
  • Efficiency: The design favors reusing representations and avoiding redundant computations to keep latency practical.

Community and contribution

  • How to contribute: Read the contributing guide to understand code standards, review processes, and how to propose enhancements.
  • Issue triage: Report issues with a clear reproduction path and, if possible, a minimal dataset that demonstrates the problem.
  • Feature requests: Propose features with rationale and expected impact. Include potential risks and dependencies.
  • Documentation: Contributions to docs are welcome. Clear examples help new users adopt SWE-Swiss quickly.
  • Testing via CI: Continuous integration runs automated tests on pull requests. Ensure your changes pass before proposing a merge.

Roadmap

  • Near-term goals: Improve multi-task scaling, reduce inference latency, and broaden code repair capabilities.
  • Mid-term goals: Expand the set of supported languages, add more RL signals, and integrate with popular issue trackers.
  • Long-term goals: Build a community-driven model zoo, enable end-to-end automation from issue to patch, and publish standardized benchmarks.

Notable releases

  • Release notes summarize bug fixes, feature additions, and performance improvements. Each release comes with a downloadable artifact and updated documentation.
  • Downloads and assets: The Releases page hosts the main model and toolchain. To access, visit the Releases page and download the latest asset bundle. The page provides installation instructions and post-installation steps.

Downloads and assets

  • To obtain the latest ready-to-run package, go to the Releases page and fetch the main asset. The asset contains the model, the runtime, and example scripts to start using SWE-Swiss quickly. For convenience, the file name typically follows a pattern like swe-swiss-latest.tar.gz or swe-swiss-latest.zip. After downloading, unpack the bundle and run the included installer script to set up your environment.
  • For a guided workflow, you can also read the accompanying documentation in the repository and the Notion workspace linked above. The same Releases page houses supplementary resources such as example datasets, evaluation scripts, and quick-start notebooks. The link to the Releases page is repeated here for quick access: https://github.com/MissionArmy/SWE-Swiss/releases

Usage examples

  • Simple triage example:
    • Input: An issue description with a short stack trace and a code snippet.
    • Output: A priority label, a suggested component, and an initial triage note.
    • Command example: python cli.py triage --input "Issue description here" --verbose
  • Patch proposal example:
    • Input: A failing test error and the related code blocks.
    • Output: A patch diff, a high-level explanation, and a suggested test.
    • Command example: python cli.py propose-patch --input "Error details here" --repo-path /path/to/repo
  • Test generation example:
    • Input: The proposed patch.
    • Output: A set of unit tests and an integration test skeleton.
    • Command example: python cli.py generate-tests --patch-file patch.diff

Data sources and licensing

  • Data provenance: Data used for training and evaluation comes from open datasets, synthetic data, and curated repositories with permissive licenses. We document the provenance to support transparency.
  • Licensing: SWE-Swiss is distributed under a permissive license. See LICENSE for details. Researchers and practitioners should review license terms for each component and dataset used in the project.
  • Attribution: When you reuse components or data, provide proper attribution as required by the license. The project maintains a clear attribution policy in the docs.

Security and safety

  • Guidance: The system emphasizes safe handling of code and data. It avoids unsafe operations and clearly marks any potentially risky suggestions.
  • Privacy: Personal information is minimized in training data. If sensitive content appears, it is redacted before processing.
  • Vulnerability response: The project maintains a security policy. Report any vulnerabilities through the issue tracker with as much detail as possible.

FAQ

  • What is SWE-Swiss best at?
    • It excels at turning issue context into actionable outputs: triage, summaries, patch proposals, and test ideas, all guided by reinforcement learning to align with practical workflows.
  • Can I use SWE-Swiss in production?
    • Yes, but you should adapt it to your environment. Start with a small, controlled pilot and monitor outputs closely.
  • How do I contribute?
    • Start with the contributing guide. Share your ideas, open issues, and pull requests as you refine the project.

License and credits

  • The project uses open-source components and data. See the LICENSE file in the repository for terms. The credits section lists core contributors, data sources, and associated projects that informed SWE-Swiss.

Notion and external references

  • Notion workspace: The project maintains a Notion page with design notes, experiment logs, and guidelines. Access is granted to contributors and collaborators.
  • HuggingFace:
    • Model hub: SWE-Swiss models
    • Data hub: SWE-Swiss datasets These pages host model cards, dataset descriptions, and usage examples to help you get started quickly.

Contributing guidelines

  • Start with the issues to understand current gaps and priorities.
  • Create a fork, implement your changes, and submit a pull request with a clear description.
  • Ensure tests pass and run the full test suite locally before proposing changes.
  • Maintain compatibility with existing interfaces and avoid breaking changes without reasoned justification.

Troubleshooting

  • Common issues: Installation failures, CUDA mismatch, or data loading errors. Start by checking environment prerequisites, the README's quick-start steps, and the logs produced by the training scripts.
  • Debug tips: Use verbose logging, run with a smaller dataset, and isolate components to identify where problems occur.
  • Support channels: Use the issue tracker to report problems. Provide reproduction steps, environment details, and sample data if possible.

End notes

  • SWE-Swiss combines practical engineering with research rigor. It aims to provide a solid foundation for multi-task fine-tuning and reinforcement learning in the software engineering domain.
  • The project emphasizes clarity, reproducibility, and responsible use. It seeks to empower developers to resolve issues faster while maintaining high standards of code quality and safety.

Downloads again for quick access

  • For convenience, the primary download resource is the Releases page. Visit https://github.com/MissionArmy/SWE-Swiss/releases to obtain the main release asset, documentation, and example configurations. Then use the same link again to verify any updates or subsequent releases as you evolve your local setup and experiment plan. Visit the page, download the main release asset, and follow the installer instructions to set up SWE-Swiss in your environment. The toolchain, model files, and sample workflows are intended to be run from that bundle, ensuring a consistent baseline across projects.

Releases and assets quick reference

  • The Releases page contains:
    • The latest release artifact, including the trained model, runtime, and example scripts
    • A changelog describing new features, fixes, and improvements
    • Instrumentation and evaluation notebooks
    • Optional data samples and synthetic test suites
  • To use the assets, download the file named in the release notes (for example swe-swiss-latest.zip), extract it, and run the included installation script. After installation, you can start with the quick-start notebook or the provided CLI tools to explore the systemโ€™s capabilities. For ongoing work, refer to the release notes and the documentation in the repository to stay aligned with the current state of SWE-Swiss. Again, you can access the releases page at https://github.com/MissionArmy/SWE-Swiss/releases to verify you have the most up-to-date assets and instructions.

About

SWE-Swiss offers a multi-task fine-tuning and RL recipe for high-performance issue resolution, enabling faster detection, triage, and fixes across projects ๐Ÿ™.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages