Think Fast, Talk Smart: Partitioning Deterministic and Neural Computation for Structured Health Text Generation

Kai-Chen Cheng, Haejun Han, Qiwei Sun

TL;DR

This paper proposes a "Think Fast, Talk Smart" (TFTS) framework that partitions structured health text generation into deterministic code for recurring analysis and a bounded LLM for fluent expression. TFTS significantly outperforms one-call LLM baselines in accuracy and cost, demonstrating that deterministic code should handle stable analytical tasks while LLMs express verified facts within defined interfaces.

What Problem Does This Paper Address?

The increasing use of Large Language Models (LLMs) for generating health-related text from structured data (like wearable sensor readings, lab results, etc.) presents a critical challenge: ensuring the generated text is not only fluent but also factually accurate, grounded in evidence, and compliant with specific instructions. Simply prompting LLMs for complex, recurring health insights often leads to errors in numerical accuracy, policy adherence, and attribution. The paper addresses the question of where to draw the line between deterministic, rule-based computation and LLM-driven generation in these structured health text generation tasks. They argue that for recurring analytical tasks that are stable and verifiable, relying solely on runtime LLM prompting might be the wrong abstraction.

Methods

The core of the proposed method is the Think Fast, Talk Smart (TFTS) framework, which decomposes the health text generation pipeline into four stages:

  1. Structured Health Data: Raw input data from sources like wearables, vitals, etc.
  2. Deterministic Analytical Contracts: This is the "Think Fast" part. Here, deterministic code performs recurring, verifiable analysis. This includes numerical comparisons (e.g., current vs. baseline), selection policies (deciding which metric to highlight), and attribution gating (ensuring claims are supported by evidence).
  3. Bounded LLM Writer: This is the "Talk Smart" part. A single, constrained LLM call takes the verified facts from the deterministic layers and generates user-facing prose. The LLM's role is to express these facts naturally and empathetically, not to perform the analysis itself.
  4. Structured Insight Evaluation: Deterministic evaluation of the structured output.

A key methodological innovation is the layer-replacement protocol. To understand which specific analytical responsibilities are problematic when delegated to LLMs, they systematically replace individual deterministic layers (comparison, ranking, attribution, and a "handoff" layer) with LLM-generated typed artifacts. This allows them to isolate failure modes and assess the LLM's ability to preserve the intended meaning of intermediate analytical outputs.

Datasets

The study uses data from 280 user-nights collected from 20 active users of a sleep-health tracking system. This data consists of longitudinal and heterogeneous wearable-derived sleep, recovery, physiology, and behavior signals. No new benchmarks were introduced; the focus was on evaluating performance on this real-world health data.

Key Insights and Ideas

  • Deterministic code for "thinking fast": For recurring, stable analytical tasks in health text generation (like comparing a metric to a baseline or selecting a key finding), deterministic code is more reliable and cost-effective than relying on LLM prompting alone.
  • LLMs for "talking smart": LLMs excel at translating verified facts into natural, empathetic, and schema-constrained language, but they should not be tasked with performing the core analytical reasoning.
  • The writer interface is crucial: Even when upstream analytical steps are deterministic, the interface through which verified facts are passed to the LLM writer is critical. A poorly designed interface can reintroduce errors, suggesting that the "evidence packet" constraining the LLM's output should remain deterministic.
  • Layer-specific failures reveal LLM weaknesses: Replacing individual deterministic layers with LLM-generated artifacts showed that LLMs struggle with numerical comparison, adhering to ranking policies, and accurately gating attribution based on evidence. These are precisely the kinds of tasks that deterministic code handles well.
  • Schema-validity is not enough: An LLM can produce syntactically correct JSON (schema-valid), but this doesn't guarantee the content is accurate, grounded, or adheres to the intended analytical logic.

Key Results

  • Lower Error and Cost: TFTS consistently achieved lower numeric error (NUMERR) and instruction-compliance error (SELERR, ATTRERR) compared to structured zero-shot and few-shot one-call LLM baselines across six different LLM models.
  • Error Frontier: TFTS occupied the low-cost, low-error region in cost-error plots, with average NUMERR at 0.7% and instruction-compliance error below 3%.
  • Layer Replacement Impact:
    • Replacing the comparison layer with an LLM artifact increased NUMERR to 16.9%.
  • Replacing the ranking layer led to an aggregate SELERR of 65.8%.
  • Replacing the attribution layer resulted in an aggregate ATTRERR of 24.5%.
  • Replacing the handoff (writer interface) layer increased NUMERR to 4.8% and ATTRERR to 10.7%.
  • Cost Efficiency: TFTS achieved lower end-to-end costs than the one-call baselines.

Limitations and Future Work

  • Domain Specificity: While the partitioning principle is general, the experiments were conducted specifically on sleep-health data. The authors acknowledge that other health domains might require different partitioning strategies.
  • Clinical Optimality vs. Deterministic Reference: The study evaluated performance against a deterministic reference system, not necessarily clinical optimality. Metrics like SELERR reflect disagreement with an application selection rule, not necessarily health importance.
  • Future Work: The authors suggest exploring human evaluation of helpfulness and perceived personalization as complementary future work. They also propose build-time agentic AI, where LLM agents assist humans in constructing and auditing deterministic health-insight pipelines before deployment. They believe the partitioning principle is most applicable to domains with structured inputs, stable analytical rules, repeated deployment, and verifiable intermediates, such as lab result explanations, vitals monitoring, and medication adherence coaching. Tasks requiring open-ended clinical reasoning, diagnosis, or treatment planning might require different approaches.

Summary updated

Abstract

Large language models (LLMs) are increasingly being used to generate health text from structured records such as wearable time series, biomarkers, vitals, and care-management logs. For recurring health outputs, fluency is not enough: systems must remain faithful to source data, ground explanatory claims in available evidence, follow stated policies, emit machine-readable outputs, and run cheaply enough for repeated use. We ask which responsibilities in structured health generation should be deterministic computation rather than runtime LLM prompting. We introduce Think Fast, Talk Smart (TFTS), a sleep-health insight pipeline in which deterministic code performs recurring analysis before one bounded LLM writer call. Across 280 user-nights and six models, TFTS achieves lower numeric error, lower instruction-compliance error, and lower end-to-end cost than structured zero-shot and few-shot one-call baselines. Layer replacement reveals contract-specific failures: LLM comparison raises numeric error, LLM ranking degrades policy selection, LLM attribution increases unsupported causal language, and an LLM-generated writer interface reintroduces errors even after upstream facts are deterministic. The results support a broader design rule: let code own recurring analysis, and let LLMs express verified facts within bounded interfaces.
BibTeX
@inproceedings{cheng2026think,
  author = {Kai-Chen Cheng and Haejun Han and Qiwei Sun},
  title = {{Think Fast, Talk Smart: Partitioning Deterministic and Neural Computation for Structured Health Text Generation}},
  booktitle = {SD4H @ ICML},
  year = {2026},
  url = {https://openreview.net/forum?id=LF7WwoWAGI},
}
Figure