Natural language generation (NLG)

Natural language generation is the branch of AI and computational linguistics concerned with producing readable human-language text, from data, from other text or from a model's internal representations.

Natural language generation is the writing side of language technology. It is often paired with natural language understanding, its mirror image. Understanding has to make sense of messy, ambiguous input; generation has the opposite problem, choosing one clear, consistent wording out of many possible ones.

Classic systems broke the job into stages, set out by the researchers Reiter and Dale: decide what information to include, order it, merge related points, choose the words, decide how to refer to things, and finally produce grammatical sentences. A simple example turns six pollen readings into a short forecast for Scotland. These systems usually worked from structured data and templates, which made them predictable and easy to check.

They were in real use long before chatbots. In the early 1990s the FoG system generated weather forecasts in French and English for Environment Canada. On March 17, 2014 the Los Angeles Times published an earthquake report written by software within about three minutes of the quake. From July 2014 the Associated Press used software from Automated Insights to write short quarterly earnings stories, expanding coverage from about 300 companies to about 4,400.

Modern generation is mostly done end to end by neural networks, first recurrent networks and now large language models such as the ones behind ChatGPT. They write far more flexibly than templates, but they can produce text that reads well and is wrong. A template fills in the number it is given; a language model predicts likely words, and a confident error is called a hallucination.

Judging generated text is hard. The options are testing whether it helps people do a task, asking people to rate it, or using automatic metrics such as BLEU and ROUGE. The automatic metrics are cheap but mainly measure word overlap with a reference text, so they can miss whether the output is accurate or useful.

Common questions

What is natural language generation?

It is the use of software to produce human-readable text, whether from data such as figures in a spreadsheet, from other text as in summarising, or from a language model. Weather reports, earnings summaries and chatbot replies are all examples.

What is the difference between NLG, NLU and NLP?

Natural language processing is the whole field of computers working with human language. Natural language understanding is the part concerned with interpreting language, and natural language generation is the part concerned with producing it.

Is ChatGPT an example of natural language generation?

Yes. ChatGPT runs on a large language model that generates text one token at a time, which is natural language generation. It differs from older systems, which typically filled templates from structured data.

What are examples of NLG in use?

Examples include automated weather forecasts, such as Environment Canada's FoG system in the early 1990s, the Associated Press's automated earnings stories from 2014, product descriptions, summaries of medical records and chatbot replies.

Finding more

Search for "natural language generation", "data-to-text generation" or "automated journalism" to see both the classic and modern sides of the field. Reliable sources include the ACL Anthology of computational linguistics papers, university course notes, and newsroom accounts of how automated stories are produced and checked. Be sceptical of output-volume claims in vendor case studies, which rarely report error rates.

Working out what this means for your business?

Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.