Nowadays, many people interact with Artificial Intelligence (AI) daily. As a result, prompt engineering has become increasingly important. The quality of AI responses depends heavily on the formulation of instructions. Focusing on punctuation, grammar and spelling, this article analyzes how clarity or ambiguity in writing prompts strongly affects the quality of AI responses.
1. Introduction
Have you thought about how your parents/grandparents lived without TV? Or if you are not so young, do you remember how it was living without a phone in your pocket? What do you think kids in a few years will think about us living in the pre AI generation? I have been a professor for around ten years and have been a witness of this transformation, at least in the academic area. Especially in the years post-pandemic, I have seen cases where students cannot conceive the idea of making an assignment without AI, or considering ridiculous its restriction for one specific scored test. In other words, nowadays, many people interact with Artificial Intelligence (AI) daily.
2. Why Prompt Clarity Matters
Given this, there is one thing people using AI today is looking for: a benefit. We may point at some examples: a high school student who may want to check if the text is aligned with the assignment from the teacher, a self learner developer who would like to restructure his code in order to follow SOLID principles he just learned, or maybe a software engineer who would like to include the AI assistance in the responses of a chat section. As a result, prompt engineering has become increasingly important, and the quality of AI responses has been raised as a topic to be taken into account.
3. The role of Language in AI Prompts
AI understanding is not like human understanding. It actually depends on the text input it receives–humans rely on both verbal and non-verbal communication. In other words, the quality of AI responses depends heavily on the formulation of instructions. The response will be in accordance with the input: if the input is ambiguous, the quality of the answer will be affected–and the benefit will be lost.
To achieve better results in responses, there are three key language concepts to take into account: punctuation, grammar and spelling. Let’s take a look into each one with some prompts examples:
3.1 Punctuation
Punctuation marks work as instruction/content separators, and clarify the intent of the input.
Bad prompt: Review this pull request check naming conventions point out bugs improve performance
Improved prompt: Review this pull request: check naming conventions, point out bugs, improve performance.
Without punctuation, the tasks are not clearly separated, leading the AI to make assumptions, reducing the quality of the response.
3.2 Grammar
Grammar defines the relation between words, which includes subject-verb relation and timing. It provides clarity and ordering to instructions.
Bad prompt: Make the user delete inactive accounts automatically
Improved prompt: Implement a process that automatically deletes inactive user accounts.
With an ambiguous subject-verb relation, it is not clear who has to make what, impacting the quality of the response.
3.3 Spelling
Spelling is key in giving the right meaning to the instruction, guiding the response as expected.
Bad prompt: Create a function to handle user session and cash data
Improved prompt: Create a function to handle user session and cache data.
A misspelling in a word may change the meaning of the entire instruction, deriving the response from what was intended by the writer of the input.
In technical contexts, like software development, medicine or laws, linguistic mistakes or inaccuracies may lead to wrong assumptions regarding the intended task, especially when prompt includes a wide range of steps or domain-specific terms. While individual errors may not represent a big issue, the impact is evident for complete and large prompts, where the clarity of the input directly impacts the quality of the response.
4. Structuring Better Prompts
At this point, we come to the concept of improving the way we ask the AI for help; some call it "prompt engineering”. To write a good prompt in order to get the best answer that fits what the user is looking for, ideally the prompt should have these four parts:
For example:
Act as a senior software engineer. You will have to review a pull request that is part of a backend service for a health records system in a private institution. Review the code included in the pull request. Check naming conventions, identify potential bugs, and suggest performance improvements. Don’t rewrite the entire code.
Let’s break down the prompt:
This example shows how using correct grammar, punctuation, and spelling combined with a complete structure in a prompt will lead to more useful AI responses, and will impact positively in their quality.
With this perspective, let’s think about AI as having a car. You may want some benefits from it, as being carried from A to B. But if you don’t know how it works, it will be nonsense. You may try to go in first gear on the highway, certainly you won’t get the benefit; or you may want to go without gas or oil, it won’t work either. You may blame the car– what a junk piece of metal!–or you may improve your knowledge about it. As Harvard Business Review stated: AI Won’t Replace Humans — But Humans With AI Will Replace Humans Without AI 1.