Qlaudia

← All courses

Working with LLMs

  • Artificial Intelligence
  • Technology & Computing

Explore the three core approaches to directing LLMs: prompting to steer output through instructions, fine-tuning to reshape model behavior through training, and agents to extend capabilities with tools and multi-step actions. Develop practical decision-making frameworks for choosing the right intervention level based on your task's constraints and requirements.

Sign in to enroll$1033 lessons

What you'll learn

  • Large Language Model (LLM)A large language model is a deep learning system based on the transformer architecture trained on enormous collections of text that generates coherent, contextually appropriate language.
  • Context WindowThe maximum number of tokens a model can process at once, encompassing the system prompt, conversation history, input data, and generated response.
  • PromptingThe practice of crafting input text to an LLM in order to guide it toward a desired output without changing the model's parameters.
  • HallucinationThe tendency of a language model to produce text that sounds confident and coherent but is factually wrong, fabricated, or entirely made up.
  • LLM AgentsA system in which a language model acts as an autonomous reasoning engine that can plan, take actions, observe results, and iterate over multiple steps to complete goals.
  • Prompt EngineeringPrompt engineering is the systematic practice of designing, testing, and iterating on prompts to reliably produce high-quality outputs from a language model.
  • Retrieval-Augmented Generation (RAG)A technique that retrieves relevant documents from an external information store at inference time and inserts them into the model's context, allowing the model to answer questions by reading and synthesizing provided passages rather than relying on memorized facts.
  • Cost and Latency ManagementThe practices and tradeoffs involved in controlling API expenses and response time when deploying LLMs in production systems.
  • TokenizationThe process that converts human-readable text into numerical representations by breaking it into subword pieces that are smaller than words but larger than individual characters.
  • Fine-TuningThe process of continuing training on a pre-trained LLM with a smaller, task-specific dataset to adjust its behavior in a targeted way.
  • LLM EvaluationThe discipline of systematically measuring the quality, accuracy, and reliability of a language model's outputs for a specific task.
  • Tool Use / Function CallingThe ability of an LLM to request the execution of external functions or APIs as part of generating a response by emitting structured tool calls instead of relying only on its training data.
  • Safety and Content ModerationThe collection of techniques used to prevent language models from producing harmful, offensive, factually dangerous, or policy-violating outputs when deployed in real applications.
  • Prompt TemplatesA prompt template is a reusable prompt structure containing static text combined with named placeholders that are filled in dynamically at runtime.
  • LLM API IntegrationThe practice of sending prompts programmatically to a language model provider's web service and parsing structured responses in your application code.
  • Few-Shot PromptingA technique where you include a small number of worked input-output examples directly in the prompt to steer the model toward a specific format, style, or reasoning pattern without retraining.
  • ReAct PatternAn agent design pattern in which a language model alternates between Thought steps (reasoning about the situation) and Action steps (calling a tool), receiving Observations after each action until the task completes.
  • Chain-of-Thought PromptingA technique that guides a language model to explicitly write out its reasoning steps before producing a final answer, improving performance on multi-step problems.
  • EmbeddingsA numerical representation that converts text into a vector of real numbers such that semantically similar texts produce vectors that point in similar directions.
  • System PromptA special instruction given to an LLM before the user's message that sets the context, constraints, persona, or behavioral guidelines for the entire conversation.
  • Instruction Fine-TuningA supervised fine-tuning process that trains a pretrained model on instruction-response pairs to recognize and follow explicit directions.
  • Structured Output GenerationA set of techniques that constrain an LLM to produce machine-readable results in predictable formats like JSON objects or specific schemas rather than free-form text.
  • GroundingA set of techniques that anchor an LLM's responses to verified, external, or explicitly provided factual information to reduce hallucination.
  • Multi-Step Task PlanningMulti-step task planning is an agent's ability to decompose a complex, high-level goal into an ordered sequence of concrete subtasks that achieve that goal when executed correctly.
  • Prompting vs. Fine-Tuning TradeoffsA comparison of two approaches to shaping model behavior: prompting (which adapts the input), which is instant and reversible but token-costly at inference, and fine-tuning (which updates weights), which requires upfront GPU time and labeled data but may reduce token costs later.
  • Fine-Tuning Dataset PreparationThe process of creating and structuring high-quality training examples with instructions, responses, and optional context that will determine the effectiveness of a fine-tuned model.
  • Agent MemoryMechanisms that enable an agent to retain and recall information across multiple steps or sessions so it can maintain context, avoid repetition, and work toward goals coherently.
  • Vector DatabaseA specialized database optimized for storing and searching high-dimensional embedding vectors by semantic similarity rather than exact matching.
  • Temperature and SamplingParameters that control the probability distribution over token choices, allowing you to trade off between predictable, focused output and more creative, varied responses.
  • Code Generation and ExecutionThe capability for an LLM to write code in response to descriptions and then run that code to inspect results and inform subsequent actions.
  • Web Browsing ToolA capability that enables an LLM-based agent to fetch and read live internet content to access information beyond its training data cutoff.
  • LLM Output ParsingLLM output parsing is the process of taking the free-form text that a language model returns and converting it into a structured representation that downstream code can operate on reliably.
  • Zero-Shot PromptingThe practice of asking a language model to perform a task based solely on a plain-language instruction, without providing worked examples.

About this course

Working with LLMs: A Practical Map of the Territory

Understanding what a large language model is gets you only so far. The more pressing question is: how do you make it do what you actually need? This course addresses exactly that — the practical methods and systems that bridge the gap between a raw model and a useful, reliable tool.

There are three broad layers to working with LLMs effectively: prompting, fine-tuning, and agentic systems. Each layer represents a different level of intervention, a different cost-benefit tradeoff, and a different class of problems it solves best.

The Core Challenge

LLMs are trained on vast quantities of text and develop a general-purpose ability to generate coherent, contextually appropriate language. But "general-purpose" is precisely the problem — a model trained on everything is not automatically optimised for your specific task, your tone, your domain, or your workflow. The methods in this course are answers to that problem.

Think of a pre-trained LLM as a highly capable but unconstrained collaborator. Prompting is how you give it instructions. Fine-tuning is how you reshape its habits. Agents are how you give it tools and let it act.

Layer 1: Prompting

Prompting is the most immediate and accessible way to steer a model. You write text — a question, an instruction, a few examples — and the model responds. No code changes, no model training, no infrastructure beyond API access.

But prompting is not just asking questions. Prompt engineering is the disciplined practice of designing inputs that reliably elicit high-quality outputs. This includes structuring instructions clearly, providing examples (few-shot prompting), specifying the desired format, and iterating based on observed failures.

Within a conversation, the system prompt plays a special role: it is an instruction given before the user's message that sets the model's persona, constraints, or behavioral guidelines. A well-written system prompt can make the same underlying model behave like a customer service agent, a coding assistant, or a Socratic tutor.

Prompting is fast and costs nothing beyond the API call itself. Its limitation is that it works within the model's existing knowledge and capabilities — you cannot prompt your way to new factual knowledge the model lacks, and you cannot prompt a model into consistently following a very unusual style or format without significant prompt overhead.

Layer 2: Fine-Tuning

Where prompting guides a model at inference time, fine-tuning changes the model itself. Additional training on a curated dataset adjusts the model's weights so that the new behavior becomes the default — not something you have to re-specify every time.

Fine-tuning is the right tool when:

  • You need consistent behavior that is difficult to reliably specify in a prompt
  • You want the model to learn a particular style, domain vocabulary, or response format
  • Prompt overhead (long system prompts, many examples) is becoming costly or unwieldy
  • You have labeled examples of the exact input-output behavior you want

Fine-tuning carries real costs: you need training data, compute, and tooling. It also locks in behavior — a fine-tuned model is less flexible than a prompted one, because the weights themselves have been shifted.

Layer 3: Agents

Both prompting and fine-tuning treat the LLM as a responder — it receives input and produces output. Agentic systems change this fundamentally. An agent is a system where the LLM is given tools and the ability to take actions: calling APIs, searching the web, writing and executing code, reading files, or chaining multiple steps in pursuit of a goal.

Agents unlock a qualitatively different class of tasks — ones that require information the model doesn't have at inference time, or that involve multiple sequential decisions, or that produce side effects in the world (sending an email, updating a database). The model becomes less like a text generator and more like an autonomous planner.

This power comes with new challenges: reliability, error handling, safety, and the difficulty of debugging multi-step reasoning chains.

Three Layers of Working with LLMs Prompting No model changes • System prompts • Few-shot examples • Prompt engineering Fast · Flexible No training required Limited by model's existing knowledge Fine-Tuning Adjusts model weights • Task-specific data • Style adaptation • Domain specialisation Consistent · Efficient at inference time Requires data & compute cost Agents LLM + Tools + Actions • API calls • Web browsing • Code execution Multi-step · Autonomous Real-world actions Complex to debug & ensure reliability ← Less intervention · · · · · · · · More intervention →

The three layers of working with LLMs, ordered by degree of intervention: prompting requires no model changes; fine-tuning adjusts weights; agents extend the model with tools and multi-step action.

How These Layers Interact

These three approaches are not mutually exclusive. In practice, real systems combine them:

  • An agent might use a fine-tuned model with a carefully engineered system prompt
  • A fine-tuned model still requires thoughtful prompting to get consistent results
  • Prompt engineering is the baseline skill that informs every other layer

Developing intuition for which layer to reach for — and when combining layers makes sense — is one of the central skills this course builds.

What You Will Develop

By working through this material, you will gain:

  1. Practical prompting skill — writing prompts that produce reliable, high-quality outputs
  2. Fine-tuning intuition — knowing when to invest in training and what data you need
  3. Agent literacy — understanding how tool-using systems are structured and where they succeed or fail
  4. Decision-making frameworks — the ability to look at a new problem and choose the right approach

These are the skills that turn knowledge of what LLMs are into the ability to build things with them.