mlsanityData to 14 Oct 2026

CRABS: A syntactic-semantic pincer strategy for bounding LLM interpretation of Python notebooks

arXiv 2507.11742 ↗First posted 15 Jul 2025cs.CL cs.AIcited by 1

Not on the map. Why?

Abstract (arXiv)

Recognizing the information flows and operations comprising data science and machine learning Python notebooks is critical for evaluating, reusing, and adapting notebooks for new tasks. Investigating a notebook via re-execution often is impractical due to the challenges of resolving data and software dependencies. While Large Language Models (LLMs) pre-trained on large codebases have demonstrated effectiveness in understanding code without running it, we observe that they fail to understand some realistic notebooks due to hallucinations and long-context challenges. To address these issues, we propose a notebook understanding task yielding an information flow graph and corresponding cell execution dependency graph for a notebook, and demonstrate the effectiveness of a pincer strategy that uses limited syntactic analysis to assist full comprehension of the notebook using an LLM. Our Capture and Resolve Assisted Bounding Strategy (CRABS) employs shallow syntactic parsing and analysis of the abstract syntax tree (AST) to capture the correct interpretation of a notebook between lower and upper estimates of the inter-cell I/O setunicodex2014the flows of information into or out of cells via variablesunicodex2014then uses an LLM to resolve remaining ambiguities via cell-by-cell zero-shot learning, thereby identifying the true data inputs and outputs of each cell. We evaluate and demonstrate the effectiveness of our approach using an annotated dataset of 50 representative, highly up-voted Kaggle notebooks that together represent 3454 actual cell inputs and outputs. The LLM correctly resolves 1397 of 1425 (98%) ambiguities left by analyzing the syntactic structure of these notebooks. Across 50 notebooks, CRABS achieves average F1 scores of 98% identifying cell-to-cell information flows and 99% identifying transitive cell execution dependencies.

Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 15 of its 37 references that are in the map. First posted on arXiv 15 Jul 2025.

Builds on

15 of 37 references.

References · 15

  1. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
  2. 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
  3. 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 367
  4. 2023Using an LLM to Help With Code Understandingcited by 228
  5. 2022Natural Language to Code Generation in Interactive Data Science Notebookscited by 87
  6. 2024Spider2-V: How Far Are Multimodal Agents From Automating Data Science and Engineering Workflows?cited by 56
  7. 2024Dataflow-Guided Retrieval Augmentation for Repository-Level Code Completioncited by 40
  8. 2022Execution-based Evaluation for Data Science Code Generation Modelscited by 32
  9. 2023A large language model-assisted education tool to provide feedback on open-ended responsescited by 22
  10. 2024LLMDFA: Analyzing Dataflow in Code with Large Language Modelscited by 22
  11. 2024Analyzing the Performance of Large Language Models on Code Summarizationcited by 19
  12. 2022Python Code Generation by Asking Clarification Questionscited by 17
3 more
  1. 2015YesWorkflow: A User-Oriented, Language-Independent Tool for Recovering Workflow Information from Scriptscited by 4
  2. 2024Contextualized Data-Wrangling Code Generation in Computational Notebookscited by 3
  3. 2025Suggesting Code Edits in Interactive Machine Learning Notebooks Using Large Language Modelscited by 1

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 1.

1 paper.