Automated Data Journalism Platform Using LLMs for Real-time News Generation

realtime · Media & Entertainment · 2024 · source Agentic: no · promotional bias: low · source-backed · extracted with prompt 0.5.4 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Media & Entertainment

Realtime needed to keep a data-journalism site updated as public datasets changed faster than journalists could manually inspect, contextualize, and write about every update.

Constraints:

Architecture

Realtime uses a polling and diffing data pipeline to detect new datapoints across public datasets, normalize them into a single format, fetch relevant recent news through NewsAPI, and then construct GPT-4 Turbo prompts from dataset metadata, quantitative update features, and related news. The LLM generates headlines, subheads, and annotated summaries, then a second LLM pass edits for input consistency and style-guide compliance. Visualizations are generated with Vega/Vega-Lite, homepage ranking combines data-change magnitude, recency, and news volume, and reader-facing markup links claims back to data and articles for transparency.

Diagram confidence: explicit (topology described by the source).

flowchart LR
  dataset-polling-pipeline[Dataset polling pipeline] --> normalized-data-store[Normalized data store]
  dataset-polling-pipeline --> newsapi-context-fetcher[NewsAPI context fetcher]
  normalized-data-store --> prompt-builder[Prompt builder]
  newsapi-context-fetcher --> prompt-builder
  prompt-builder --> gpt-4-turbo-generator[GPT-4 Turbo generator]
  gpt-4-turbo-generator --> llm-editing-pass[LLM editing pass]
  gpt-4-turbo-generator --> story-ranking-system[Story ranking system]
  llm-editing-pass --> visualization-layer[Visualization layer]
  story-ranking-system --> visualization-layer
  normalized-data-store --> visualization-layer
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Dataset polling pipeline Continually asks public data providers for updates and diffs new data against known data. Normalized data store, NewsAPI context fetcher
Normalized data store Massages diverse public datasets into a single format suitable for downstream prompting and visualization. Dataset polling pipeline, Prompt builder, Visualization layer
NewsAPI context fetcher Retrieves recent articles relevant to each dataset or topic. Dataset polling pipeline, Prompt builder
Prompt builder Combines dataset metadata, quantitative update features, and recent news into GPT-4 Turbo prompts. Normalized data store, NewsAPI context fetcher, GPT-4 Turbo generator
GPT-4 Turbo generator Generates headlines, subheads, annotated summaries, and structured story fields. Prompt builder, LLM editing pass, Story ranking system
LLM editing pass Checks generated text for errors that do not follow from inputs and wording inconsistent with the style guide. GPT-4 Turbo generator, Visualization layer
Story ranking system Ranks homepage stories using data-change magnitude, recency, and related-news volume. GPT-4 Turbo generator, Visualization layer
Visualization layer Renders Vega/Vega-Lite visualizations and annotated generated text so readers can inspect data and source links. Normalized data store, LLM editing pass, Story ranking system

Data flow

The system regularly polls each configured data source and diffs the publisher's latest data against known data. When an update appears, Realtime normalizes it, retrieves related NewsAPI articles, and builds a prompt from dataset metadata, latest data features, and recent news. GPT-4 Turbo produces an annotated summary, headline, and subhead; a follow-up LLM edit checks for unsupported or off-style output. The resulting text and data drive Vega/Vega-Lite visualizations, homepage ranking, and reader-facing links that expose the underlying data and news evidence.

3 supporting quotes
“So we’ve built a pipeline to continually ask data sources, “Do you have any new data for me?” — essentially [diffing](https://en.”article, stated
“To generate this text, we dynamically construct a prompt from three inputs: the dataset metadata (the title, description, and other information the LLM needs to understand what it’s writing about), the latest data features (a quantitative summary of relevant updates), and any recent related news.”article, stated
“Finally, we again pass this text back to the LLM and ask it to edit the previously created output, looking in particular for errors that don’t follow from our inputs”article, stated

Why this architecture

The architecture separates data freshness, LLM generation, quality control, and presentation because each has a different failure mode. Polling and diffing solve unavailable push notifications. Prompt construction grounds generation in structured metadata, numeric data features, and news context. Multi-stage LLM calls improve task performance despite added cost, while post-generation checks and annotations address hallucination and transparency risks. Running generation on data updates, not page views, keeps model spending decoupled from audience growth.

4 supporting quotes
“Ideally, data providers would let us know every time they published a new datapoint, but the infrastructure isn’t there yet.”article, stated
“One of the biggest performance improvements that we’ve found was via utilizing multiple calls to the LLM, rather than asking it to do multiple things in one shot.”article, stated
“This influenced how we designed our systems, we had to ensure that the cost was invariant to the number of visitors coming to our site.”article, stated
“We try to make it clear when text is generated and give readers ways to double check it for accuracy, for example, by always showing the data visualized alongside generated text and providing direct links to referenced news articles.”article, stated

Models used: GPT-4 Turbo

Scale

Alternatives considered (roads not taken)

Single monolithic LLM call

Rejected because: Realtime found that splitting work into multiple LLM calls improved performance, even though it increased API cost.

“By breaking up the tasks into multiple calls, we see significant performance improvements, at least with the current generation of models.”article, stated
“The downside is that each call to the LLM comes with a cost (covered in our next point), but new open source tools like [DSPy](https://github.”article, stated

JSON as the primary prompt data format

Rejected because: The team found the extra syntax in JSON adds noise for the model, while YAML-like readable formatting is easier for both humans and LLMs to parse.

“The additional characters (the curly braces, quotations, etc.) help compilers to rigorously understand exactly what data is being described, but it is just extra noise for the LLM.”article, stated

Open-source models for lower cost

Rejected because: The article says open-source models are cheaper but did not yet match proprietary accuracy at the time of writing.

“Open source models offer a much cheaper alternative, but as of writing this, they do not achieve comparable accuracy.”article, stated

Patterns

prompt-chaining (generation-workflow)

Realtime breaks generation and review into multiple LLM calls instead of asking one prompt to perform every task.

“One of the biggest performance improvements that we’ve found was via utilizing multiple calls to the LLM, rather than asking it to do multiple things in one shot.”article, stated

structured-output-contract (integration)

The LLM returns typed story fields and annotated summary text that downstream ranking, visualization, and link-rendering code can consume.

“We use JSON in some of our outputs, for example, when generating headlines, we instruct the LLM to return a JSON object:”article, stated
“We use this structure data to feature a dataset and visualize it over a specific timespan when creating a story for the homepage.”article, stated

guardrails-io-filtering (quality-control)

Prompts forbid unsupported causality and additional LLM calls check for predictable fallacies and style-guide violations.

“We have to make sure in our prompts to prevent the LLM from generating headlines like “data went up X% because of news story Y”, when there is no proof of such a causal relationship.”article, stated
“This can be done through additional LLM calls that help guard against predictable types of fallacies”article, stated

cost-aware-routing (operations)

Realtime runs LLM generation on data updates rather than per reader request so model spend does not grow with traffic.

“This influenced how we designed our systems, we had to ensure that the cost was invariant to the number of visitors coming to our site.”article, stated

Tradeoffs

Multi-stage generation

Chose several focused LLM calls over one broad LLM prompt.

Rationale: Multiple calls improved model performance for generation and review, at the cost of more API calls.

“By breaking up the tasks into multiple calls, we see significant performance improvements, at least with the current generation of models.”article, stated
“The downside is that each call to the LLM comes with a cost (covered in our next point)”article, stated

Traffic-invariant generation cost

Chose generate on data updates over generate on every reader request.

Rationale: Decoupling model calls from audience traffic keeps unit economics predictable as readership grows.

“This influenced how we designed our systems, we had to ensure that the cost was invariant to the number of visitors coming to our site.”article, stated

Transparent AI labeling and linked evidence

Chose visible generated-text disclosure, visualized data, and linked article/data references over hiding AI generation behind normal editorial presentation.

Rationale: The team considered AI output useful but fallible, so readers need clear provenance and verification affordances.

“Don’t hide the fact that you’re using AI tools. Readers just want useful information — whether it comes from AI or not — but using AI comes with caveats”article, stated
“We try to make it clear when text is generated and give readers ways to double check it for accuracy”article, stated

Gotchas (what bit them)

LLMs overstate causal narratives in news headlines.

Root cause: The model tends to prefer exciting cause-and-effect stories even when the data only supports correlation or temporal co-occurrence.

Resolution: Realtime explicitly forbids unsupported causality and adds guardrail calls for causation, math, and semantic errors.

“One of the biggest recurring issues that we saw with our implementation was that the LLM really wanted to make exciting headlines that had a clear cause and effect narrative.”article, stated
“This can be done through additional LLM calls that help guard against predictable types of fallacies”article, stated

Prompt data format affects model comprehension.

Root cause: Syntactic characters in machine-friendly formats can become noise for an LLM.

Resolution: Realtime favors human-readable representations such as YAML-like data when passing information to the model.

“If it’s easier for a human to parse, it’s likely easier for the LLM to parse.”article, stated
“The additional characters (the curly braces, quotations, etc.) help compilers to rigorously understand exactly what data is being described, but it is just extra noise for the LLM.”article, stated

Generated journalism still inherits input-data quality problems.

Root cause: The LLM can only summarize and contextualize the datasets and news it receives.

Resolution: The system invests in clean, consistently updating datasets and makes source verification visible to readers.

“The boring but honest truth is that Realtime gets a lot of its utility from the work that we did to provide access to clean, consistently updating datasets and news articles.”article, stated

Evaluation

Realtime describes iterative prompt experimentation, follow-up LLM checks for predictable error classes, and reader-facing verification through data visualizations and source links rather than a formal offline benchmark.

Metrics: relative magnitude of data changes · recency of latest data updates · relative volume of news headlines · qualitative performance improvements from multiple LLM calls

3 supporting quotes
“We compute a ranking of the top stories at any given time by taking into account the relative magnitude and recency of the latest data updates, along with the relative volume of news headlines.”article, stated
“By breaking up the tasks into multiple calls, we see significant performance improvements, at least with the current generation of models.”article, stated
“Finally, we again pass this text back to the LLM and ask it to edit the previously created output, looking in particular for errors that don’t follow from our inputs”article, stated

Outcomes

The article does not give traffic counts, but it explicitly designs generation costs to be invariant to visitor volume and targets many updating public datasets.

3 supporting quotes
“Our system automates the creation of straightforward analyses and visualizations through the use of statistical software”article, stated
“Journalists can do less rote work and instead focus on in-depth reporting based on the trends and patterns that pop out automatically.”article, stated
“But I want to be clear that LLMs are fallible and still in their infancy.”article, stated