custom-scorer-evaluation-dataset-formats.md

Created about 12 hours ago

attributes
source_pathreferences/dataset-quality/references/custom-scorer-evaluation-dataset-formats.md
source_sha256b84458eb90b16c2df1cf0183a8cc1aef015640ebb0e88b9a0fa28716eb3211c9
source_urlhttps://github.com/aws/agent-toolkit-for-aws/blob/903433d67cc4eeab334355620373f33a0c162dd4/skills/core-skills/aws-ai-ml/references/dataset-quality/references/custom-scorer-evaluation-dataset-formats.md
supporting_skill_id40202
upstream_revision903433d67cc4eeab334355620373f33a0c162dd4

Custom Scorer Evaluation Dataset Formats

Dataset format requirements for evaluation datasets used with the Custom Scorer pathway. Note that these are distinct from any requirements for training dataset formats — they are specifically for datasets scored by Prime Math, Prime Code, or a Custom Lambda during model evaluation.

Format by scorer type

Prime Math

Evaluates mathematical reasoning by comparing model output to a ground truth answer using symbolic equality.

Field Type Required Description
query string yes The math problem
response string yes The ground truth answer

Example:

{"query": "What is 15 + 27?", "response": "42"}
{"query": "What is the square root of 81?", "response": "9"}
{"query": "Solve for x: 2x + 6 = 20", "response": "7"}

Notes:

  • The scorer uses sympy for symbolic comparison and extracts answers from \boxed{}, text after "is", "=", "answer:", etc.
  • response should be just the answer value (e.g., "42"), not a full explanation. The scorer compares this against what it extracts from the model's output.

Prime Code

Evaluates code generation by executing the model's output against test cases (stdin → stdout).

Field Type Required Description
query string yes The coding problem description
response string yes Reference solution code (used for text metrics like ROUGE/BLEU)
metadata object yes Test cases: {"inputs": [...], "outputs": [...]}

Example:

{"query": "Write a program that reads an integer and prints its double.", "response": "n = int(input())\nprint(n * 2)", "metadata": {"inputs": ["5", "3", "10"], "outputs": ["10", "6", "20"]}}

Notes:

  • metadata.inputs and metadata.outputs must be string arrays of equal length.
  • The scorer extracts code from ```python ``` blocks in the model's output, then executes it with each input piped to stdin and compares stdout to the expected output.
  • The model must produce code that reads from stdin and prints to stdout.

Custom Lambda

Uses your own Lambda function to score model outputs. The dataset format depends on the model type.

Dataset for Custom Lambda — OSS models

Field Type Required Description
query string yes The prompt/input
response string yes The ground truth / expected output
system string no System prompt

Example:

{"query": "Redact PII from: John Smith lives at 123 Main St.", "response": "[PERSON: John Smith] lives at [ADDRESS: 123 Main St].", "system": "You are a PII redaction assistant."}

Dataset for Custom Lambda — Nova models

Field Type Required Description
messages array yes Conversation array with role and content (plain strings, not objects)
reference_answer string or object no Ground truth, a string or an object such as {"answer": "..."}; required only if your Lambda compares against it. The format check names a file Nova_RLVR only when it is an object (supported-formats.md), which does not matter for a Custom Lambda evaluation

Messages may include a system role (optional):

{"messages": [{"role": "system", "content": "You are a PII redaction assistant."}, {"role": "user", "content": "Redact PII from: John Smith lives at 123 Main St."}], "reference_answer": {"answer": "[PERSON: John Smith] lives at [ADDRESS: 123 Main St]."}}

Or just a user message:

{"messages": [{"role": "user", "content": "Redact PII from: John Smith lives at 123 Main St."}], "reference_answer": {"answer": "[PERSON: John Smith] lives at [ADDRESS: 123 Main St]."}}

Or a plain string as the ground truth:

{"messages": [{"role": "user", "content": "Redact PII from: John Smith lives at 123 Main St."}], "reference_answer": "[PERSON: John Smith] lives at [ADDRESS: 123 Main St]."}

Children

No children yet.

Like how this is organised?

Build your own Memory tree on knowen.md: notes, decisions and tasks in one connected markdown graph, shared with your team and your AI agents.