Week 3 Lab: LLM systems, RAG, and modern tools

2026-04-23

Lab focus

Review, discuss, extend

  • revisit the exercise
  • clarify what retrieval adds
  • discuss why custom RAG still matters
  • briefly look at modern LLM systems and tools

Quick recap of the exercise

What made the grounded answer better?

  • more specific
  • easier to verify
  • tied to a source
  • clearer about the measure being used

But what could still go wrong?

  • wrong passage retrieved
  • important passage missed
  • model misreads the source
  • source itself is incomplete

Worked example reminder

Question

According to the National Statistics Office’s Consumer Price Bulletin, what was the year-on-year inflation rate in March 2025, and which categories contributed most to the increase?

Plain LLM-style answer

Inflation in March 2025 was around 5.8%, mainly driven by food prices and transport costs. Housing-related costs may also have contributed. This suggests inflation remained elevated during the period.

What to notice

  • sounds plausible
  • no clear source
  • slightly inaccurate

Grounded / RAG-style answer

According to the Consumer Price Bulletin, March 2025, the year-on-year inflation rate was 6.2%, up from 5.8% in February 2025.

The bulletin states that the increase was mainly driven by food and non-alcoholic beverages, transport, and housing, water, electricity, gas and other fuels.

What to notice

  • cites the source
  • more precise
  • easier to verify

Why build custom RAG if modern LLMs already have tools?

  • search our own trusted corpus
  • get more control over output and references
  • use a smaller / cheaper model on selected evidence
  • improve even strong models on document-specific tasks
  • support governance and deliberate corpus updates

Modern LLM systems are often model + tools

flowchart LR
    A[User request] --> B[LLM]
    B --> C[Web search]
    B --> D[File search / retrieval]
    B --> E[Calculator / Python]
    B --> F[Images / other tools]
    C --> G[Answer]
    D --> G
    E --> G
    F --> G

The key idea

Strong LLM vs custom RAG is often a false choice

  • a RAG system can use a strong LLM as its generator
  • retrieval adds grounding and control
  • built-in tools are useful, but not the same as owning the retrieval layer

Optional deeper dive

Base model vs assistant model

flowchart LR
    A[Pretraining] --> B[Base model]
    B --> C[Post-training / alignment]
    C --> D[Assistant model]
    D --> E[Optional tools]

  • Base model: broad language ability
  • Assistant model: more helpful and instruction-following
  • Tools: extend what the overall system can do

One simple example

Prompt

Explain inflation in simple terms.

Base-model-style

“Inflation is a general increase in prices over time and may be measured by various indices and macroeconomic indicators in the economy…”

Post-trained assistant-style

“Inflation means prices are rising over time, so the same amount of money buys less than before. For example, if bread costs more this year than last year, that may reflect inflation.”

Bridge to later sessions

Later we will look more closely at:

  • retrieval quality
  • generation quality
  • evaluation
  • how StatsChat fits together as a system

Final prompt

Be ready to discuss one or two examples.