liveBook · Manning

Llama

As explained in Natural Language Processing in Action, Second Edition

Llama 2 is a family of autoregressive large language models released by Meta for text generation and understanding.

Llama 2 is a family of autoregressive language models for text generation and understanding. Its 7B, 13B, and 70B variants illustrate how scaling increases capability while also increasing practical resource demands. section 10.1.1

Running Llama 2 locally involves:

  • Accepting access terms and loading a Hugging Face authentication token. section 10.1.1
  • Tokenizing a prompt, generating tokens with Transformers, and decoding them into text. section 10.1.1
  • Planning for substantial storage, memory, download time, and generation latency. section 10.1.1

Prompted generation

A question-and-answer prompt can produce a direct response, such as answering that two cows and two bulls have 16 legs before explaining the arithmetic as 8. This inconsistency shows why generated answers require checking.

Figure 10.1 Scatterplot of the size vs. release date for LLMs with red diamond markers for proprietary models, such as GPT-4, with approx 1.5 trillion parameters and blue circles for open source models, such as Bloom, with almost 200 billion parameters
figure

Compare open-source and proprietary language-model sizes and release dates. section 10.1.1

How Natural Language Processing in Action, Second Edition covers it

How deep it goes
Explains model sizes, resource requirements, authentication, tokenization, generation, and streaming, but does not cover training internals.
Examples
Uses question-answer prompts, arithmetic reasoning, decoded token sequences, and a streaming generation loop.
What you can do after
Apply Llama 2 via Hugging Face Transformers to tokenize prompts, generate responses, decode output, and inspect reliability.
How it connects
Connects autoregressive language models with transformers, tokenization, Hugging Face Hub, and text generation.

Also explained in

Compare how 5 books explain Llama →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Natural Language Processing in Action, Second Edition. The section links point to the parts of the book it draws on.