liveBook · Manning

Language model

As explained in MongoDB 8.0 in Action, Third Edition

A large language model is a machine learning model with many parameters trained to process and generate natural language.

A large language model processes and generates natural language from patterns learned during training. Because it generates text rather than checking facts, it can produce convincing but incorrect information, called hallucinations. section 14.0 section 14.6

Retrieval-augmented generation improves reliability by supplying relevant external information during generation. Documents are divided into chunks, embedded, stored in a vector database, retrieved for a query, and assembled into context for the model. section 14.1

Use language models with supporting controls when accuracy matters:

  • Improve training data, add real-time fact-checking, or strengthen verification systems to reduce fabricated responses. section 14.0
  • Use a vector database and vector search to retrieve semantically relevant source material before generation. section 14.1
  • Use LangChain to connect the model with external data sources and tools, or deploy a RAG reference architecture through LangServe. section 14.6

Grounded chatbot response

A customer-support chatbot embeds a user query, compares it with stored document vectors, retrieves relevant information, and gives the language model that context for a more accurate answer. section 14.1

Figure 14.1 RAG paradigm step by step (Image © MongoDB 2024 CC BY-NC-SA 3.0)
A diagram of a document

Description automatically generated

Follow the step-by-step RAG diagram from document processing through vector retrieval and grounded response generation. section 14.1

How MongoDB 8.0 in Action, Third Edition covers it

How deep it goes
Explains pattern-based generation, hallucinations, and the eight-step RAG workflow without detailing model internals.
Examples
Uses chatbot, customer-support, and technical-assistance scenarios grounded in retrieved documents.
What you can do after
Apply RAG to generate responses informed by retrieved, verified information and reduce hallucinations.
How it connects
Connects language models with retrieval-augmented generation, embedding models, vector databases, vector search, hallucinations, and LangChain.

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 MongoDB 8.0 in Action, Third Edition. The section links point to the parts of the book it draws on.