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

Advanced AI techniques explained with everyday examples
How AI thinks and reasons: a journey into advanced techniques
Matteo 5 min

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?

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

Few-shot Learning is like my nephew learning to recognize new words after seeing them only a couple of times. It’s the ability to learn from a few examples, instead of needing thousands of repetitions.

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 the same thing: it learns patterns and rules from a limited number of examples.

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 tasks it wasn’t specifically trained for.

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. It’s like having an assistant who, while talking to you, can consult an infinite library of documents.

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 can access additional information to enrich and verify its answers.

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 Learning Orchestra

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. Chain of Thought can use Few-shot Learning to improve its reasoning, while RAG can enrich the answers generated through Zero-shot Learning.

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, rapid learning and intelligent access to information.

It’s a bit like watching a child learn: at first they need lots of examples and explanations (Few-shot), then they start making connections on their own (Chain of Thought), until they’re able to handle completely new situations (Zero-shot). The difference is that AI does it at an impressive speed and scale.

Conclusion: AI That Grows

AI learns a bit like a child, just in a different way. It doesn’t have a biological brain that grows and develops, but it has these incredible methods for acquiring and using knowledge.

In the next article 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

Copiato