The conversation about AI in Journalism is no longer about whether it is good or bad but about how it can be used to enhance work and productivity.
We have previously written about ways newsrooms can use AI and why journalists need to look out for the shortfalls of AI like its bias and a few homegrown AI tools developed in Nigeria that journalists can use for fact-checking.
This article will focus on Generative AI prompting for journalists, the kinds of prompts used by journalists and how best to use them while ensuring quality control.
What is Prompt or prompt engineering? This is probably the best entry-point question to be answered in order to dive into the world of Generative AI prompting for anybody, especially journalists as we set out to do in this article.
A Prompt is a piece of text question or instruction given to an AI to answer or generate. While Prompt engineering is the process of designing and refining prompts to get the best possible responses from an AI.
Using computer operation terms, prompts are the input for the AI which uses its Large Language Models (LLMs), a repository of enormous amounts of information and algorithmic instructions that serves as its processor which helps it understand the task enough to be able to work on it and generate a response which is the output it sends back to the user.
An example of a prompt using a Google search scenario is googling “Nigerian Journalism” while prompt engineering in extension can be refining it to say “Tell me about the history and evolution of Nigerian journalism” or further saying “Generate a 1000-word article chronicling the evolution of Nigerian Journalism from pre-independence to post-independence and up till current political dispensation.”
Prompting is the mode of communication with the Large Language Models (LLMs) on which generative AI is built so journalists need to understand how to refine these prompts given to AI for tasks to achieve the best result possible.
Prompting achieves better results when expressed in full sentences with clear and specific instructions to adhere to for a given task. The clearer the instruction for the task to be achieved the higher the chance of generating better output. Some other proven hacks to prompting is providing an ideal sample for the AI to imitate and instructing it to work out and highlight its step-by-step solution to achieving the task given.
There are different kinds of prompting techniques and their categorisation varies per expert, but for the sake of this article, we will use the three highlighted in this article published by the Generative AI in the Newsroom (GAIN) Project. The authors highlight the three key prompting techniques to be: Zero-shot Prompting, Few-shot Prompting and Chain-of-Thought Prompting.
READ ALSO: Need for more balanced reportage about AI by media in Nigeria
Each of these prompting techniques offers varying levels of task-oriented instructing techniques for the AIs and generates valuable results for the users.
- Zero-shot Prompting: in simple terms, zero-shot prompting employs the simplest and a short string of words as instructions to the AI for a given task. It involves instructing the model to complete a task without providing it with examples, specific reference points and parameters or demonstrations of the task or its output (i.e. “zero” in zero-shot refers to zero examples provided). This type of prompting can be useful for tasks that require ideation (e.g., brainstorming interview questions or article topics), content generation (e.g., drafts for headlines), and translation.
The shortfall of this technique, however, is that it requires many iterations/refining over the initial prompt to include the necessary details to generate the desired output. This could be attributed to the statistical nature of LLMs that makes it difficult to consistently predict the model’s exact responses and format when completing a task.
Another shortfall worthy of note is that since instruction is not specific enough the AI may only rely on its training to and not up-to-date information to generate output for the prompt.
Zero-shot prompting can be used for simple translation, text summarization, sentiment analysis, question answering and content creation.
- Few-shot Prompting: Few-shot prompting is just a little notch higher than zero-shot prompting as it uses additional details, structure, and formatted responses in the prompts to clarify the requirements for solving the task given. Unlike zero-shot, few-shot prompting provides clear examples of the task or the formatting of the desired output giving enough context for the AI to work with. It helps the AI to recognise the preferred output it needs to generate for the user.
As in the case of sentiment analysis in zero-shot prompts, journalists can use a few-shot prompt to establish the preferred classification of users’ comments on news articles by providing the LLM with a few examples of negative, positive and neutral comments along with their corresponding labels.
Similarly, few-shot prompting can be useful for information extraction (e.g., extracting named entities like people or places) or categorization (e.g. labelling content according to a schema) use cases. Or
The key to few-shot prompting is the development of examples that demonstrate to the model how to complete a task so it can ideally generalize across those examples. This can also be the fall short because if the ideal example is not well communicated to the AI it may misunderstand the instruction and generate irrelevant information. This prompting is also prone to overfitting content to the example given making the generated less accurate or flawed,
- Chain-of-Thought Prompting(CoT): In Chain of Thought prompting the user gives enough information and instruction to enable the AI to “reason” about complex tasks and come up with a valid result using a step-by-step approach.
CoT prompting is not much different or complex compared to zero-shot and few-shot prompting, it simply includes the instruction to show a step-by-step working in its response. It is like asking a mathematics student to show his workings as he solves the problem given.
It is as simple as adding the phrase “lets think step-by-step” to a zero-shot or few-shot prompts a mutually exclusive technique to the other prompting techniques we have described thus far. In its most basic form you can append “let’s think step by step” to any prompt including the zero and few shot prompts. The reason this works is that, before tackling the task, the model will output context which can further help ground the output. This prompting technique has proven to be useful for analytical tasks such as answering quantitative questions from text. It can also be combined with few-shot prompting to get better results on more complex tasks that require reasoning before responding