On this page

Policy

A policy is Skryba's native GRPO distribution over rewrite strategies. It decides which editing direction to ask the generator to try; it does not generate text and does not bypass the quality or detector gates.

Built-in strategies

The version-1 policy contains six ordered strategies:

  1. natural-editor
  2. plainspoken
  3. scholarly-human
  4. rhythmic
  5. specific
  6. light-touch

The default policy has equal logits, so each strategy starts at probability 1/6.

File shape

A saved policy is JSON with:

version
strategies[]             name plus editing instruction
logits[]
reference_logits[]
adam_first_moment[]
adam_second_moment[]
updates

All vectors must have the same length as strategies. Values must be finite. The current version is 1.

Lifecycle

skryba train loads a policy or starts from the uniform default. For each training example it samples a group of strategies, generates and scores their rewrites, converts detectability and quality into rewards, normalizes those rewards into advantages, and updates logits with Adam under PPO-style clipping and a KL penalty against reference_logits.

The output policy is saved after every group. Saving creates the parent directory, writes a sibling path with extension json.tmp, then renames it to the requested path. An interrupted run therefore leaves the last published JSON or, before rename, a temporary file rather than a partially written policy.

Invariants and refusals

  • unsupported policy version <n>
  • policy vectors do not match the strategy count
  • policy contains a non-finite value
  • GRPO group size must be positive
  • GRPO samples and rewards must have the same non-zero length
  • GRPO rewards must be finite
  • invalid GRPO optimization configuration

A missing file begins with reading policy <path>; malformed JSON begins with parsing policy <path>. Rewrite and benchmark never silently replace an invalid requested policy.

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