AGENT SKILL

evaluation-and-optimization

Guide AdalFlow evaluation metrics, datasets, parameters, gradients, prompt/few-shot/text-grad optimization, AdalComponent, Trainer, and optimize_anything workflows.

License 许可
MIT
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
evaluation-and-optimization
license
MIT
metadata
{ "disco-role": "operating" }
description
Guide AdalFlow evaluation metrics, datasets, parameters, gradients, prompt/few-shot/text-grad optimization, AdalComponent, Trainer, and optimize_anything workflows.
disable-model-invocation
true

02 资源文件 5

03 SKILL.md 正文

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:

  • AnswerMatchAcc, RetrieverEvaluator, and cautious LLMasJudge evaluation.
  • Dataset loaders for GSM8K, TREC, HotpotQA, and BBH-style tasks, including small-size and skip-expensive guidance.
  • Parameter, ParameterType, GradComponent, EvalFnToTextLoss, LLMAsTextLoss, BootstrapFewShot, TGDOptimizer, AdalComponent, Trainer, and optimize_anything workflows.

Route away instead of duplicating guidance:

  • RAG construction, document splitting, local/vector retrievers, and index pipelines: use retrieval-rag-and-data-pipelines.
  • Provider model-client configuration, credentials, Generator, and fake provider clients: use model-client-and-generator-workflows.
  • Tracing/logging artifacts and callback storage: use tracing-observability-and-configuration.

Reference map

  • Evaluation metrics: metric APIs, input shapes, output objects, and no-network smoke examples.
  • Optimization and training: Parameter/gradient concepts, AdalComponent contracts, Trainer.fit/diagnose, few-shot/text-gradient optimizer setup, and optimize_anything.
  • Datasets and benchmarks: loader classes, fields, optional dependencies, downloads, and benchmark constraints.
  • Troubleshooting: evaluator shape errors, metric extras, dataset misses, checkpoint/resume, validation-set requirements, provider cost, runtime limits, and multiprocessing issues.
  • Metric smoke script: service-free exact/fuzzy/F1/retriever metric check.

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

  • What is being scored: final answer strings, structured labels, retrieved contexts/IDs, or model-judged quality?
  • Is the metric service-free, optional-package-backed, or provider-backed?
  • Are predictions raw values, GeneratorOutput.data, or Parameter.full_response.data?
  • Are trainable values marked with the right ParameterType (PROMPT for instructions, DEMOS for examples)?
  • Does the training data provide stable id fields and a real validation set?
  • What are the maximum samples, optimizer steps, worker count, and checkpoint/resume plan?

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351