AI Hints
Home›NLP Tutorial›Large Language Models
NLP · Lesson 25 of 106

Large Language Models

One model, every task.

⏱ 2 min read▶ Video at 44:53🎓 Free
Watch this lesson in the NLP courseWatch on YouTube ↗Full NLP course

For decades, each NLP job needed its own model, its own data, and its own team. Then something strange happened. One model could classify, extract, summarise, translate, and write, all from plain instructions. The whole field shifted, within about two years. Today, you'll put a real one to work.

Large Language Models
From the video: Large Language Models
  • Each job once needed its own model
  • Now one model does them all
  • The field shifted in two years

Your first API call

Calling a large language model takes just a few lines. We create a client, which picks up the key from your environment. We choose a model, and pass in our request. Run it. This is a real call to a real model, running in a data centre. It read our sentence, and wrote a thoughtful reply. Remember how it works. It's predicting one token at a time, just as we discussed. The same model could now translate, or classify, without any training by us.

first_call.pypython
from google import genai

client = genai.Client()

reply = client.models.generate_content(
    model="gemini-flash-latest",
    contents="In one sentence, why do customers love independent bookshops?")

print(reply.text)
Output
Customers love independent bookshops because they offer a warm, community-centered sanctuary where passionate staff and thoughtfully curated shelves turn browsing into a deeply personal, serendipitous discovery that algorithms simply cannot replicate.

How an LLM thinks about your request

Keep three facts in mind. A language model has no memory between calls. Each one starts fresh, unless you send the history again. It has a context window, a limit on how much it can read at once. And it isn't looking anything up. It's generating text based on patterns that it's learned, so it can be confidently wrong. Everything in this module follows from these three facts.

No memorysend the history each time
Context windowa limit on what it can read
Generates, doesn't look upit can be confidently wrong

Summary

One API call, and any NLP task is available. But the quality of what you get depends on how you ask. Next, the craft of writing prompts.

Key takeaways
  • One model, many tasks
  • No memory between calls
  • It generates, it doesn't look up
Next up: Prompting for Real Work — clear instructions, good results