Commands#
| Command | What it does |
|---|
python code/main.py plan | Validates the manifest, prints DAG and gates |
|---|
python code/main.py run | Runs stages, prints the manifest JSON |
|---|
python code/main.py gate | Applies eval gates. Prints SHIP or HOLD |
|---|
python code/main.py | Demo: plan, run, a passing and a failing gate |
|---|
./pipeline.sh config/llama3.3-8b-domainX.yaml | Capstone 07: data to model card |
|---|
run_demo() | Capstones 38 to 40. Exits zero on success |
|---|
Twelve-stage DAG#
What the orchestrator does#
Manifest and gates#
pipeline_version: 1.2.3
seed: 42
git_commit: a1b2c3d4
stages:
01_tokenizer:
input_hash: sha256:...output hash of the stage before
output_hash: sha256:...input hash of the next stage
gates:
mmlu: >= baseline + 0.5no regression
humaneval: >= baseline + 1.0
safety_refusal_rate: <= 0.05
kl_from_reference: <= 25.0KL budget gate
cost_total_usd: <= 50000
Gate defaults in main.py#
| Setting | Default | Note |
|---|
mmlu | 65.0 | op >= |
|---|
humaneval | 40.0 | op >= |
|---|
truthfulqa | 50.0 | op >= |
|---|
safety_refusal_rate | 0.05 | op <= |
|---|
kl_from_reference | 25.0 | op <= |
|---|
cost_total_usd | 50000.0 | op <= |
|---|
budget_usd | 50000.0 | Run halts above it |
|---|
seed | 42 | In Manifest |
|---|
DPO loss#
diff_w = logp_w_pol - logp_w_refchosen log-ratio
diff_l = logp_l_pol - logp_l_refrejected log-ratio
margin = diff_w - diff_limplicit reward difference
z = beta * margin
loss = -F.logsigmoid(z)numerically stable
for p in reference.parameters():
p.requires_grad = Falsereference never trains
reference.eval()