LLMs for mobile engineers, from tokens to your app · Start here · 1 of 8

What a language model is

Before anything else, the one idea everything stands on. You send a model some text; it continues it. Here's what that program is, where it runs, and how your app reaches it.

The problem

Your product team wants "summarise this review" in the app. People call the thing that does it an AI or a model. Before any code: what is it, where does it run, and what does your app actually talk to?

See it

Training shows the model huge amounts of text; given the text "The capital of France is" it continues with Paris; it runs on a provider's servers; your app sends an HTTP request with text and a key and gets the continuation back lots of text language model "The capital of France is" → Paris provider's servers your app text + key → an API: request in, continuation out
  1. In training, a program reads huge amounts of text, learning what tends to come next. The result is a language model.

    Step 1 of 4
  2. Give it any text and it continues it: "The capital of France is" becomes "Paris".

    Step 2 of 4
  3. Large ones, LLMs, are too big for a phone: they run on a provider's servers. Predict: how does your app use one?

    Step 3 of 4
  4. Through an API: an HTTP request with your text and a secret key, and a response with the continuation.

    Step 4 of 4

The building block

A language model is a program that continues text. Give it "The capital of France is" and it continues with "Paris". Give it a review and "Summary:" and it continues with a summary.

It learned to do that in training: it was shown huge amounts of text and, again and again, asked what comes next, and adjusted every time it was wrong. The result is a program that, given any text, can score how likely each possible next word is. Picking likely words, one after another, produces an answer. (The next puzzle shows the exact unit it picks.)

The big ones are called large language models, LLMs. They're too big for a phone and run on a provider's servers: Anthropic's models are called Claude, Google's are called Gemini.

Your app reaches one through an API: an HTTP request to the provider, with your text in the body and a secret key that identifies your account, and a response with the continuation in it. To your code, it's a slow, expensive, very capable endpoint.

The analogy

Autocomplete on your keyboard, scaled up by a factor of millions. Your keyboard suggests the next word from what you typed; a language model does the same with whole paragraphs, because it has read far more.

Check yourself

What does a language model do with the text you send it?

Right. It continues text.

Not quite. Your text is input to continue, not code to run.

Not quite. It doesn't look things up; it continues text based on what it learned.

Where does a large language model like Claude usually run when your app uses it?

Not quite. Large models are far too big for an app; they run on servers.

Right. On servers, through an API.

Not quite. The provider hosts it; the store has nothing to do with it.

What's the difference between training and using a model?

Not quite. That's the two swapped. Re-read that part ↑

Right. Learning vs answering.

Sources

  • Anthropic: Glossary, LLM ("Large language models (LLMs) are AI language models with many parameters that are capable of performing a variety of surprisingly useful tasks. These models are trained on vast amounts of text data and can generate human-like text, answer questions, summarize information, and more"; models are "pretrained to predict the next word, given the previous context of text")

What you now know

A language model is a program trained on huge amounts of text until, given any text, it can score which words are likely to come next, and so continue it: answer a question, summarise a review. Large ones run on a provider's servers (Anthropic's Claude, Google's Gemini), and your app reaches them through an API: an HTTP request with your text, and a response with the continuation.