How AI Agents Solve Mathematical Modeling Competition Problems: A Technical Workflow

    This article presents a practical workflow for using AI agents to solve mathematical modeling competition problems. It explains why agent-based pipelines fit long, constraint-heavy problem statements, then walks through a four-layer architecture that separates problem parsing, reasoning, execution, and validation. Key stages cover dual-channel extraction of explicit constraints and implicit intent, generating minimal and testable assumptions, comparing at least two modeling routes with a fixed scoring rubric, running code in a real sandbox, auto-generating reports bound to real outputs, and enforcing quality control through automatic, cross-check, and human review gates. Engineering notes and a common-pitfalls checklist help teams build a reproducible, trustworthy agent system without faking results.

    1. Why Mathematical Modeling Is a Good Fit for AI Agents

    Mathematical modeling competition problems—such as continuous-modeling and data-analysis tracks—usually share three traits: long problem statements, many constraints, and grading criteria that emphasize the reasonableness of the solution process. The bottleneck for a human solver is rarely the ability to write code. It is more often incomplete information extraction, loose assumptions, a lack of model comparison, and results that are hard to read.

    An AI agent is well positioned to fill these gaps. In essence, an agent connects a large language model’s reasoning ability with external tools—retrieval, computation, plotting, and self-checking—to form a repeatable execution loop. Compared with a single question-and-answer turn, an agent adds three things:

    • Executable output: it does not just suggest a modeling idea; it actually runs code and produces numerical results;
    • Traceability: every assumption and every parameter change leaves intermediate artifacts behind, which makes review easier;
    • Iteration: when results violate common sense (for example, a negative probability or an out-of-range forecast), it can automatically go back to the previous step and revise.

    2. Overall Architecture: A Four-Layer Separation of Concerns

    For a usable modeling agent, a four-layer, loosely coupled design is recommended instead of cramming all logic into one extremely long prompt.

    Layer Responsibility Key Output
    Understanding Segment the problem statement; extract variables and constraints Structured problem card
    Reasoning Generate assumptions, select models, compare options Modeling proposal
    Execution Generate and run code, process data, draw charts Numerical results and figures
    Validation Check dimensions, bounds, and stability; write the report Final paper draft

    The value of this separation is context isolation. A full problem statement can easily run to tens of thousands of words. If it is mixed with code output in the same context, the model’s attention is diluted and it tends to “forget constraints.” Compressing the problem into a structured card before passing it downstream can noticeably reduce hallucination.

    A problem card can use a simple structured format:

    1. {
    2. "problem_id": "A",
    3. "goal": "Describe and predict the state evolution of a class of systems",
    4. "decision_vars": ["x1(t)", "x2(t)"],
    5. "constraints": ["conservation of total quantity", "non-negativity", "boundary conditions"],
    6. "data_given": ["time-series samples", "parameter ranges"],
    7. "deliverables": ["model derivation", "parameter calibration", "sensitivity analysis"]
    8. }

    3. Key Stage 1: Problem Parsing and Assumption Generation

    The most common parsing error is mistaking descriptive statements for hard constraints. In practice, a “dual-channel extraction” approach works well: one channel extracts explicit constraints (numbers, intervals, equalities), while the other extracts implicit intent (optimization direction, fairness requirements). The two sets of results are cross-checked, and conflicting items are either raised explicitly by the model as questions or flagged as assumptions pending confirmation.

    Assumption generation should follow a “minimal and testable” principle. Every assumption should answer two questions: What does it simplify? At which step will it be verified? For example, the assumption “ignore higher-order nonlinear terms” should come with an error bound in the sensitivity analysis section, rather than serving only as a throwaway disclaimer.

    4. Key Stage 2: Model Selection and Multi-Option Comparison

    A mature practice is not to let the model simply “guess” one model, but to require it to produce at least two technical routes with a rationale for the choice. For continuous-modeling problems, common routes include differential-equation modeling, state-space and grey-system approaches, and data-driven regression or time-series forecasting. For data-analysis problems, common routes include clustering, correlation screening combined with regression, and optimization-based layout.

    The comparison dimensions should be fixed at five: assumption strength, data availability, solution complexity, interpretability, and robustness. The agent can output a comparison table and then score the options by weight to pick a winner. This step substantially strengthens the “model development” section of the paper, because reviewers care about the selection logic rather than the conclusion itself.

    5. Key Stage 3: Code Execution and Numerical Solving

    The execution layer must be built on a real sandbox; otherwise, so-called “solving” is just a text performance. The recommended minimal capability set is: data processing, numerical computation, optimization, statistical testing, and charting. Three engineering points matter:

    1. Pin dependencies: pre-install a stable version of the scientific computing stack in the image so dependencies do not have to be resolved on every run;
    2. Set timeouts and resource limits: enforce a per-run time limit and memory cap to prevent infinite loops from bringing down the whole pipeline;
    3. Persist artifacts: write data, intermediate results, and figures uniformly to object storage or a local working directory to form a traceable chain.

    A schematic execution loop looks like this:

    1. def solve_once(plan, sandbox, max_retry=3):
    2. for attempt in range(max_retry):
    3. result = sandbox.run(plan.code, timeout=120)
    4. if result.exit_code == 0 and validate(result):
    5. return result
    6. plan = plan.revise(result.stderr) # revise based on errors and validation feedback
    7. raise RuntimeError("No convergence; human intervention required")

    The validate step here is often overlooked but extremely important. It is responsible for checks on dimensional consistency, value ranges, conservation relationships, and numerical stability.

    6. Key Stage 4: Automatic Report Generation with Text and Figures

    The review experience depends heavily on presentation quality. The agent should bind “results—figures—conclusions” together: every figure must be produced from real data and explicitly referenced and interpreted in the body text. Image-generation capabilities are suitable for flow diagrams and conceptual illustrations, but must not be used to fabricate data curves—this is the bottom line of academic integrity.

    The report structure should be fixed as follows: problem restatement, assumptions and notation, model development, solution algorithm, results analysis, sensitivity and robustness checks, and model evaluation and extension. A fixed template reduces omissions and makes version differences clearer across iterations.

    7. Key Stage 5: Quality Control and Human Review

    Agent output should not go straight to submission. Three gates are recommended:

    • Automatic gate: code is reproducible, figures match the numbers, units and bounds pass;
    • Cross-check gate: rerun with a different reasoning configuration or a different random seed and compare whether the conclusions remain stable;
    • Human gate: team members review assumption reasonableness and paper wording, especially whether the claimed innovations are overstated.

    8. Engineering Deployment and General Cloud Capabilities

    To upgrade this workflow from a personal script to a service usable by a team, you typically only need to combine general cloud capabilities: a container platform to host the sandbox and task scheduling, object storage to hold problem statements, code, and figure artifacts, a message queue to smooth out spikes and chain long-running tasks, and logging plus monitoring and alerting to track failure rates and latency. On the model side, a multi-model strategy works well—use a more capable model for reasoning-intensive steps and a lightweight model for format conversion and summarization to control cost. Baidu AI Cloud offers corresponding capabilities across these general categories, and they can be combined as needed to build the full pipeline without binding to proprietary interfaces.

    9. Common Pitfalls Checklist

    1. Stuffing the full problem statement into the context, causing constraint forgetting;
    2. Lacking real execution, with results “made up” from invented numbers;
    3. Using only a single model, without comparison or ablation;
    4. Making sensitivity analysis a formality, without giving error ranges;
    5. Figures inconsistent with the conclusions in the body text;
    6. Ignoring reproducibility by failing to fix random seeds and dependency versions.

    10. Conclusion

    The core strength of using agents to solve mathematical modeling competition problems lies not in “how strong the model is,” but in whether the workflow forms a closed loop, whether validation is strict, and whether outputs are reproducible. By separating the four layers—understanding, reasoning, execution, and validation—and adding a sandbox plus three quality gates, an agent can reliably produce well-structured, credible competition materials, freeing the team’s energy for the modeling creativity and paper polishing that truly require human judgment.