# AI for Everyone: Advanced Techniques Made Simple (Part 4)

> From Chain of Thought to RAG, discover how to get better reasoning and answers out of AI through practical examples and everyday analogies. Part four of our guide that makes AI understandable for everyone.

- URL: https://mautoblog.com/en/posts/ai-fundamentals-complete-guide-part-4/
- Language: en
- Published: 2025-02-08
- Updated: 2026-10-23
- Author: Matteo
- Categories: Artificial Intelligence, Technology
- Tags: Prompt Engineering, Machine Learning, RAG
- Guide: AI for Everyone: AI Fundamentals (part 4)
- Translation (it): https://mautoblog.com/posts/ai-fondamenti-guida-completa-parte-4/

---
Remember that famous lunch with friends I told you about? Well, while we were ordering dessert (yes, we made it all the way to dessert), Claudia, who teaches elementary school, came up with an interesting question: "So how does AI learn new things? The kids in my class sometimes need to see a word dozens of times before they learn it, other times a single example is enough. How does it work for AI?"

The question sparked such a heated discussion that the waiter had to come back three times before he managed to take our dessert order. But she had hit on a crucial point: how exactly does AI learn and reason? And above all, why does it sometimes seem to have almost human insights, while other times it makes mistakes that not even an elementary school kid would make?

Before we start, though, an important clarification, one that surprised me too that day: almost none of the techniques in this article teach the model anything permanent. The "real" learning happens during training (we covered it in [part two](/en/posts/ai-fundamentals-complete-guide-part-2/)), when the model's parameters get adjusted. The techniques we'll see here act instead on the way we make our requests: the examples, instructions or documents we put in the prompt count for that conversation, and then the model forgets them. They don't make it permanently smarter: they help it make better use of what it already knows.

## Chain of Thought: Thinking Out Loud

Remember when your math teacher at school used to say "show your work"? They didn't just want the final answer, they wanted to understand how you got there. Chain of Thought in AI works exactly like that.

It's like when you try to explain to someone how to get to your place: "Come out of the subway, turn right at the traffic light, go past the café with the red umbrella..." Each step leads logically to the next. AI uses this technique to "think out loud", making every step of its reasoning explicit.

The other day I was using ChatGPT to solve a programming problem. Instead of giving me the solution straight away, it explained: "First let's check the inputs, then we verify the conditions, then..." It was like having a colleague reasoning it through with you!

## Few-shot Learning: Learning from Just a Few Examples

With language models, Few-shot Learning means putting a few examples of what you want in the prompt. Write two or three "question → answer" pairs in the format you're after, and the model picks up the pattern and applies it to the next case, with no need for thousands of examples or any new training.

It's a bit like when you learn to cook a new dish: maybe you only need to watch the chef do it once or twice to understand the process. You don't need to watch them prepare that recipe hundreds of times. AI with Few-shot Learning does something similar: it picks up the pattern from a limited number of examples. With one important difference: you'll still remember the recipe a week later, while the model only uses those examples as long as they stay in the prompt.

## Zero-shot Learning: A Leap in the Dark

If Few-shot Learning is impressive, Zero-shot Learning is almost magical. It's like when you manage to figure out the meaning of a word you've never seen before based on the context. AI can do the same: tackle a task without any examples, even if it wasn't specifically trained for it.

It reminds me of when I had to speak Spanish on a trip, despite never having studied it. Knowing Italian and a bit of Latin, I managed to get by. AI with Zero-shot Learning does something similar: it uses the knowledge it has to tackle completely new situations.

## Prompt Chaining: The Art of Chaining Questions

Prompt Chaining is like when you have to organize a big event and you split it into small, manageable tasks. Instead of asking the AI to do everything at once, you chain several prompts together, each dedicated to a specific aspect of the problem.

It's like following a complex recipe: you don't do everything at once, you follow a series of steps in order. First you prep the ingredients, then you make the base, then the filling... Each output becomes the input for the next step.

## RAG (Retrieval Augmented Generation): Augmented Memory

RAG is perhaps one of the most interesting techniques: it lets AI "look up" external information while generating answers. Here's how it works: before answering, the system searches a collection of documents (the company handbook, a set of articles, a product's documentation) for the passages most relevant to your question and adds them to the prompt along with the question itself. It's like having an assistant who, before answering you, goes and fetches the pages you need from the right shelf.

It reminds me of when I was at university giving presentations: I had my notes at hand and could check them on the fly if needed. RAG does the same for AI: it gives it up-to-date, specific information to base its answers on. This greatly reduces hallucinations, but doesn't eliminate them: if the retrieved document is wrong, or the model misreads it, the answer can still be wrong.

The other day I was using a company chatbot that used RAG. Instead of giving generic answers, it could cite specific company policies and internal documents. It was like talking to a colleague who always has the procedures manual at hand!

## How It All Connects: The Orchestra of Techniques

These techniques aren't isolated; they often work together. It's like an orchestra where each instrument has its role, but it's the ensemble that creates the symphony. For example, a prompt can contain a few examples (Few-shot) of step-by-step reasoning (Chain of Thought), or a RAG system can retrieve some documents and then ask the model to reason about them.

## The Future Is Already Here

These techniques are already changing the way we interact with AI. They're no longer simple question-and-answer systems, but sophisticated tools capable of reasoning step by step, adapting on the fly to the examples we give them and drawing on external information.

Unlike a child, though, the model doesn't grow from the experience of a single conversation: what it can do depends on how it was trained and how we ask our questions. But used well, these techniques make a huge difference.

## Conclusion: Making Good Use of What It Knows

AI doesn't learn like a child. Its real learning happens once, during training; after that, techniques like these let it make the most of what it knows and draw on what it doesn't.

In the [next article](/en/posts/ai-fundamentals-complete-guide-part-5/) we'll talk about how to optimize these systems, making them more efficient and better performing. But that's another story, for next time.

P.S. If you're wondering whether an AI can really "think" like us... well, maybe the right question isn't whether it thinks like us, but whether it can think in a way that's useful and complementary to ours. And the answer, as we've seen, is more and more often "yes"!

---
### Useful resources
- [AI for Everyone: The Guide You Wish You'd Had Sooner (Part 1)](/en/posts/ai-fundamentals-complete-guide-part-1/)
- [AI for Everyone: How Machines Learn (Part 2)](/en/posts/ai-fundamentals-complete-guide-part-2/)
- [AI for Everyone: Architectures and Artificial Brains (Part 3)](/en/posts/ai-fundamentals-complete-guide-part-3/)
- [AI for Everyone: Optimization and Putting Models on a Diet (Part 5)](/en/posts/ai-fundamentals-complete-guide-part-5/)
- [AI for Everyone: How Do We Know If an AI Really Works? (Part 6)](/en/posts/ai-fundamentals-complete-guide-part-6/)

