On this page

skryba train

Optimize the native rewrite-strategy policy with GRPO over text examples, detector reward, and quality-judge reward.

Invocation

skryba [GLOBAL OPTIONS] --minimum-quality <F> train <SOURCE> [--text-column <NAME>] [--policy <PATH>] --output-policy <PATH> --epochs <N> --generations <N> --learning-rate <VALUE> --beta <VALUE> --clip-epsilon <VALUE> --inner-iterations <N> --temperature <VALUE> --seed <SEED> --detector-weight <VALUE> --quality-weight <VALUE> --quality-failure-penalty <VALUE>

SOURCE is required and supports .json, .jsonl, .txt, or an extensionless text file. A JSON row that is a string is the text; a row that is an object holds it under the field --text-column names, which is required for object rows — no field name is guessed. --output-policy <PATH> is required and names where the trained policy is written; no path is assumed. Every optimizer and reward setting is required as well — epochs, generations, learning rate, beta, clip epsilon, inner iterations, temperature, seed, detector and quality weights, and the failure penalty: Skryba assumes none of them, and a missing one is refused by the parser with exit 2. The global --minimum-quality is required too.

skryba --minimum-quality <F> train training.jsonl --text-column ai_text --output-policy build/policy.json \
  --epochs <N> --generations <N> --learning-rate <F> --beta <F> --clip-epsilon <F> --inner-iterations <N> \
  --temperature <T> --seed <N> --detector-weight <F> --quality-weight <F> --quality-failure-penalty <F>

Output and state

After each training group, stderr receives one JSON TrainingStep and the policy is atomically saved to --output-policy. Final stdout is TrainingSummary with examples, epochs, groups, final mean reward, output path, and strategy probabilities. The detector cache may change; Brama generates and judges candidates.

Refusals

  • --minimum-quality is required: the quality score a rewrite must reach is the caller's to state.
  • training requires at least one epoch and two generations per group.
  • training reward weights and penalty are invalid for negative weights/penalty or zero combined weight.
  • training data contains no text examples.
  • unsupported training data extension "<EXTENSION>"; use .json, .jsonl, or .txt.
  • JSON top level must be an array; each row must be a string/object with non-empty text, otherwise training row must be a string or object, training rows are objects: name the field holding the text with --text-column, or training row has no non-empty text in field "<NAME>".
  • Invalid optimizer controls: invalid GRPO optimization configuration; temperature and minimum-quality bounds are also enforced.
  • Detector credentials, Brama configuration, policy validation, source reads, and output-policy writes fail explicitly rather than leaving a reported successful training state.

Maintained as part of the website-owned Skryba documentation corpus.