Agent system for reasoning with LLMs via in-context reinforcement learning
Top 86.3% on SourcePulse
SwiftSage is a generative agent system designed for complex interactive reasoning tasks, mimicking human fast and slow thinking processes. It targets researchers and developers working with Large Language Models (LLMs) who need a flexible framework for enhancing LLM reasoning capabilities through in-context reinforcement learning. The system aims to improve LLM performance on tasks requiring planning, execution, and iterative refinement.
How It Works
SwiftSage v2 employs a "plan-ground-execute" paradigm, unifying task formats and using a Python executor for code-based solutions. It leverages in-context reinforcement learning, a tuning-free, prompting-based strategy, to adapt reasoning strategies. Feedback is generated by LLMs, acting as critics and reward signals to update the agent's approach. The system comprises a Swift Agent (smaller LM for intuitive reasoning), a Feedback Agent (larger LM for critique), and a Sage Agent (even larger LM for analytical thinking if the Swift Agent fails). The workflow involves the Swift Agent generating a plan and code, the executor running it, the Feedback Agent critiquing the output, and iterating or escalating to the Sage Agent if necessary.
Quick Start & Requirements
pip install git+https://github.com/SwiftSage/SwiftSage.git
TOGETHER_API_KEY
, ENGINE
, SWIFT_MODEL_ID
, FEEDBACK_MODEL_ID
, SAGE_MODEL_ID
) must be set.swiftsage --problem "QUERY" --api_provider ${ENGINE} ...
Highlighted Details
Maintenance & Community
science_world
branch.Licensing & Compatibility
Limitations & Caveats
This is a beta version and may not be stable. The retriever module is not yet implemented, which is expected to further improve reasoning.
9 months ago
Inactive