Curation sessions

A session is a raw conversation dataset that you upload. A curation has a model judge each conversation and registers the examples it keeps as a version of a training dataset.

Upload a session

To upload conversations, run the following command:

akka optimize training sessions create -f conversations.jsonl --source oasst1

The -f option is required and does not read standard input. The --source option must be oasst1, otel or canonical. Each format has one record per line:

Source Format

oasst1

The OASST1 message-trees JSONL export, one tree per line. Each prompter and assistant pair becomes a candidate, without a system prompt.

otel

The OTLP JSON logs export from an OpenTelemetry Collector file exporter, one batch per line.

canonical

Captured model calls in JSONL. Records whose provenance.complete is false are left out.

Keep the session hash printed by the command. You need it to start curation; there is no session list command.

Start a curation

To start a curation, follow these steps:

  1. Save the following request as curation.yaml, replacing SESSION_HASH with the hash from the upload.

    curationId: triage-curation-1
    sessionHashes:
      - SESSION_HASH
    source: oasst1
    threshold: 0.7
    dataset: triage/curated
    systemPrompt: "You are a concise general-purpose assistant. Answer directly and accurately, show reasoning briefly when the question calls for it, and say plainly when you do not know."
  2. Apply the request:

    akka optimize training curations apply -f curation.yaml --wait --exit-status

Use -f - to read the request from standard input. Without --wait, follow progress with akka optimize training curations wait ID.

The request accepts the following fields:

Field Meaning

curationId

Optional ID. If omitted, Optimize generates cur- followed by eight hexadecimal characters.

sessionHashes

Required list of uploaded session hashes.

source

Required source format: oasst1, otel or canonical.

lang

Language filter for oasst1 only. Defaults to en.

judgeInstruction

Optional judging instruction.

threshold

Minimum score to keep a candidate, from 0 to 1. Defaults to 0.7.

systemPrompt

Required system prompt for examples without their own system prompt.

dataset

Required registry dataset name, such as triage/curated.

In a custom judgeInstruction, keep the following sentence. Optimize does not check for it.

Respond ONLY with a JSON object of the form {"score": <number 0.0-1.0>, "ok": <true|false>}.

Starting again with the same ID and parameters reuses the curation.

Follow a curation

The phases are EXTRACTING, JUDGING, BUILDING_DATASET, WRITING_ARTIFACTS, COMPLETED and FAILED. Only JUDGING reports progress, as judged candidates out of extracted candidates.

The following example shows wait output. Your IDs and counts differ.

akka optimize training curations wait triage-curation-1 --timeout 30m --exit-status
Curation   triage-curation-1
Threshold  0.70

         Extracting
         Judging              ████████████░░░░░░░░░░░░  50%   600/1200 candidates
         Building dataset
         Writing artifacts
         Completed

Curation       triage-curation-1
Phase          Completed

Judged         1200 of 1200 extracted
Mean score     0.7412, keeping 0.70 and above
Kept           812 candidate(s)
Dataset        triage/curated:v1
Judge dataset  triage/curated-judge:v1

Press Control+C to stop watching. The curation continues.

Read the record with get. Use the whole ID, not a prefix. Keep the ID; there is no command to list curations.

akka optimize training curations get triage-curation-1 -o json

Use get -o json to read the counts, mean score, registered datasets, skip reasons, and any failure reason.

Check Unscored and Skipped before comparing mean scores. Unscored candidates do not contribute to the mean.

The JSON skips map counts candidates by reason:

Source Reasons

oasst1

deleted, lang, empty-text, unexpected-role.

otel

invalid-body, missing-uuid, duplicate, sidechain, orphan, unsupported-type, empty-input, empty-output.

canonical

aborted, no-trailer, dropped-frames, refused, body-unfinished, empty-input, empty-output.

Registered datasets

Candidates that score at or above threshold become a new version of dataset, with one chat example per line. Each example contains system, user and assistant messages. A candidate’s own system prompt takes precedence over systemPrompt.

Every scored candidate also goes into <dataset>-judge, shown as judgeDataset. Unscored candidates go into neither dataset. If no candidate is kept, no version of the training dataset is registered. Content that the registry already holds adds no version.

For evaluation of free-text answers, use a model: or http: grader. The json-label-match grader does not score prose. See Graders and rewards.

Curate inside a pipeline

A curate stage takes the same request fields. A later stage names its output as @<stage> where it names a dataset. See The curate stage.