04 — Generative AI

Deep Learning and Generative AI

7 min read

Deep learning and generative AI are behind today's most visible breakthroughs, from image recognition to chat assistants that write, summarise and translate. This chapter explains how they work in plain language, and where their limits are.

Neural networks

A neural network is a type of machine learning model loosely inspired by the brain. It is made of layers of simple connected units (often called neurons). Each connection has a weight: a number that controls how much one unit influences the next.

During training, the network makes a prediction, measures how wrong it was, and adjusts its weights slightly to do better next time. Repeated millions of times, these small adjustments let the network learn complex patterns.

Deep learning

Deep learning uses neural networks with many layers. Early layers learn simple patterns (edges in an image, sounds in speech); later layers combine them into complex ideas (a face, a word, a sentence). Deep learning powers image recognition, speech-to-text, translation and much more.

Generative AI

Most AI systems classify or predict: "is this spam?", "how much rain tomorrow?". Generative AI creates new content: text, images, audio, video or code, based on patterns learned from very large amounts of data.

Large language models (LLMs)

A large language model is a generative AI model trained on vast amounts of text. At its core, it predicts the most likely next piece of text (called a token, roughly a word or part of a word), one step at a time. Doing this extremely well lets it answer questions, summarise documents, draft emails and write code.

The instruction you give an LLM is called a prompt. Clear prompts with context, a defined task and the desired format usually produce better results.

Important limitation: hallucinations

Because LLMs generate likely-sounding text, they can produce statements that are fluent but false, such as invented facts, numbers or references. This is called a hallucination. Always verify important information against reliable sources, and keep a human in the loop for high-stakes decisions.

Using generative AI well

  • Good uses: first drafts, summaries, brainstorming, explaining concepts, translating, coding help.
  • Use with care: facts and figures, legal, medical or financial advice, anything that affects people's rights or safety.
  • Protect data: do not paste confidential or personal information into public AI tools.

Key takeaways

  • Neural networks learn by adjusting connection weights to reduce errors.
  • Deep learning uses many layers to learn complex patterns.
  • Generative AI creates new content; LLMs predict the next token of text.
  • LLMs can hallucinate, so verify important outputs.