mlsanityData to 7 Oct 2026

Toward Automated and Trustworthy Scientific Analysis and Visualization with LLM-Generated Code

arXiv 2511.21920 ↗First posted 26 Nov 2025cs.SE cs.AIcited by 0

Not on the map. Why?

Abstract (arXiv)

As modern science becomes increasingly data-intensive, the ability to analyze and visualize large-scale, complex datasets is critical to accelerating discovery. However, many domain scientists lack the programming expertise required to develop custom data analysis workflows, creating barriers to timely and effective insight. Large language models (LLMs) offer a promising solution by generating executable code from natural language descriptions. In this paper, we investigate the trustworthiness of open-source LLMs in autonomously producing Python scripts for scientific data analysis and visualization. We construct a benchmark suite of domain-inspired prompts that reflect real-world research tasks and systematically evaluate the executability and correctness of the generated code. Our findings show that, without human intervention, the reliability of LLM-generated code is limited, with frequent failures caused by ambiguous prompts and the models' insufficient understanding of domain-specific contexts. To address these challenges, we design and assess three complementary strategies: data-aware prompt disambiguation, retrieval-augmented prompt enhancement, and iterative error repair. While these methods significantly improve execution success rates and output quality, further refinement is needed. This work highlights both the promise and current limitations of LLM-driven automation in scientific workflows and introduces actionable techniques and a reusable benchmark for building more inclusive, accessible, and trustworthy AI-assisted research tools.

Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 16 of its 34 references that are in the map. First posted on arXiv 26 Nov 2025.

Builds on

16 of 34 references.

References · 16

  1. 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,049
  2. 2025Gemma 3 Technical Reportcited by 1,686
  3. 2024A Survey on Large Language Models for Code Generationcited by 646
  4. 2018fastMRI: An Open Dataset and Benchmarks for Accelerated MRIcited by 464
  5. 2024CodeAgent: Enhancing Code Generation with Tool-Integrated Agent Systems for Real-World Repo-level Coding Challengescited by 278
  6. 2023Magicoder: Empowering Code Generation with OSS-Instructcited by 251
  7. 2024Data Interpreter: An LLM Agent For Data Sciencecited by 222
  8. 2021Retrieval Augmented Code Generation and Summarizationcited by 148
  9. 2024Code Generation with AlphaCodium: From Prompt Engineering to Flow Engineeringcited by 100
  10. 2024MatPlotAgent: Method and Evaluation for LLM-Based Agentic Scientific Data Visualizationcited by 98
  11. 2024Wiki-LLaVA: Hierarchical Retrieval-Augmented Generation for Multimodal LLMscited by 79
  12. 2024SynCode: LLM Generation with Grammar Augmentationcited by 66
4 more
  1. 2024Search-Based LLMs for Code Optimizationcited by 27
  2. 2025PlotGen: Multi-Agent LLM-based Scientific Data Visualization via Multimodal Feedbackcited by 19
  3. 2024Domain Adaptation of Llama3-70B-Instruct through Continual Pre-Training and Model Merging: A Comprehensive Evaluationcited by 14
  4. 2024Assessing, Exploiting, and Mitigating Syntactic Robustness Failures in LLM-Based Code Generationcited by 6

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2025ChatVis: Large Language Model Agent for Generating Scientific Visualizations
  2. 2025AIRepr: An Analyst-Inspector Framework for Evaluating Reproducibility of LLMs in Data Science
  3. 2026Evaluating LLM-generated code for domain-specific languages: molecular dynamics with LAMMPS
  4. 2024S3LLM: Large-Scale Scientific Software Understanding with LLMs using Source, Metadata, and Document
  5. 2025Towards Scientific Intelligence: A Survey of LLM-based Scientific Agents
  6. 2026Figures as Interfaces: Toward LLM-Native Artifacts for Scientific Discovery
  7. 2026Toward Reliable Scientific Visualization Pipeline Construction with Structure-Aware Retrieval-Augmented LLMs
  8. 2026SciText2Eq: Assessing LLMs for Explainable Equation Generation for Scientific Creativity