factor-mining
Operate AlphaGPT factor-token mining, formula execution, feature engineering, backtest scoring, and training artifacts safely.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- factor-mining
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Operate AlphaGPT factor-token mining, formula execution, feature engineering, backtest scoring, and training artifacts safely.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/api-reference.md8.5 KB
- 参考文档references/training-and-formulas.md7.3 KB
- 参考文档references/troubleshooting.md6.4 KB
- 脚本scripts/alpha_gpt_formula_smoke.py24.9 KB
03 SKILL.md 正文
Factor Mining
Use this sub-skill when the task is about AlphaGPT's factor-token language,
formula validation, synthetic factor execution, model-core training loop, LoRD
regularization in the AlphaGPT model, or interpreting best_meme_strategy.json
and training_history.json.
Do not route here for
- Raw token/OHLCV database population; use data-pipeline.
- Live consumption of a mined formula by the runner, wallet execution, risk controls, or portfolio state; use live-strategy.
- Dashboard display and monitoring; use dashboard-ops.
- Standalone
times.pyorlord/experiment.pyresearch unless the user explicitly selects optional experiments; see ../../references/experiments-and-exclusions.md.
Read or run
- Read references/training-and-formulas.md for the formula vocabulary, RPN examples, feature/operator tables, training sequence, and JSON artifacts.
- Read references/api-reference.md for verified signatures, constants, tensor contracts, and class responsibilities.
- Read references/troubleshooting.md when
StackVM.execute(...)returnsNone, factors are constant, DB rows are missing, training is slow, or GPU/backend expectations are unclear. - Run scripts/alpha_gpt_formula_smoke.py for a safe deterministic formula smoke that uses synthetic tensors and no database, API keys, Solana RPC, or trading paths.
- Use the root environment checker with
--scope factorfor import checks.
Safe default workflow
- Start with the vocabulary: six feature tokens followed by twelve operators, verified size
18and operator offset6. - Validate the formula as reverse Polish notation before using it in training or live strategy.
- Use synthetic tensors to confirm stack behavior and finite outputs.
- Confirm full training prerequisites only after the formula path is understood: populated SQL tables, PyTorch runtime, and acceptable output directory for
best_meme_strategy.jsonandtraining_history.json. - Treat CUDA as a performance/backend detail, not proof that the formula grammar is valid.
- Do not run the full
AlphaEngine.train()loop as a quick smoke check; it expects DB data, samples large batches, may run long, and writes artifacts.
Core runtime facts
FeatureEngineer.compute_features(raw_dict)returns[token_count, 6, time]for rawopen,high,low,close,volume,liquidity, andfdvtensors.AdvancedFactorEngineer.compute_advanced_features(self, raw_dict)returns twelve channels, but the verified formula vocabulary still exposes only the six base feature tokens.StackVM.execute(self, formula_tokens, feat_tensor)returns a single factor tensor orNonewhen the RPN stack is invalid.MemeBacktest.evaluate(self, factors, raw_data, target_ret)converts factor logits to sigmoid signals and scores median risk-adjusted performance.AlphaEngine.__init__(self, use_lord_regularization=True, lord_decay_rate=0.001, lord_num_iterations=5)wires the loader, model, optimizer, StackVM, and backtester.AlphaEngine.train(self)writesbest_meme_strategy.jsonandtraining_history.jsonin the process working directory.
Quick route map
| User intent | Read/run | Notes |
|---|---|---|
| "What do token IDs mean?" | references/training-and-formulas.md | Includes feature/operator table and RPN examples. |
| "Does this formula execute?" | scripts/alpha_gpt_formula_smoke.py | Uses synthetic tensors; accepts token IDs or names. |
| "Why did the VM return None?" | references/troubleshooting.md | Stack underflow, bad IDs, leftover operands, and feature mismatch. |
| "How does training produce best_meme_strategy.json?" | references/training-and-formulas.md | Covers DB-backed loader, rewards, LoRD, and outputs. |
| "What are the API signatures?" | references/api-reference.md | Verified signatures and config constants. |
Verification stance
The bundled formula smoke is the default assertion-backed validation path. Full
native model_core/engine.py training is a DB-dependent, long-running candidate
and should remain skipped unless the user supplies a populated fixture database
or explicitly authorizes a training run.
04 同仓库更多 Skills
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.
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.
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.
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.
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.
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).