self-evolve-framework 1.5.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/template/skills/skillopt-sleep/SKILL.md +42 -0
- package/template/skills/skillopt-sleep/configs/_base_/default.yaml +103 -0
- package/template/skills/skillopt-sleep/configs/alfworld/default.yaml +29 -0
- package/template/skills/skillopt-sleep/configs/docvqa/default.yaml +28 -0
- package/template/skills/skillopt-sleep/configs/features/soft_gate.yaml +47 -0
- package/template/skills/skillopt-sleep/configs/livemathematicianbench/default.yaml +22 -0
- package/template/skills/skillopt-sleep/configs/officeqa/default.yaml +34 -0
- package/template/skills/skillopt-sleep/configs/searchqa/default.yaml +32 -0
- package/template/skills/skillopt-sleep/configs/spreadsheetbench/default.yaml +34 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/__init__.py +28 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/config.py +282 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/datasets/__init__.py +7 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/datasets/base.py +512 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/engine/__init__.py +9 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/engine/trainer.py +2379 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/__init__.py +1 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/_template/README.md +43 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/_template/config_template.yaml +55 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/_template/env_template.py +151 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/_template/loader_template.py +87 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/alfworld/__init__.py +5 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/alfworld/adapter.py +428 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/alfworld/dataloader.py +123 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/alfworld/prompts/analyst_error.md +55 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/alfworld/prompts/analyst_success.md +33 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/alfworld/prompts/rollout_no_history.md +8 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/alfworld/prompts/rollout_with_history.md +9 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/alfworld/prompts/rollout_with_memory.md +16 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/alfworld/reflect.py +4 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/alfworld/rollout.py +366 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/alfworld/skills/initial.md +45 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/alfworld/vendor/__init__.py +9 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/alfworld/vendor/alfworld_envs.py +221 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/alfworld/vendor/alfworld_projection.py +60 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/alfworld/vendor/alfworld_prompts.py +8 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/alfworld/vendor/config_tw.yaml +145 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/alfworld/vendor/env_base.py +84 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/alfworld/vendor/env_manager.py +139 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/alfworld/vendor/memory.py +87 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/base.py +329 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/docvqa/__init__.py +1 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/docvqa/adapter.py +90 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/docvqa/dataloader.py +61 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/docvqa/evaluator.py +113 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/docvqa/prompts/analyst_error.md +35 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/docvqa/prompts/analyst_success.md +24 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/docvqa/prompts/rollout_system.md +12 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/docvqa/rollout.py +391 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/docvqa/skills/initial.md +11 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/livemathematicianbench/__init__.py +1 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/livemathematicianbench/adapter.py +129 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/livemathematicianbench/dataloader.py +308 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/livemathematicianbench/evaluator.py +62 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/livemathematicianbench/prompts/analyst_error.md +37 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/livemathematicianbench/prompts/analyst_success.md +25 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/livemathematicianbench/prompts/rollout_system.md +12 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/livemathematicianbench/reflect.py +4 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/livemathematicianbench/rollout.py +434 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/livemathematicianbench/skills/initial.md +16 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/officeqa/__init__.py +1 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/officeqa/adapter.py +112 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/officeqa/dataloader.py +71 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/officeqa/evaluator.py +46 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/officeqa/prompts/analyst_error.md +37 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/officeqa/prompts/analyst_success.md +25 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/officeqa/prompts/rollout_system.md +15 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/officeqa/rollout.py +799 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/officeqa/skills/initial.md +15 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/officeqa/tool_runtime.py +552 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/searchqa/__init__.py +1 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/searchqa/adapter.py +96 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/searchqa/dataloader.py +42 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/searchqa/evaluator.py +100 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/searchqa/prompts/analyst_error.md +46 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/searchqa/prompts/analyst_success.md +32 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/searchqa/prompts/rollout_system.md +13 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/searchqa/reflect.py +4 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/searchqa/rollout.py +494 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/searchqa/skills/initial.md +3 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/spreadsheetbench/__init__.py +5 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/spreadsheetbench/adapter.py +159 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/spreadsheetbench/codegen_agent.py +731 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/spreadsheetbench/dataloader.py +37 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/spreadsheetbench/evaluator.py +158 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/spreadsheetbench/executor.py +67 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/spreadsheetbench/prompts/analyst_error.md +46 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/spreadsheetbench/prompts/analyst_success.md +32 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/spreadsheetbench/prompts/codegen_system.md +1 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/spreadsheetbench/prompts/critical_rules.md +9 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/spreadsheetbench/prompts/react_system.md +21 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/spreadsheetbench/react_agent.py +395 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/spreadsheetbench/reflect.py +4 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/spreadsheetbench/rollout.py +979 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/envs/spreadsheetbench/skills/initial.md +56 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/evaluation/__init__.py +13 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/evaluation/gate.py +148 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/gradient/__init__.py +15 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/gradient/aggregate.py +253 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/gradient/reflect.py +635 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/model/__init__.py +514 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/model/azure_openai.py +915 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/model/backend_config.py +185 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/model/claude_backend.py +371 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/model/codex_backend.py +666 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/model/codex_harness.py +1057 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/model/common.py +229 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/model/minimax_backend.py +277 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/model/qwen_backend.py +456 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/model/router.py +236 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/optimizer/__init__.py +15 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/optimizer/appendix.py +156 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/optimizer/clip.py +109 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/optimizer/lr_autonomous.py +108 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/optimizer/meta_skill.py +79 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/optimizer/rewrite.py +59 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/optimizer/scheduler.py +127 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/optimizer/select.py +4 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/optimizer/skill.py +201 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/optimizer/skill_aware.py +206 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/optimizer/slow_update.py +396 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/optimizer/update_modes.py +135 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/prompts/__init__.py +63 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/prompts/analyst_error.md +41 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/prompts/analyst_error_full_rewrite.md +32 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/prompts/analyst_error_rewrite.md +44 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/prompts/analyst_success.md +36 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/prompts/analyst_success_full_rewrite.md +30 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/prompts/analyst_success_rewrite.md +33 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/prompts/lr_autonomous.md +20 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/prompts/merge_failure.md +30 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/prompts/merge_failure_full_rewrite.md +28 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/prompts/merge_failure_rewrite.md +26 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/prompts/merge_final.md +33 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/prompts/merge_final_full_rewrite.md +28 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/prompts/merge_final_rewrite.md +25 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/prompts/merge_success.md +28 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/prompts/merge_success_full_rewrite.md +28 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/prompts/merge_success_rewrite.md +25 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/prompts/meta_skill.md +40 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/prompts/ranking.md +20 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/prompts/ranking_rewrite.md +15 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/prompts/rewrite_skill.md +25 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/prompts/slow_update.md +60 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/scheduler/__init__.py +8 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/types.py +306 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/utils/__init__.py +4 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/utils/json_utils.py +172 -0
- package/template/skills/skillopt-sleep/scripts/framework/skillopt/utils/scoring.py +28 -0
package/package.json
CHANGED
|
@@ -80,3 +80,45 @@ python -m .codebuddy.skills.skillopt-sleep.scripts.python \
|
|
|
80
80
|
## 内核
|
|
81
81
|
|
|
82
82
|
执行引擎来自 [microsoft/SkillOpt](https://github.com/microsoft/SkillOpt) — 由微软研究院开源的 skill 文档训练框架。
|
|
83
|
+
|
|
84
|
+
## 文件结构
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
.codebuddy/skills/skillopt-sleep/
|
|
88
|
+
├── SKILL.md ← 本指令文件
|
|
89
|
+
├── scripts/
|
|
90
|
+
│ ├── python/ ← 睡眠引擎(SkillOpt-Sleep)
|
|
91
|
+
│ │ ├── cycle.py → 六阶段循环(Harvest/Mine/Replay/Consolidate/Gate/Adopt)
|
|
92
|
+
│ │ ├── harvest.py → 会话历史收集
|
|
93
|
+
│ │ ├── mine.py → 模式挖掘
|
|
94
|
+
│ │ ├── replay.py → 回放验证
|
|
95
|
+
│ │ ├── consolidate.py → 合并优化
|
|
96
|
+
│ │ ├── gate.py → Held-out 验证门控
|
|
97
|
+
│ │ ├── staging.py → 暂存管理
|
|
98
|
+
│ │ └── experiments/ → 基准实验
|
|
99
|
+
│ ├── framework/ ← 核心训练框架(SkillOpt)
|
|
100
|
+
│ │ ├── engine/trainer.py → Skill 训练器
|
|
101
|
+
│ │ ├── envs/ → 基准环境(alfworld/docvqa/searchqa 等)
|
|
102
|
+
│ │ ├── optimizer/ → 有界编辑优化器
|
|
103
|
+
│ │ ├── prompts/ → Analyst/Merge/Rewrite 提示模板
|
|
104
|
+
│ │ ├── model/ → LLM 后端
|
|
105
|
+
│ │ ├── gradient/ → 梯度计算
|
|
106
|
+
│ │ ├── evaluation/ → 评估
|
|
107
|
+
│ │ └── scheduler/ → 调度
|
|
108
|
+
│ └── shell/ ← 辅助脚本
|
|
109
|
+
├── configs/
|
|
110
|
+
│ ├── _base_/default.yaml ← 默认配置
|
|
111
|
+
│ ├── alfworld/ → AlfWorld 基准配置
|
|
112
|
+
│ ├── docvqa/ → DocVQA 基准配置
|
|
113
|
+
│ ├── searchqa/ → SearchQA 基准配置
|
|
114
|
+
│ └── features/ → 特性开关(soft_gate)
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## 进阶用法(训练新 skill)
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
cd .codebuddy/skills/skillopt-sleep/scripts/framework
|
|
121
|
+
python -m skillopt.engine.trainer --config ../../configs/_base_/default.yaml
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
详细的训练配置见 `configs/` 中各基准的 YAML 文件。
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# SkillOpt default configuration — base for all environments.
|
|
2
|
+
# Environment configs should inherit via: _base_: default.yaml
|
|
3
|
+
|
|
4
|
+
model:
|
|
5
|
+
backend: azure_openai
|
|
6
|
+
optimizer: gpt-5.5
|
|
7
|
+
target: gpt-5.5
|
|
8
|
+
optimizer_backend: openai_chat
|
|
9
|
+
target_backend: openai_chat
|
|
10
|
+
reasoning_effort: medium
|
|
11
|
+
rewrite_reasoning_effort: ""
|
|
12
|
+
rewrite_max_completion_tokens: 64000
|
|
13
|
+
codex_exec_path: codex
|
|
14
|
+
codex_exec_sandbox: workspace-write
|
|
15
|
+
codex_exec_profile: ""
|
|
16
|
+
codex_exec_full_auto: false
|
|
17
|
+
codex_exec_reasoning_effort: none
|
|
18
|
+
codex_exec_use_sdk: auto
|
|
19
|
+
codex_exec_network_access: false
|
|
20
|
+
codex_exec_web_search: false
|
|
21
|
+
codex_exec_approval_policy: never
|
|
22
|
+
claude_code_exec_path: claude
|
|
23
|
+
claude_code_exec_profile: ""
|
|
24
|
+
claude_code_exec_use_sdk: auto
|
|
25
|
+
claude_code_exec_effort: medium
|
|
26
|
+
claude_code_exec_max_thinking_tokens: 16384
|
|
27
|
+
codex_trace_to_optimizer: true
|
|
28
|
+
azure_openai_endpoint: "" # e.g. "https://your-resource.openai.azure.com/"
|
|
29
|
+
azure_openai_api_version: "2024-12-01-preview"
|
|
30
|
+
azure_openai_api_key: "" # Fill locally if you do not export AZURE_OPENAI_API_KEY
|
|
31
|
+
azure_openai_auth_mode: "" # empty → fall back to AZURE_OPENAI_AUTH_MODE env (default "azure_cli")
|
|
32
|
+
azure_openai_ad_scope: "https://cognitiveservices.azure.com/.default"
|
|
33
|
+
azure_openai_managed_identity_client_id: ""
|
|
34
|
+
optimizer_azure_openai_endpoint: "" # e.g. "https://your-resource.openai.azure.com/"
|
|
35
|
+
optimizer_azure_openai_api_version: "2024-12-01-preview"
|
|
36
|
+
optimizer_azure_openai_api_key: ""
|
|
37
|
+
optimizer_azure_openai_auth_mode: "" # empty → fall back to OPTIMIZER_AZURE_OPENAI_AUTH_MODE env, then shared
|
|
38
|
+
optimizer_azure_openai_ad_scope: "https://cognitiveservices.azure.com/.default"
|
|
39
|
+
optimizer_azure_openai_managed_identity_client_id: ""
|
|
40
|
+
target_azure_openai_endpoint: "" # e.g. "https://your-resource.openai.azure.com/"
|
|
41
|
+
target_azure_openai_api_version: "2024-12-01-preview"
|
|
42
|
+
target_azure_openai_api_key: ""
|
|
43
|
+
target_azure_openai_auth_mode: "" # empty → fall back to TARGET_AZURE_OPENAI_AUTH_MODE env, then shared
|
|
44
|
+
target_azure_openai_ad_scope: "https://cognitiveservices.azure.com/.default"
|
|
45
|
+
target_azure_openai_managed_identity_client_id: ""
|
|
46
|
+
|
|
47
|
+
# MiniMax backend settings (minimax_chat target)
|
|
48
|
+
minimax_base_url: "" # https://api.minimax.io/v1 if blank
|
|
49
|
+
minimax_api_key: ""
|
|
50
|
+
minimax_model: "MiniMax-M2.7"
|
|
51
|
+
minimax_temperature: "0.7"
|
|
52
|
+
minimax_max_tokens: "8000"
|
|
53
|
+
minimax_enable_thinking: "false"
|
|
54
|
+
optimizer_minimax_base_url: "" # per-role override
|
|
55
|
+
target_minimax_base_url: "" # per-role override
|
|
56
|
+
optimizer_minimax_api_key: ""
|
|
57
|
+
target_minimax_api_key: ""
|
|
58
|
+
|
|
59
|
+
train:
|
|
60
|
+
num_epochs: 4
|
|
61
|
+
train_size: 0 # 0 = derive from dataset split when available
|
|
62
|
+
batch_size: 40
|
|
63
|
+
accumulation: 1
|
|
64
|
+
seed: 42
|
|
65
|
+
|
|
66
|
+
gradient:
|
|
67
|
+
minibatch_size: 8
|
|
68
|
+
merge_batch_size: 8
|
|
69
|
+
analyst_workers: 16
|
|
70
|
+
max_analyst_rounds: 3
|
|
71
|
+
failure_only: false
|
|
72
|
+
|
|
73
|
+
optimizer:
|
|
74
|
+
learning_rate: 4 # max edits per step (edit_budget)
|
|
75
|
+
min_learning_rate: 2 # min edits for decay schedulers
|
|
76
|
+
lr_scheduler: cosine # constant / linear / cosine / autonomous
|
|
77
|
+
lr_control_mode: fixed # fixed / autonomous / none
|
|
78
|
+
skill_update_mode: patch # patch / rewrite_from_suggestions / full_rewrite_minibatch
|
|
79
|
+
use_slow_update: true
|
|
80
|
+
slow_update_samples: 20
|
|
81
|
+
slow_update_gate_with_selection: false
|
|
82
|
+
longitudinal_pair_policy: mixed # mixed / changed / unchanged
|
|
83
|
+
use_meta_skill: true
|
|
84
|
+
use_skill_aware_reflection: false # EmbodiSkill: split failures into SKILL_DEFECT (edit body) vs EXECUTION_LAPSE (protected appendix)
|
|
85
|
+
skill_aware_appendix_source: both # both = success+failure emit appendix notes; failure_only = only EXECUTION_LAPSE (paper-faithful)
|
|
86
|
+
skill_aware_consolidate_threshold: 0 # 0 = off; >0 = LLM-consolidate the appendix when its note count exceeds N
|
|
87
|
+
|
|
88
|
+
evaluation:
|
|
89
|
+
use_gate: true
|
|
90
|
+
sel_env_num: 0
|
|
91
|
+
test_env_num: 0
|
|
92
|
+
eval_test: true
|
|
93
|
+
|
|
94
|
+
env:
|
|
95
|
+
name: ""
|
|
96
|
+
skill_init: ""
|
|
97
|
+
split_mode: ratio # ratio = build deterministic split from data_path; split_dir = use pre-split train/val/test
|
|
98
|
+
split_seed: 42
|
|
99
|
+
split_dir: ""
|
|
100
|
+
data_path: ""
|
|
101
|
+
split_output_dir: ""
|
|
102
|
+
exec_timeout: 120 # per target model/code-agent call timeout in seconds
|
|
103
|
+
out_root: ""
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
_base_: ../_base_/default.yaml
|
|
2
|
+
|
|
3
|
+
train:
|
|
4
|
+
train_size: 0
|
|
5
|
+
accumulation: 1
|
|
6
|
+
|
|
7
|
+
gradient:
|
|
8
|
+
minibatch_size: 8
|
|
9
|
+
merge_batch_size: 8
|
|
10
|
+
|
|
11
|
+
optimizer:
|
|
12
|
+
learning_rate: 4
|
|
13
|
+
|
|
14
|
+
evaluation:
|
|
15
|
+
sel_env_num: 0
|
|
16
|
+
test_env_num: 0
|
|
17
|
+
|
|
18
|
+
env:
|
|
19
|
+
name: alfworld
|
|
20
|
+
skill_init: skillopt/envs/alfworld/skills/initial.md
|
|
21
|
+
split_mode: split_dir
|
|
22
|
+
split_dir: data/alfworld_path_split
|
|
23
|
+
data_path: ""
|
|
24
|
+
split_output_dir: ""
|
|
25
|
+
max_steps: 50
|
|
26
|
+
max_completion_tokens: 16384
|
|
27
|
+
workers: 8
|
|
28
|
+
max_api_workers: 8
|
|
29
|
+
limit: 0
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
_base_: ../_base_/default.yaml
|
|
2
|
+
|
|
3
|
+
model:
|
|
4
|
+
reasoning_effort: medium
|
|
5
|
+
|
|
6
|
+
train:
|
|
7
|
+
batch_size: 40
|
|
8
|
+
accumulation: 1
|
|
9
|
+
|
|
10
|
+
gradient:
|
|
11
|
+
minibatch_size: 8
|
|
12
|
+
merge_batch_size: 8
|
|
13
|
+
|
|
14
|
+
optimizer:
|
|
15
|
+
learning_rate: 4
|
|
16
|
+
|
|
17
|
+
env:
|
|
18
|
+
name: docvqa
|
|
19
|
+
skill_init: skillopt/envs/docvqa/skills/initial.md
|
|
20
|
+
split_mode: split_dir
|
|
21
|
+
split_dir: data/docvqa/splits
|
|
22
|
+
data_path: ""
|
|
23
|
+
split_output_dir: ""
|
|
24
|
+
max_turns: 1
|
|
25
|
+
max_completion_tokens: 16384
|
|
26
|
+
workers: 16
|
|
27
|
+
image_detail: auto
|
|
28
|
+
limit: 0
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# ─────────────────────────────────────────────────────────────────────────────
|
|
2
|
+
# Feature: soft / mixed validation-gate metric (community-contributed, PR #25)
|
|
3
|
+
# ─────────────────────────────────────────────────────────────────────────────
|
|
4
|
+
#
|
|
5
|
+
# This is NOT a default SkillOpt setting and was NOT used to produce the
|
|
6
|
+
# numbers reported in the paper. It is provided as a reference for users
|
|
7
|
+
# who encounter a specific scenario where the default `hard` gate is too
|
|
8
|
+
# coarse to drive training.
|
|
9
|
+
#
|
|
10
|
+
# When to consider this:
|
|
11
|
+
# - You are running on a custom environment.
|
|
12
|
+
# - Your held-out *selection* split has very few items (e.g. ≤ ~10).
|
|
13
|
+
# - Your reward function is continuous / partial-credit (e.g. F1, BLEU,
|
|
14
|
+
# soft match) rather than purely binary 0/1.
|
|
15
|
+
#
|
|
16
|
+
# Symptom this addresses:
|
|
17
|
+
# With a small selection split + continuous rewards, candidate skills
|
|
18
|
+
# often improve per-item soft scores (e.g. 0.06 → 0.26 on one item) but
|
|
19
|
+
# never flip the discrete hard outcome. The default `hard` gate then
|
|
20
|
+
# rejects every candidate and training stalls. Switching the gate to
|
|
21
|
+
# `soft` or `mixed` lets these partial improvements be accepted.
|
|
22
|
+
#
|
|
23
|
+
# When NOT to use this:
|
|
24
|
+
# - When reproducing the paper. The paper-reported numbers were obtained
|
|
25
|
+
# under the default `hard` gate.
|
|
26
|
+
# - When your selection split is large (dozens+ items) and / or your
|
|
27
|
+
# reward is already binary — `hard` is the more conservative choice
|
|
28
|
+
# and matches the design described in the paper.
|
|
29
|
+
#
|
|
30
|
+
# To use: inherit your env config from this file, e.g.
|
|
31
|
+
# _base_: ../features/soft_gate.yaml
|
|
32
|
+
# or copy the `evaluation:` block below into your config.
|
|
33
|
+
# ─────────────────────────────────────────────────────────────────────────────
|
|
34
|
+
|
|
35
|
+
_base_: ../_base_/default.yaml
|
|
36
|
+
|
|
37
|
+
evaluation:
|
|
38
|
+
# Three options:
|
|
39
|
+
# 'hard' — default; exact-match accuracy. Use this to reproduce the paper.
|
|
40
|
+
# 'soft' — per-item soft / partial-credit score (recommended for the
|
|
41
|
+
# small-split + continuous-reward scenario described above).
|
|
42
|
+
# 'mixed' — weighted average: (1 - w) * hard + w * soft, with `w` set by
|
|
43
|
+
# `gate_mixed_weight` below.
|
|
44
|
+
gate_metric: soft
|
|
45
|
+
|
|
46
|
+
# Only used when gate_metric == 'mixed'. Ignored otherwise.
|
|
47
|
+
gate_mixed_weight: 0.5
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
_base_: ../_base_/default.yaml
|
|
2
|
+
|
|
3
|
+
train:
|
|
4
|
+
train_size: 0
|
|
5
|
+
batch_size: 40
|
|
6
|
+
accumulation: 1
|
|
7
|
+
|
|
8
|
+
env:
|
|
9
|
+
name: livemathematicianbench
|
|
10
|
+
skill_init: skillopt/envs/livemathematicianbench/skills/initial.md
|
|
11
|
+
split_mode: split_dir
|
|
12
|
+
split_dir: data/livemathematicianbench_split
|
|
13
|
+
data_path: ""
|
|
14
|
+
split_output_dir: ""
|
|
15
|
+
max_turns: 1
|
|
16
|
+
max_completion_tokens: 16384
|
|
17
|
+
exec_timeout: 300
|
|
18
|
+
workers: 64
|
|
19
|
+
limit: 0
|
|
20
|
+
shuffle_choices: true
|
|
21
|
+
use_theorem: false
|
|
22
|
+
use_sketch: false
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
_base_: ../_base_/default.yaml
|
|
2
|
+
|
|
3
|
+
model:
|
|
4
|
+
reasoning_effort: medium
|
|
5
|
+
|
|
6
|
+
train:
|
|
7
|
+
batch_size: 40
|
|
8
|
+
accumulation: 1
|
|
9
|
+
|
|
10
|
+
gradient:
|
|
11
|
+
minibatch_size: 8
|
|
12
|
+
merge_batch_size: 8
|
|
13
|
+
|
|
14
|
+
optimizer:
|
|
15
|
+
learning_rate: 4
|
|
16
|
+
|
|
17
|
+
env:
|
|
18
|
+
name: officeqa
|
|
19
|
+
skill_init: skillopt/envs/officeqa/skills/initial.md
|
|
20
|
+
split_mode: split_dir
|
|
21
|
+
split_dir: data/officeqa_split
|
|
22
|
+
data_dirs:
|
|
23
|
+
- data/officeqa_docs_official
|
|
24
|
+
workers: 4
|
|
25
|
+
max_tool_turns: 24
|
|
26
|
+
max_completion_tokens: 16384
|
|
27
|
+
search_mode: offline
|
|
28
|
+
max_queries_per_turn: 4
|
|
29
|
+
search_api_url: http://apisix.westus2.cloudapp.azure.com/search_tool/search
|
|
30
|
+
search_auth_env: OFFICEQA_CUSTOM_SEARCH_AUTH
|
|
31
|
+
search_provider: duckduckgo
|
|
32
|
+
search_max_num_results: 4
|
|
33
|
+
search_timeout_seconds: 20
|
|
34
|
+
limit: 0
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
_base_: ../_base_/default.yaml
|
|
2
|
+
|
|
3
|
+
model:
|
|
4
|
+
reasoning_effort: medium
|
|
5
|
+
|
|
6
|
+
train:
|
|
7
|
+
train_size: 400
|
|
8
|
+
batch_size: 40
|
|
9
|
+
accumulation: 1
|
|
10
|
+
|
|
11
|
+
gradient:
|
|
12
|
+
minibatch_size: 8
|
|
13
|
+
merge_batch_size: 8
|
|
14
|
+
|
|
15
|
+
optimizer:
|
|
16
|
+
learning_rate: 4
|
|
17
|
+
|
|
18
|
+
evaluation:
|
|
19
|
+
sel_env_num: 0
|
|
20
|
+
test_env_num: 0
|
|
21
|
+
|
|
22
|
+
env:
|
|
23
|
+
name: searchqa
|
|
24
|
+
skill_init: skillopt/envs/searchqa/skills/initial.md
|
|
25
|
+
split_mode: split_dir
|
|
26
|
+
split_dir: data/searchqa_split
|
|
27
|
+
data_path: ""
|
|
28
|
+
split_output_dir: ""
|
|
29
|
+
max_turns: 1
|
|
30
|
+
max_completion_tokens: 16384
|
|
31
|
+
workers: 24
|
|
32
|
+
limit: 0
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
_base_: ../_base_/default.yaml
|
|
2
|
+
|
|
3
|
+
model:
|
|
4
|
+
reasoning_effort: medium
|
|
5
|
+
|
|
6
|
+
train:
|
|
7
|
+
train_size: 80
|
|
8
|
+
batch_size: 40
|
|
9
|
+
accumulation: 1
|
|
10
|
+
|
|
11
|
+
gradient:
|
|
12
|
+
minibatch_size: 8
|
|
13
|
+
merge_batch_size: 8
|
|
14
|
+
|
|
15
|
+
optimizer:
|
|
16
|
+
learning_rate: 4
|
|
17
|
+
|
|
18
|
+
evaluation:
|
|
19
|
+
sel_env_num: 0
|
|
20
|
+
test_env_num: 0
|
|
21
|
+
|
|
22
|
+
env:
|
|
23
|
+
name: spreadsheetbench
|
|
24
|
+
skill_init: skillopt/envs/spreadsheetbench/skills/initial.md
|
|
25
|
+
split_mode: split_dir
|
|
26
|
+
split_dir: data/spreadsheetbench_split
|
|
27
|
+
data_path: ""
|
|
28
|
+
split_output_dir: ""
|
|
29
|
+
data_root: data/spreadsheetbench_verified_400
|
|
30
|
+
mode: multi
|
|
31
|
+
max_turns: 30
|
|
32
|
+
max_completion_tokens: 16384
|
|
33
|
+
exec_timeout: 600
|
|
34
|
+
workers: 24
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"""ReflACT: Reflective Agent Tuning.
|
|
2
|
+
|
|
3
|
+
A general-purpose framework for iteratively optimizing LLM agent skills
|
|
4
|
+
through structured reflection and self-improvement.
|
|
5
|
+
|
|
6
|
+
Pipeline stages:
|
|
7
|
+
1. Rollout — execute episodes with current skill
|
|
8
|
+
2. Reflect — analyze trajectories, generate patches
|
|
9
|
+
3. Aggregate — hierarchical merge of patches
|
|
10
|
+
4. Select — rank and select top edits
|
|
11
|
+
5. Update — apply edits to skill document
|
|
12
|
+
6. Evaluate — validate candidate skill, accept/reject
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
__version__ = "0.1.0"
|
|
16
|
+
|
|
17
|
+
from skillopt.types import ( # noqa: F401
|
|
18
|
+
BatchSpec,
|
|
19
|
+
Edit,
|
|
20
|
+
EditOp,
|
|
21
|
+
FailureSummaryEntry,
|
|
22
|
+
GateAction,
|
|
23
|
+
GateResult,
|
|
24
|
+
Patch,
|
|
25
|
+
RawPatch,
|
|
26
|
+
RolloutResult,
|
|
27
|
+
SlowUpdateResult,
|
|
28
|
+
)
|