TL;DR
While LLM agents excel at isolated coding tasks, real-world data analysis requires managing complex, shifting context over long timelines. This paper introduces LongDS, a new benchmark derived from real-world Kaggle notebooks that tests an agent's ability to track, update, and roll back analytical states over multi-turn interactions. Evaluating top-tier models reveals a glaring capability gap: even the best model scores under 50% accuracy, with performance plummeting as analytical states compound.
What Problem Does This Paper Address?
Most existing data science benchmarks evaluate AI agents on single-turn or short, highly guided tasks. However, real-world data analysis is an iterative, persistent process. An analyst might clean data in Turn 1, apply a filter in Turn 2, update a metric definition in Turn 3, temporarily test a counterfactual assumption in Turn 4, and then roll back to an earlier state in Turn 5.
To succeed, an agent must maintain an accurate analytical state across long dependency chains. Current models frequently suffer from "state drift" or fail to correctly isolate temporary changes from permanent updates. The authors address this evaluation gap by introducing a framework and benchmark specifically designed to measure long-horizon analytical state management.
Methods
The authors formalize long-horizon data analysis as a problem of state management and identify five core state-evolution patterns:
- Initial State Construction: Establishing reusable analytical objects (e.g., cleaning a table).
- State Update: Permanently overwriting a baseline definition or filter.
- Counterfactual Perturbation: Applying a temporary assumption for the current turn only.
- Long-range Rollback: Reverting the active environment to an earlier anchored state.
- Multi-state Composition: Combining multiple independent historical states.
To build the benchmark, the authors developed a semi-automated pipeline. They used an LLM coding agent (Codex) equipped with a specialized "task-construction skill" to break down real Kaggle notebooks into analysis clusters and generate state-dependent questions. These tasks were then rigorously refined through a three-stage validation process involving expert human review to ensure dependency validity and answer reliability.
Datasets
The paper introduces LongDS, a benchmark consisting of 68 tasks and 2,225 turns built from 77 verified Kaggle notebooks. The dataset spans six diverse domains: Geoscience, Business, Community, Social Good, Education, and Sports.
Unlike simpler datasets, LongDS features an intense dependency structure, boasting an average task length of 32.7 turns and an average dependency span of 11.3 turns (meaning a question at Turn 20 might directly rely on a state established at Turn 9).
Key Insights and Ideas
- The "Cascading Error" Bottleneck: Error analysis shows that 52% to 69% of agent failures are driven by long-horizon errors rather than local coding or planning mistakes. The single largest culprit is Cascade Error—where a small mistake made early in the trajectory propagates downstream, dooming all subsequent turns.
- More Interaction Budget Doesn't Help: Interestingly, giving agents more reasoning steps or a larger interaction budget does not improve performance. For instance, Claude-4.6-Sonnet took the highest average number of steps per turn but underperformed compared to more efficient models. Extra steps often just introduce more opportunities for state drift.
- The Reset Trade-off: Experimenting with environment resets revealed a fascinating nuance. Resetting the execution environment mid-trajectory actually helps agents that have already corrupted their state (by forcing them to reconstruct the state cleanly from history), but it severely hurts agents on successful trajectories by breaking state continuity.
Key Results
The authors evaluated five state-of-the-art models: GPT-5.4, Gemini-3.1-Pro, Claude-4.6-Sonnet, Kimi-K2.6, and DeepSeek-V4-Pro.
- Low Overall Accuracy: Gemini-3.1-Pro achieved the highest average accuracy, but still only reached 48.45%. GPT-5.4 followed at 43.50%.
- Severe Performance Degradation: Across all models, accuracy dropped by nearly 47 percentage points when comparing the first 10% of a task's turns to the final 10%.
- Complexity Penalties: Performance drops sharply as dependency breadth increases and state operations become more complex. Models handle initial state construction relatively well (~44.4% overall) but struggle significantly with long-range rollbacks (~22.2% overall).
Limitations and Future Work
The authors note several limitations in their current work:
- Domain Imbalance: The dataset is skewed toward domains like Geoscience and Community, with very few tasks in Sports due to the computational difficulty of executing large sports datasets.
- Quantitative Focus: To ensure reliable, automated grading, the benchmark prioritizes quantitatively verifiable questions (e.g., ranked lists, exact numerical outputs) over open-ended insight generation or visualization-heavy tasks.
- Source Bias: Because the tasks are curated from public Kaggle notebooks, they may inherit specific formatting or structural biases present in the source code.
Future work points toward developing agents with explicit state-tracking architectures, better recovery mechanisms for cascading errors, and testing on proprietary, production-grade enterprise data workflows.
Summary updated