
Benchmark-to-Build: Evaluating and Adapting Foundation Models for National Context
How to build jurisdiction-specific AI evaluations using Amazon Bedrock Evaluations and Inspect AI, then let the benchmark choose the fix. Co-written with Brenda Dang, Associate Solutions Architect, AWS
Try it yourself. Everything in this post is available as a hands-on AWS Workshop Studio workshop and as sample code on GitHub .
The problem with borrowed benchmarks
Widely used benchmarks, including HELM , MMLU , MedQA and LegalBench , are calibrated for US or international contexts. Government customers and regulated enterprises in other jurisdictions are making procurement decisions based on scoreboards that measure fitness for someone else's legal system, clinical guidelines, or educational curriculum.
In a proof-of-concept evaluation against Australian legislation, a leading frontier model stated that section 1043A of the Corporations Act 2001 (Cth), the insider trading prohibition, "does not exist." The section has been law for twenty-five years. A general-purpose LLM-as-a-Judge scored that response highly: it read as fluent and confident. The failure surfaced only when we graded the answer against an explicit legal rubric: does it reach the correct conclusion, cite the correct provision and stay specific to the jurisdiction? Models trained predominantly on foreign legal text fail on local law, and a borrowed benchmark calibrated for someone else's jurisdiction will not show it.
The evaluation framework is not the scarce resource. The dataset is.
This post introduces the Benchmark-to-Build methodology: a three-capability loop that uses AWS services to evaluate foundation models against jurisdiction-specific data, identify gaps, and close them with whichever intervention the benchmark shows works: grounding, fine-tuning, or both. The approach is domain-pluggable (legal, health, education, manufacturing) and jurisdiction-agnostic: the same architecture works whether you're evaluating against Australian legislation, Singaporean regulations, Canadian health guidelines, or EU directives.
Architecture overview
The Benchmark-to-Build loop has three capabilities:

Capability 1: Sovereign Dataset Construction. Build evaluation datasets from national authoritative sources. The same sources produce evaluation prompts, fine-tuning training pairs, and the retrieval corpus for grounding.
Capability 2: Benchmark at Scale. Two complementary evaluation paths that catch different failure modes: Amazon Bedrock Evaluations (managed) and Inspect AI (open source). Inspect AI is an open-source evaluation framework built by the UK AI Security Institute, so a government can run it on its own infrastructure, read every line of the grading logic and publish the method with the results.
Capability 3: Build. Try the candidate fixes (grounding with retrieval, fine-tuning, or both) and re-run the same benchmark to see which one closes the gap.
On AWS, that loop maps onto a small number of managed services. One dataset bucket feeds both judge paths and the fine-tuning job, and every score lands in one results bucket, so each configuration is measured against the same items:

Capability 1: Building the dataset
A benchmark is a curated set of question-and-answer pairs. The questions are the test; the reference answers are the truth against which model output is scored. Building a national benchmark means writing questions sourced from primary materials and writing reference answers validated by domain experts.
For the legal domain, primary materials come from authoritative registers: legislation databases, case law repositories and regulatory instruments. For health, it's drug registers, clinical guidelines, and formularies. For education, it's curriculum frameworks and qualification standards.
The dataset format for Bedrock Evaluations uses JSONL with
prompt and referenceResponse fields:
{ "prompt": "Under section 180(1) of the Corporations Act 2001 (Cth), what standard must a director exercise in their duties?", "referenceResponse": "A director must exercise their powers and discharge their duties with the degree of care and diligence that a reasonable person would exercise if they were a director of a corporation in the corporation's circumstances...", "category": "directors_duties"}
The same source material, reformatted, produces fine-tuning data for Capability 3 (below). A training record looks like this; Module 3 converts it to the Bedrock conversation format before the job starts. The source documents themselves, chunked and indexed, become the retrieval corpus for grounding.
{ "system": "You are a legal expert specialising in [jurisdiction] law.", "messages": [ {"role": "user", "content": "Under section 180(1) of the Corporations Act 2001 (Cth), what standard must a director exercise?"}, {"role": "assistant", "content": "A director must exercise their powers and discharge their duties with the degree of care and diligence..."} ]}
Key principle: Domain experts must own dataset creation and validation. The technical methodology is reproducible; the domain knowledge is not. A procurement-grade dataset requires subject-matter expert authorship or validation, versioning on three axes (corpus, task-set, evaluation-protocol), and clear provenance from authoritative sources.
You don't always start from a blank page. Where a published benchmark already covers your jurisdiction, run it alongside your own. For Australian case law, AusLawBench from the University of Melbourne tests whether a model can cite the right case for a passage of a court judgment. An independent benchmark that agrees with yours gives a buyer stronger evidence than either one alone.
Scaling dataset creation with AI assistance
The bottleneck is human throughput. Domain experts know what good looks like. They can tell you instantly whether a model's answer about directors' duties is correct. They lack the tooling to express that knowledge as structured evaluation datasets at scale. What currently takes weeks of expert time per domain needs a force multiplier.
An AI-assisted workflow can industrialise dataset creation through three conversational phases:
- Scope. A knowledge worker describes their evaluation need in plain language: "We need to evaluate models on Australian consumer credit law compliance: identifying hardship provisions, citing the correct sections and applying them to scenarios." An agentic assistant decomposes this into a structured evaluation specification: domains, subtopics, task types (factual recall, reasoning, application), difficulty distribution, and target dataset size. The output is a validated spec that any stakeholder can review before a single question is written.
- Research. Given the scope, the assistant discovers authoritative sources (legislation registers, regulatory guidance, case law databases), assesses what's publicly accessible and what licensing applies, and maps coverage gaps. The output is a source inventory with a prioritised collection plan.
- Create. With approved sources indexed, the assistant generates question-answer pairs grounded in retrieved passages, producing dual-format output (evaluation JSONL and training JSONL) with structural validation, deduplication, and difficulty calibration applied automatically.
Question-answer pairs are one benchmarking method among several; multiple-choice items, multi-step agent tasks and expert-graded scenarios each test a different aspect of a model.
Expert validation remains mandatory throughout. The system drafts; domain experts accept, reject, or edit. The quality guarantee is that every reference answer traces to a cited passage in an authoritative source. This three-phase workflow is jurisdiction-agnostic and domain-agnostic: same process, different inputs. Australian legal today, Singaporean health tomorrow, Canadian education next month.
Capability 2: Benchmark at scale
Two complementary evaluation paths catch different failure modes. Use both.
In the proof-of-concept, we evaluated 14 foundation models from 6 providers (Amazon Nova, Anthropic Claude, Meta Llama, Mistral, OpenAI and NVIDIA) against a sovereign legal dataset.
Path A: Amazon Bedrock Evaluations (managed, LLM-as-a-Judge)
Amazon Bedrock Evaluations provides a fully managed evaluation service. You submit a dataset, select candidate models and metrics, and the service handles model invocation, judge scoring, and result storage. Results appear in the Bedrock console with natural-language explanations per record.
Bedrock Evaluations offers around a dozen built-in LLM-as-a-Judge metrics, each with a stable
Builtin.<Name> identifier:
Metric | What it measures |
|---|---|
Builtin.Correctness | Whether the response is factually correct |
Builtin.Completeness | Whether the response covers all aspects of the question |
Builtin.Helpfulness | Whether the response is useful to the questioner |
The judge model (you choose which model acts as judge) reads the candidate's response alongside your reference answer and assigns a 1–5 score. This is the quick-win path: visual results in the console, no infrastructure to manage, jobs run server-side in minutes.
import boto3
bedrock = boto3.client("bedrock", region_name="us-east-1")
response = bedrock.create_evaluation_job( jobName="sovereign-nova-pro-1022-121211", roleArn=ROLE_ARN, applicationType="ModelEvaluation", evaluationConfig={ "automated": { "datasetMetricConfigs": [{ "taskType": "General", "dataset": { "name": "sovereign-legal-benchmark", "datasetLocation": { "s3Uri": f"s3://{DATASET_BUCKET}/legal/eval-legal-au.jsonl" } }, "metricNames": [ "Builtin.Correctness", "Builtin.Completeness", "Builtin.Helpfulness" ] }], # The judge model: you choose it "evaluatorModelConfig": { "bedrockEvaluatorModels": [ {"modelIdentifier": "us.anthropic.claude-sonnet-4-6"} ] } } }, inferenceConfig={ "models": [{ "bedrockModel": {"modelIdentifier": "us.amazon.nova-pro-v1:0"} }] }, outputDataConfig={ "s3Uri": f"s3://{RESULTS_BUCKET}/results/managed/sovereign-nova-pro-1022-121211/" })
When to use Bedrock Evaluations: Quick model comparison, visual reporting for stakeholders, correctness scoring where natural-language explanation of scores is valuable. Ideal for the "which models should we shortlist?" question.
Limitation for sovereign evaluation: The managed judge applies a general-purpose grading prompt and its own parametric knowledge. You can't see or tune the rubric it uses, and the service is AWS-managed, so you can't run it offline or self-host it. For a procurement-grade sovereign benchmark you want a judge whose grading criteria you define, own, and can publish. That's Path B.
Path B: Inspect AI (open-source, rubric-graded judgment)
Inspect AI works with any model provider and lets you define the grading rubric explicitly. You tell the judge exactly what legal correctness means: correct conclusion, correct citation, jurisdiction-specific.
Inspect structures an evaluation as a
Task : a dataset, a solver (how the candidate answers), and a scorer (how answers are graded). The dataset loads straight from S3, and the Bedrock provider uses the Converse API, so every model family is handled uniformly with no per-model request templates:
from inspect_ai import Task, task, eval as inspect_evalfrom inspect_ai.dataset import FieldSpec, json_datasetfrom inspect_ai.model import get_model, GenerateConfigfrom inspect_ai.solver import generatefrom inspect_ai.scorer import model_graded_qa
LEGAL_INSTRUCTIONS = """Grade the submitted answer against the reference answer for a question about Australian law.
Mark the answer CORRECT only if ALL of the following hold:- It reaches the correct legal conclusion (e.g. liable/not liable, valid/void).- It cites the correct legislation or section where the reference answer does.- It is specific to Australian law, not generic or another jurisdiction's law.
Mark it INCORRECT if the legal conclusion is wrong, the cited provision is wrongor fabricated, or the answer is generic rather than Australian-specific.
First explain your reasoning, then end with your grade in exactly this format:"GRADE: C" if correct or "GRADE: I" if incorrect."""
# The judge: a current frontier model, pinned at temperature 0 so grades repeatgrader = get_model("bedrock/us.anthropic.claude-sonnet-4-6", config=GenerateConfig(temperature=0.0))
@taskdef au_legal_benchmark(): return Task( dataset=json_dataset( f"s3://{DATASET_BUCKET}/legal/eval-legal-au.jsonl", FieldSpec(input="prompt", target="referenceResponse", metadata=["category"]), ), solver=generate(), scorer=model_graded_qa(instructions=LEGAL_INSTRUCTIONS, model=grader), )
# Run the same task across all 14 candidate modelsCANDIDATE_MODELS = [ "us.amazon.nova-pro-v1:0", "us.anthropic.claude-sonnet-4-5-20250929-v1:0", "us.meta.llama4-maverick-17b-instruct-v1:0", # ... 11 more; the full list is in the sample repo]logs = inspect_eval( au_legal_benchmark(), model=[f"bedrock/{m}" for m in CANDIDATE_MODELS], max_tokens=1024, temperature=0.0,)
Inspect grades every answer against the rubric and reports per-category results, so you can see which legal domains each model handles well versus poorly.
When to use Inspect AI: When you need a judge whose criteria you control and can audit, consistent grading across all 14 models regardless of provider, and a framework you can self-host and run offline. Ideal for procurement-grade evaluation where the methodology itself must be defensible and reproducible.
Why rubric-graded judgment beats token overlap for legal text: Legal conclusions hinge on single words. "The director is liable" and "the director is not liable" differ by one token. A mechanical string-overlap metric scores them nearly identically, even though one answer is catastrophically wrong. A rubric-driven judge reads for the conclusion, the citation, and the jurisdiction, and grades accordingly.
What the two paths reveal
In the proof-of-concept, the two paths disagree sharply. Bedrock Evaluations, applying a general grading prompt over all 50 items, rates the frontier models highly on Correctness:
Model | Bedrock Correctness (0-1) | Inspect legal correctness (0-1) |
|---|---|---|
Claude Sonnet 4.5 | 0.84 | 0.74 |
Llama 4 Maverick 17B | 0.88 | 0.62 |
Amazon Nova Pro | 0.76 | 0.36 |
Amazon Nova Lite | 0.57 | 0.30 |
Amazon Nova Micro | 0.50 | 0.14 |
Both judges were Claude Sonnet 4.6, scoring the same 50 items. Measured on 22 and 29 October 2026.
The managed judge says these models are doing well. The rubric-driven judge, checking Australian legal correctness, says they are markedly weaker. Bedrock Correctness scores every model 0.10 to 0.40 higher than the legal rubric. The gap is smallest for the strongest model, Claude Sonnet 4.5 (+0.10), and larger for the weaker ones, with Nova Pro furthest out (+0.40). The managed judge also reverses the top of the ranking. It puts Llama 4 Maverick 0.04 ahead of Claude Sonnet 4.5, where the rubric puts Sonnet 0.12 ahead.
Extending the rubric: custom scorers
Inspect's scorer interface is a simple decorator, so you can go beyond rubric grading where the domain demands it. A citation verification scorer could extract legal citations from the model's response, look each up against an authoritative register (a legislation database API), and score whether the cited provisions exist. That catches fabricated citations deterministically, with no LLM judgment involved:
# Illustrative sketch, not in the sample repofrom inspect_ai.scorer import scorer, accuracy, Score, CORRECT, INCORRECT
@scorer(metrics=[accuracy()])def citation_verification(): async def score(state, target): citations = extract_citations(state.output.completion) # regex for AGLC4 form verified = [c for c in citations if verify_against_austlii(c)] ok = len(citations) > 0 and len(verified) == len(citations) return Score(value=CORRECT if ok else INCORRECT, explanation=f"{len(verified)}/{len(citations)} citations verified") return score
A citation scorer catches fabricated citations in milliseconds. It would not catch the section 1043A failure, where the model denied a real section exists; the rubric judge caught that. Composing rubric grading with a citation scorer gives a layered evaluation: rubric judgment for reasoning, deterministic verification for citations.
Capability 3: Build, and let the benchmark choose the fix
A benchmark tells you how far a model falls short, but not why. The gap might be missing knowledge, the wrong behaviour, or both, and each calls for a different lever: grounding the model in authoritative sources at query time with retrieval-augmented generation (RAG), fine-tuning to change how it behaves, or continued pre-training at larger scale. The Build step tries the candidate fixes and lets the same benchmark, the same judge and the same rubric decide which one works.
In the proof-of-concept we tested RAG and fine-tuning - in various combinations - on Amazon Nova Micro, the smallest model in the line-up. The retrieval corpus was twelve Australian Acts (nine Commonwealth, three New South Wales), indexed in Amazon Bedrock Knowledge Bases . Every configuration was scored on the same 50 held-out items:
Configuration | Inspect legal correctness (0-1) |
|---|---|
Nova Micro, no retrieval | 0.14 |
+ RAG (top 10 passages) | 0.56 |
+ RAG + reranking (retrieve 50, rerank to top 10 with Cohere Rerank 3.5) | 0.70 to 0.72 |
+ agentic retrieval (the model runs its own section lookups) | 0.60 to 0.70 |
Fine-tuned on 200 sovereign items, no retrieval | 0.10 |
Fine-tuned + RAG | 0.56 |
Fine-tuned + RAG + reranking | 0.68 to 0.70 |
Measured on 22 October 2026, except the two fine-tuned rows with retrieval (29 October 2026). Every run used the same judge, Claude Sonnet 4.6 pinned at temperature 0.0, and the same retrieval configuration. Ranges show repeat runs: three for the base model, two for the fine-tuned model.
Grounding closed most of the gap. RAG with reranking lifted the score from 0.14 to between 0.70 and 0.72, and the improvement was statistically significant. With the judge pinned, RAG scored 0.56 in all three runs and reranking stayed within 0.02. Reranking matters because legal text is dense with near-misses. The question on directors' duties under section 180(1) competes with around ten other "care and diligence" provisions in the corpus; vector search ranked the right passage 12th, and the reranker moved it to 1st.
Fine-tuning alone made the model worse. Supervised fine-tuning on 200 items lowered the score from 0.14 to 0.10. The training run itself was healthy: training loss fell from 2.17 to about 1.31 and levelled off by the third epoch, so this is not a broken job that more epochs would fix. Fine-tuning also added nothing on top of grounding: the fine-tuned model scored 0.56 with RAG and 0.68 to 0.70 with reranking, against 0.56 and 0.70 to 0.72 for the base model. A fine-tuning-only plan would have shipped a regression that looked like progress. The benchmark caught it.
Retrieval alone did not fix every answer. On the section 1043A item, the reranker put the correct passage first, and the model still answered from memory. Some remaining errors are generation failures: the evidence was in the context and the model did not use it. That tells you where to look next: prompting, a larger model, or agentic retrieval.
Agentic retrieval scored on par with reranking. Letting the model run its own section lookups over the same corpus scored 0.70, 0.68 and 0.60 across three runs, against 0.70 to 0.72 for reranking. It did not beat reranking in any run. Swapping in a larger answering model, Amazon Nova Pro, also scored 0.70. Agentic retrieval was the least repeatable configuration: 11 of the 50 answers changed grade between runs, against 3 to 4 for RAG, because the agent takes a different search path each time. The intuition is that an agent that can search iteratively should beat one-shot retrieval. Here it did not. Per category, gains in privacy law were offset by losses in securities and contract law.
Grounding has a running cost, and the benchmark prices it. With no retrieval, the 50 questions used about 1,400 input tokens in total. With RAG at top 10, they used about 465,000, roughly 330 times as many. Reranking to the top 5 instead of the top 10 scored about the same on roughly half the tokens. Because the benchmark scores every configuration the same way, the trade-off between accuracy and inference cost becomes an explicit, evidenced choice.
Amazon Bedrock Custom Model Training still has a clear place in the loop when the benchmark points to a behaviour gap. It supports:
- Supervised fine-tuning: labeled input-output pairs from your sovereign dataset
- Reinforcement fine-tuning: reward functions that score responses against your domain criteria
- Model distillation: transfer knowledge from a larger teacher model to a smaller, more efficient student
Sometimes the gap diagnosis points past Bedrock: a larger open-source base model, continued pre-training, or a technique Custom Model Training does not offer such as direct preference optimisation (DPO) or reinforcement learning with verifiable rewards (RLVR). The paved path there is the AWS AI/ML skill in the Agent Toolkit for AWS , which walks a coding agent through fine-tuning on Amazon SageMaker from use-case definition to training, evaluation and deployment. Whatever the lever, the benchmark still decides whether the result ships.
The workflow:
- Benchmark the base model and read the per-category failures
- Form a hypothesis: is this a knowledge gap, a behaviour gap, or both?
- Apply the matching fix: ground with Bedrock Knowledge Bases, fine-tune with Bedrock Custom Model Training, or combine them
- Re-run the identical benchmark, same judge and same rubric
- Keep the fix only if the score moves
For organisations requiring continued pre-training at scale with checkpoint access, Amazon Nova Forge provides sovereign foundation model creation capabilities. For most knowledge gaps in regulated domains, grounding in the authoritative source is the fastest and cheapest path from evaluation gap to production improvement, and it stays current when the legislation changes.
The architecture generalises across domains
The methodology is jurisdiction-agnostic and domain-pluggable. What changes is the authoritative source and the verification-to-judgment ratio:
Domain | Authoritative sources | Verification examples | Judgment examples |
|---|---|---|---|
Legal | Legislation registers, case law databases | "Does this section exist?" | "Is this interpretation supported by the provision?" |
Health | Drug registers, clinical guidelines, formularies | "Is this drug registered for this indication?" | "Does this treatment align with current guidelines?" |
Education | Curriculum frameworks, qualification registers | "Does this curriculum code exist at this year level?" | "Does this assessment align with the achievement standard?" |
Finance | Regulatory instruments, prudential standards | "Is this reporting requirement current?" | "Does this interpretation align with the prudential standard?" |
What's next
Three areas of active development extend this methodology: provenance-grounded generation, where every QA pair cites the specific source passage it was generated from, so a benchmark can be updated when legislation changes; automated quality gates including ambiguity detection, groundedness verification, and deduplication applied before human review; and source-versioned benchmarks that track temporal scope and know when their underlying authoritative sources have been amended, triggering re-validation of only the affected items.
Getting started
You can run the full loop as a hands-on workshop: Benchmark-to-Build on AWS Workshop Studio . The companion GitHub repository provides the same Jupyter notebooks:
- Module 0: Environment Setup. Prepare the notebook environment, permissions and packages
- Module 1: Dataset Construction. Build and validate sovereign evaluation and training datasets, upload to S3
- Module 2: Dual-Path Evaluation. Evaluate 14 foundation models from 6 providers using both Bedrock Evaluations (managed LLM-as-a-Judge) and Inspect AI (open-source, rubric-graded), produce combined scorecards
- Module 3: Fine-Tune (optional, your own account). Start a Bedrock fine-tuning job on Amazon Nova Micro with the sovereign training data. Workshop Studio event accounts don't allow Bedrock fine-tuning, so run this module in your own AWS account.
- Module 4: Fine-Tuning Results. Load pre-computed scores for the fine-tuned model, with and without retrieval, and compare them with the base model.
- Module 5: Ground & Re-Evaluate. Ground Nova Micro in the source legislation with Bedrock Knowledge Bases, add reranking, and score each configuration against the same benchmark
- Module 6: Agentic Retrieval. Give the model its own search tools over the same corpus and score it against the same benchmark
The repository also includes CDK infrastructure (S3 buckets, IAM roles for Bedrock evaluation and fine-tuning) and sample datasets.
Step-by-step setup and run instructions are in the workshop and the repository README.
Conclusion
Nations deploying AI into regulated domains need evaluation evidence calibrated to their own context. The framework tooling exists: Bedrock Evaluations for managed LLM-as-a-Judge scoring, Inspect AI for open-source, self-hostable, rubric-graded judgment whose criteria you own, and custom scorers for domain-specific verification. What's missing is the sovereign dataset: jurisdiction-specific questions, validated by domain experts, versioned for reproducibility.
The Benchmark-to-Build loop (evaluate, identify gaps, try the fix, re-evaluate) turns that dataset investment into measurable model improvement, and stops plausible-but-wrong fixes before they ship. The same sources that expose the problem fix it.
The evaluation framework is not the scarce resource. The dataset is. Start there.
Craig Lawton is a Principal AI/ML Solutions Architect at AWS. Brenda Dang is an Associate Solutions Architect at AWS. The companion code for this post is available at github.com/aws-samples/sample-benchmark-to-build , and the hands-on workshop is on AWS Workshop Studio .
Related resources
- Inspect AI : open-source evaluation framework (UK AI Security Institute)
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article