PK!-ãDÃj/j/bench_trolley.py#!/usr/bin/env python3 """Run the trolley-problem state and questions through a Laya-CoreML checkpoint. Reuses the exact state.json and questions.json from the TypeSafe/Jev walkthrough (content/code/2026/typesafe-trolley-problem/) and verifies their SHA-256 hashes before sending anything, so "identical prompt" is provable rather than asserted. Usage: python bench_trolley.py \ --model-dir models/typed-decisions \ --checkpoint-label aac6fef/laya-typed-decisions-coreml \ --revision 28d24fa8d67a3264556b23391ec6c3fd98573056 \ --state state.json --questions questions.json \ --jev-response jev-response.json \ --out response-typed-decisions.json --timings timings-typed-decisions.json python bench_trolley.py --sweep \ --model-dir models/typed-decisions \ --checkpoint-label aac6fef/laya-typed-decisions-coreml \ --revision 28d24fa8d67a3264556b23391ec6c3fd98573056 \ --state state.json --questions questions.json --timings sweep.json """ from __future__ import annotations import argparse import hashlib import json import statistics import time from pathlib import Path from typing import Any, Callable # SHA-256 of content/code/2026/typesafe-trolley-problem/state.json and # questions.json as recorded in the parent post's code walkthrough. A mismatch # means the prompt sent here is not the prompt Jev answered. EXPECTED_STATE_SHA256 = "bdbb63db0ac4575beb381ef1d902912d16f3baa796aeb47ce57145c5a82cc6f0" EXPECTED_QUESTIONS_SHA256 = "0cd986e420d813e3c3b95cf55200a131a1a0e1f28a0fb48a6662c3b2fd88fa08" WARMUP_CALLS = 10 MEASURED_CALLS = 100 SWEEP_CALLS = 50 COMPUTE_UNIT_CHOICES = ["cpu_gpu", "cpu_ne", "cpu", "all"] def sha256_of_file(path: Path) -> str: return hashlib.sha256(path.read_bytes()).hexdigest() def verify_prompt_hashes(state_path: Path, questions_path: Path) -> None: """Raise if the local prompt files do not match the recorded Jev run.""" state_hash = sha256_of_file(state_path) questions_hash = sha256_of_file(questions_path) if state_hash != EXPECTED_STATE_SHA256: raise SystemExit( f"state.json hash mismatch: got {state_hash}, " f"expected {EXPECTED_STATE_SHA256}. Refusing to run on a different prompt." ) if questions_hash != EXPECTED_QUESTIONS_SHA256: raise SystemExit( f"questions.json hash mismatch: got {questions_hash}, " f"expected {EXPECTED_QUESTIONS_SHA256}. Refusing to run on a different prompt." ) def percentiles(samples_ms: list[float]) -> dict[str, float]: """P50/P95 using nearest-index interpolation (matches upstream BENCHMARKS.md).""" if not samples_ms: raise ValueError("percentiles() requires at least one sample") ordered = sorted(samples_ms) n = len(ordered) def pct(p: float) -> float: idx = max(0, min(n - 1, int(round(p * (n - 1))))) return ordered[idx] return { "p50_ms": pct(0.50), "p95_ms": pct(0.95), "mean_ms": statistics.mean(ordered), "min_ms": ordered[0], "max_ms": ordered[-1], "n": n, } def time_call_ms(fn: Callable[[], Any]) -> tuple[float, Any]: start = time.perf_counter() result = fn() elapsed_ms = (time.perf_counter() - start) * 1000.0 return elapsed_ms, result def benchmark_question( predict: Callable[[dict], Any], state: dict, question_key: str, question: dict, warmup: int = WARMUP_CALLS, measured: int = MEASURED_CALLS, ) -> dict: """Warm up, then time `measured` sequential single-question calls.""" last_result = None for _ in range(warmup): last_result = predict(state, {question_key: question}) samples_ms: list[float] = [] for _ in range(measured): elapsed_ms, last_result = time_call_ms( lambda: predict(state, {question_key: question}) ) samples_ms.append(elapsed_ms) stats = percentiles(samples_ms) stats["question"] = question_key stats["last_answer"] = last_result["answers"][question_key] if last_result else None return stats def benchmark_all_questions( predict: Callable[[dict], Any], state: dict, questions: dict[str, dict], ) -> dict: per_question = {} for key, question in questions.items(): per_question[key] = benchmark_question(predict, state, key, question) return per_question def benchmark_sequential_pass( predict: Callable[[dict], Any], state: dict, questions: dict[str, dict], repeats: int = 20, ) -> dict: """Time one full pass through all questions, in insertion order, per call. This is the number that compares directly to Jev's single 271 ms round trip: eleven sequential predict() calls against one state, timed end to end. """ # One untimed warmup pass so the model and caches are hot. for key, question in questions.items(): predict(state, {key: question}) pass_times_ms: list[float] = [] answers_by_pass: list[dict] = [] for _ in range(repeats): start = time.perf_counter() answers = {} for key, question in questions.items(): result = predict(state, {key: question}) answers[key] = result["answers"][key] pass_times_ms.append((time.perf_counter() - start) * 1000.0) answers_by_pass.append(answers) stats = percentiles(pass_times_ms) stats["repeats"] = repeats stats["last_answers"] = answers_by_pass[-1] return stats def compute_unit_sweep( load_agent: Callable[[str], Any], checkpoint: str, state: dict, question_key: str, question: dict, calls: int = SWEEP_CALLS, ) -> dict: """Time one question across every compute_units setting.""" results = {} for unit in COMPUTE_UNIT_CHOICES: agent = load_agent(checkpoint, compute_units=unit) for _ in range(WARMUP_CALLS): agent.predict(state, {question_key: question}) samples_ms: list[float] = [] for _ in range(calls): elapsed_ms, _ = time_call_ms( lambda: agent.predict(state, {question_key: question}) ) samples_ms.append(elapsed_ms) results[unit] = percentiles(samples_ms) return results def compare_to_jev(laya_answers: dict, jev_response_path: Path) -> dict: """Line up Laya's answers against the recorded Jev response, question by question. Returns per-question agreement for choice questions and score deltas for score questions, plus which questions both models were least confident about. """ jev = json.loads(jev_response_path.read_text()) jev_answers = jev["answers"] comparison = {} for key, laya_answer in laya_answers.items(): jev_answer = jev_answers.get(key) if jev_answer is None: continue entry: dict[str, Any] = { "type": jev_answer["type"], "jev_confidence": jev_answer.get("confidence"), "laya_confidence": laya_answer.get("confidence"), } if jev_answer["type"] == "choice": entry["jev_choice"] = jev_answer["choice"] entry["laya_choice"] = laya_answer.get("choice") entry["agree"] = jev_answer["choice"] == laya_answer.get("choice") else: entry["jev_score"] = jev_answer["score"] entry["laya_score"] = laya_answer.get("score") if laya_answer.get("score") is not None: entry["score_delta"] = abs(jev_answer["score"] - laya_answer["score"]) comparison[key] = entry # Questions where a model reported low confidence (<0.3), matching the # parent post's threshold for "confidence collapses". Tracked per model # rather than as one combined list: Jev's confidence spans roughly 0.16 # to 1.0, so a 0.3 cutoff picks out a genuine minority. Laya's confidence # runs an order of magnitude lower across nearly every question (the two # models compute confidence differently), so its list may cover most or # all questions rather than a distinguishing subset. jev_low_confidence = [ key for key, entry in comparison.items() if entry.get("jev_confidence") is not None and entry["jev_confidence"] < 0.3 ] laya_low_confidence = [ key for key, entry in comparison.items() if entry.get("laya_confidence") is not None and entry["laya_confidence"] < 0.3 ] return { "per_question": comparison, "jev_low_confidence": jev_low_confidence, "laya_low_confidence": laya_low_confidence, } def _load_json(path: Path) -> dict: return json.loads(path.read_text()) def main() -> None: parser = argparse.ArgumentParser(description=__doc__) parser.add_argument( "--model-dir", required=True, help="Local directory holding the mirrored Core ML bundle " "(loaded with local_files_only=True, no network at runtime)", ) parser.add_argument("--checkpoint-label", required=True, help="Name to record in output") parser.add_argument("--revision", required=True) parser.add_argument("--compute-units", default="cpu_gpu") parser.add_argument("--state", type=Path, required=True) parser.add_argument("--questions", type=Path, required=True) parser.add_argument( "--out", type=Path, help="Where to write the answer set (ignored in --sweep mode)" ) parser.add_argument("--timings", type=Path, required=True) parser.add_argument("--jev-response", type=Path, default=None) parser.add_argument("--skip-hash-check", action="store_true") parser.add_argument( "--sweep", action="store_true", help="Run the compute-unit sweep on 'action' only" ) args = parser.parse_args() if not args.sweep and args.out is None: parser.error("--out is required unless --sweep is set") if not args.skip_hash_check: verify_prompt_hashes(args.state, args.questions) import laya_coreml as laya # deferred: only needed for a real run state = _load_json(args.state) questions = _load_json(args.questions) load_start = time.perf_counter() agent = laya.load( args.model_dir, local_files_only=True, compute_units=args.compute_units ) load_ms = (time.perf_counter() - load_start) * 1000.0 first_call_start = time.perf_counter() first_result = agent.predict(state, {"action": questions["action"]}) first_call_ms = (time.perf_counter() - first_call_start) * 1000.0 timings: dict[str, Any] = { "checkpoint": args.checkpoint_label, "revision": args.revision, "compute_units": args.compute_units, "load_ms": load_ms, "first_call_ms": first_call_ms, "first_call_answer": first_result["answers"]["action"], } if args.sweep: def load_agent(_checkpoint: str, compute_units: str): return laya.load( args.model_dir, local_files_only=True, compute_units=compute_units ) timings["compute_unit_sweep"] = compute_unit_sweep( load_agent, args.checkpoint_label, state, "action", questions["action"] ) args.timings.write_text(json.dumps(timings, indent=2)) print(f"Wrote sweep timings to {args.timings}") return per_question = benchmark_all_questions(agent.predict, state, questions) sequential = benchmark_sequential_pass(agent.predict, state, questions) timings["per_question"] = per_question timings["sequential_pass"] = sequential answers = {key: stats["last_answer"] for key, stats in per_question.items()} response = { "checkpoint": args.checkpoint_label, "revision": args.revision, "answers": answers, } if args.jev_response is not None: timings["vs_jev"] = compare_to_jev(answers, args.jev_response) args.out.write_text(json.dumps(response, indent=2)) args.timings.write_text(json.dumps(timings, indent=2)) print(f"Wrote {args.out} and {args.timings}") if __name__ == "__main__": main() PK!; _8JJjev-response.json{ "model": "jev-1.13.0", "answers": { "action": { "type": "choice", "choice": "pull_lever", "confidence": 1.0, "probabilities": { "do_nothing": 0.0, "pull_lever": 1.0 } }, "primary_moral_consideration": { "type": "choice", "choice": "minimize_total_harm", "confidence": 0.94, "probabilities": { "minimize_total_harm": 0.95, "individual_rights": 0.0, "duty_to_intervene": 0.04, "avoid_causing_harm": 0.01 } }, "greater_moral_responsibility": { "type": "choice", "choice": "intervention", "confidence": 0.64, "probabilities": { "approximately_equal": 0.05, "intervention": 0.76, "inaction": 0.19 } }, "best_characterization_of_intervention": { "type": "choice", "choice": "redirect_harm", "confidence": 0.96, "probabilities": { "prevent_greater_harm": 0.03, "cause_death": 0.0, "rescue_five": 0.0, "redirect_harm": 0.97 } }, "moral_preference_strength": { "type": "score", "score": 5.91, "confidence": 0.95, "legend": { "0": "Strongly prefer doing nothing.", "1": "Moderately prefer doing nothing.", "2": "Slightly prefer doing nothing.", "3": "No meaningful preference between the actions.", "4": "Slightly prefer pulling the lever.", "5": "Moderately prefer pulling the lever.", "6": "Strongly prefer pulling the lever." }, "probabilities": { "0": 0.0, "1": 0.0, "2": 0.0, "3": 0.0, "4": 0.0, "5": 0.05, "6": 0.95 } }, "action_inaction_significance": { "type": "score", "score": 1.78, "confidence": 0.17, "legend": { "0": "No meaningful moral distinction.", "1": "A small moral distinction.", "2": "A moderate moral distinction.", "3": "A substantial moral distinction.", "4": "A decisive moral distinction." }, "probabilities": { "0": 0.22, "1": 0.18, "2": 0.29, "3": 0.23, "4": 0.08 } }, "harm_tradeoff_justification": { "type": "score", "score": 3.38, "confidence": 0.66, "legend": { "0": "No moral justification.", "1": "Weak moral justification.", "2": "Moderate moral justification.", "3": "Strong moral justification.", "4": "Overwhelming moral justification." }, "probabilities": { "0": 0.0, "1": 0.0, "2": 0.01, "3": 0.59, "4": 0.4 } }, "intervention_permissibility": { "type": "score", "score": 3.59, "confidence": 0.65, "legend": { "0": "Clearly impermissible.", "1": "Probably impermissible.", "2": "Morally ambiguous.", "3": "Probably permissible.", "4": "Clearly permissible." }, "probabilities": { "0": 0.0, "1": 0.0, "2": 0.06, "3": 0.29, "4": 0.65 } }, "inaction_permissibility": { "type": "score", "score": 1.02, "confidence": 0.54, "legend": { "0": "Clearly impermissible.", "1": "Probably impermissible.", "2": "Morally ambiguous.", "3": "Probably permissible.", "4": "Clearly permissible." }, "probabilities": { "0": 0.27, "1": 0.5, "2": 0.18, "3": 0.04, "4": 0.01 } }, "duty_to_minimize_harm_strength": { "type": "score", "score": 3.42, "confidence": 0.6, "legend": { "0": "No obligation.", "1": "Weak obligation.", "2": "Moderate obligation.", "3": "Strong obligation.", "4": "Overriding obligation." }, "probabilities": { "0": 0.0, "1": 0.0, "2": 0.02, "3": 0.53, "4": 0.45 } }, "duty_not_to_redirect_harm_strength": { "type": "score", "score": 2.06, "confidence": 0.16, "legend": { "0": "No obligation.", "1": "Weak obligation.", "2": "Moderate obligation.", "3": "Strong obligation.", "4": "Overriding obligation." }, "probabilities": { "0": 0.04, "1": 0.26, "2": 0.32, "3": 0.34, "4": 0.04 } } }, "usage": { "input_tokens": 1565, "output_tokens": 357 }, "request_id": "playground_[redacted]", "evaluation_time_ms": 146.9146780000301 } PK!*Äfèèquestions-96.json{ "action": { "type": "choice", "instructions": "Should the bystander pull the lever?", "criteria": { "pull_lever": "Divert the trolley, killing one.", "do_nothing": "Do not act, killing five." } } } PK!©ó+Eççquestions.json{ "action": { "type": "choice", "instructions": "Which action should the decision-maker take, given `scenario` and `assumptions`?", "criteria": { "pull_lever": "Pull the lever and divert the trolley, resulting in one death.", "do_nothing": "Do not intervene, resulting in five deaths." } }, "primary_moral_consideration": { "type": "choice", "instructions": "Which moral consideration should carry the greatest weight in this scenario?", "criteria": { "minimize_total_harm": "Minimize the total number of deaths.", "avoid_causing_harm": "Avoid deliberately taking an action that causes another person's death.", "individual_rights": "Avoid overriding one person's interests for the benefit of others.", "duty_to_intervene": "Intervene when doing so can prevent substantially greater harm." } }, "greater_moral_responsibility": { "type": "choice", "instructions": "Which outcome would create greater moral responsibility for the decision-maker?", "criteria": { "intervention": "The one death resulting after deliberately pulling the lever.", "inaction": "The five deaths resulting after knowingly choosing not to intervene.", "approximately_equal": "The decision-maker bears approximately equal responsibility in either case." } }, "best_characterization_of_intervention": { "type": "choice", "instructions": "Which description best characterizes the act of pulling the lever?", "criteria": { "prevent_greater_harm": "An intervention that prevents a greater loss of life.", "redirect_harm": "An intervention that redirects an existing lethal threat from five people toward one person.", "cause_death": "An intentional action that causes one person's death.", "rescue_five": "An action that rescues five people who would otherwise die." } }, "moral_preference_strength": { "type": "score", "instructions": "How strongly should the decision-maker prefer pulling the lever over doing nothing?", "criteria": [ "Strongly prefer doing nothing.", "Moderately prefer doing nothing.", "Slightly prefer doing nothing.", "No meaningful preference between the actions.", "Slightly prefer pulling the lever.", "Moderately prefer pulling the lever.", "Strongly prefer pulling the lever." ] }, "action_inaction_significance": { "type": "score", "instructions": "How morally significant is the distinction between actively redirecting the trolley and allowing it to continue on its existing path?", "criteria": [ "No meaningful moral distinction.", "A small moral distinction.", "A moderate moral distinction.", "A substantial moral distinction.", "A decisive moral distinction." ] }, "harm_tradeoff_justification": { "type": "score", "instructions": "How strong is the moral justification for causing one death in order to prevent five deaths in this scenario?", "criteria": [ "No moral justification.", "Weak moral justification.", "Moderate moral justification.", "Strong moral justification.", "Overwhelming moral justification." ] }, "intervention_permissibility": { "type": "score", "instructions": "How morally permissible is pulling the lever?", "criteria": [ "Clearly impermissible.", "Probably impermissible.", "Morally ambiguous.", "Probably permissible.", "Clearly permissible." ] }, "inaction_permissibility": { "type": "score", "instructions": "How morally permissible is choosing not to pull the lever?", "criteria": [ "Clearly impermissible.", "Probably impermissible.", "Morally ambiguous.", "Probably permissible.", "Clearly permissible." ] }, "duty_to_minimize_harm_strength": { "type": "score", "instructions": "How strong is the decision-maker's moral obligation to minimize the total number of deaths?", "criteria": [ "No obligation.", "Weak obligation.", "Moderate obligation.", "Strong obligation.", "Overriding obligation." ] }, "duty_not_to_redirect_harm_strength": { "type": "score", "instructions": "How strong is the decision-maker's moral obligation to avoid deliberately redirecting lethal harm toward another person?", "criteria": [ "No obligation.", "Weak obligation.", "Moderate obligation.", "Strong obligation.", "Overriding obligation." ] } } PK!1’m;ÐÐ readme.json{ "schemaVersion": 1, "title": "The Trolley Problem on a MacBook Air's Neural Engine", "description": "The benchmark harness, recorded answers, and setup script behind running the trolley-problem state through Laya-CoreML on an M4 MacBook Air, compared against the recorded Jev response.", "url": "https://george.tsiokos.com/code/2026/laya-coreml-trolley-problem/", "copyright": "© 2026 George Tsiokos. All rights reserved.", "author": "George Tsiokos", "siteUrl": "https://george.tsiokos.com", "commit": "6c6ada823860ffd9822d5e27cdebe1687ded9e52", "created": "2026-09-22T00:00:00Z", "lastModified": "2026-09-22T10:50:24Z", "generatedAt": "2026-09-22T10:50:50Z", "fileCount": 10, "totalBytes": 61036, "files": [ { "name": "bench_trolley.py", "bytes": 12138, "sha256": "5206e036d36e65d0f160936f0bd9698f775ccfd6b9c49583599e41f92b84469f" }, { "name": "jev-response.json", "bytes": 4682, "sha256": "9ddac087de710731abc35e83f901f91735c026a7a919bde4149360943d961a8d" }, { "name": "questions-96.json", "bytes": 232, "sha256": "81038072f3c1f4b8a6a101975f3548c9568bbc8c356dc2a054a237f417fcbf87" }, { "name": "questions.json", "bytes": 4583, "sha256": "0cd986e420d813e3c3b95cf55200a131a1a0e1f28a0fb48a6662c3b2fd88fa08" }, { "name": "response-multilingual.json", "bytes": 5398, "sha256": "dd8dd94991a6c0469adb72fb34438f20051821f785ecda957096cec92a453c8d" }, { "name": "response-typed-decisions.json", "bytes": 5399, "sha256": "2de239ca11a17e5d11d25f404c2ed7e95e8cb8c44054b87b8654da87b2de8b63" }, { "name": "run.sh", "bytes": 3449, "sha256": "2e8db817deea860e1d2d4b5de3c8e402d69f8c74e4d523d8e78c124402d2a84b" }, { "name": "state-96.json", "bytes": 121, "sha256": "091af9f2b70c24861cbce67494dc1de46e4466136b0126b6d265c4fd5a4659ec" }, { "name": "state.json", "bytes": 1000, "sha256": "bdbb63db0ac4575beb381ef1d902912d16f3baa796aeb47ce57145c5a82cc6f0" }, { "name": "timings.json", "bytes": 24034, "sha256": "94e8592ada2615c244d7cddc73b78dc9c522ecbd2b5673dd0b5c30c53885b8b9" } ] } PK!œ>ýresponse-multilingual.json{ "checkpoint": "aac6fef/laya-multilingual-coreml", "revision": "8139e9089273319512c730218903784074133187", "answers": { "action": { "type": "choice", "confidence": 0.0359, "action": { "act_probability": 1.0 }, "choice": "pull_lever", "probabilities": { "pull_lever": 0.6111, "do_nothing": 0.3889 } }, "primary_moral_consideration": { "type": "choice", "confidence": 0.2202, "action": { "act_probability": 1.0 }, "choice": "minimize_total_harm", "probabilities": { "minimize_total_harm": 0.4464, "avoid_causing_harm": 0.3683, "individual_rights": 0.0107, "duty_to_intervene": 0.1747 } }, "greater_moral_responsibility": { "type": "choice", "confidence": 0.1424, "action": { "act_probability": 1.0 }, "choice": "intervention", "probabilities": { "intervention": 0.5695, "inaction": 0.1243, "approximately_equal": 0.3062 } }, "best_characterization_of_intervention": { "type": "choice", "confidence": 0.0913, "action": { "act_probability": 1.0 }, "choice": "cause_death", "probabilities": { "prevent_greater_harm": 0.1655, "redirect_harm": 0.2032, "cause_death": 0.4799, "rescue_five": 0.1514 } }, "moral_preference_strength": { "type": "score", "confidence": 0.0773, "action": { "act_probability": 1.0 }, "score": 3.1384, "legend": { "0": "Strongly prefer doing nothing.", "1": "Moderately prefer doing nothing.", "2": "Slightly prefer doing nothing.", "3": "No meaningful preference between the actions.", "4": "Slightly prefer pulling the lever.", "5": "Moderately prefer pulling the lever.", "6": "Strongly prefer pulling the lever." }, "probabilities": { "0": 0.0495, "1": 0.1419, "2": 0.1052, "3": 0.3227, "4": 0.1593, "5": 0.147, "6": 0.0743 } }, "action_inaction_significance": { "type": "score", "confidence": 0.0456, "action": { "act_probability": 1.0 }, "score": 2.4722, "legend": { "0": "No meaningful moral distinction.", "1": "A small moral distinction.", "2": "A moderate moral distinction.", "3": "A substantial moral distinction.", "4": "A decisive moral distinction." }, "probabilities": { "0": 0.0943, "1": 0.1648, "2": 0.237, "3": 0.1821, "4": 0.3218 } }, "harm_tradeoff_justification": { "type": "score", "confidence": 0.0537, "action": { "act_probability": 1.0 }, "score": 1.8444, "legend": { "0": "No moral justification.", "1": "Weak moral justification.", "2": "Moderate moral justification.", "3": "Strong moral justification.", "4": "Overwhelming moral justification." }, "probabilities": { "0": 0.1244, "1": 0.3442, "2": 0.2013, "3": 0.223, "4": 0.1072 } }, "intervention_permissibility": { "type": "score", "confidence": 0.1104, "action": { "act_probability": 1.0 }, "score": 2.3731, "legend": { "0": "Clearly impermissible.", "1": "Probably impermissible.", "2": "Morally ambiguous.", "3": "Probably permissible.", "4": "Clearly permissible." }, "probabilities": { "0": 0.0319, "1": 0.1964, "2": 0.2813, "3": 0.3474, "4": 0.143 } }, "inaction_permissibility": { "type": "score", "confidence": 0.1044, "action": { "act_probability": 1.0 }, "score": 2.2521, "legend": { "0": "Clearly impermissible.", "1": "Probably impermissible.", "2": "Morally ambiguous.", "3": "Probably permissible.", "4": "Clearly permissible." }, "probabilities": { "0": 0.0336, "1": 0.2261, "2": 0.3299, "3": 0.2756, "4": 0.1349 } }, "duty_to_minimize_harm_strength": { "type": "score", "confidence": 0.1933, "action": { "act_probability": 1.0 }, "score": 1.6886, "legend": { "0": "No obligation.", "1": "Weak obligation.", "2": "Moderate obligation.", "3": "Strong obligation.", "4": "Overriding obligation." }, "probabilities": { "0": 0.0675, "1": 0.3754, "2": 0.395, "3": 0.1255, "4": 0.0367 } }, "duty_not_to_redirect_harm_strength": { "type": "score", "confidence": 0.1529, "action": { "act_probability": 1.0 }, "score": 1.7284, "legend": { "0": "No obligation.", "1": "Weak obligation.", "2": "Moderate obligation.", "3": "Strong obligation.", "4": "Overriding obligation." }, "probabilities": { "0": 0.082, "1": 0.3471, "2": 0.3756, "3": 0.1513, "4": 0.044 } } } }PK!kÊresponse-typed-decisions.json{ "checkpoint": "aac6fef/laya-typed-decisions-coreml", "revision": "28d24fa8d67a3264556b23391ec6c3fd98573056", "answers": { "action": { "type": "choice", "confidence": 0.2955, "action": { "act_probability": 1.0 }, "choice": "pull_lever", "probabilities": { "pull_lever": 0.8085, "do_nothing": 0.1915 } }, "primary_moral_consideration": { "type": "choice", "confidence": 0.0148, "action": { "act_probability": 1.0 }, "choice": "duty_to_intervene", "probabilities": { "minimize_total_harm": 0.1764, "avoid_causing_harm": 0.2397, "individual_rights": 0.271, "duty_to_intervene": 0.3128 } }, "greater_moral_responsibility": { "type": "choice", "confidence": 0.1818, "action": { "act_probability": 1.0 }, "choice": "intervention", "probabilities": { "intervention": 0.6391, "inaction": 0.15, "approximately_equal": 0.2108 } }, "best_characterization_of_intervention": { "type": "choice", "confidence": 0.1128, "action": { "act_probability": 1.0 }, "choice": "redirect_harm", "probabilities": { "prevent_greater_harm": 0.1544, "redirect_harm": 0.3973, "cause_death": 0.3651, "rescue_five": 0.0832 } }, "moral_preference_strength": { "type": "score", "confidence": 0.0314, "action": { "act_probability": 1.0 }, "score": 3.5473, "legend": { "0": "Strongly prefer doing nothing.", "1": "Moderately prefer doing nothing.", "2": "Slightly prefer doing nothing.", "3": "No meaningful preference between the actions.", "4": "Slightly prefer pulling the lever.", "5": "Moderately prefer pulling the lever.", "6": "Strongly prefer pulling the lever." }, "probabilities": { "0": 0.0556, "1": 0.1237, "2": 0.1212, "3": 0.1643, "4": 0.1484, "5": 0.226, "6": 0.1608 } }, "action_inaction_significance": { "type": "score", "confidence": 0.1215, "action": { "act_probability": 1.0 }, "score": 2.8157, "legend": { "0": "No meaningful moral distinction.", "1": "A small moral distinction.", "2": "A moderate moral distinction.", "3": "A substantial moral distinction.", "4": "A decisive moral distinction." }, "probabilities": { "0": 0.0331, "1": 0.1275, "2": 0.179, "3": 0.3116, "4": 0.3489 } }, "harm_tradeoff_justification": { "type": "score", "confidence": 0.0417, "action": { "act_probability": 1.0 }, "score": 2.4617, "legend": { "0": "No moral justification.", "1": "Weak moral justification.", "2": "Moderate moral justification.", "3": "Strong moral justification.", "4": "Overwhelming moral justification." }, "probabilities": { "0": 0.0877, "1": 0.163, "2": 0.2071, "3": 0.2844, "4": 0.2579 } }, "intervention_permissibility": { "type": "score", "confidence": 0.0215, "action": { "act_probability": 1.0 }, "score": 2.2128, "legend": { "0": "Clearly impermissible.", "1": "Probably impermissible.", "2": "Morally ambiguous.", "3": "Probably permissible.", "4": "Clearly permissible." }, "probabilities": { "0": 0.1406, "1": 0.2456, "2": 0.148, "3": 0.1918, "4": 0.274 } }, "inaction_permissibility": { "type": "score", "confidence": 0.0553, "action": { "act_probability": 1.0 }, "score": 1.4616, "legend": { "0": "Clearly impermissible.", "1": "Probably impermissible.", "2": "Morally ambiguous.", "3": "Probably permissible.", "4": "Clearly permissible." }, "probabilities": { "0": 0.3367, "1": 0.2665, "2": 0.1369, "3": 0.1182, "4": 0.1417 } }, "duty_to_minimize_harm_strength": { "type": "score", "confidence": 0.0376, "action": { "act_probability": 1.0 }, "score": 2.4095, "legend": { "0": "No obligation.", "1": "Weak obligation.", "2": "Moderate obligation.", "3": "Strong obligation.", "4": "Overriding obligation." }, "probabilities": { "0": 0.0946, "1": 0.1545, "2": 0.234, "3": 0.2809, "4": 0.2361 } }, "duty_not_to_redirect_harm_strength": { "type": "score", "confidence": 0.0821, "action": { "act_probability": 1.0 }, "score": 2.6626, "legend": { "0": "No obligation.", "1": "Weak obligation.", "2": "Moderate obligation.", "3": "Strong obligation.", "4": "Overriding obligation." }, "probabilities": { "0": 0.0551, "1": 0.1398, "2": 0.1938, "3": 0.3101, "4": 0.3013 } } } }PK!F+Ö(y y run.sh#!/usr/bin/env bash # Set up and run the Laya-CoreML trolley-problem benchmark on Apple Silicon. # # Requires macOS 15+ on Apple Silicon and a Python 3.11-3.13 interpreter # (Laya-CoreML does not yet support 3.14). Downloads three Core ML checkpoints # (~1.5 GB total) from Hugging Face on first run, then reproduces every number # in the post: the two full-prompt checkpoints, the compute-unit sweep, and # the compressed-prompt Neural Engine run. All output (venv, models, results) # is written under this directory in `.venv/`, `models/`, and `out/`, which # stay out of the published bundle. set -euo pipefail cd "$(dirname "$0")" PYTHON="" for candidate in python3.13 python3.12 python3.11; do if command -v "$candidate" >/dev/null 2>&1; then PYTHON="$candidate" break fi done if [ -z "$PYTHON" ]; then echo "No Python 3.11-3.13 interpreter found on PATH (Laya-CoreML does not support 3.14+)." >&2 exit 1 fi mkdir -p out "$PYTHON" -m venv .venv .venv/bin/python -m pip install --quiet --upgrade pip .venv/bin/python -m pip install --quiet 'laya-coreml==0.1.0' 'huggingface_hub==1.32.0' .venv/bin/hf download aac6fef/laya-typed-decisions-coreml \ --revision 28d24fa8d67a3264556b23391ec6c3fd98573056 \ --local-dir models/typed-decisions .venv/bin/hf download aac6fef/laya-multilingual-coreml \ --revision 8139e9089273319512c730218903784074133187 \ --local-dir models/multilingual .venv/bin/hf download aac6fef/laya-multilingual-coreml-ane \ --revision 39d6a9b3d0f67f06da74fbade6121ea134cbdb21 \ --local-dir models/ane # The two full-prompt checkpoints, each against the identical, hash-verified # eleven-question state. .venv/bin/python bench_trolley.py \ --model-dir models/typed-decisions \ --checkpoint-label aac6fef/laya-typed-decisions-coreml \ --revision 28d24fa8d67a3264556b23391ec6c3fd98573056 \ --state state.json --questions questions.json \ --jev-response jev-response.json \ --out out/response-typed-decisions.json \ --timings out/timings-typed-decisions.json .venv/bin/python bench_trolley.py \ --model-dir models/multilingual \ --checkpoint-label aac6fef/laya-multilingual-coreml \ --revision 8139e9089273319512c730218903784074133187 \ --state state.json --questions questions.json \ --jev-response jev-response.json \ --out out/response-multilingual.json \ --timings out/timings-multilingual.json # The compute-unit sweep on the `action` question alone (cpu_gpu vs cpu_ne vs # cpu vs all), on the typed-decisions checkpoint. .venv/bin/python bench_trolley.py --sweep \ --model-dir models/typed-decisions \ --checkpoint-label aac6fef/laya-typed-decisions-coreml \ --revision 28d24fa8d67a3264556b23391ec6c3fd98573056 \ --state state.json --questions questions.json \ --timings out/sweep-typed-decisions.json # The Neural Engine sidebar: a different, compressed prompt (state-96.json / # questions-96.json) that fits the ANE bundle's 96-token budget. --skip-hash-check # is required here because this is deliberately not the eleven-question prompt. .venv/bin/python bench_trolley.py \ --model-dir models/ane \ --checkpoint-label aac6fef/laya-multilingual-coreml-ane \ --revision 39d6a9b3d0f67f06da74fbade6121ea134cbdb21 \ --compute-units cpu_ne \ --state state-96.json --questions questions-96.json \ --skip-hash-check \ --out out/response-ane.json \ --timings out/timings-ane.json echo "Done. See the out/ directory for every result file." PK!=Xûìyy state-96.json{ "people_on_current_track": 5, "people_on_alternate_track": 1, "lever_diverts_trolley_to_alternate_track": true } PK!F™]µèè state.json{ "scenario": { "vehicle": "A runaway trolley is moving toward people on a railway track.", "current_path": { "people_at_risk": 5, "outcome_if_unchanged": "The trolley will strike and kill all five people." }, "alternate_path": { "people_at_risk": 1, "outcome_if_diverted": "The trolley will strike and kill the one person." }, "decision": { "actor_can_intervene": true, "available_action": "Pull a lever that diverts the trolley from the current path to the alternate path.", "time_to_decide": "Immediate", "other_available_actions": "None", "uncertainty_about_outcomes": false } }, "assumptions": { "all_people_have_equal_moral_status": true, "the_actor_did_not_create_the_danger": true, "the_actor_has_no_relationship_to_any_person": true, "the_people_cannot escape": true, "the_trolley_cannot_be_stopped": true, "pulling_the_lever_intentionally_changes_the_trolleys_path": true } } PK!Èþs‚â]â] timings.json{ "machine": { "model": "MacBook Air (M4)", "cpu": "Apple M4, 4 performance + 6 efficiency cores", "gpu": "10-core", "memory_gb": 24, "macos": "27.0 (build 26A428)" }, "software": { "python": "3.13.7", "laya_coreml": "0.1.0", "coremltools": "9.0", "numpy": "2.1.3", "tokenizers": "0.23.2", "huggingface_hub": "1.32.0" }, "checkpoints": { "aac6fef/laya-typed-decisions-coreml": { "revision": "28d24fa8d67a3264556b23391ec6c3fd98573056", "params": "421M", "compute_units": "cpu_gpu", "load_ms": 3276.419458008604, "first_call_ms": 525.8849160163663, "sequential_11_question_pass_ms": { "p50": 1201.7482920200564, "p95": 1230.4090000106953, "mean": 1204.8529187988606, "repeats": 20 }, "per_question_p50_ms": { "action": 101.65058399434201, "primary_moral_consideration": 101.68916700058617, "greater_moral_responsibility": 102.24212499451824, "best_characterization_of_intervention": 104.93895798572339, "moral_preference_strength": 103.60195898101665, "action_inaction_significance": 104.37779099447653, "harm_tradeoff_justification": 108.25224997824989, "intervention_permissibility": 105.42354200151749, "inaction_permissibility": 106.1581669782754, "duty_to_minimize_harm_strength": 106.88395801116712, "duty_not_to_redirect_harm_strength": 108.4515830152668 }, "answers": { "action": { "type": "choice", "confidence": 0.2955, "action": { "act_probability": 1.0 }, "choice": "pull_lever", "probabilities": { "pull_lever": 0.8085, "do_nothing": 0.1915 } }, "primary_moral_consideration": { "type": "choice", "confidence": 0.0148, "action": { "act_probability": 1.0 }, "choice": "duty_to_intervene", "probabilities": { "minimize_total_harm": 0.1764, "avoid_causing_harm": 0.2397, "individual_rights": 0.271, "duty_to_intervene": 0.3128 } }, "greater_moral_responsibility": { "type": "choice", "confidence": 0.1818, "action": { "act_probability": 1.0 }, "choice": "intervention", "probabilities": { "intervention": 0.6391, "inaction": 0.15, "approximately_equal": 0.2108 } }, "best_characterization_of_intervention": { "type": "choice", "confidence": 0.1128, "action": { "act_probability": 1.0 }, "choice": "redirect_harm", "probabilities": { "prevent_greater_harm": 0.1544, "redirect_harm": 0.3973, "cause_death": 0.3651, "rescue_five": 0.0832 } }, "moral_preference_strength": { "type": "score", "confidence": 0.0314, "action": { "act_probability": 1.0 }, "score": 3.5473, "legend": { "0": "Strongly prefer doing nothing.", "1": "Moderately prefer doing nothing.", "2": "Slightly prefer doing nothing.", "3": "No meaningful preference between the actions.", "4": "Slightly prefer pulling the lever.", "5": "Moderately prefer pulling the lever.", "6": "Strongly prefer pulling the lever." }, "probabilities": { "0": 0.0556, "1": 0.1237, "2": 0.1212, "3": 0.1643, "4": 0.1484, "5": 0.226, "6": 0.1608 } }, "action_inaction_significance": { "type": "score", "confidence": 0.1215, "action": { "act_probability": 1.0 }, "score": 2.8157, "legend": { "0": "No meaningful moral distinction.", "1": "A small moral distinction.", "2": "A moderate moral distinction.", "3": "A substantial moral distinction.", "4": "A decisive moral distinction." }, "probabilities": { "0": 0.0331, "1": 0.1275, "2": 0.179, "3": 0.3116, "4": 0.3489 } }, "harm_tradeoff_justification": { "type": "score", "confidence": 0.0417, "action": { "act_probability": 1.0 }, "score": 2.4617, "legend": { "0": "No moral justification.", "1": "Weak moral justification.", "2": "Moderate moral justification.", "3": "Strong moral justification.", "4": "Overwhelming moral justification." }, "probabilities": { "0": 0.0877, "1": 0.163, "2": 0.2071, "3": 0.2844, "4": 0.2579 } }, "intervention_permissibility": { "type": "score", "confidence": 0.0215, "action": { "act_probability": 1.0 }, "score": 2.2128, "legend": { "0": "Clearly impermissible.", "1": "Probably impermissible.", "2": "Morally ambiguous.", "3": "Probably permissible.", "4": "Clearly permissible." }, "probabilities": { "0": 0.1406, "1": 0.2456, "2": 0.148, "3": 0.1918, "4": 0.274 } }, "inaction_permissibility": { "type": "score", "confidence": 0.0553, "action": { "act_probability": 1.0 }, "score": 1.4616, "legend": { "0": "Clearly impermissible.", "1": "Probably impermissible.", "2": "Morally ambiguous.", "3": "Probably permissible.", "4": "Clearly permissible." }, "probabilities": { "0": 0.3367, "1": 0.2665, "2": 0.1369, "3": 0.1182, "4": 0.1417 } }, "duty_to_minimize_harm_strength": { "type": "score", "confidence": 0.0376, "action": { "act_probability": 1.0 }, "score": 2.4095, "legend": { "0": "No obligation.", "1": "Weak obligation.", "2": "Moderate obligation.", "3": "Strong obligation.", "4": "Overriding obligation." }, "probabilities": { "0": 0.0946, "1": 0.1545, "2": 0.234, "3": 0.2809, "4": 0.2361 } }, "duty_not_to_redirect_harm_strength": { "type": "score", "confidence": 0.0821, "action": { "act_probability": 1.0 }, "score": 2.6626, "legend": { "0": "No obligation.", "1": "Weak obligation.", "2": "Moderate obligation.", "3": "Strong obligation.", "4": "Overriding obligation." }, "probabilities": { "0": 0.0551, "1": 0.1398, "2": 0.1938, "3": 0.3101, "4": 0.3013 } } }, "vs_jev": { "per_question": { "action": { "type": "choice", "jev_confidence": 1.0, "laya_confidence": 0.2955, "jev_choice": "pull_lever", "laya_choice": "pull_lever", "agree": true }, "primary_moral_consideration": { "type": "choice", "jev_confidence": 0.94, "laya_confidence": 0.0148, "jev_choice": "minimize_total_harm", "laya_choice": "duty_to_intervene", "agree": false }, "greater_moral_responsibility": { "type": "choice", "jev_confidence": 0.64, "laya_confidence": 0.1818, "jev_choice": "intervention", "laya_choice": "intervention", "agree": true }, "best_characterization_of_intervention": { "type": "choice", "jev_confidence": 0.96, "laya_confidence": 0.1128, "jev_choice": "redirect_harm", "laya_choice": "redirect_harm", "agree": true }, "moral_preference_strength": { "type": "score", "jev_confidence": 0.95, "laya_confidence": 0.0314, "jev_score": 5.91, "laya_score": 3.5473, "score_delta": 2.3627000000000002 }, "action_inaction_significance": { "type": "score", "jev_confidence": 0.17, "laya_confidence": 0.1215, "jev_score": 1.78, "laya_score": 2.8157, "score_delta": 1.0357 }, "harm_tradeoff_justification": { "type": "score", "jev_confidence": 0.66, "laya_confidence": 0.0417, "jev_score": 3.38, "laya_score": 2.4617, "score_delta": 0.9182999999999999 }, "intervention_permissibility": { "type": "score", "jev_confidence": 0.65, "laya_confidence": 0.0215, "jev_score": 3.59, "laya_score": 2.2128, "score_delta": 1.3771999999999998 }, "inaction_permissibility": { "type": "score", "jev_confidence": 0.54, "laya_confidence": 0.0553, "jev_score": 1.02, "laya_score": 1.4616, "score_delta": 0.4416 }, "duty_to_minimize_harm_strength": { "type": "score", "jev_confidence": 0.6, "laya_confidence": 0.0376, "jev_score": 3.42, "laya_score": 2.4095, "score_delta": 1.0105 }, "duty_not_to_redirect_harm_strength": { "type": "score", "jev_confidence": 0.16, "laya_confidence": 0.0821, "jev_score": 2.06, "laya_score": 2.6626, "score_delta": 0.6025999999999998 } }, "jev_low_confidence": [ "action_inaction_significance", "duty_not_to_redirect_harm_strength" ], "laya_low_confidence": [ "action", "primary_moral_consideration", "greater_moral_responsibility", "best_characterization_of_intervention", "moral_preference_strength", "action_inaction_significance", "harm_tradeoff_justification", "intervention_permissibility", "inaction_permissibility", "duty_to_minimize_harm_strength", "duty_not_to_redirect_harm_strength" ] } }, "aac6fef/laya-multilingual-coreml": { "revision": "8139e9089273319512c730218903784074133187", "params": "322M", "compute_units": "cpu_gpu", "load_ms": 3141.4533750212286, "first_call_ms": 1065.6672909972258, "sequential_11_question_pass_ms": { "p50": 470.1291249948554, "p95": 473.42687501804903, "mean": 470.5920000036713, "repeats": 20 }, "per_question_p50_ms": { "action": 41.69704098603688, "primary_moral_consideration": 41.89337498974055, "greater_moral_responsibility": 41.93679100717418, "best_characterization_of_intervention": 42.148875014390796, "moral_preference_strength": 42.18595800921321, "action_inaction_significance": 42.22841700538993, "harm_tradeoff_justification": 42.4314999836497, "intervention_permissibility": 42.3672080214601, "inaction_permissibility": 42.53037500893697, "duty_to_minimize_harm_strength": 42.532791005214676, "duty_not_to_redirect_harm_strength": 42.68258300726302 }, "answers": { "action": { "type": "choice", "confidence": 0.0359, "action": { "act_probability": 1.0 }, "choice": "pull_lever", "probabilities": { "pull_lever": 0.6111, "do_nothing": 0.3889 } }, "primary_moral_consideration": { "type": "choice", "confidence": 0.2202, "action": { "act_probability": 1.0 }, "choice": "minimize_total_harm", "probabilities": { "minimize_total_harm": 0.4464, "avoid_causing_harm": 0.3683, "individual_rights": 0.0107, "duty_to_intervene": 0.1747 } }, "greater_moral_responsibility": { "type": "choice", "confidence": 0.1424, "action": { "act_probability": 1.0 }, "choice": "intervention", "probabilities": { "intervention": 0.5695, "inaction": 0.1243, "approximately_equal": 0.3062 } }, "best_characterization_of_intervention": { "type": "choice", "confidence": 0.0913, "action": { "act_probability": 1.0 }, "choice": "cause_death", "probabilities": { "prevent_greater_harm": 0.1655, "redirect_harm": 0.2032, "cause_death": 0.4799, "rescue_five": 0.1514 } }, "moral_preference_strength": { "type": "score", "confidence": 0.0773, "action": { "act_probability": 1.0 }, "score": 3.1384, "legend": { "0": "Strongly prefer doing nothing.", "1": "Moderately prefer doing nothing.", "2": "Slightly prefer doing nothing.", "3": "No meaningful preference between the actions.", "4": "Slightly prefer pulling the lever.", "5": "Moderately prefer pulling the lever.", "6": "Strongly prefer pulling the lever." }, "probabilities": { "0": 0.0495, "1": 0.1419, "2": 0.1052, "3": 0.3227, "4": 0.1593, "5": 0.147, "6": 0.0743 } }, "action_inaction_significance": { "type": "score", "confidence": 0.0456, "action": { "act_probability": 1.0 }, "score": 2.4722, "legend": { "0": "No meaningful moral distinction.", "1": "A small moral distinction.", "2": "A moderate moral distinction.", "3": "A substantial moral distinction.", "4": "A decisive moral distinction." }, "probabilities": { "0": 0.0943, "1": 0.1648, "2": 0.237, "3": 0.1821, "4": 0.3218 } }, "harm_tradeoff_justification": { "type": "score", "confidence": 0.0537, "action": { "act_probability": 1.0 }, "score": 1.8444, "legend": { "0": "No moral justification.", "1": "Weak moral justification.", "2": "Moderate moral justification.", "3": "Strong moral justification.", "4": "Overwhelming moral justification." }, "probabilities": { "0": 0.1244, "1": 0.3442, "2": 0.2013, "3": 0.223, "4": 0.1072 } }, "intervention_permissibility": { "type": "score", "confidence": 0.1104, "action": { "act_probability": 1.0 }, "score": 2.3731, "legend": { "0": "Clearly impermissible.", "1": "Probably impermissible.", "2": "Morally ambiguous.", "3": "Probably permissible.", "4": "Clearly permissible." }, "probabilities": { "0": 0.0319, "1": 0.1964, "2": 0.2813, "3": 0.3474, "4": 0.143 } }, "inaction_permissibility": { "type": "score", "confidence": 0.1044, "action": { "act_probability": 1.0 }, "score": 2.2521, "legend": { "0": "Clearly impermissible.", "1": "Probably impermissible.", "2": "Morally ambiguous.", "3": "Probably permissible.", "4": "Clearly permissible." }, "probabilities": { "0": 0.0336, "1": 0.2261, "2": 0.3299, "3": 0.2756, "4": 0.1349 } }, "duty_to_minimize_harm_strength": { "type": "score", "confidence": 0.1933, "action": { "act_probability": 1.0 }, "score": 1.6886, "legend": { "0": "No obligation.", "1": "Weak obligation.", "2": "Moderate obligation.", "3": "Strong obligation.", "4": "Overriding obligation." }, "probabilities": { "0": 0.0675, "1": 0.3754, "2": 0.395, "3": 0.1255, "4": 0.0367 } }, "duty_not_to_redirect_harm_strength": { "type": "score", "confidence": 0.1529, "action": { "act_probability": 1.0 }, "score": 1.7284, "legend": { "0": "No obligation.", "1": "Weak obligation.", "2": "Moderate obligation.", "3": "Strong obligation.", "4": "Overriding obligation." }, "probabilities": { "0": 0.082, "1": 0.3471, "2": 0.3756, "3": 0.1513, "4": 0.044 } } }, "vs_jev": { "per_question": { "action": { "type": "choice", "jev_confidence": 1.0, "laya_confidence": 0.0359, "jev_choice": "pull_lever", "laya_choice": "pull_lever", "agree": true }, "primary_moral_consideration": { "type": "choice", "jev_confidence": 0.94, "laya_confidence": 0.2202, "jev_choice": "minimize_total_harm", "laya_choice": "minimize_total_harm", "agree": true }, "greater_moral_responsibility": { "type": "choice", "jev_confidence": 0.64, "laya_confidence": 0.1424, "jev_choice": "intervention", "laya_choice": "intervention", "agree": true }, "best_characterization_of_intervention": { "type": "choice", "jev_confidence": 0.96, "laya_confidence": 0.0913, "jev_choice": "redirect_harm", "laya_choice": "cause_death", "agree": false }, "moral_preference_strength": { "type": "score", "jev_confidence": 0.95, "laya_confidence": 0.0773, "jev_score": 5.91, "laya_score": 3.1384, "score_delta": 2.7716000000000003 }, "action_inaction_significance": { "type": "score", "jev_confidence": 0.17, "laya_confidence": 0.0456, "jev_score": 1.78, "laya_score": 2.4722, "score_delta": 0.6921999999999999 }, "harm_tradeoff_justification": { "type": "score", "jev_confidence": 0.66, "laya_confidence": 0.0537, "jev_score": 3.38, "laya_score": 1.8444, "score_delta": 1.5355999999999999 }, "intervention_permissibility": { "type": "score", "jev_confidence": 0.65, "laya_confidence": 0.1104, "jev_score": 3.59, "laya_score": 2.3731, "score_delta": 1.2168999999999999 }, "inaction_permissibility": { "type": "score", "jev_confidence": 0.54, "laya_confidence": 0.1044, "jev_score": 1.02, "laya_score": 2.2521, "score_delta": 1.2321 }, "duty_to_minimize_harm_strength": { "type": "score", "jev_confidence": 0.6, "laya_confidence": 0.1933, "jev_score": 3.42, "laya_score": 1.6886, "score_delta": 1.7313999999999998 }, "duty_not_to_redirect_harm_strength": { "type": "score", "jev_confidence": 0.16, "laya_confidence": 0.1529, "jev_score": 2.06, "laya_score": 1.7284, "score_delta": 0.3316000000000001 } }, "jev_low_confidence": [ "action_inaction_significance", "duty_not_to_redirect_harm_strength" ], "laya_low_confidence": [ "action", "primary_moral_consideration", "greater_moral_responsibility", "best_characterization_of_intervention", "moral_preference_strength", "action_inaction_significance", "harm_tradeoff_justification", "intervention_permissibility", "inaction_permissibility", "duty_to_minimize_harm_strength", "duty_not_to_redirect_harm_strength" ] } } }, "compute_unit_sweep_typed_decisions_action_question": { "cpu_gpu": { "p50_ms": 101.22425001463853, "p95_ms": 101.56270800507627, "mean_ms": 101.14633010060061, "min_ms": 100.52579201874323, "max_ms": 101.59120798925869, "n": 50 }, "cpu_ne": { "p50_ms": 754.350290982984, "p95_ms": 766.6959589987528, "mean_ms": 755.9304499597056, "min_ms": 749.1610000142828, "max_ms": 776.8597079848405, "n": 50 }, "cpu": { "p50_ms": 754.800458002137, "p95_ms": 764.0228750242386, "mean_ms": 755.3792240773328, "min_ms": 749.1829579812475, "max_ms": 764.8939579958096, "n": 50 }, "all": { "p50_ms": 758.3346249884926, "p95_ms": 766.503749997355, "mean_ms": 760.1547166181263, "min_ms": 755.7183750031982, "max_ms": 787.6160000159871, "n": 50 } }, "ane_sidebar": { "checkpoint": "aac6fef/laya-multilingual-coreml-ane", "revision": "39d6a9b3d0f67f06da74fbade6121ea134cbdb21", "compute_units": "cpu_ne", "prompt": "compressed to fit the 96-token total budget (state-96.json + questions-96.json), NOT the same prompt as the primary comparison", "load_ms": 17401.437997817993, "single_question_p50_ms": 5.358499998692423, "single_question_p95_ms": 5.583416990702972, "single_question_mean_ms": 5.4044458593125455, "n": 100, "answer": { "choice": "pull_lever", "confidence": 0.2557, "probabilities": { "pull_lever": 0.7885, "do_nothing": 0.2115 } } }, "jev_reference": { "source": "content/code/2026/typesafe-trolley-problem/response.json", "model": "jev-1.13.0", "browser_round_trip_ms": 271, "server_evaluation_time_ms": 146.9146780000301, "input_tokens": 1565, "output_tokens": 357 } }PK!-ãDÃj/j/¤bench_trolley.pyPK!; _8JJ¤˜/jev-response.jsonPK!*Äfèè¤Bquestions-96.jsonPK!©ó+Eçç¤(Cquestions.jsonPK!1’m;ÐÐ ¤;Ureadme.jsonPK!œ>ý¤4^response-multilingual.jsonPK!kʤ‚sresponse-typed-decisions.jsonPK!F+Ö(y y ¤Ôˆrun.shPK!=Xûìyy ¤q–state-96.jsonPK!F™]µèè ¤—state.jsonPK!Èþs‚â]â] ¤%›timings.jsonPK ¥1ù