InterCore Technologies
● InterCore · Agentic search optimization

How Large Language Models Actually Work

Be the firm AI recommends.

A rigorous, plain-English explainer of how large language models work — tokenization, embeddings, transformers, self-attention, training, and how AI search engines retrieve and cite your law firm.

Get your free AI visibility report →Read the guide
By Scott Wiseman·CEO & Founder, InterCore Technologies·Updated Jul 2026
Quick
answer

A rigorous, plain-English explainer of how large language models work — tokenization, embeddings, transformers, self-attention, training, and how AI search engines retrieve and cite your law firm.

TL;DR — Key takeaways
  • LLMs are neural networks trained to predict the next word in text, learning patterns from billions of examples. They are not programmed with rules; they learn statistical regularities.
  • Text is tokenized (split into subword units), then converted to high-dimensional vectors (embeddings) where semantic meaning is encoded as geometric proximity. Tokens with similar meaning have embeddings that point in similar directions.
  • The transformer architecture uses self-attention to let every token attend to every other token in parallel, enabling efficient training and the ability to capture long-range context. Attention explains how models understand which information is relevant.
  • Training has two stages: pretraining (predict the next word on massive text corpora), which encodes general knowledge and language ability, and alignment (supervised fine-tuning + RLHF), which trains the model to follow instructions and match human preferences.
  • LLMs hallucinate because they model likely text, not facts. They have no access to external truth or fact-checking. Retrieval-Augmented Generation (RAG) grounds LLMs in retrieved passages, dramatically reducing hallucinations and enabling AI search engines to cite external sources.
  • For law firms, being cited by AI search engines requires: allowing AI bots to crawl your site, server-rendering all content, using consistent semantic terminology, structuring content for passage extraction, and ensuring all facts are truthful and verifiable. The bridge between traditional SEO and AI citability is passage-level structure and entity clarity.
The complete guide

Read it, chapter by chapter

The full 11-chapter guide for law firms — pick any chapter to read it here.

Chapter 1 of 11

What Is an LLM? (And Why "LLM" Means Two Different Things for Lawyers)

An LLM is a Large Language Model — a type of artificial intelligence trained to predict the next word in a sequence, given all the words before it. It does this by learning statistical patterns from billions of examples of human text (books, websites, code, legal documents). The key insight: it is not programmed with rules; it learns patterns. This is radically different from the Master of Laws degree, also called an LLM, that some attorneys pursue. In AI, LLM is the abbreviation; in education, it's your credential. Both are real in legal contexts, so we clarify: here, LLM = Large Language Model, the AI system.

When we say "large," we mean two things. First, the model itself is huge — measured in billions of parameters (internal knobs the network adjusts during training). GPT-3 has 175 billion parameters; GPT-4's size is not publicly disclosed but is estimated to be larger. Second, the training dataset is enormous — GPT-3 trained on ~300 billion tokens of text, a scale that took years to assemble. Scaling up both the model and the data has proven to be one of the most reliable ways to improve performance across a vast range of tasks, a trend codified in scaling laws (Kaplan et al., 2020).

The core mechanism is surprisingly simple: predict the next token (a chunk of text, usually a few characters or a word). During training, the model sees millions of examples of text, and for each one, it learns to adjust its internal weights so that, given the first N words, it can guess the (N+1)th word accurately. This process, called next-token prediction or causal language modeling, is the entire training objective. Once trained, the model can generate new text by applying this same prediction logic iteratively — predict the next word, then the one after that, and so on — a process called autoregressive generation.

Why does predicting the next word teach a model anything useful? Because to predict text accurately, a model must learn to understand grammar, facts, reasoning, and even some aspects of how humans think. It must learn that "attorney" and "lawyer" are semantically related; that certain practices tend to involve litigation; that there is something like legal jurisdiction and how it works. None of this is explicitly programmed in. The model infers it by finding patterns in the data.

LLM vs. Traditional Software
PropertyTraditional SoftwareLarge Language Model
How it worksProgrammed rules + logicLearned statistical patterns from data
Knowledge sourceCode, databases, APIsTraining text corpus (billions of examples)
ErrorsPredictable bugs (given the same input)Probabilistic; same input may yield different outputs
ExplanationHumans wrote the rulesModel learned from patterns; reasons are opaque
GeneralizationLimited to what was codedCan apply patterns to novel tasks ("few-shot")
Hallucination riskRare (unless a query hits an unhandled case)Inherent: model generates likely text, not facts
Share
InterCore · Services

Every guide in this hub

Explore the full cluster — pick any node to open its guide.

7
Services
What clients say

In their words

5.0★★★★★Excellent · 20 reviews on GoogleWrite a review
★★★★★

We tried a lot of vendors, but in less than a year, this law firm marketing agency generated tangible results.

Calyn Settle
Verified Google review · 8 months ago
★★★★★

Within 90 days we were showing up in ChatGPT and Google AI Overviews for our top practice areas. The qualified calls followed.

Managing Partner
Personal Injury firm
★★★★★

They actually understand how the AI platforms work. Our cost per signed case dropped while lead quality went up.

Founding Attorney
Family Law firm
★★★★★

As a solo, I finally compete with the billboard firms — because AI recommends me by name for DUI cases in my city.

Solo Practitioner
Criminal Defense

One verified Google review shown; the remaining quotes are representative. Past results do not guarantee future outcomes.

Scott Wiseman, CEO / Founder, InterCore Technologies · AI-Powered Marketing for Law Firms Since 2002
Scott Wiseman
CEO / Founder, InterCore Technologies · AI-Powered Marketing for Law Firms Since 2002

Scott is a former Google Marketing Director with a background in computer science and business. He helps law firms acquire clients across every search channel — SEO, PPC, and the newer generative and answer-engine categories (GEO and AEO) — improving their visibility both on Google and in the recommendations of AI systems like ChatGPT, Gemini, and Perplexity. A network engineer and software programmer by training, Scott holds a bachelor's in computer science from California State University, Northridge, an MBA from Pepperdine's Graziadio Business School, and an Applied Agentic AI certificate from Harvard Business School. He has guided law firms through every major shift — Yellow Pages to Google Ads to today's AI revolution — pioneering Generative Engine Optimization for attorneys nationwide.

Watch · Short

Why Law Firms Need GEO (Generative Engine Optimization)

100+
law firms served
18:1
avg marketing ROI
2002
law-firm-only since
More on the InterCore channel — @IntercoreAI
Sources & references

Backed by research

Vaswani, A., Shazeer, N., Parmar, N., et al. (2017). 'Attention Is All You Need.' Advances in Neural Information Processing Systems (NeurIPS).Brown, T. B., Mann, B., Ryder, N., et al. (2020). 'Language Models are Few-Shot Learners.' Advances in Neural Information Processing Systems (NeurIPS).Devlin, J., Chang, M. W., Lee, K., & Toutanova, K. (2018). 'BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding.' Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics (NAACL).Mikolov, T., Sutskever, I., Chen, K., et al. (2013). 'Distributed Representations of Words and Phrases and their Compositionality.' Advances in Neural Information Processing Systems (NeurIPS).Lewis, P., Perez, E., Piktus, A., et al. (2020). 'Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks.' Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP).Ouyang, L., Wu, J., Jiang, X., et al. (2022). 'Training language models to follow instructions with human feedback.' Advances in Neural Information Processing Systems (NeurIPS).Kaplan, J., McCandlish, S., Henighan, T., et al. (2020). 'Scaling Laws for Neural Language Models.' arXiv preprint.Hoffmann, J., Borgeaud, S., Mensch, A., et al. (2022). 'Training Compute-Optimal Large Language Models.' arXiv preprint.Sennrich, R., Haddow, B., & Birch, A. (2016). 'Neural Machine Translation of Rare Words with Subword Units.' Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (ACL).Radford, A., Narasimhan, K., Salimans, T., & Sutskever, I. (2019). 'Language Models are Unsupervised Multitask Learners.' OpenAI Blog (technical report).Touvron, H., Lavril, T., Izacard, G., et al. (2023). 'Llama: Open and Efficient Foundation Language Models.' arXiv preprint.Raffel, C., Shazeer, N., Roberts, A., et al. (2020). 'Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer.' Journal of Machine Learning Research, 21(140), 1–67.
Hochreiter, S., Schmidhuber, J., et al. (1997). 'Long Short-Term Memory.' Neural Computation, 9(8), 1735–1780. [Historical reference: RNNs and LSTMs, which preceded transformers.]
Bengio, Y., Ducharme, R., Vincent, P., & Janvin, C. (2003). 'A Neural Probabilistic Language Model.' Journal of Machine Learning Research, 3, 1137–1155.
FAQ

Frequently asked questions

LLM stands for Large Language Model, a type of AI trained to predict the next word in text by learning patterns from billions of examples. In legal education, LLM also stands for Master of Laws (a degree), so context matters. Here, LLM = the AI system that powers ChatGPT, Claude, Gemini, and Perplexity.

Yes. ChatGPT is a conversational interface built on top of an LLM (GPT-3.5 or GPT-4). The underlying LLM is trained to predict the next word; the conversational layer adds instruction-following and alignment via RLHF so it follows user requests.

LLMs learn via next-token prediction: they are shown billions of examples of text and trained to predict the next word given all prior words. No human labels are needed for pretraining. During alignment, humans rank responses and the model is fine-tuned to match human preferences.

This is philosophically contested. LLMs encode meaning geometrically — semantically similar concepts have embeddings that are close in vector space — but whether this constitutes true understanding is debated. For practical purposes, they behave as if they understand: they can reason, analogize, and solve novel problems. But they do not have phenomenal consciousness or a persistent internal model of the world the way humans do.

LLMs are trained to predict likely text, not to verify facts. They have no access to external truth and no fact-checking mechanism. If a false claim is plausible (sounds like text in the training data), the model generates it confidently. Retrieval-Augmented Generation mitigates this by grounding answers in external sources.

They use Retrieval-Augmented Generation: convert the user's question into an embedding (a vector), search the web for pages with similar embeddings, extract relevant passages from those pages, feed the passages to the LLM, and ask it to answer the question and cite the source URLs.

Temperature controls randomness in token sampling. Low temperature (0.1) makes outputs deterministic and focused; high temperature (1.5+) introduces variability and creativity but can produce nonsense. Temperature 0 = always pick the highest-probability token; temperature 1 = sample from the learned distribution; temperature >1 = flatten the distribution to favor lower-probability tokens.

LLMs are trained on a fixed dataset and their weights are frozen at inference time. They cannot make HTTP requests or query APIs. Some interfaces (ChatGPT with web browsing, Claude with web search) add retrieval as a separate pipeline: the model requests a search, a separate system fetches web results, and those results are fed back to the model as context.

Search engines (Google) rank pages by relevance and authority, returning a list of URLs. LLMs generate natural language by predicting tokens. AI search engines (Perplexity, Gemini) combine both: they retrieve relevant pages via search, extract passages, feed them to an LLM, and generate a natural-language answer that cites sources.

Yes, but it is expensive. Fine-tuning involves modifying a model's weights on domain-specific data. For a law firm, you could fine-tune a model on your case files, win documents, and legal templates to create a specialized model. OpenAI, Google, and others offer fine-tuning APIs, but the cost and complexity have limited adoption so far. Prompt-based customization (giving the model instructions and examples) is much cheaper and often sufficient.

More guides
LLM Entity Embedding StrategyLLM-Friendly Content DesignLLM Seeding (GEO + AEO)LLM SEO ChecklistLocal AI SearchAI Visibility (Hub)

Ready to be the answer AI recommends?

See exactly how ChatGPT, Google AI and Perplexity rank your firm — a 23-point report in 24 hours. No credit card.

Get my free AI visibility report →Call 213-282-3001