界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
效率与协作 · SKILL.md

evaluation-optimization

evaluation-optimization

【效率与协作】Configure YiVal evaluators, human ratings, AHP selection, and prompt/combination enhancers safely and accurately.

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: evaluation-optimization description: "Configure YiVal evaluators, human ratings, AHP selection, and prompt/combination enhancers safely and accurately." disable-model-invocation: true metadata: disco-role: operating license: Apache 2.0

YiVal evaluation and optimization

Use this sub-skill when the user needs to choose or debug evaluators, configure AHP selection, add human ratings, run prompt enhancers, compare model outputs, or understand metric names used in YiVal aggregated results.

Read first

Useful helper:

  • python sub-skills/evaluation-optimization/scripts/evaluate_expected_result_smoke.py runs the string expected-result evaluator and AHP selection without network calls.

Evaluator types

TypeYAML valueWhen it runs
Individualevaluator_type: individualPer ExperimentResult; output is attached to each result and can be averaged.
Comparisonevaluator_type: comparisonPer input group, comparing multiple outputs for the same input.
All-resultsevaluator_type: allAfter aggregation, with access to the whole experiment list.

Common evaluator choices

GoalEvaluator idNotes
Check expected answer text, exact/include/fuzzy/JSON validitystring_expected_resultFast and offline. Reads InputData.expected_result.
Execute generated Python and score successpython_validation_evaluatorUnsafe unless sandboxed; uses exec.
Semantic similarity with BERTScorebertscore_evaluatorCan download/use models; tests mock the scorer.
ROUGE for summarization-like textrouge_evaluatorOffline once dependency is installed.
Judge one output against a prompt and choicesopenai_prompt_based_evaluatorOpenAI/network/billing.
Global Elo-style preference judgingopenai_elo_evaluatorOpenAI/network/billing.
AlpacaEval comparisonalpaca_eval_evaluatorExternal annotator/model setup required.

AHP selection pattern

selection_strategy:
  ahp_selection:
    criteria:
      - "string_expected_result: matching"
      - average_token_usage
      - average_latency
    criteria_weights:
      "string_expected_result: matching": 0.8
      average_token_usage: 0.1
      average_latency: 0.1
    criteria_maximization:
      "string_expected_result: matching": true
      average_token_usage: false
      average_latency: false
    normalize_func: null

Criteria can name built-in aggregate fields (average_token_usage, average_latency), evaluator names, or aggregated metric keys like openai_prompt_based_evaluator: clarity.

Enhancer pattern

enhancer:
  name: optimize_by_prompt_enhancer
  model_name: gpt-4
  max_iterations: 2
  enhance_var:
    - task

Enhancers normally call LLM providers and should be run only after a tiny evaluator/selector workflow is proven.

Workflow guidance

  1. Start with string_expected_result or another offline metric when possible.
  2. Add OpenAI/Alpaca/provider-backed judge metrics only after credentials, costs, and prompts are approved.
  3. Make display_name unique when multiple evaluators share the same name so metric keys are distinguishable.
  4. Keep AHP weights explicit and ensure maximization direction matches business intent.
  5. Treat python_validation_evaluator as unsafe code execution; sandbox it or avoid it.
  6. Inspect Experiment.combination_aggregated_metrics before finalizing selector criteria.

Route elsewhere

  • For data and prompt-generation setup, read prompt-automation.
  • For running and reading output pickles, read run.
  • For custom evaluator/selector/enhancer classes, read custom-components.
我的收藏