Why LLMs Struggle with AI for Science: Key Engineering Challenges

    This article examines why large language models still underperform in AI for Science scenarios despite being added to many teams' roadmaps. It breaks the problem into verifiable, engineerable parts: interpreting benchmark signals and saturation risks, the scarcity and noise of scientific data, the economics of long-context inference, tool use and verifiable execution, the amplified cost of hallucinations, and practical implementation advice from private evaluation sets to platform-level capabilities. Readers will find code examples for corpus cleaning, retrieval, and sandboxed execution, plus an output contract for traceable results.

    Over the past year, multiple LLM teams have added “AI for Science” to their roadmaps. Yet in practice, scientific workflows turn out to be a different engineering system from general-purpose chat. A telling signal: on several benchmarks closely tied to research capability, even top models post modest absolute scores, and leading Chinese models only hold a relative edge. This suggests research capability is still at an early stage, and the gap cannot be closed by a single version bump. This article breaks “where the difficulty lies” into verifiable, engineerable problems.

    1. Reading the Benchmark Signals: What Average Scores Actually Mean

    Research-oriented benchmarks generally fall into two categories. The first is high-difficulty subject knowledge QA, covering expert-level questions in mathematics, physics, chemistry, biology, and other fields. The second is research task execution in a terminal environment, requiring multi-step operations such as literature processing, data cleaning, script execution, and result validation in a command-line setting. The former tests depth of knowledge and resistance to interference; the latter tests planning and self-correction over long task chains.

    It is important to note that these benchmarks show clear ceiling effects and saturation risk: the number of questions is limited, answers tend to be unique, and some questions may already be in the training corpus, inflating scores. So “average scores” carry at least three implications:

    • Knowledge coverage still has blind spots, especially for cross-disciplinary questions;
    • Success rates on multi-step tasks decay exponentially as the number of steps grows;
    • The benchmarks themselves are not enough to represent real research workflows.

    The engineering takeaway: do not treat public leaderboards as the sole basis for model selection. Build a private evaluation set that closely matches your own workloads.

    2. Challenge 1: High-Quality Scientific Data Is Scarce and Noisy

    General corpora are mostly web text. Scientific corpora are “sparse, expensive, dirty, and messy in format.” Papers are mostly PDFs with two-column layouts, formulas, figures, footnotes, and references. Lab records are mostly tables and instrument exports. Code and data are often not public.

    A typical data processing pipeline looks like this:

    1. # Minimal viable cleaning pipeline for scientific corpora (illustrative)
    2. def build_corpus(pdf_dir, table_dir):
    3. docs = []
    4. for f in pdf_dir:
    5. text = parse_pdf_layout(f) # layout analysis + reading order restoration
    6. text = normalize_formula(text) # convert formulas to LaTeX or unified placeholders
    7. text = strip_references(text) # remove references, headers, and footers
    8. docs.append(chunk_by_section(text)) # split by section, preserve heading hierarchy
    9. for t in table_dir:
    10. docs.append(table_to_markdown(t)) # structure tables to avoid column loss from linearization
    11. return dedup_and_quality_filter(docs) # deduplicate + quality-score filtering

    The key point: chunking must preserve structural semantics (sections, theorems, experimental setup); otherwise the model learns fragments rather than reasoning chains. If tables and formulas are crudely linearized, verifiability is directly broken.

    3. Challenge 2: Inference Cost and the Economics of Long Context

    Research tasks often require loading papers, code, data samples, and experiment logs at the same time, with contexts ranging from tens of thousands to hundreds of thousands of tokens. This creates two practical constraints: memory and bandwidth pressure, and latency plus cost per task.

    Common optimizations include retrieval-augmented generation (use vector retrieval to narrow the candidate set first, then have the model read closely), hierarchical summarization (produce a structured summary of long documents first, then drill down layer by layer), and caching and reuse of inference results. An illustrative retrieval strategy:

    1. def retrieve(query, index, top_k=8, rerank=True):
    2. cands = index.search(query, top_k=top_k * 3) # widen coarse recall
    3. if rerank:
    4. cands = rerank_model.score(query, cands)[:top_k] # narrow with fine ranking
    5. return cands

    On the enterprise side, it is advisable to evaluate “task success rate” and “cost per task” on the same dashboard, avoiding optimization of only one of them.

    4. Challenge 3: Tool Use and Verifiable Execution

    The value of research lies in reproducibility, and reproducibility depends on a toolchain: numerical libraries, plotting, version control, containerized environments, and experiment tracking. The model must learn the loop of “write code, execute, read errors, fix,” rather than producing an answer in one shot.

    A controlled execution sandbox typically includes resource quotas, network isolation, filesystem snapshots, and retained execution logs. Pseudocode example:

    1. def run_in_sandbox(code, limits):
    2. with Sandbox(cpu=limits.cpu, mem=limits.mem, net=False) as box:
    3. box.write(code)
    4. r = box.exec(timeout=limits.timeout)
    5. return {"code": r.exit_code, "out": r.stdout, "err": r.stderr}

    The recommended engineering practice is “verify first, then trust”: have the model emit checkable assertions (such as dimensional checks, conservation relations, and boundary-value tests) and let the program judge them, rather than relying on the model’s self-report.

    5. Challenge 4: The Cost of Hallucination Is Amplified in Science

    In casual chat, the cost of a hallucination is one wrong answer. In research, a wrong coefficient or boundary condition can lead to weeks of wrong experiments. Mitigation includes enforced citation traceability (bind every conclusion to a source snippet), numerical consistency checks, and an “abstain when uncertain” policy design.

    1. Output contract example:
    2. Conclusion: <one-sentence conclusion>
    3. Evidence: <list of cited snippet IDs>
    4. Validation: <dimensional/unit/boundary check results>
    5. Confidence: <high|medium|low>; when low, additional experiment suggestions are required

    6. Implementation Advice: From Private Evaluation to Platform Capabilities

    1. Build a private evaluation set: stratify by subject, task type, and difficulty; fix versions; run regular regression.
    2. Keep scenarios small: prioritize tasks whose correctness can be judged automatically, such as data cleaning, parameter sweeps, and chart generation.
    3. Platform support: use object storage for corpora and artifacts, a container platform for isolated execution, a message queue to decouple long tasks, and logging plus monitoring and alerting for observability.
    4. Human-in-the-loop workflow: the model produces hypotheses and code, experts review key assumptions, and the loop generates feedback data.
    5. Cost governance: route by task tier, sending simple tasks to small models or rules and escalating only complex tasks.

    When implementing this architecture in the cloud, the general capability categories offered by Baidu AI Cloud (object storage, container platform, message queue, logging, monitoring and alerting, and so on) can serve as a reference model, making it easier for teams to compose services as needed and scale smoothly.

    7. Conclusion

    Research intelligence is not a single-point breakthrough from a “bigger model.” It is systems engineering across data, evaluation, toolchain, cost, and workflow. For developers, the pragmatic path is: first make small, verifiable scenarios solid, drive iteration with a private evaluation set, and then consolidate capabilities into reusable, platform-level components.