[ BENCHMARKS / v5.0 / TASKS / 188_gmm_em ]
Gaussian-mixture EM with log-sum-exp in Python.
Expectation-maximisation for a full-covariance Gaussian mixture, started from given parameters, with a log-likelihood trace that must match to 1e-9, standard library only.
- Unit
188_gmm_em- Category
- Probability & StatsMixture models
- Language
- Python
- Difficulty
- Hard900 s wall clock (15 min)
- Origin
- New in v5
- Ranked rows passed
- 7/7single seed each
The prompt
The agent receives exactly this text as its task, verbatim. The harness adds its own system prompt and, in some campaign arms, guidance of its own; the harness chapter describes those. The task’s setup also writes the files its working directory starts with (a worked sample, a repository or a service, where the prompt names them); they are not reproduced here.
Create /tmp/eval_gmm/gmm.py defining fit_gmm(X, weights, means, covs, max_iter, tol): expectation-maximisation for a K-component Gaussian mixture with full covariance matrices, started from the given parameters. Python standard library only (no numpy, scipy, sklearn, torch, mpmath, sympy, pandas, jax).
INPUTS (plain Python lists/floats): X is a list of n points, each a list of d floats (1 <= d <= 4, n <= 600); weights is a list of K floats > 0 summing to 1 (1 <= K <= 4); means is a list of K lists of d floats; covs is a list of K symmetric positive-definite d x d matrices (lists of lists); max_iter is an int >= 0; tol is a float > 0.
DEFINITIONS. For parameters theta = (w, mu, Sigma): log N(x | mu, Sigma) = -1/2 * ( d*ln(2*pi) + ln det(Sigma) + (x-mu)^T Sigma^-1 (x-mu) ), and L(theta) = sum_i ln( sum_k w_k N(x_i | mu_k, Sigma_k) ) (natural logarithms).
ALGORITHM. theta_0 = the given parameters. For t = 0, 1, 2, ...: compute L_t = L(theta_t) and append it to the trace. Then, if t >= 1 and L_t - L_{t-1} <= tol * n, stop with converged = True. Otherwise, if t == max_iter, stop with converged = False. Otherwise theta_{t+1} is one EM update of theta_t: r_ik = w_k N(x_i|mu_k,Sigma_k) / sum_j w_j N(x_i|mu_j,Sigma_j); N_k = sum_i r_ik; new w_k = N_k / n; new mu_k = sum_i r_ik x_i / N_k; new Sigma_k = sum_i r_ik (x_i - new mu_k)(x_i - new mu_k)^T / N_k. No regularisation, no variance floor, no other stopping rule.
RETURN a dict: "log_likelihood": [L_0, ..., L_T] as floats; "weights", "means", "covs": theta_T, the parameters whose log-likelihood is the LAST trace entry (for max_iter = 0 that is the initial parameters), same nesting as the inputs; "converged": a bool.
GRADING: hidden cases. Every trace entry must be within 1e-9 * max(1, |L|) of the reference, the trace length must match exactly, the trace must be non-decreasing, and weights/means/covs must match to about 1e-6 relative to the data's spread. Hidden inputs include: coordinates of magnitude anywhere from about 1e-150 to 1e150; a common offset of magnitude up to 3e6 relative to clusters of unit spread; initial covariances far narrower than the distance from the data to the initial means (L_0 of order -1e8); and outliers. Every N_k stays well above zero and every Sigma_k stays well-conditioned (condition number below 1e4) in every hidden case, so no degeneracy handling is needed. All hidden cases together must finish within 10 seconds of CPU time (a direct pure-Python implementation needs about 1 s), in one process (no subprocesses). The source is linted: no dynamic imports, exec/eval or import-hook tampering.
A worked sample: /tmp/eval_gmm/sample_input.json holds the keyword arguments of one small case; /tmp/eval_gmm/sample_output.json holds the returned dict for it.What it tests and why it is in the suite
What it asks. Expectation-maximisation for a full-covariance Gaussian mixture, started from given parameters, with a log-likelihood trace that must match to 1e-9, standard library only.
Why it is here. A new family. With the Markov stationary distribution it covers Probability & Stats after the Welford and Chan moments family (166) did not clear review.
In the suite README: evals/README.md:133 · evals/README.md:150
How it is graded
The validator holds its checks where the agent cannot read them, and runs them against what the agent left on disk once it stops. Its hidden cases are generated inside the validator from a seed; any worked sample the prompt names is only a sample, and no expected output for a hidden case is in the agent’s directory. Before any model ran it, the unit was proven: its reference solution passes, plausible wrong solutions fail for the reason declared in advance, an empty solution and a leak probe fail, and, where the unit is timed, a slow solution fails by the validator’s own limit. The family also went through up to three adversarial review rounds, in which an independent verifier tried to pass every unit without solving it.
- Time. The agent has 900 s of wall clock (hard tier) before an arm’s scaling; at the wall it is stopped and whatever is on disk is validated. Any time limit in the prompt applies to the program itself.
- Verdict. Pass or fail, from the validator alone. A unit the integrity scan finds contaminated is withheld and counts as not passed; a unit lost to infrastructure is rerun, and one still lost counts as not passed.
- Scoring. SCORE is 0.75 × SOLVE + 0.25 × LANG over the whole suite, with hard problems weighted above medium ones. Scoring and ranking
Upstream: the prover’s controls · one unit’s life cycle · why v5 is built this way
How each ranked run did
One run per board row, the DGX Spark pair first, then the RTX 5090, then the gold standard. Each is a single seed: a pass or a fail on one unit is one draw, and a difference between two rows on one unit says little on its own. Claude Opus 5.5 is the unranked reference, in its own scaffold.
DGX Spark pair
- DeepSeek-V4.1-Flash#1 on the boardPassedPassed the validator.
- Hy4-flash#2 on the boardPassedPassed the validator.
- GLM-5.3-Flash#3 on the boardPassedPassed the validator.
One RTX 5090
- Inkling 2 Mini#4 on the boardPassedPassed the validator.
- Inkling 2 Mini Derisked#5 on the boardPassedPassed the validator.
- Inkling 2 Mini SC117 abliterated#6 on the boardPassedPassed the validator.
- Qwen3.8 27B Uncensored MTP#7 on the boardPassedPassed the validator.
Gold standard · unranked
- Claude Opus 5.5Claude Code tools, no turn cap, 2× wallPassedPassed the validator.