DSFlow: A Neuro-Symbolic Data Workflow Agent with Statistical Diagnostic Guardrails

Junfeng Nie, Xiaohui ChenarXiv 2026 · arXiv

TL;DR

DSFlow is a neuro-symbolic agent that brings statistical rigor to LLM-driven data science. By wrapping large language model (LLM) planning within deterministic "diagnostic guardrails," the system can automatically detect when a proposed analytical method (like OLS regression) is unsuitable for the data and override it with a safer alternative (like Huber robust regression), all while producing an auditable decision trace.

What Problem Does This Paper Address?

Modern data science is a minefield of hidden assumptions. While LLMs have made it incredibly easy to generate analysis code from natural language, they often lack the "statistical common sense" to verify if a chosen method is actually appropriate for the data at hand.

For example, an LLM might confidently apply Ordinary Least Squares (OLS) regression to a dataset with extreme outliers, or use K-means clustering on non-convex data (like concentric rings). In both cases, the code will run perfectly, but the results will be statistically misleading. There is a persistent gap between a user's high-level analytical intent and the creation of a reliable, statistically sound pipeline. DSFlow aims to bridge this gap by moving away from "passive text generation" toward an agent that actively validates its own statistical choices.

Methods

DSFlow uses a neuro-symbolic architecture built on LangGraph. It treats LLM reasoning and deterministic code-based rules as complementary forces:

  1. The Neuro Side (LLM): An LLM parses the user's intent, selects reusable "skills" from a library, and proposes a structured plan (task, target, features, and model preference).
  2. The Symbolic Side (Guardrails): This is the core innovation. Before execution, a deterministic layer performs Schema Validation (ensuring requested fields exist) and Statistical Diagnostics.
  3. Diagnostic Routing: The system runs specific checkers for properties like nonlinearity, heteroscedasticity, and data geometry. If the diagnostics suggest the LLM’s preferred method is unsuitable, the guardrail can request a replan, override the method with a symbolic fallback, or ask the user for clarification.
Figure 1: DSFlow workflow for the evaluated regression and clustering paths. The LLM proposes a plan. Schema validation can request clarification or replanning, and diagnostics determine whether to retain or override the proposed method. The examples pair ordinary least squares (OLS) with Huber robust regression and K-means with spectral clustering. A deterministic stage checks the executor’s outputs and formats the report. Classification is supported in the architecture and outside the scope of the evaluation.

Datasets

The authors evaluated DSFlow using three primary setups:

  • Contaminated Regression: A modified version of the USA Housing dataset (5,002 rows) where two highly influential "outlier" records were injected to test if the agent could detect them and switch from OLS to robust regression.
  • Non-convex Clustering: A fully synthetic dataset consisting of a central disc and two concentric rings. This geometry is a classic failure case for centroid-based methods like K-means.
  • Language Interface Suite: A set of 25 prompts (20 executable, 5 ambiguous) used to test the agent's ability to ground natural language requests into valid schemas and handle missing information.

Key Insights and Ideas

  • Diagnostics as Authority: Unlike standard agents that might just "talk" about outliers in a summary, DSFlow gives its diagnostic modules the authority to change the execution path. If Cook’s distance indicates high influence, the system forces a shift to robust estimation.
  • Stability over Complexity: The routing logic is designed to retain simpler, preferred methods (like OLS) when assumptions are met, rather than always defaulting to the most complex model available.
  • Auditable Reports: Because the system follows a deterministic routing logic, it can generate a "decision trace." This allows a human analyst to see exactly why a specific model was chosen or why a default was overridden, turning the "black box" of agentic AI into a transparent audit trail.

Key Results

In head-to-head comparisons with general-purpose assistants (Manus 1.6 Lite, Gemini 3.1 Flash-Lite, and ChatGPT 5.5 Instant), DSFlow was the only system to consistently identify and correct for statistical violations.

  • Rubric Scoring: On a 7-point rubric measuring analytical behavior (not just code correctness), DSFlow scored a perfect 42/42 across three runs. The next best competitor, Manus, scored 19/42.
  • Clustering Success: In the non-convex ring case, DSFlow correctly identified the manifold structure and executed Spectral clustering in every run. Competitors largely stuck to K-means, resulting in "incorrect" angular partitions of the rings.
Comparison of clustering outputs. DSFlow (left) correctly recovers the ring geometry using Spectral clustering, while others fail by using K-means.
  • Regression Accuracy: In the contaminated regression case, DSFlow’s use of Huber robust regression reduced the holdout Root Mean Squared Error (RMSE) to 100,131, compared to 127,139 for a standard OLS fit on the same data.
Sensitivity analysis showing that DSFlow's robust regression (middle) achieves performance nearly identical to OLS with outliers manually removed (right).

Limitations and Future Work

The authors acknowledge several areas for growth:

  • Task Scope: The current evaluation focuses heavily on regression and clustering. While the architecture supports classification, it wasn't the primary focus of this study.
  • Generalization: It remains an open question how well these specific diagnostic thresholds (e.g., Cook's distance cutoffs) transfer to vastly different data distributions or more exotic task families.
  • Human-in-the-loop: The current system is highly automated; future versions could explore more interactive ways for the "symbolic" layer to present evidence to a human expert for a final decision.

Summary updated

Abstract

Data science workflows often require tools that presume non-trivial technical knowledge. Large language models (LLMs) reduce this barrier, but a gap remains between flexible general-purpose agents and statistically controlled pipelines. We introduce DSFlow, a LangGraph-based neuro-symbolic data-agent platform that combines reusable, LLM-selected skills with deterministic diagnostic guardrails. Skills provide extensible task knowledge. Symbolic validation can accept a proposed method, request clarification or replanning, override an unsuitable method, or supply a safe fallback. Regression and clustering case studies illustrate how DSFlow uses diagnostic evidence to correct method choices and documents those decisions in auditable reports.
BibTeX
@misc{nie2026dsflow,
  author = {Junfeng Nie and Xiaohui Chen},
  title = {{DSFlow: A Neuro-Symbolic Data Workflow Agent with Statistical Diagnostic Guardrails}},
  year = {2026},
  eprint = {2611.25111},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.25111},
}
Figure