Logo Gepa

Gepa

Tổ chức
skillberry-ai
gepa

Chạy vòng lặp tối ưu hóa GEPA (arXiv:2507.19457) — tìm kiếm Pareto phản tư, tiết kiệm số lượt lấy mẫu. Một cổng kiểm tra sơ bộ rẻ trên minibatch train sẽ quyết định đề xuất có đáng để đánh giá val tốn kém hay không; các phương án cha được lấy mẫu từ biên Pareto theo từng trường hợp, nhờ đó các phương án chuyên biệt vẫn được giữ lại thay vì bị gộp thành phương án trung bình. Dùng khi các lượt chạy tốn kém, bộ chấm điểm đưa ra phản hồi hữu ích cho từng tác vụ và bạn muốn đạt chất lượng cao nhất với mỗi lần đánh giá. Thay vào đó, dùng hill-climb để chạy thử đường cơ sở đầu tiên hoặc cho các tác vụ chỉ có kết quả đạt/không đạt, ít phản hồi.

Add to TypingMind

Tổng quan

Nhà phát hànhskillberry-ai
Kho mãcap-evolve
Tên kỹ nănggepa
Sao
67
Bản fork
18
Tệp đi kèm
6
Giấy phépApache-2.0
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 6 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được skillberry-ai công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Gepa trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/skillberry-ai/cap-evolve/tree/main/skills/algorithms/gepa
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/skillberry-ai/cap-evolve.git /tmp/cap-evolve
mkdir -p .claude/skills
cp -r /tmp/cap-evolve/skills/algorithms/gepa .claude/skills/gepa
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Gepa trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Gepa ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Gepa với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

gepa — sample-efficient reflective Pareto search

algorithms/hill-climb owns the mechanics every algorithm shares: parent → proposal → val gate → commit, specified once in algorithms/hill-climb/references/run-step.md. Read that first. This page states only what GEPA (Agrawal et al., 2025) does differently, and why those differences are the paper's actual contribution rather than decoration. A thin wrapper over cap_evolve.gepa.gepa_loop.

The two mechanisms, and why removing either turns GEPA back into hill-climb

1. The parent is sampled from per-instance winners, not from the global best. A mean is a lossy summary. A candidate that fixes one genuinely hard task while regressing three easy ones has a worse mean than the incumbent, so a best-parent rule discards it — and with it the only text in the pool that has ever solved that task. GEPA instead scores per val instance and samples frequency-weighted over candidates that (co-)win at least one, so specialists and stepping-stones stay reachable as parents while their mean is still behind. That is the quality-diversity argument (MAP-Elites): keep the set that covers the task distribution, not the single champion. Sampling is stochastic and seeded, so the exploration is reproducible.

2. A cheap train minibatch pre-gates the expensive val evaluation. Rollouts dominate cost and a full-val eval costs |val| · n_trials of them. Most proposals are bad; paying full price to find that out is what makes naive reflective search unaffordable, and GEPA's headline "~35× fewer rollouts" comes almost entirely from not paying it. So parent and child are evaluated on the same small train minibatch (2 · minibatch-size rollouts, eval-cached) and the child is dropped unless sum(child) > sum(parent). The minibatch never decides acceptance — it decides whether acceptance is worth measuring.

A side benefit of (2): reflection reads train traces, so the proposer never sees the split its gate is computed on.

What differs from hill-climb, step by step

  1. Parent — frequency-weighted sample over per-instance (co-)winners (--selection-strategy, default pareto_per_instance), not the current best.
  2. Signal — a minibatch of --minibatch-size (default 4) train ids, evaluated with traces, instead of the whole train focus set.
  3. Reflective dataset — REFLECTION.md in the optimizer workdir, over the parent's failing minibatch tasks (phases/diagnose owns what one is and what shape it takes). "Failing" is the hard threshold reward < 1.0, so with a graded scorer that never reaches 1.0 every sampled task is listed and the header always reads 0/N pass — read it as "sampled tasks, worst first". Each entry is truncated to ~800 chars and at most 12 tasks are written: a summary, not an archive; untruncated rollouts stay in rollouts/train/. The prompt also carries the run's cross-iteration files (LEDGER.md, JOURNAL.md, PROCESS.md, RUNMAP.md + prior_iterations/) so a proposal builds on prior work. All five are real here since #396: harness.record_iteration writes the step event those files are built from and folds the optimizer's appended JOURNAL.md entry back into the run-level handover, so the history accumulates across iterations.
  4. Local gate — child on the same minibatch, sum(child) > sum(parent), else dropped with no val spend. This is the extra stage; everything after it is hill-climb's.
  5. Merge — every --merge-cadence accepts, find two strict-frontier dominators sharing a common ancestor both beat and recombine them component-by-component (each component from whichever descendant changed it), then minibatch-gate and val-gate the result like any other child.

Note the word "frontier" covers two different sets here: the sampling pool in step 1 is every candidate with ≥1 instance win, which can include dominated candidates; the strict per-task Pareto frontier (selection.pareto_frontier) is a subset of it and is what the merge and the reported frontier_size use.

Component selection

A component is one editable file of the candidate. (Unrelated to hill-climb's --focus, which selects tasks; this selects files.)

  • --component-selector round_robin (default): one component per iteration, cycled, written to FOCUS.md. Small attributable changes are exactly the unit the merge can later recombine — a sprawling multi-file rewrite cannot be.
  • --component-selector all: list every component; the optimizer may edit anywhere. Use for monolithic capabilities or genuinely cross-cutting changes.

For a single-file capability the two coincide and the merge skips gracefully (gepa_merge_skip) rather than emitting a degenerate child.

Key hyperparameters

  • --max-metric-calls (default 0 = unlimited): PRIMARY budget, checked between iterations. An in-flight iteration runs to completion, so actual spend can exceed it by up to 2·minibatch-size + |val|·n-trials — and a merge fires inside an accepting iteration, adding 3·minibatch-size (the merge and BOTH parents, on a freshly sampled minibatch) plus a second |val|·n-trials, for a worst case of 5·minibatch-size + 2·|val|·n-trials. Set it below your hard ceiling.
  • --max-iterations (default 50): secondary cap on propose→gate iterations.
  • --minibatch-size (default 4): train ids per cheap local gate.
  • --n-trials (default 1): rollouts/task on the full-val eval (raise under noise so the significance gate is trustworthy). Minibatch evals are always 1 trial.
  • --max-merges (default 2): cap on merge attempts that built a candidate — a merge rejected at either gate consumes one. A skip (no eligible pair) is free.
  • --merge-cadence (default 3): accepts between merge attempts.
  • --protected-paths (empty = off; default = the built-in globs): seals the eval surface (scorer/gold/tasks/tests). A child that edits one is INDECISIVE — no reward recorded, not remembered as rejected, stall counter untouched — because scoring a gold-hacking edit at all would teach the optimizer that it worked. It still charges spent.iterations (record_iteration(..., indecisive=True)): the rollouts and the optimizer call were really spent, so the spend meter counts it and only the evidence meter does not.
  • --workers (default 1): pools the minibatch rollouts. Only safe when the adapter's run_target is thread-safe.
  • --store / --store-commit-cmd (default git): where accepted candidates are committed.
  • --gate-mode / --k-se, --no-regression, --seed: as hill-climb.
  • --resume: rebuild pool/lineage/frontier from gepa_state.json + each accepted candidate's rollouts and continue the search. Preserved spend keeps the budget honest; the parent-sampling RNG stream restarts, so a resumed run is not byte-identical.

Known gaps (present tense — the shipped loop, not the paper)

Two. Re-derived against current main, because most of what this section used to list has since been fixed in core: the hollow eval-cache reflection by #387, the missing step record and the non-accumulating JOURNAL.md by #396 (harness.record_iteration is now the one place every algorithm ends an iteration, and GEPA calls it), and the dirty snapshots plus the un-excluded optimizer-agent dotfiles by #350 and #386. Check the two below before trusting them.

  • The reflective dataset does not carry the task input, though _write_reflection's own docstring says each failing task "contributes its input" (gepa.py:230). It writes Agent output / Trajectory / Feedback and no input field (:263-267), so the optimizer sees a bad answer to a question it cannot read. Since #387 the output and trace survive an eval-cache hit, so the entry is no longer hollow — just anonymous.
  • If splits.train is empty the minibatch silently falls back to val ids (gepa.py:530), putting the gate split in front of the proposer, with no warning. Do not run GEPA with a zero-size train split.

How to run

bash
python scripts/check.py    # behavioral, offline (mock optimizer + synthetic adapter)
python scripts/run.py --run-dir .capevolve/run_X --project .capevolve/project \
  --optimizer 'python .../run-optimizer/scripts/run.py --name mock --workdir {workdir} --prompt {prompt}' \
  --max-metric-calls 400 --minibatch-size 4 --component-selector round_robin

Requires baseline first (reads the seed's full-val result from baseline.json). Reports the pool, frontier_size, best candidate, accepts, merges, and metric-calls spent.

Agent-mode loop

When orchestration_mode: agent, follow orchestrate/orchestrate §Agent-mode loop for the shared rules, and make each round GEPA-shaped: pick the parent by per-instance win count; sample minibatch-size train ids; evaluate parent then child on that same minibatch and drop the child unless sum(child) > sum(parent); only then pay for a full val eval and its gate. Reflect on the train minibatch, never on val — val is the judge, not the teacher.

References

  • references/concepts.md — the paper's thesis (language as a richer learning medium than a scalar), the frequency-weighted per-instance frontier, the system-aware merge and its tie-breaking, the metric-call/eval-cache accounting, and how the pieces relate to the hill-climb / skillopt siblings. Load when you need the reasoning behind a knob rather than its value. Cites arXiv:2507.19457.

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Gepa làm được gì?

Chạy vòng lặp tối ưu hóa GEPA (arXiv:2507.19457) — tìm kiếm Pareto phản tư, tiết kiệm số lượt lấy mẫu. Một cổng kiểm tra sơ bộ rẻ trên minibatch train sẽ quyết định đề xuất có đáng để đánh giá val tốn kém hay không; các phương án cha được lấy mẫu từ biên Pareto theo từng trường hợp, nhờ đó các phương án chuyên biệt vẫn được giữ lại thay vì bị gộp thành phương án trung bình. Dùng khi các lượt chạy tốn kém, bộ chấm điểm đưa ra phản hồi hữu ích cho từng tác vụ và bạn muốn đạt chất lượng cao nhất với mỗi lần đánh giá. Thay vào đó, dùng hill-climb để chạy thử đường cơ sở đầu tiên hoặc cho các tá...

Vì sao nên dùng Gepa trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Gepa là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Gepa trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/skillberry-ai/cap-evolve/tree/main/skills/algorithms/gepa. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Gepa?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Gepa với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Gepa với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Gepa có miễn phí không?

Có. Kỹ năng này được skillberry-ai phát hành trên GitHub theo giấy phép Apache-2.0. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả
Logo của nexu-io

Html Ppt Zhangzara Cobalt Grid

nexu-io
Tổ chứcPhổ biến

Đề xuất gia hạn và mở rộng số suất người dùng OpenDesign cho khách hàng đang phát triển: giá trị thực tế, bằng chứng sử dụng và ROI của việc mở rộng. Được xây dựng thành bộ slide bán hàng B2B hỗ trợ người bảo trợ và người phê duyệt tài chính đưa ra quyết định.

11.2K
96.7K
2 tệp
Xem
Logo của nexu-io

Html Ppt Zhangzara Monochrome

nexu-io
Tổ chứcPhổ biến

Đề xuất tài trợ nghiên cứu về chỉnh sửa base CRISPR cho bệnh hồng cầu hình liềm — giả thuyết, phương pháp, các mốc tiến độ và rủi ro. Được xây dựng thành bộ slide nghiên cứu học thuật, hỗ trợ ra quyết định cho hội đồng xét duyệt tài trợ…

11.2K
96.7K
2 tệp
Xem
Logo của nexu-io

Html Ppt Zhangzara Scatterbrain

nexu-io
Tổ chứcPhổ biến

Đồ án tốt nghiệp trường thiết kế: hệ thống chỉ đường công cộng cho một trung tâm trung chuyển — đề bài, quy trình và kết quả. Được xây dựng thành bộ slide bảo vệ đồ án giúp đưa ra quyết định, dành cho hội đồng phản biện và giảng viên.

11.2K
96.7K
2 tệp
Xem
Logo của paperclipai

Create Agent Adapter

paperclipai
Tổ chứcPhổ biến

Tạo hoặc chỉnh sửa bộ chuyển đổi tác nhân AI Paperclip trên các giao diện máy chủ, UI và CLI. Dùng khi bổ sung hỗ trợ cho một tác nhân AI CLI mới, tác nhân AI API, quy trình tùy chỉnh hoặc gói bộ chuyển đổi.

16.2K
95.4K
Hướng dẫn
Xem

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇