How General-Purpose LLMs Enter AI for Science: An Engineering Path
This article breaks down how general-purpose large language models are moving into scientific research, and why the real competition is not model size but safe, reproducible integration into existing research workflows. It explains why coding agents are the foundation of research agents, outlines a four-layer reference architecture (model, agent, execution, governance) with tool contracts, and dissects a single-cell trajectory inference demo covering sparse inputs, composite pipelines, compute-dominated runtime, and traceability. It closes with practical guidance on workflow hardening, reproducibility, human checkpoints, cost control, and data security.
1. Why Research Is Becoming the New Battleground for LLMs
Over the past two years, the focus of LLM evaluation has shifted noticeably. Benchmarks centered on general question answering and text generation are being replaced by a simple question: can the model complete an end-to-end task? Two categories matter most. One is software engineering, which offers clear feedback through compilation and testing. The other is scientific research, which requires the model to advance hypotheses when data is incomplete and evaluation criteria are ambiguous.
From an engineering perspective, both tasks rely on the same underlying capability: long-horizon autonomous execution. The model must decompose a problem, write code, call external tools, read intermediate results, fix errors, and keep going. Several foundation model teams already use software engineering as a training signal to improve base reasoning and tool use, and this pattern is fairly general. What makes research different is that it raises the bar from “the code runs” to “the conclusion is explainable and the process is reproducible.”
Domestic foundation model vendors have responded to this trend relatively slowly and only recently started to invest. One shared choice stands out: most teams do not build their own labs or instruments. Instead, they take an integration path of “general-purpose model + vertical agent + existing research infrastructure.” The engineering logic is clear. The moat in research lies in data, toolchains, and domain priors, and those are held by specialized software and service providers.
2. The Prerequisite: Why Coding Ability Is the Foundation of Research Agents
Research agents may look unrelated to writing code, but their first step at runtime is almost always translating a research question into an executable computational workflow. That makes code generation and debugging an entry ticket, not a bonus.
This shows up at three levels. The first is script generation: producing code skeletons for data loading, quality control, statistical testing, and visualization based on research intent. The second is environment adaptation: research software is version-sensitive, so the model must detect dependency conflicts and provide a working installation and invocation method. The third is error recovery: when intermediate results look wrong, the model needs to read logs, locate parameter or data issues, and rerun, rather than repeating the same failed path.
A schematic execution loop can be abstracted as:
# Generic abstraction of a research agent execution loopwhile not task.done and step < max_steps:plan = model.plan(task.context) # decompose the current subgoalcode = model.write_code(plan) # generate executable coderesult = sandbox.run(code) # run in an isolated compute environmentif result.failed:task.context += summarize(result.log) # compress the log and feed it backelse:task.context += summarize(result.artifacts)task.commit(plan, code, result) # persist traceable intermediate artifacts
The key point in this pseudocode is not the model but sandbox and task.commit: the former ensures execution safety, and the latter ensures the process can be traced.
3. Reference Architecture: A Four-Layer Design for Connecting General Models to Research Pipelines
A practical design usually has four layers with clear boundaries, so each can be replaced and upgraded independently.
- Model layer: a general-purpose base model handles semantic understanding, planning, and code generation, and does not carry domain data.
- Agent layer: a vertical research agent holds the domain workflow, with built-in tools such as cell type identification, differential expression analysis, and pathway enrichment, and declares the input/output contract of each tool.
- Execution layer: provides isolated compute environments, including containerized runtimes, dependency images, dataset mounts from object storage, and task queues with concurrency control.
- Governance layer: logging, monitoring and alerting, permissions, and auditing, responsible for recording every tool call and parameter snapshot.
Tool contracts should be declared explicitly to stop the model from “guessing parameters”:
{"tool": "differential_expression","inputs": {"count_matrix": "s3://bucket/demo/matrix.mtx","group_labels": "s3://bucket/demo/meta.csv","method": "wilcoxon"},"outputs": ["deg_table", "volcano_plot"],"runtime": {"cpu": 8, "memory_gb": 32, "gpu": 0}}
On the cloud, these four layers map directly to general cloud product categories: a container platform carries the execution layer, object storage holds matrices and intermediate artifacts, a message queue handles task distribution, and the logging and monitoring stack covers the governance layer. Baidu AI Cloud provides exactly this kind of general foundation, while the model and the agent can still evolve independently.
4. Case Breakdown: The Engineering of Single-Cell Trajectory Inference
A publicly shown demo from a specialized organization is representative: for about 3,696 mouse pancreatic cells, using gene expression data from a single developmental time point only, it inferred possible cell developmental paths and screened candidate genes. The whole run took about 90 minutes and produced one inferred trajectory map and 100 candidate genes.
Breaking down the engineering, four points stand out.
First, the input is sparse. Single-time-point data lacks a time series, so trajectory inference is essentially a directional assumption built on expression similarity structure. The output must therefore be framed as an “inferred map,” not an established fact. This is a basic honesty requirement for research agents.
Second, the pipeline is composite. A typical chain includes quality control filtering, dimensionality reduction, clustering, cell type annotation, trajectory inference, and candidate gene screening. Each step has optional algorithms and parameters, and the model’s value is in proposing reasonable defaults and explaining the tradeoffs.
Third, the runtime is compute-dominated. Most of the 90 minutes goes to matrix operations and visualization rendering, while model calls take a small share. This suggests compute and storage throughput often affect the experience more than model parameter count.
Fourth, artifacts must be traceable. A candidate gene list cannot be reviewed by peers without parameter snapshots and random seed records, so artifact versioning should be on by default.
5. Implementation Advice and Risk Control
- Fix the workflow first, then add autonomy. Turning mature analysis chains into tools and letting the model orchestrate them within a limited number of steps significantly reduces unpredictability.
- Enforce reproducibility. Pinning dependency images, recording random seeds, and using content-addressed storage for intermediate artifacts are hard requirements in research.
- Add human checkpoints. Conclusion-level nodes such as hypothesis generation and candidate screening should keep human confirmation, and model outputs should be labeled with confidence and sources.
- Govern cost and quotas. Set step limits, timeouts, and budget alerts for long tasks to avoid runaway spending from automated pipelines.
- Put data security first. Research data often involves unpublished results and compliance requirements, so network isolation, key management, and audit trails need to be designed up front.
6. Conclusion
As general-purpose LLMs enter research, the competitive focus is not model parameters but whether the model can be embedded into existing research workflows safely and reproducibly. With coding ability as the foundation, vertical agents carrying domain tools, and a general cloud foundation providing compute, storage, and observability, this is currently the most pragmatic engineering paradigm. For developers, the real barrier is three fundamentals: tool contract design, execution environment isolation, and end-to-end traceability, not chasing single-point demo results.
