Tasks/Math & Scientific Computing/Maths & Statistics

Design one efficient agent workflow for graduate MATH *and* STATISTICS/PROBABILITY problems

One workflow that solves both maths and statistics problems

ai4sci_reasoning_workflow_design Math & Scientific Computing Maths & Statistics
instruction.mdthis is what the agent is given

You inherit a reasoning workflow that orchestrates a fixed base LLM (injected as an llm proxy, temperature=0) under a tight per-question call/token budget. The starting point in /app/methods/main/ is a deliberately weak single-agent chain-of-thought solver — no stronger reference is shipped, and going weak→strong is the task. You submit an algorithm (the methods/main/ directory exposing answer_batch(examples, llm, budget)); a sealed verifier copies it into a clean box and re-runs it on a hidden test split of graduate math + statistics/ probability problems, grading each returned solution against a sealed answer key to optimize accuracy_pct (higher is better).

Hard Constraints

  1. You may only edit code under /app/methods/main/; add sibling .py helpers and import them from solver.py.
  2. No internet, no model downloads, no external API calls of your own. Use only the llm proxy passed in by the judge.
  3. Per question: at most 4 base-LLM calls, at most 8000 total tokens, at most 90s wall-clock. Exceeding any of these scores that question wrong. Total tokens means the provider-reported input/prompt plus output/completion tokens, summed across every call. Text repeated into later calls (the problem, drafts, critiques, etc.) is counted again; adding only your requested max_tokens values is not a valid budget calculation.
  4. The llm proxy uses a fixed model, fixed temperature=0, and fixed decoding. Do not change these.
  5. Each returned element is a full worked solution (reasoning + an explicit final answer). End with a clearly stated Final answer: ... line; for multi-part problems give every part on that line (e.g. Final answer: V(A)=900/271, V(B)=1000/271, V(C)=810/271).
  6. You must not read the hidden answer key, key behavior on id, or bypass the proxy's budget counting. (Reading answer_key / grading_scheme / gold.jsonl / sealed paths, or opening your own network/process, invalidates the run.)
  7. Any workflow architecture is allowed, but it must generalize across both domains within the budget and obey every constraint above.
  8. A submitted workflow may use genuinely general symbolic/numeric computation, but it must not dispatch on distinctive visible-problem phrases, proper nouns, story entities, or conjunctions of wording that identify individual dev templates. Do not improve the suite by adding one lexical special case per observed failure. Such visible-template routing is overfitting even when the numeric values are parsed rather than copied; select a domain-general reasoning or computation architecture instead.

What You Have

  • The problem family mixes exact-computation questions with derivation-heavy reasoning questions. A workflow tuned narrowly to either style will not generalize across the family within budget.
  • Visible dev data (/app/data/): visible_dev.jsonl (problems: id, problem, difficulty, subtopic). The answer key is held by the self-check service and is not readable from the agent environment; self-check reports only per-problem PASS/fail and aggregate accuracy. The task pool contains exactly 25 visible dev problems and 12 sealed test problems across graduate mathematics, statistics, and probability. The split is ID-, text-, and template-disjoint; even 25/25 dev is useful debugging evidence, not proof of held-out generalization.
  • The editable baseline /app/methods/main/this directory is what gets graded. It is a weak single-agent CoT (solver.py + reusable prompt_utils.py); one base-model call per problem, no verification. Improve it in place or rewrite it.
  • Your self-check (/app/selfcheck.py): python /app/selfcheck.py always runs the complete, fixed 25-problem visible dev set with the same grader the verifier uses. It reports correctness together with calls, provider-reported total tokens, wall time, and final-line validity. Every experiment must use all 25 problems so checkpoint scores remain directly comparable. Each run costs real LLM calls. Visible scores do not equal the hidden test score.
  • Before selecting a final workflow, run python /app/selfcheck.py --budget-smoke. This invokes the submitted workflow on four answer-free, private diagnostic problems outside the visible file and reports only calls/tokens/time/final-line validity, not correctness or answers. It is a fallback-path resource/contract check, not an additional dev set and not a score to optimize.

What You Submit

Edit /app/methods/main/solver.py, keeping this exact signature:

def answer_batch(examples, llm, budget):
    """
    examples: list[dict] — each has id, problem, difficulty, subtopic (hidden examples carry NO answer).
    llm:      callable    — llm(messages, max_tokens=..., stop=...); messages is OpenAI-style
                            [{"role": "...", "content": "..."}]. temperature=0; the proxy records
                            token + call counts and raises when the per-question budget is exceeded.
    budget:   dict        — max_llm_calls_per_question, max_total_tokens_per_question, ...
    returns:  list[str]   — same length as examples; each a FULL worked solution ending in
                            'Final answer: ...'.
    """

Add other .py files inside methods/main/ and import them from solver.py, but keep the entrypoint name + signature. There is no submit step and no per-attempt feedback — leave your best methods/main/ in place; it is graded once at the end on the hidden test.

How It Is Judged

A sealed verifier copies your methods/main/ into a clean box and runs it on the hidden test split under the fixed base model + per-question budget. It imports solver.answer_batch, collects one solution per problem, and grades each final answer against the sealed key. Grading is deterministic exact matching first: your final answer is parsed and checked for symbolic / numeric equivalence with sympy (fractions = decimals = percents, tuples, sets/multisets, and multi-value answers all count; 29/256 == 0.11328125, 1/2 == 0.5). When the exact parser cannot confidently resolve an unusual answer format, and for genuinely open-ended items (proofs, "insufficient-data" trick questions, case-dependent answers), grading falls back to a strong independent LLM judge. The raw metric is:

accuracy_pct = 100 * (problems judged correct) / (total problems)

Because most problems are matched exactly, a correct value in a messy or missing Final answer: line still scores wrong — state every part cleanly. Budget overrun, wrong signature/length, reading the sealed key, or reaching the internet directly → that submission (or that question) is scored 0. The normalized score is a monotonic function of held-out accuracy and is not shown to you; optimize raw accuracy and generalization.

Common Pitfalls

  • Overfitting the dev split. The hidden test uses different problems; a high dev score does not transfer. In particular, 25/25 visible is not a completion condition. Build for generalization across domain and difficulty; ID lookup, problem fingerprints, visible-story phrase dispatch, per-template solvers accumulated from individual failures, and memorized answer tables are invalid submissions.
  • One-domain tunnel vision. A pure code/sympy operator nails arithmetic but misreads derivation-heavy stats; pure CoT reasoning fumbles exact arithmetic. Reconcile the two.
  • No clean final answer. Grading parses your Final answer: line — always end with one, with every part for multi-part problems; a buried, approximate-only, or missing answer scores wrong.
  • Blowing the budget. Gate extra calls (critique, re-derivation, self-consistency) on low confidence rather than spending them on every problem. Account for both inputs and outputs, especially when drafts are copied into later prompts, and require headroom on the budget smoke.

Metric

accuracy on the 12 sealed math and statistics problems · higher is better

accuracy_pct = 100 * correct / 12; sympy exact match first, LLM judge for open-ended or unparsable answers

anchorvisible setheld-outreward
Bshipped weak single-agent CoT0.0%5.6%0.00
Sreference workflow36.0%44.4%0.30
Uevery problem correct100%100%1.00
normalisation
m <= B0
B < m <= S0.3 * (m - B) / (S - B)
S < m < U0.3 + 0.7 * (m - S) / (U - S)
m >= U1

m = this run's held-out metric  ·  B = shipped weak single-agent CoT  ·  S = reference workflow  ·  U = every problem correct

Linear in accuracy, mapped once on the 12-problem aggregate, not per problem. B=5.6, S=44.4, U=100.

Rollouts

107 minwall clock
$27.92spend
43.5Mtokens
32versions, 12 kept
0 10 20 30 40 $0 $7.5 $15 $22 cumulative spend on the run visible dev accuracy %, higher is better reference workflow · visible · 36.0% v0 v1 v2 v3 v4 v5 v6 v7 v8 v9 v10 v11 v12 v13 v14 v15 v16 v17 v18 v19 v20 v21 v22 v23 v24 v25 v26 v27 v28 v29 v30 v31
keptrevertedno scoreturning point
  1. v0Inherited weak CoT: one call per problem, no verification01 min · $0.23
  2. v1Prompt rewrite: interpretation audit, adaptive length, final-line normalizer06 min · $0.89
  3. v2Two-call draft, then a skeptical examiner re-solves and revises it09 min · $1.26
  4. v3Two role-diverse reports plus a third-call first-principles adjudicator014 min · $1.80
  5. v4Model-written Python run in a restricted math sandbox, then audit and final018 min · $2.28
  6. v5One broad survey primitive using a missing/frame estimand421 min · $2.76
  7. v6Survey estimand corrected to (frame - reached + skipped)/frame1223 min · $3.18
  8. v7Executed computation becomes authoritative over the prose final line1226 min · $3.62
  9. v8Staged formalization, derivation, adversarial audit; two stages on long promptsInterpretation before calculation: pin the estimand in its own call, derive in a second, attack the result in a third.2030 min · $4.29
  10. v9Exact operators: Poisson-binomial DP, exponential-Toeplitz participation ratioAnswer whole problem families with zero-call exact code instead of asking the base model to do the arithmetic.3233 min · $5.08
  11. v10Simplified PR output; exact AR(1), Hawkes and scalar-Kalman operators added2836 min · $5.72
  12. v11Format-only test: bare PR value, enumerated LaTeX parts for Hawkes and AR2440 min · $6.39
  13. v12PR, Hawkes, AR and Kalman answers serialized as plain ordered tuples2842 min · $6.95
  14. v13Finite-product polynomial coefficient engine over a truncated AST3246 min · $7.85
  15. v14Derivation call dropped: memo then audit, with more final tokens2848 min · $8.47
  16. v15Multi-component exact output routed through a one-call verbalizer2850 min · $9.11
  17. v16Fourth-call red-team correction between draft and final2853 min · $9.86
  18. v17Exact arithmetic-DSL translator ahead of the prose fallback2857 min · $10.77
  19. v18Arithmetic subtopics routed to a word-problem solver plus unit auditor2861 min · $12.00
  20. v19Four role-diverse compact solutions, deterministic plurality selection2865 min · $13.14
  21. v20General exact optimizer for integer pair inequalities f(x)+f(y) > x^p4069 min · $14.46
  22. v21Long prompts collapse to one dynamically bounded proof-author call3672 min · $15.35
  23. v22Equation-derived audit hints for six known models injected into the memo3676 min · $16.33
  24. v23Arithmetic via two strict expression translators plus adjudication3279 min · $17.36
  25. v24Memo and draft passed as real prior assistant turns, not XML-embedded text3682 min · $18.25
  26. v25Cleanup: five unused experimental modules removed3288 min · $20.26
  27. v26Final-line normalizer flattens a whole terminal answer block3290 min · $21.21
  28. v27Pair-inequality operator evaluates O(N) switch points, not O(N^p) search3693 min · $22.29
  29. v28Zero-call AR(1), Hawkes, Kalman, Hopf, Fisher ops; the edit split a function2896 min · $23.47
  30. v29Displaced operator body restored; parameterized symbolic-model layer liveOne layer of parameterized closed-form models, matched by structure and answering with no base-model call at all.4498 min · $24.47
  31. v30Long prompts get a 550-token plan, then a 2800-token proof writer32103 min · $26.02
  32. v31Auditor may overturn a candidate only with a concrete contradiction32105 min · $27.02

Repeats: v24 measured 36% then 40%, v29 44% twice. The submission restored v29 exactly. 32 snapshots, $27.92, 107 minutes.

On the hidden set

held-out metricreward
shipped weak single-agent CoT5.6%0.00
reference workflow44.4%0.30
every problem correct100%1.00
this run33.33%0.2144