Evaluation and optimization

From VectorSpaceLab/AREX-Skill · View interactive version

Evaluation and optimization is an AI agent skill from the GitHub repository VectorSpaceLab/AREX-Skill. Guide AdalFlow evaluation metrics, datasets, parameters, gradients, prompt/few-shot/text-grad optimization, AdalComponent, Trainer, and optimize_anything workflows.

How to use this skill

Skill file

AdalFlow evaluation and optimization

Use this sub-skill when the user wants to score task outputs, select or load AdalFlow benchmark datasets, make Parameter objects trainable, wrap a task in AdalComponent, run Trainer.diagnose or Trainer.fit, configure few-shot/text-gradient optimizers, or use optimize_anything for bounded text-artifact search.

Route boundaries

Stay here for:

Route away instead of duplicating guidance:

Reference map

Safe operating defaults

  1. Score before optimizing. Build a deterministic metric with AnswerMatchAcc or RetrieverEvaluator and run a tiny local smoke case before any model-backed judge or optimizer.
  2. Treat live judging and text gradients as expensive. LLMasJudge, LLMAsTextLoss, backward engines, teacher generators, and TGDOptimizer can invoke model providers. Require explicit provider setup, credentials, budget, sample limits, and cache/checkpoint choices.
  3. Use bounded data. Dataset loaders may download external data and optional packages. Prefer size=... or pre-existing local data for first tests.
  4. Make AdalComponent contracts explicit. prepare_task returns (callable, kwargs) for one sample; prepare_eval returns (eval_fn, kwargs) for inference scoring; prepare_loss returns (loss_fn, kwargs) with Parameter inputs and correct eval_input values.
  5. Prefer diagnosis before training. Trainer.diagnose is useful for identifying failing samples and prompt/output issues. Use num_workers=1 for minimal debugging, then raise concurrency only after stable.
  6. Do not imply full benchmark training is safe. Benchmark scripts and full prompt optimization runs are optional, network/provider/dataset dependent, and should be reduced to a tiny user-approved run before scaling.

Minimal decision checklist

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.