Mokabyte

Dal 1996, architetture, metodologie, sviluppo software

  • Argomenti
    • Programmazione & Linguaggi
      • Java
      • DataBase & elaborazione dei dati
      • Frameworks & Tools
      • Processi di sviluppo
    • Architetture dei sistemi
      • Sicurezza informatica
      • DevOps
    • Project Management
      • Organizzazione aziendale
      • HR
      • Soft skills
    • Lean/Agile
      • Scrum
      • Teoria della complessità
      • Apprendimento & Serious Gaming
    • Internet & Digital
      • Cultura & Società
      • Conferenze & Reportage
      • Marketing & eCommerce
    • Hardware & Tecnologia
      • Intelligenza artificiale
      • UX design & Grafica
  • Ultimo numero
  • Archivio
    • Archivio dal 2006 ad oggi
    • Il primo sito web – 1996-2005
  • Chi siamo
  • Libri
  • Contatti e newsletter
  • Argomenti
    • Programmazione & Linguaggi
      • Java
      • DataBase & elaborazione dei dati
      • Frameworks & Tools
      • Processi di sviluppo
    • Architetture dei sistemi
      • Sicurezza informatica
      • DevOps
    • Project Management
      • Organizzazione aziendale
      • HR
      • Soft skills
    • Lean/Agile
      • Scrum
      • Teoria della complessità
      • Apprendimento & Serious Gaming
    • Internet & Digital
      • Cultura & Società
      • Conferenze & Reportage
      • Marketing & eCommerce
    • Hardware & Tecnologia
      • Intelligenza artificiale
      • UX design & Grafica
  • Ultimo numero
  • Archivio
    • Archivio dal 2006 ad oggi
    • Il primo sito web – 1996-2005
  • Chi siamo
  • Libri
  • Contatti e newsletter

Nel numero:

nonumber
, anno 2026

LLMs models: how do they work?

Part 8: A first look at Prompt Engineering

Luca Vetti Tagliati
Luca Vetti Tagliati

Senior esperto in tecnologia e trasformazione digitale, con una solida esperienza in Enterprise Architecture, ruoli di CTO, Product Ownership e posizioni di technical management, gestendo elevati budget globali.

Riconosciuto per una leadership innovativa, orientata al cliente e ai risultati, con la capacità di operare efficacemente tra strategia, esecuzione e coinvolgimento degli stakeholder per garantire il successo dei programmi.

Unisce una profonda competenza tecnica all'esperienza commerciale e gestionale, riuscendo anche a risanare programmi complessi, spesso richiesti dai regolatori, e a fornire soluzioni pragmatiche e ad alto impatto in tempi stretti.

Porta visioni strategiche supportate da un approccio concreto, allineando costantemente tecnologia, dati e innovazione agli obiettivi aziendali e normativi.

Ha conseguito un dottorato di ricerca, presso la University Of London, lavorando a tempo pieno nell’industria. Ciò gli permetti di offrire una combinazione di rigore accademico e concretezza operativa.

Recentemente è tornato a dedicarsi all’Intelligenza Artificiale e all’analisi avanzata dei dati, avendo ricoperto il ruolo di Head of Data Analytics & Innovation (2022) per due anni, pubblicando ricerche peer-reviewed e contribuendo attivamente a think tank e forum di settore sull’AI.

Tra le principali attività portate a compimento negli anni:

Progettazione dell’architettura del sistema su larga scala Impairment(s), vincitore del Global Enterprise Architecture Excellence Awards 2018 (categoria Banking)

Ideazione e implementazione del "DANTE Data Fabric", vincitore dell’iCMG Enterprise, Business & IT Architecture Excellence Awards 2015 (categoria SOA Services for Enterprise)

Progettazione della piattaforma di calcolo REF, finalista ai Banking Technology Awards 2014 (categoria Best Use of IT for risk/regulatory change)

Attribuzione del premio “Extraordinary Commitment” nel 2014

 

Pubblicazioni:

Libro UML and Software Engineering - From Theory to Practice (2004)

Libro Java Best Practices (2008)

Libro Towards Java SE 8: Notes for Developers in Java 7 (2013)

Numerosi articoli su riviste IT e online, inclusi contributi sull’Intelligenza Artificiale.

Pagina LinkedIn: https://ch.linkedin.com/in/luca-vetti-tagliati-phd-2b55618

 

Artificial Intellgence, Large Language Models

LLMs models: how do they work?

Part 8: A first look at Prompt Engineering

Immagine di Luca Vetti Tagliati

Luca Vetti Tagliati

  • Questo articolo parla di: Intelligenza artificiale, Internet & Digital

Introduction

An accurate and effective definition of prompts, the inputs provided to a model to obtain a response, is crucial in the interaction with LLMs: the clarity and, more generally, the quality of a prompt directly influence the relevance, accuracy, and, ultimately, the utility of the model’s output. It is not uncommon to hear users, especially less experienced ones, complain about the low quality of the generated output or the fact that the model does not understand the topic and produces erroneous results. In many cases, however, the issue stems from inadequately constructed prompts, which limit or misguidedly direct the model’s responses. Well-crafted and structured prompts guide the model towards the desired outcome, reduce ambiguity, and minimise misunderstandings, leading to more efficient and effective interactions. Clear and specific instructions improve output quality, aligning the model’s responses with the user’s intent. Prompt engineering is therefore a fundamental competence to maximise the value obtained from LLMs and, more generally, from AI tools.

A new programming language?

Certain professionals have begun to theorise that “prompting” is the programming language of the future. Machines are now capable of understanding natural language when appropriately structured with certain adjustments. Therefore, learning to provide better prompts to LLMs could become a fundamental competence in the new era of software engineering and beyond. Furthermore, in previous articles, we discussed LLM hallucinations, namely instances where a model produces outputs that appear plausible but are in reality false, fabricated, or misleading. Although the research community is still working towards a comprehensive solution, there exist several practical approaches designed to mitigate the risk of such hallucinations. An appropriate use of prompting, alongside typical research approaches such as requesting sources, fact-checking, and cross-referencing results, has been shown to reduce misinformation in AI-generated outputs.

Prompt engineering: a technical and linguistic competence

Various strategies can assist users in obtaining higher quality and more personalised outputs from LLMs. Consequently, the ability to define effective prompts is rapidly becoming a key competence to derive the maximum value from these models. In this and the forthcoming article, we will focus on methods and frameworks designed to enhance prompt quality. Specifically, methods such as Zero-Shot prompting, Few-Shot prompting, Chain-of-Thought (CoT) prompting, and ReAct prompting (Reason + Act) will be introduced. We will also present structured frameworks such as Role Prompting, RACE, and CRISPE. It is important to note that there is no universally accepted distinction between “methods” and “frameworks”, and that the two spheres frequently overlap, to the extent that the two terms are often used interchangeably. Prompting strategies define how to interact with an LLM to influence its behaviour and performance, whereas prompting frameworks define how to structurethe input to ensure clarity, coherence, and completeness.

But what is a prompt?

A prompt is the input provided to an LLM to elicit a response. It can assume the form of a question, instruction, command, or statement, and can range from a single word to a detailed and structured message. More generally, a prompt encompasses any input that expresses the user’s intent and provides the model with the necessary information to generate a relevant output [Sheldon et al., 2024].

 

Effects of inadequate prompt engineering

Inadequate prompt engineering is not merely a theoretical or marginal issue; ambiguous or imprecise prompts regularly lead to measurable inefficiencies, increased costs, and lower output quality. Although rigorous empirical research on this topic is still under development, existing studies and industry surveys converge in highlighting the negative effects of poorly designed prompts and suboptimal interactions with LLMs.

Time

Poor or unstructured prompts can increase the time required to complete tasks. An independent controlled study, conducted on expert open-source software developers, revealed that the use of AI tools increased task completion time by approximately 19% compared to working without AI assistance, despite the developers perceiving themselves to be faster. The process typically requires several iterations of output verification, resulting in the updating and re-entry of prompts. The prolonged times are primarily due to the additional activities of reviewing and refining the AI-generated outputs, highlighting how imperfect prompting and suboptimal interaction with the model can reduce, rather than increase, actual productivity [Becker et al., 2025].

Quality

The manner in which prompts are formulated heavily influences the correctness and utility of the outputs produced by LLMs. Empirical studies in the fields of human-computer interaction and AI have demonstrated that systematic prompt design approaches, such as the use of structured methods and frameworks, can significantly enhance model performance in executing complex tasks. In the absence of such approaches, unstructured prompts tend to yield lower-quality results that necessitate more thorough revisions and verifications [Gutheil et al., 2026].

High-risk contexts

In critical decision-making domains, such as medicine, the formulation and structure of prompts can significantly influence diagnostic accuracy and the reliability of outputs. Studies on multimodal LLMs have highlighted that structured prompting approaches, such as Chain-of-Thought reasoning, improve diagnostic quality and the clarity of explanations compared to naïve prompts. This suggests that inadequate prompting elevates the risk of erroneous results in sensitive contexts. Although exact values vary depending on the domain, this trend is corroborated within medical scientific literature [Hassanein et al., 2025].

Economic and corporate risk

Hallucinations, coupled with erroneous outputs, represent a significant risk for organisations. These issues frequently originate from poorly defined prompts. Industry analyses and documented cases illustrate situations where erroneous AI-generated outputs have resulted in negative economic, reputational, and contractual consequences. For instance, a well-known case involved a consulting firm publishing a report containing fabricated references, necessitating corrections and compensation. Such episodes highlight how unreliable outputs, also stemming from ill-defined prompts, can translate into concrete economic risks [Laurent, 2025].

Decision-making risk slowing down corporate adoption

Surveys on AI adoption within enterprises indicate that, whilst investments continue to grow rapidly, organisations encounter difficulties in quantifying a return on investment (ROI) and frequently in mitigating the risks associated with output quality. Many executives report that unclear benefits, alongside the need for governance and verification frameworks, restrict the achievement of anticipated efficiency gains. This suggests that the suboptimal design of user-model interaction, including prompting, contributes to the wastage of resources and a slower creation of value.

 

Techniques vs. frameworks

Prompting techniques are strategies that guide the manner in which one interacts with an LLM (e.g., zero-shot, few-shot, chain-of-thought, ReAct prompting), with the objective of improving reasoning, learning, or overall performance. These techniques primarily aim to influence the model’s behaviour. Prompting frameworks, conversely, define how to structure and organise the input. They provide templates (e.g., Role Prompting, RACE, CRISPE) that ensure clarity, completeness, and coherence in prompt design. In this sense, frameworks shape the form of the prompt, whilst techniques influence the way the model processes it. Nevertheless, an overlap frequently exists between these two “categories”. Certain techniques inherently require structural elements typically associated with frameworks. For example, few-shot prompting relies upon the inclusion of examples within the prompt, whereas chain-of-thought (CoT) prompting encourages step-by-step reasoning, often by explicitly asking the model to “think” in subsequent steps. Overall, although techniques and frameworks serve distinct purposes, they are complementary and are frequently utilised in tandem to achieve optimal results.

Clearly, we will not provide an exhaustive list of all possible methods and frameworks, but rather present a selection of the most widely used ones, to highlight their primary characteristics and briefly outline the contexts in which each proves more or less effective. By analysing these approaches, the Prompt techniques Let us therefore begin in this article by examining prompt techniques, whilst in the next one we will look more closely at frameworks. In recent years, both the academic and industrial spheres have developed methods and frameworks aimed at improving prompt design. Several effective approaches have emerged for structuring and optimising prompt engineering for Large Language Models. In the following paragraphs, we will provide a brief introduction to prompt construction methods widely recognised and utilised in both research and practice.

 

Zero-shot prompting

The basic idea of zero-shot prompting is to request the LLM to perform a task using exclusively instructions or questions expressed in natural language, without providing examples. The model thus relies entirely upon its prior training to interpret and execute the task [Groome, 2025]. This approach represents a baseline for evaluating the model’s generalisation capabilities and forms the foundation of many modern prompt engineering strategies. It is also likely the method through which the majority of users first encounter LLMs. Historically, it was widely used with early models such as GPT-2 and remains a default interaction mode for many foundational models. LLMs frequently possess sufficient prior knowledge to perform numerous tasks without the need for examples. The principal advantage of this approach lies in its simplicity and the low cost in terms of formulating initial prompts. The typical utilisation of this method involves an iterative process of refinement: users start with an initial prompt, analyse the response, and subsequently modify it based on the obtained output. This may include rephrasing the text, adding context, or simplifying the request to improve the results. In many cases, the LLM itself can assist in refining and improving the prompt.

Example

“Summarise the following article in 3–5 key points.”

Use cases

  • Simple tasks
  • Rapid explorations
  • Classification, summarisation, information extraction, translation, and basic reasoning.

Key points

Experience demonstrates that this simple approach, whilst adequate for basic tasks, frequently proves insufficient and can lead to the problems described previously: time wastage, low output quality, etc. Certain general best practices remain valid: prompts should minimise ambiguity and avoid redundant or imprecise language. For instance, in the case above, the prompt clearly specifies “3–5 key points” instead of a vague expression such as “a few points”. It is furthermore advisable to explicitly state what the model should do, rather than what it should not do.

 

Few-shot prompting

At the core of the few-shot technique lies this idea: LLMs are capable of handling many relatively simple tasks using a basic zero-shot prompting approach. However, for complex tasks, the model’s performance can frequently be improved by including examples within the prompt, in order to guide the model and increase its accuracy. Few-shot prompting relies precisely upon this principle: providing the model with a small set of relevant examples directly within the prompt. These examples assist the model in understanding how to approach and respond to a specific type of task or question. The demonstrations are generally structured as described below. Input–output schemas: each provided example consists of a pair:

  • input, for example a question or a text;
  • corresponding desired output.

Format consistency: the examples follow a uniform structure, assisting the model in recognising and replicating the expected pattern. Relevance to the task: the examples are closely aligned with the task, clearly demonstrating the required competence or knowledge. According to Touvron et al. [Touvron et al., 2023], the necessity and advantages of the few-shot prompting method began to emerge when models started to reach a sufficiently large scale [Kaplan et al., 2020]. Certain prompt engineering works also refer to one-shot prompting [Chen et al., 2025], which can be viewed as a compromise between zero-shot and few-shot prompting, wherein only a single example is provided. This method can be used in rather simple classification tasks.

Example

PROMPT

“Classify the sentiment of the football match report.

Example 1: Text: Our team won 3–0, dominating the entire match. Sentiment: Positive

Example 2: Text: We lost 3–1 and the defence made several mistakes. Sentiment: Negative

Example 3: Text: The match ended 1–1 with both teams being cautious. Sentiment: Neutral

Now classify this: Text: Our team scored in the last minute, securing a 2–1 victory. Sentiment:”

OUTPUT

“Positive”

Use cases

  • Situations where the output format is important
  • Classification activities
  • Situations where zero-shot or one-shot prompting prove insufficient

Key points

When utilising this technique, it is important to remember that:

  • the quality of the examples is more important than the quantity: a few well-chosen examples frequently outperform many weak examples;
  • performance is sensitive to the selection, ordering, and formulation of the examples; thus, even minor variations can significantly influence the results.

Chain-of-thought (CoT) prompting

The basic idea of this method is that the prompt instructs the LLM to generate intermediate reasoning outputs before providing the final answer. Instead of arriving directly at the conclusion, chain-of-thought (CoT) prompting is a technique that encourages models to explicate step-by-step reasoning in natural language. In particular, the study Chain-of-Thought Prompting Elicits Reasoning in Large Language Models [Wei et al., 2023] demonstrates that, when models have managed to achieve sufficient scalability, requesting them to provide a few examples of explicated reasoning can significantly improve performance in multi-step tasks, such as mathematical problems, symbolic reasoning, and common-sense questions.

Example

The classic schema assumes the following form: “Solve the following problem and explain your reasoning step by step” or “Solve the following problem and explain your reasoning one step at a time”.

PROMPT

“How many times in a day do the hour and minute hands of an analogue clock overlap? Explain your reasoning step by step.”

OUTPUT

  1. Speed of the hands: The minute hand completes a full rotation every 60 minutes. The hour hand completes a full rotation every 12 hours (12 × 60 = 720 minutes). Therefore, their speeds are:
  • Minute hand: 360 / 60 = 6 degrees per minute
  • Hour hand: 360 / 720 = 0.5 degrees per minute
  1. Relative speed: The minute hand gains on the hour hand at a speed of 6 − 0.5 = 5.5 degrees per minute To meet again, the minute hand must catch up 360° relative to the hour hand.
  2. Time between two consecutive meetings: Time = 360 / 5.5 ≈ 65.45 minutes Thus, the hands meet approximately every 65.45 minutes.
  3. Number of meetings in 12 hours: In 12 hours there are 720 minutes, therefore: 720 / 65.45 ≈ 11. Therefore, the hands meet 11 times in 12 hours.
  4. Number of meetings in 24 hours: Since 24 hours comprise two 12-hour cycles: 11 × 2 = 22

Final answer: The hands of an analogue clock meet 22 times in a day. Although the day has 24 hours, they only meet 22 times because one meeting occurs shortly after 12:00, resulting in one fewer meeting per 12-hour cycle.

Use cases

  • Mathematical problems
  • Symbolic reasoning
  • Common-sense reasoning
  • Multi-step questions
  • Planning and decision-making activities

Key points

Research demonstrates that encouraging models to reason step by step can significantly improve performance on complex tasks. For example, prompts such as “Let’s think step by step” have been shown to substantially increase reasoning accuracy in benchmarks.

 

Self-consistency prompting

Self-consistency prompting is an extension of CoT prompting. The principal difference lies in the fact that, instead of producing a single reasoning path, the model generates multiple diversified reasoning paths to solve the same problem. This produces several potential answers, from which the final answer is selected based on consistency, typically via a majority vote. The underlying idea is that, rather than relying on a single reasoning sequence, the method aggregates multiple reasoning processes and chooses the answer that appears most frequently, thereby improving robustness and accuracy [Wang et al., 2022].

Example

Consider the following problem: “There is a father and a son. When the father was 31 years old, the son was 8. Now the father is twice the age of the son. How old is the son?”.

PHASE 1: CHAIN-OF-THOUGHT PROMPT

“There is a father and a son. When the father was 31 years old, the son was 8. Now the father is twice the age of the son. How old is the son? Reason step by step.”

PHASE 2: SAMPLING MULTIPLE REASONING PATHS

Reasoning path 1:

  • The age difference remains constant. Age difference = 31 – 8 = 23
  • Letx be the son’s current age, then the father’s age is x+23.
  • Given that the father is twice the age of the son:x+23=2x
  • Solving:x=23
  • Answer: 23

Reasoning path 2:

  • The father is always 23 years older than the son.
  • Now the father is twice the age of the son:
  • If the son is 23 years old, the father is 46 → difference = 23
  • Condition satisfied.
  • Answer: 23

Reasoning path 3 (erroneous):

  • The father is twice the age, so perhaps: 31 × 2 = 62
  • Then the son could be 31 years old.
  • Answer: 31

Reasoning path 4:

  • Letx be the son’s age and thus 2x the father’s.
  • Difference =2x−x=x
  • But we know the difference is 23 →x=23
  • Answer: 23

PHASE 3: AGGREGATION OF ANSWERS (SELF-CONSISTENCY)

  • Answer 23 → appears 3 times
  • Answer 31 → appears 1 time
  • Final answer (majority vote): 23

Key points

In this simple example, multiple reasoning paths are generated for an arithmetic problem concerning ages. Although certain trajectories fail due to erroneous interpretations of the proportional relationships between the ages, the majority correctly exploit the constant age difference and the provided constraint. The aggregation of answers via a majority vote allows the correct solution to be obtained, illustrating the greater robustness of self-consistency compared to reasoning based upon a single path.

A note on computational cost

From a prompting perspective, two primary approaches have emerged for implementing self-consistency, partly due to the limitations of early LLMs. The first approach does not require explicitly instructing the model to generate multiple reasoning paths within a single prompt. Conversely, analogously to CoT prompting, it is sufficient to request step-by-step reasoning, so that self-consistency is implemented at the sampling (decoding) level rather than at the prompt level. This avoids altering the output distribution. Notably, explicitly requesting multiple reasoning paths within a single prompt can lead the model to collapse them into a single response, generate reasoning paths that are not genuinely independent, and reduce the statistical benefits derived from sampling diversified trajectories. The second approach, conversely, entails explicitly requesting the model to generate multiple reasoning paths within a single response. For example:

PROMPT

“Solve the following problem […] Generate 3–5 different answers using distinct reasoning paths. Then aggregate a single final answer based on […] Reason step by step.”

Although this approach can prove useful in practice, it deviates from the original formulation of self-consistency and can produce lesser independence between the reasoning paths. Users can experiment with both approaches as a form of benchmarking to evaluate the robustness and accuracy of the final result. In practice, the first approach tends to yield better results, as it is more aligned with the theoretical foundations of self-consistency. The self-consistency approach entails a typically higher computational cost, as it requires multiple parallel paths generated by the model instead of a single inference. However, it generally improves accuracy: by aggregating multiple reasoning paths, it reduces the probability of relying upon an erroneous sequence of thought. This also increases robustness to reasoning errors, since flawed or defective paths are overcome by the more consistent and correct ones. Finally, it can achieve even better performance for complex tasks, particularly those requiring multi-step reasoning (for instance, arithmetic, common-sense knowledge, and symbolic reasoning).

 

ReAct prompting (Reason + act)

Basic idea: the model alternates phases of reasoning and actions, such as retrieving information from external tools or its own knowledge sources. The central idea is to allow the model to reason step by step whilst interacting with external information, thereby improving accuracy in complex tasks such as question-answer iterations, research, and the decision-making process [Yao et al., 2023]. ReAct prompting instructs an LLM to generate interleaved sequences of reasoning traces (“Thought”) and actions oriented towards a specific task (“Action”), followed by observations returned from the environment. The classic interaction cycle typically follows this structure:

Thought → Action → Observation → Thought → Action → Observation → … → Final Answer

This approach combines:

  • Chain-of-thought reasoning (explicit step-by-step reasoning)
  • Use of tools / interaction with the environment

Example

QUESTION

“Who are considered the greatest footballers of all time?”.

Thought: The question is subjective. I should search for the players most frequently cited in historical rankings and in major awards such as the Ballon d’Or. Action: Search Action input: rankings of the greatest footballers of all time Observation: Many rankings frequently include Pelé, Diego Maradona, Lionel Messi, and Cristiano Ronaldo amongst the best players.

Thought: I should verify the achievements obtained by these players to understand why they are considered amongst the best.

Action: Search

Action input: main footballing achievements of Pelé

Observation: Pelé won three FIFA World Cups (1958, 1962, 1970) with Brazil and scored over 1000 career goals.

Thought: Pelé is widely recognised as one of the greatest due to his World Cup success and his goalscoring record.

I should also verify Diego Maradona.

Action: Search

Action input: main footballing achievements of Diego Armando Maradona

Observation: Winner of the 1986 World Cup (with a dominant individual performance); FIFA Player of the Century (joint winner). He led Napoli to two Serie A titles.

Thought: Diego Maradona is considered one of the greatest footballers of all time not only for his statistics but also for his extraordinary individual influence on the teams he played for.

Action: Search

Action input: main footballing achievements of Lionel Messi

Observation: Lionel Messi has won numerous Ballons d’Or, the FIFA World Cup (2022), and many titles with clubs such as Barcelona and PSG.

Thought: Individual awards and playmaking ability contribute to Messi’s reputation as one of the greatest ever.

I should also verify Cristiano Ronaldo.

Action: Search

Action input: Main footballing achievements of Cristiano Ronaldo

Observation: Cristiano Ronaldo has won numerous Ballons d’Or, UEFA Champions League titles, and holds many international goalscoring records.

Thought: Based on historical rankings and the achievements obtained, several players consistently appear in discussions regarding the greatest of all time.

FINAL ANSWER

The players most commonly cited amongst the greatest footballers of all time include Pelé, Diego Armando Maradona, Lionel Messi, and Cristiano Ronaldo, due to their exceptional achievements, the records set, and their enduring influence on the game.

A note on access to information

To fully comprehend the example, it is important to note that modern LLMs can access information beyond their integrated knowledge. RAG (Retrieval-Augmented Generation) is a method wherein an artificial intelligence model first retrieves relevant information (from documents, databases, or the web) and subsequently utilises it to generate a more accurate response. This process typically comprises three phases: the retrieval of useful information (Retrieval), the enrichment of the model’s knowledge with such information (Augmented), and the generation of an improved response (Generation). In simple terms, it is akin to providing the AI with supplementary notes, allowing it to offer more accurate and up-to-date responses instead of relying solely upon what it already “knows”.

Use cases

  • Answering complex questions: improves accuracy by combining step-by-step reasoning and the retrieval of external information.
  • Multi-step research: allows iterative search, verification, and refinement of information across multiple sources.
  • Problem solving with tools: integrates external tools (search engines, databases, APIs) to obtain more reliable and up-to-date answers.
  • Analysis and decision-making: supports structured reasoning based upon evidence, useful for evaluations and recommendations.
  • Interactive agents and workflows: enables systems that must act, observe results, and adapt (e.g., assistants, autonomous agents).

Key points

When applying this strategy, it is important to balance reasoning and action. Overly prolonged, excessive reasoning can be inefficient, whilst too many actions can introduce noise. Well-designed prompts, conversely, assist in maintaining an appropriate balance. Furthermore, it is fundamental to be aware of the risk of error propagation: erroneous observations can negatively influence subsequent reasoning steps and compromise the validity of the entire process. Finally, although this strategy offers significant advantages for complex tasks and articulated analyses, it introduces an excessive overhead for relatively simple activities.

 

Who writes the prompt?

As a final consideration of this article, let us ask ourselves who, effectively, “writes the prompt”: a human user or an automated system? Bearing this aspect in mind, there are two primary scenarios to consider:

  • User interaction with an LLM: in this case, it is generally advisable to begin with a simple prompting approach and, if necessary, progressively adopt more sophisticated methods.
  • LLM integrated into automated processes: in this scenario, due to the broader implications (for instance, reliability, costs, and scalability), it is important to select the prompting method considered most appropriate from the outset and rigorously validate it during the testing phase.

Conclusions

In this first article on prompt engineering, we have examined certain basic concepts followed by a series of techniques for prompt writing, featuring examples and use cases. We have relied upon corporate-type experiences and a series of “academic” studies that, recently, have contributed to systematising and clarifying the situation. In the next article of the series, we will continue our examination, moving on to the analysis of frameworks.

 

 

References

[Google, 2026]  Google, Prompt engineering: overview and guide, 14 January 2026
https://cloud.google.com/discover/what-is-prompt-engineering

 

[Becker et al., 2025]  Joel Becker, Nate Rush, Beth Barnes, David Rein, Measuring the Impact of Early-2025 AI on Experienced Open-Source Developer Productivity, 25 July 2025
https://arxiv.org/pdf/2507.09089

 

[Gutheil et al., 2026]  Niklas Gutheil, Valentin Mayer, Leopold Müller, Jörg Rommelt, Niklas Kühl, PromptPilot: Improving Human-AI Collaboration Through LLM-Enhanced Prompt Engineering, 1 Oct 2025 06
https://arxiv.org/pdf/2510.00555

 

[Laurent, 2025]  Adrien Laurent, AI Hallucinations in Business: Causes and Prevention, 2025
https://intuitionlabs.ai/articles/ai-hallucinations-business-causes-prevention?utm_source=chatgpt.com

 

[Hassanein et al., 2025]  Fatma EA Hassanein, Yousra Ahmed, Shaymaa Maher, Ahmed El Barbary, Asmaa Abou-Bakr, Prompt-dependent performance of multimodal AI model in oral diagnosis: a comprehensive analysis of accuracy, narrative quality, calibration, and latency versus human expert, 30 October 2025
https://pmc.ncbi.nlm.nih.gov/articles/PMC12575769/?utm_source=chatgpt.com

 

[Horton et al., 2025]  Richard Horton  Jan Michalski  Stacey Winters  Douglas Gunn  Jennifer Holland , AI ROI: The paradox of rising investment and elusive returns, 22 Oct 2025
https://www.deloitte.com/uk/en/issues/generative-ai/ai-roi-the-paradox-of-rising-investment-and-elusive-returns.html?utm_source=chatgpt.com

 

[Groome, 2025]  Imogen Groome, What is Zero-Shot Prompting?, 7 Aug  2025
https://www.ai21.com/glossary/foundational-llm/zero-shot-prompting/

 

[Brown et al. 2020]  Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, Dario Amodei, Language Models are Few-Shot Learners, last revised 22 Jul 2020
https://arxiv.org/abs/2005.14165

 

[Kaplan et al., 2020]  Jared Kaplan, Sam McCandlish, Tom Henighan, Tom B. Brown, Benjamin Chess, Rewon Child, Scott Gray, Alec Radford, Jeffrey Wu, Dario Amodei, Scaling Laws for Neural Language Models, 23 Jan 2020
https://arxiv.org/abs/2001.08361

 

[Touvron et al, 2023]  Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothee Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro, Faisal Azhar, Aurelien Rodriguez, Armand Joulin, Edouard Grave, Guillaume Lample, LLaMA: Open and Efficient Foundation Language Models, 27 Feb 2023
https://arxiv.org/pdf/2302.13971

 

[Chen et al., 2025]  Banghao Chen, Zhaofeng Zhang, Nicolas Langrené, Shengxin Zhu, Unleashing the potential of prompt engineering for large language models, Volume 6, Issue 6, 13 June 2025, 101260
https://www.sciencedirect.com/science/article/pii/S2666389925001084?utm_source=chatgpt.com

 

[Wei et al., 2023]  Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Brian Ichter, Fei Xia, Ed Chi, Quoc Le, Denny Zhou, Chain-of-Thought Prompting Elicits Reasoning in Large Language Models, 10 Jan 2023
https://arxiv.org/abs/2201.11903

 

[Yao et al., 2023]  Shunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du, Izhak Shafran, Karthik Narasimhan, Yuan Cao, ReAct: Synergizing Reasoning and Acting in Language Models, 10 Mar 2023
https://arxiv.org/abs/2210.03629

 

[Park, 2026]  David Park, The RACE Framework: Master Prompt Engineering in 15 Minutes, January 2026
https://automatemyjob.co.uk/blog/race-framework-prompt-engineering?utm_source=chatgpt.com

 

[Sheldon et al., 2024]  Robert Sheldon, Kinza Yasar, What is an AI prompt?, November 2024
https://www.techtarget.com/searchenterpriseai/definition/AI-prompt?utm_source=chatgpt.com

 

[Wang et al., 2022]  Xuezhi Wang, Jason Wei, Dale Schuurmans, Quoc Le, Ed Chi, Sharan Narang, Aakanksha Chowdhery, Denny Zhou , Self-Consistency Improves Chain-of-Thought Reasoning in Language Models, March 2023
https://arxiv.org/abs/2203.11171

 

 

Facebook
Twitter
LinkedIn
Luca Vetti Tagliati
Luca Vetti Tagliati

Senior esperto in tecnologia e trasformazione digitale, con una solida esperienza in Enterprise Architecture, ruoli di CTO, Product Ownership e posizioni di technical management, gestendo elevati budget globali.

Riconosciuto per una leadership innovativa, orientata al cliente e ai risultati, con la capacità di operare efficacemente tra strategia, esecuzione e coinvolgimento degli stakeholder per garantire il successo dei programmi.

Unisce una profonda competenza tecnica all'esperienza commerciale e gestionale, riuscendo anche a risanare programmi complessi, spesso richiesti dai regolatori, e a fornire soluzioni pragmatiche e ad alto impatto in tempi stretti.

Porta visioni strategiche supportate da un approccio concreto, allineando costantemente tecnologia, dati e innovazione agli obiettivi aziendali e normativi.

Ha conseguito un dottorato di ricerca, presso la University Of London, lavorando a tempo pieno nell’industria. Ciò gli permetti di offrire una combinazione di rigore accademico e concretezza operativa.

Recentemente è tornato a dedicarsi all’Intelligenza Artificiale e all’analisi avanzata dei dati, avendo ricoperto il ruolo di Head of Data Analytics & Innovation (2022) per due anni, pubblicando ricerche peer-reviewed e contribuendo attivamente a think tank e forum di settore sull’AI.

Tra le principali attività portate a compimento negli anni:

Progettazione dell’architettura del sistema su larga scala Impairment(s), vincitore del Global Enterprise Architecture Excellence Awards 2018 (categoria Banking)

Ideazione e implementazione del "DANTE Data Fabric", vincitore dell’iCMG Enterprise, Business & IT Architecture Excellence Awards 2015 (categoria SOA Services for Enterprise)

Progettazione della piattaforma di calcolo REF, finalista ai Banking Technology Awards 2014 (categoria Best Use of IT for risk/regulatory change)

Attribuzione del premio “Extraordinary Commitment” nel 2014

 

Pubblicazioni:

Libro UML and Software Engineering - From Theory to Practice (2004)

Libro Java Best Practices (2008)

Libro Towards Java SE 8: Notes for Developers in Java 7 (2013)

Numerosi articoli su riviste IT e online, inclusi contributi sull’Intelligenza Artificiale.

Pagina LinkedIn: https://ch.linkedin.com/in/luca-vetti-tagliati-phd-2b55618

 

Immagine di Luca Vetti Tagliati

Luca Vetti Tagliati

Senior esperto in tecnologia e trasformazione digitale, con una solida esperienza in Enterprise Architecture, ruoli di CTO, Product Ownership e posizioni di technical management, gestendo elevati budget globali. Riconosciuto per una leadership innovativa, orientata al cliente e ai risultati, con la capacità di operare efficacemente tra strategia, esecuzione e coinvolgimento degli stakeholder per garantire il successo dei programmi. Unisce una profonda competenza tecnica all'esperienza commerciale e gestionale, riuscendo anche a risanare programmi complessi, spesso richiesti dai regolatori, e a fornire soluzioni pragmatiche e ad alto impatto in tempi stretti. Porta visioni strategiche supportate da un approccio concreto, allineando costantemente tecnologia, dati e innovazione agli obiettivi aziendali e normativi. Ha conseguito un dottorato di ricerca, presso la University Of London, lavorando a tempo pieno nell’industria. Ciò gli permetti di offrire una combinazione di rigore accademico e concretezza operativa. Recentemente è tornato a dedicarsi all’Intelligenza Artificiale e all’analisi avanzata dei dati, avendo ricoperto il ruolo di Head of Data Analytics & Innovation (2022) per due anni, pubblicando ricerche peer-reviewed e contribuendo attivamente a think tank e forum di settore sull’AI. Tra le principali attività portate a compimento negli anni: Progettazione dell’architettura del sistema su larga scala Impairment(s), vincitore del Global Enterprise Architecture Excellence Awards 2018 (categoria Banking) Ideazione e implementazione del "DANTE Data Fabric", vincitore dell’iCMG Enterprise, Business & IT Architecture Excellence Awards 2015 (categoria SOA Services for Enterprise) Progettazione della piattaforma di calcolo REF, finalista ai Banking Technology Awards 2014 (categoria Best Use of IT for risk/regulatory change) Attribuzione del premio “Extraordinary Commitment” nel 2014   Pubblicazioni: Libro UML and Software Engineering - From Theory to Practice (2004) Libro Java Best Practices (2008) Libro Towards Java SE 8: Notes for Developers in Java 7 (2013) Numerosi articoli su riviste IT e online, inclusi contributi sull’Intelligenza Artificiale. Pagina LinkedIn: https://ch.linkedin.com/in/luca-vetti-tagliati-phd-2b55618  
Tutti gli articoli
Nello stesso numero
Loading...

LLMs models: how do they work?

Part 7: Causes of hallucinations and methods to limit them

LLMs models: how do they work?

Part 6: AI hallucinations defined

LLMs models: how do they work?

Part 5: Transformer Architecture. Working principles and adaptability

LLMs models: how do they work?

Part 4: Transformer Architecture. Requirements

LLMs models: how do they work?

Part 3: Embeddings

LLMs models: how do they work?

Part 2: BNN vs ANN, an OO View

I meetup di MokaByte: L’AI riscrive le regole dello sviluppo prodotto

LLMs models: how do they work?

Part 1: Artificial Neural Networks

Containers and other new technologies in IT Operations

An Overview

Cookie Policy

Nella stessa serie
Loading...

Modelli LLM: Come funzionano?

VIII parte: Un primo sguardo sul Prompt Engineering

LLMs models: how do they work?

Part 7: Causes of hallucinations and methods to limit them

Modelli LLM: Come funzionano?

VII parte: Cause delle allucinazioni e modalità per limitarle

LLMs models: how do they work?

Part 6: AI hallucinations defined

Modelli LLM: Come funzionano?

VI parte: Definizione e tipologia delle allucinazioni

LLMs models: how do they work?

Part 5: Transformer Architecture. Working principles and adaptability

Modelli LLM: Come funzionano?

V parte: Architettura Transformer. Funzionamento e adattamenti

Modelli LLM: Come funzionano?

IV parte: Architettura Transformer. I requisiti

LLMs models: how do they work?

Part 4: Transformer Architecture. Requirements

LLMs models: how do they work?

Part 3: Embeddings

Modelli LLM: Come funzionano?

III parte: Embeddings

LLMs models: how do they work?

Part 2: BNN vs ANN, an OO View

Modelli LLM: Come funzionano?

II parte: BNN e ANN, una visione OO

Modelli LLM: Come funzionano?

I parte: ANN (Artificial Neural Network), reti neurali artificiali

LLMs models: how do they work?

Part 1: Artificial Neural Networks

Mokabyte

MokaByte è una rivista online nata nel 1996, dedicata alla comunità degli sviluppatori java.
La rivista tratta di vari argomenti, tra cui architetture enterprise e integrazione, metodologie di sviluppo lean/agile e aspetti sociali e culturali del web.

Imola Informatica

MokaByte è un marchio registrato da:
Imola Informatica S.P.A.
Via Selice 66/a 40026 Imola (BO)
C.F. e Iscriz. Registro imprese BO 03351570373
P.I. 00614381200
Cap. Soc. euro 100.000,00 i.v.

Privacy | Cookie Policy

Contatti

Contattaci tramite la nostra pagina contatti, oppure scrivendo a info@mokabyte.it

Seguici sui social

Facebook Linkedin Rss
Imola Informatica
Mokabyte