How General-Purpose LLMs Enter AI for Science: A Layered Architecture with Professional Tools
This article explains why general-purpose large language models are entering scientific research by integrating with existing professional toolchains rather than replacing them. It breaks down a three-layer architecture (interaction, orchestration, and execution), lists the core components of a practical research agent system, and walks through a single-cell expression case study for trajectory inference. It also covers engineering best practices for reproducibility, cost control, failure recovery, compliance, and evaluation, showing developers how to move AI for Science from demos to production.
1. Why Scientific Workflows Need “General Models + Specialized Tools”
The mainstream way general-purpose LLMs enter scientific research is not by replacing specialized software outright. Instead, they partner with organizations that already have mature toolchains and domain customers, embedding the model into existing workflows.
The reason is that scientific computing demands a high degree of verifiability. A model can interpret intent, orchestrate steps, and generate code, but the final numerical results must come from validated professional tools.
This has led to a repeatedly validated deployment pattern that can be abstracted into three layers:
- Interaction layer: natural language Q&A, research question clarification, and result explanation;
- Orchestration layer (agent): task decomposition, code generation, tool selection, and retry on failure;
- Execution layer: specialized computing tools + isolated compute environments + data and artifact storage.
The value of this separation is a clear boundary of responsibility: the model’s uncertainty is confined to the orchestration layer, while the determinism and reproducibility of the execution layer are preserved.
2. Reference Architecture and Key Components
A practical research agent system typically includes the following common components:
- Tool registration and description: each specialized tool is described with unified metadata covering inputs, outputs, applicable conditions, and resource cost, so the model can retrieve and select it.
- Sandboxed compute environment: a container platform spins up isolated environments on demand, mounts datasets and dependencies, and reclaims them when the task finishes.
- Artifact and data management: raw data, intermediate results, and charts are written to object storage as a traceable directory.
- Logging and monitoring/alerting: parameters, duration, and status of each tool call are recorded for review and cost accounting.
- Message queue: long-running tasks are made asynchronous to avoid blocking the interaction layer.
An illustrative tool description structure (pseudocode):
tool_spec = {"name": "expression_analysis","inputs": {"matrix": "h5ad", "params": "json"},"outputs": {"embedding": "ndarray", "markers": "csv"},"preconditions": ["gene_symbols_unique"],"cost": {"cpu_minutes": 8, "mem_gb": 16},}
The invocation plan the model generates based on this is essentially a constrained orchestration script:
plan = [{"tool": "qc_filter", "args": {"min_genes": 200}},{"tool": "normalize", "args": {"method": "standard"}},{"tool": "cluster", "args": {"resolution": 0.5}},{"tool": "trajectory", "args": {"root": "auto"}},{"tool": "marker_select", "args": {"top_n": 100}},]
3. Case Study: Inferring Developmental Trajectories from Single-Cell Expression Data
In a publicly shown demo from an industry organization, an agent faced a single-timepoint expression matrix of about 3,696 cells. The task was to infer possible cell state transition paths from a single time slice and to shortlist candidate genes. The system completed in about 90 minutes, producing a speculative state map and 100 candidate genes.
The technical workflow can be summarized in four steps:
- Problem understanding: the model translates “infer developmental trajectory” into a standard pipeline of dimensionality reduction, clustering, root node determination, pseudotime ordering, and differential gene selection;
- Code and parameter generation: it chooses an approximate nearest-neighbor graph construction method based on data scale to control memory and runtime;
- Tool invocation and validation: each step checks preconditions, such as uniqueness of gene symbols and anomalies in library size distribution;
- Result interpretation: abstract metrics are translated back into biological language, with the uncertainty of the conclusions clearly labeled.
It is important to emphasize that such results are computational hypotheses. They must be validated with independent data and experiments and should not be treated as conclusions.
4. Engineering Challenges and Best Practices
- Reproducibility: fix random seeds, image versions, and dependency lists, and tag artifact directories with version numbers.
- Cost control: set resource limits and timeouts for each type of tool, and use asynchronous execution plus queue-based peak shaving.
- Failure recovery: keep checkpoints in the orchestration layer so a failure reruns only the single failed step rather than the whole pipeline.
- Permissions and compliance: apply data classification, least privilege, and access auditing, and keep sensitive data within its domain.
- Evaluation system: establish three categories of metrics, namely tool selection accuracy, parameter validity rate, and result reproducibility rate, instead of looking only at the final answer.
5. Conclusion
The right role for general-purpose models in scientific research is as the orchestrator and interpreter, while specialized tools and compute environments are the source of result credibility. Baidu AI Cloud can provide a standardized foundation for such research agents through common capabilities such as container platforms, object storage, logging services, and monitoring/alerting. For developers, mastering the layered architecture, reproducibility, and a closed-loop evaluation process is the key to moving AI for Science from demos to production.
