liveBook · Manning

Language model

As explained in Build an AI Agent (From Scratch)

A large language model is a neural language model trained on extensive text data that generates and interprets language.

A large language model (LLM) learns from extensive text data to predict the next token—a word or word fragment—given preceding tokens. That ability lets it interpret varied requests and generate responses. Some models also produce thinking tokens before answering, allowing them to analyze a task or formulate a plan. section 1.2.1

In an AI agent, the LLM is the decision-making core, not the whole system. Tools provide ways to interact with the outside world, while an iterative loop lets the model choose tools and decide when to stop. A workflow differs: its execution steps are defined by the developer rather than chosen dynamically by the model. section 1.7

Choose an LLM-based approach—and a model—with the task in mind:

  • Use one when inputs are varied or unstructured, such as natural-language requests or images. For predictable inputs and outputs, conventional logic may be faster, cheaper, and more reliable. section 1.4.1
  • Weigh performance, cost, and development speed. Open models offer downloadable weights; closed models are accessed through APIs and offer features such as tool calling and structured output. section 2.1 section 2.1.1

From prediction to a research agent

Predicting “school” after “Because it’s summer vacation, I didn’t go to …” illustrates the basic training task. A research request—such as surveying recent work or extracting findings from PDFs—demands more: the LLM must interpret the request, but gathering information may require tools. section 1.2.1 section 2.0

Table 2.2 Required capabilities for unsolvable problems

Missing capability

Count

Web search and web page access

11

File reading

6

This capability breakdown makes the tool-free limit concrete: among 20 GAIA problems, 11 needed web access and six needed file reading. section 2.4.3

Training data is not a dependable substitute for external information. In the same GAIA test, only five of 20 problems were judged truly solvable without tools, although some models answered more correctly, likely by recalling facts encountered during training. An agent cannot safely assume that recalled information is current or precise. section 2.4.3

How Build an AI Agent (From Scratch) covers it

How deep it goes
Defines next-token prediction and reasoning tokens, then examines model choice and tool-free limits without detailing model-training internals.
Examples
Uses a summer-vacation word prediction, research requests involving PDFs, and tool-free GAIA problems.
What it assumes
Starts with next-token prediction and builds the agent loop from its components rather than assuming knowledge of framework internals.
What you can do after
Apply it via LiteLLM APIs to prototype an agent, then evaluate when its answers require external tools.
How it connects
Connects language models to AI agents, tool calling, agent loops, workflows, and context engineering.

Also explained in

Compare how 67 books explain language model →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build an AI Agent (From Scratch). The section links point to the parts of the book it draws on.