edX Online

How do large language models (LLMs) work?

Table of Contents

By: Thomas Broderick, Edited by: Rebecca Munday

Published: April 21, 2025


Professional software developer working late at night writing codes in an office.

Since they entered the public consciousness around late 2022, large language models (LLMs) have appeared ready to disrupt how people work.

Some researchers at top universities project that LLMs may reduce the need for many kinds of professionals, such as lawyers and high technologists. Constant news stories about LLMs leave many people wondering how LLMs work and how this technology will impact their lives.

Despite LLMs' impressive achievements, their operation relies on computer science principles anyone can understand. Uncover the mystery behind this fast-growing technology.

What is a large language model (LLM)?

LLMs, like young children, learn by soaking up large amounts of information. Instead of brain cells, they use artificial neural networks and complex algorithms to identify associations among many pieces of data. These associations let LLMs answer questions using natural language.

As of February 2025, LLMs can perform many useful tasks, such as finding grammatical errors or suggesting improvements to a document. However, despite these accomplishments, they lack what people perceive as consciousness, understanding, or reasoning.

How are LLMs trained?

Learning how LLMs work begins with understanding how they're trained. LLMs first analyze a massive amount of data, such as millions of digital books, websites, or other text. This analysis reveals patterns and relationships, including words or phrases that often appear together.

Pattern recognition gives LLMs the ability to predict what comes next. An LLM may not always make the correct prediction, so they must undergo rigorous testing to identify and remedy mistakes. After an LLM's public launch, it can improve its responses by answering users' questions and absorbing new information.

Deep learning lets LLMs improve over time. While earlier computer systems relied solely on complex algorithms to answer users' questions, deep learning uses artificial neural networks that resemble those in the human brain. This difference makes LLMs more useful and adaptable than their predecessors.

Use cases for LLMs

  • Content generation and editing: LLMs such as ChatGPT can identify grammatical mistakes, make suggestions for improvement, and even write entire documents. This feature can potentially help you save time writing emails and performing other routine tasks.
  • Code generation: LLMs that include MultiPL-E and HumanEval-X may one day write computer code in a fraction of the time. This technology may also help coders fill in knowledge gaps and learn new skills.
  • Style guide enforcement: Students and many professionals must follow style guides when writing documents. An LLM trained in style guide enforcement can catch some style errors and potentially help you remain focused on your work's content.
  • Chatbot: Chatbots offer businesses the ability to answer customers' questions without putting them on hold. Other benefits may include streamlining workforces and reducing overhead costs.
  • Sentiment analysis: Sentiment analysis involves analyzing a document's tone. An LLM's suggestions and reminders can help you craft a neutral, friendly, or authoritative message or aid you in assessing the tone of a message written by someone else.
  • Content summarization: LLMs can help you if you do not have the time to read a lengthy report or other document. Instead, you receive a condensed summary of that document's introduction, main ideas, and conclusion.

How do LLMs use conversational prompting?

Using an LLM involves conversational prompting. Much like a librarian who can help you find information, an LLM needs guidance to understand how it can best assist you. How well an LLM works for a specific need depends partly on your prompt's length and quality.

With conversational prompting, LLMs analyze plain language to assess your needs. An LLM may need to ask you some follow-up questions, depending on the complexity of your request. Answering these questions gives the LLM further insights into which information it should present.

Finding the correct information or receiving the right help may take some back and forth with an LLM, especially if you lack experience with conversational prompting.

Frequently asked questions about large language models


AI