generative-ai

Tutorials on generative AI with Python, from prompting LLMs to building your own AI-powered apps.

GenAI: Prompt Engineering, Techniques and Best Practices

You type a question into a large language model (LLM) and get back a wall of generic mush. Your coworker asks what looks like the same thing and gets a clean, structured answer. Same model, different prompt. Python prompt engineering is the craft of closing that gap: writing instructions that pull sharp, usable output from a model, then wiring them into real code. Think of the model as a brilliant new intern on their first day. Smart, fast, knows a ... Read More

NLP: Transformer Architecture, Attention Is All You Need

This is the transformer architecture explained in plain language: the design that powers GPT, BERT, and every modern AI system. You will implement self-attention, multi-head attention, and positional encoding from scratch in Python. The Transformer is the single most important architecture in deep learning, and once it clicks you will see it everywhere. “Attention is all you need.” Ashish Vaswani, Google Brain Last Updated: July 2026 | Tested on: Python 3.14.6, PyTorch 2.12.1, NumPy 2.4.6 | Difficulty: Expert | Reading ... Read More

NLP: BERT, GPT, and Modern Language Models

This BERT vs GPT comparison walks through the two architectures that shaped modern NLP (Natural Language Processing): BERT (an encoder that reads text bidirectionally to understand it) and GPT (a decoder that reads left to right to generate it). We line up their pre-training objectives, their attention patterns, and when to reach for each one, all with code you can run. “Language models are unsupervised multitask learners.” Alec Radford, OpenAI Last Updated: July 2026 | Tested on: Python 3.14.6, transformers ... Read More