TL;DR
While Large Language Models (LLMs) excel at extracting insights from unstructured text, their probabilistic nature makes them unstable, often producing different wording or formats across identical runs. To bridge the gap between volatile LLM outputs and deterministic data analytics pipelines, the authors introduce CAST (Consistency via Algorithmic Prompting and Stable Thinking). By constraining the model's latent reasoning path, CAST significantly reduces output entropy, delivering highly reproducible text summarization and tagging without sacrificing processing speed or quality.
What Problem Does This Paper Address?
The paper introduces the paradigm of Text Analysis for Data Analysis (TADA), which sits at the intersection of natural language processing and structured tabular analytics. In a typical TADA workflow, unstructured text columns (like user reviews or support tickets) are transformed into structured representations via two core atomic operations: summarization (corpus-level theme extraction) and tagging (row-level labeling).
The critical challenge is stability. Traditional data analytics workflows (like OLAP, SQL grouping, and aggregation) require deterministic keys. If an LLM labels a customer review as "Customer Service" in one run and "Support Team" in another, downstream aggregation results will fluctuate, destroying reproducibility and user trust. This instability stems from unconstrained latent reasoning trajectories; when an LLM faces a diffuse, high-entropy distribution of possible reasoning paths, its final outputs easily drift.
Methods
To enforce output stability, the authors propose the CAST framework, which constrains the generation process through explicit intermediate commitments within a single structured LLM call. It integrates two key design principles:
- Algorithmic Prompting (AP): This translates classic deterministic workflows and expert heuristics into a structured prompt sequence. It acts as a procedural scaffold, pruning or down-weighting non-compliant next states to sharpen local transition probabilities.
- Thinking-before-Speaking (TbS): Instead of allowing the model to freely generate the final answer, TbS forces it to produce well-defined intermediate states (e.g., identifying the data domain, defining a topic schema, or clustering) before emitting the final output. Committing to these early steps collapses the branching factor of the reasoning path.
Additionally, the paper introduces a stability-focused evaluation suite:
- CAST-S: A hybrid metric for bulleted summarization that combines semantic content overlap with a positional score derived from Kendall’s Tau to evaluate ordering consistency.
- CAST-T: A tagging stability metric that uses an LLM to cluster tags from multiple runs by semantic equivalence and calculates a majority convergence ratio.
Datasets
The framework was evaluated across diverse multilingual and multi-domain datasets:
- Summarization Evaluation Suite: 32 dataset-query pairs (~700 items total) featuring perspective-aware, stylistic, and structural constraints. Data was sourced from the MASSIVE dataset, multilingual Google Play reviews, product reviews, and Twitter threads.
- Tagging Evaluation Suite: 5,100 items spanning four domains:
- Amazon: 100 Chinese customer reviews for non-English validation.
- Book: 2,000 book titles for genre inference.
- Teams: 1,000 real-world user feedback samples from Microsoft Teams.
- Sushi: 2,000 synthetic restaurant reviews for domain-specific testing.
Key Insights and Ideas
- The Power of Relevant Constraints: The simple act of forcing an LLM to generate intermediate states sharpens its output distribution. Crucially, as shown in the paper's ablation studies, generating relevant intermediate states (like the number of bullet points) tightens the output spread significantly more than irrelevant ones.
- Efficiency Over Sampling: Traditional methods for achieving consistency, such as Self-Consistency (SC) or Tree-of-Thoughts (ToT), rely on expensive multi-trajectory sampling and voting. CAST achieves superior stability within a single API call by transforming latent choices into hard structural constraints.
- Synergy of AP and TbS: Algorithmic Prompting and Thinking-before-Speaking are highly complementary. AP defines the valid boundaries of the reasoning track, while TbS forces the model to lock into specific milestones along that track, preventing semantic drift.
Key Results
- Superior Stability: Across multiple backbone LLMs (GPT-5.2, DeepSeek-V3.2, Gemini-3-Flash), CAST consistently achieved the highest stability scores. For instance, on DeepSeek-V3.2, CAST improved the summarization stability score from 8.15 (baseline) to 9.47.
- Maintained or Improved Quality: Increased stability did not result in rigid, low-quality outputs. In fact, independent tagging accuracy improved (e.g., reaching 98.2% accuracy on GPT-5.2 compared to the 95.0% baseline), and summarization recall increased from 0.854 to 0.879.
- Favorable Latency: Unlike Self-Consistency, which multiplies processing time by requiring multiple sampled generations, CAST's processing time remained marginal and comparable to standard single-call baselines (e.g., 6.60s vs 6.06s on Gemini-3-Flash).
Limitations and Future Work
- Human-in-the-Loop Design: CAST currently relies on human-defined algorithmic structures and prompt engineering tailored to specific tasks, which limits its immediate scalability to entirely novel domains.
- Future Automation: The authors point to automated discovery or adaptation of algorithmic flows—using meta-learning or reasoning-path clustering to automatically infer reusable templates—as a promising future direction.
- Scope Extensions: Future work will also explore extending CAST beyond summarization and tagging into structured data extraction, causal explanation generation, and semi-structured document reasoning.
Summary updated