Table of Contents
Fetching ...

Structured Prompting and Feedback-Guided Reasoning with LLMs for Data Interpretation

Amit Rath

TL;DR

The paper tackles the fragility of LLMs in structured data reasoning due to schema misinterpretation and lack of self-correction. It introduces STROT, a structured prompting framework that embeds the LLM in an agent-like, multi-phase loop with schema-aware context, goal-aligned planning, and a feedback-driven refinement mechanism. Key contributions include schema-guided context construction, dynamic prompt scaffolding for explicit planning, and a bounded retry loop that refines transformation logic based on execution feedback, leading to improved robustness and interpretability. Empirical results on a COVID-19 dataset show high first-attempt success (≈95%) with automated recovery for the rest, and significantly higher interpretability scores than one-shot baselines, highlighting STROT’s practical value for reliable, reproducible structured data analysis in real-world settings.

Abstract

Large language models (LLMs) have demonstrated remarkable capabilities in natural language understanding and task generalization. However, their application to structured data analysis remains fragile due to inconsistencies in schema interpretation, misalignment between user intent and model output, and limited mechanisms for self-correction when failures occur. This paper introduces the STROT Framework (Structured Task Reasoning and Output Transformation), a method for structured prompting and feedback-driven transformation logic generation aimed at improving the reliability and semantic alignment of LLM-based analytical workflows. STROT begins with lightweight schema introspection and sample-based field classification, enabling dynamic context construction that captures both the structure and statistical profile of the input data. This contextual information is embedded in structured prompts that guide the model toward generating task-specific, interpretable outputs. To address common failure modes in complex queries, STROT incorporates a refinement mechanism in which the model iteratively revises its outputs based on execution feedback and validation signals. Unlike conventional approaches that rely on static prompts or single-shot inference, STROT treats the LLM as a reasoning agent embedded within a controlled analysis loop -- capable of adjusting its output trajectory through planning and correction. The result is a robust and reproducible framework for reasoning over structured data with LLMs, applicable to diverse data exploration and analysis tasks where interpretability, stability, and correctness are essential.

Structured Prompting and Feedback-Guided Reasoning with LLMs for Data Interpretation

TL;DR

The paper tackles the fragility of LLMs in structured data reasoning due to schema misinterpretation and lack of self-correction. It introduces STROT, a structured prompting framework that embeds the LLM in an agent-like, multi-phase loop with schema-aware context, goal-aligned planning, and a feedback-driven refinement mechanism. Key contributions include schema-guided context construction, dynamic prompt scaffolding for explicit planning, and a bounded retry loop that refines transformation logic based on execution feedback, leading to improved robustness and interpretability. Empirical results on a COVID-19 dataset show high first-attempt success (≈95%) with automated recovery for the rest, and significantly higher interpretability scores than one-shot baselines, highlighting STROT’s practical value for reliable, reproducible structured data analysis in real-world settings.

Abstract

Large language models (LLMs) have demonstrated remarkable capabilities in natural language understanding and task generalization. However, their application to structured data analysis remains fragile due to inconsistencies in schema interpretation, misalignment between user intent and model output, and limited mechanisms for self-correction when failures occur. This paper introduces the STROT Framework (Structured Task Reasoning and Output Transformation), a method for structured prompting and feedback-driven transformation logic generation aimed at improving the reliability and semantic alignment of LLM-based analytical workflows. STROT begins with lightweight schema introspection and sample-based field classification, enabling dynamic context construction that captures both the structure and statistical profile of the input data. This contextual information is embedded in structured prompts that guide the model toward generating task-specific, interpretable outputs. To address common failure modes in complex queries, STROT incorporates a refinement mechanism in which the model iteratively revises its outputs based on execution feedback and validation signals. Unlike conventional approaches that rely on static prompts or single-shot inference, STROT treats the LLM as a reasoning agent embedded within a controlled analysis loop -- capable of adjusting its output trajectory through planning and correction. The result is a robust and reproducible framework for reasoning over structured data with LLMs, applicable to diverse data exploration and analysis tasks where interpretability, stability, and correctness are essential.
Paper Structure (17 sections, 8 equations, 2 figures, 4 tables)

This paper contains 17 sections, 8 equations, 2 figures, 4 tables.

Figures (2)

  • Figure 1: Fig. 1. Framework overview: The flow illustrates the STROT agentic execution cycle for structured data interpretation. The pipeline begins with a user query and schema extraction from a source dataset. The middle stages involve schema-aware planning and program synthesis using LLMs. A dynamic feedback loop refines failed executions through error-aware retries. The final output is a semantically valid, structured result. Each box represents a distinct subcomponent of the system, and the feedback path captures the iterative refinement behavior central to the framework.
  • Figure 2: This bar Analysis compares the aggregated counts of total deaths and new COVID-19 cases across different WHO regions. The data was processed using a schema-aware STROT plan that filtered relevant fields, performed group-wise aggregation, and generated structured output. The result illustrates inter-regional variation in both cumulative and recent case trends, with the Americas and Europe showing the highest absolute values.