RepoMicrosoftMicrosoftpublished May 26, 2026seen 5d

microsoft/FLARE---Few-shot-Learning-based-Adaptive-Reflective-Engine

Python

Open original ↗

Captured source

source ↗

microsoft/FLARE---Few-shot-Learning-based-Adaptive-Reflective-Engine

Language: Python

License: MIT

Stars: 0

Forks: 0

Open issues: 0

Created: 2026-05-26T23:01:16Z

Pushed: 2026-05-27T00:39:32Z

Default branch: main

Fork: no

Archived: no

README:

FLARE — Few-shot Learning-based Adaptive Reflective Engine

| Optimizer | Strategy | |-----------|----------| | GEPA | Population-based reflective mutation (DSPy) | | FLARE | Few-shot Learning-based Adaptive Reflective Engine |

Tasks: 1. Emotion classification (GoEmotions-style), metric: token-level F1 2. Math problem solving (AIME-style), metric: exact-match accuracy

Repository layout

.
├── README.md
├── LICENSE
├── SECURITY.md
├── CODE_OF_CONDUCT.md
├── requirements.txt
├── .env.example
├── run_classification.py
├── run_math.py
└── flare_optimizer/
├── __init__.py
├── data_loader.py
├── metrics.py
├── task_instructions.py
├── runner.py
└── flare.py

Dataset files (not included in this repository) are expected under data/classification/ and data/math/.

Results (3 seeds, mean ± SD)

| Task | Baseline | GEPA (light) | GEPA (heavy) | FLARE | |------|----------|--------------|--------------|-------| | Classification (F1) | 38.12 ± 2.16 | 47.00 ± 3.31 | 47.57 ± 4.43 | 52.59 ± 1.50 | | Math / AIME (Accuracy %) | 43.33 ± 8.82 | 50.00 ± 3.33 | 51.11 ± 5.09 | 60.00 ± 3.33 |

Prerequisites

  • Python 3.10+
  • Azure OpenAI deployment
  • Azure CLI installed

Setup

# from the repo root
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt

Copy-Item .env.example .env
# edit .env with:
# AZURE_OPENAI_ENDPOINT
# AZURE_OPENAI_DEPLOYMENT
# AZURE_OPENAI_API_VERSION

az login

Run

# Classification
python run_classification.py

# Math / AIME
python run_math.py

Optional arguments for both scripts:

--gepa-auto {light,medium,heavy}
--iterations N
--num-threads N

License

[MIT](LICENSE)

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos is subject to those third parties' policies.

Notability

notability 5.0/10

New few-shot learning repo from Microsoft