Demystifying Transformer LLMs: Teresa Torres Explains the Mechanics Behind Context and Tokens

T

Teresa Torres

LinkedIn Author

Author, Speaker, Product Discovery Coach @ ProductTalk.org

In a recent LinkedIn post, product discovery coach Teresa Torres shares her deep dive into the inner workings of transformer Large Language Models (LLMs), spurred by a desire to understand “context rot.” Torres emphasizes her journey was driven by a fundamental curiosity about how these complex systems function, particularly regarding concepts like “context window size” and the role of “tokens.” She frames her exploration as a personal quest to grasp the underlying mechanics that power modern AI.

Torres details her process of unraveling the technology, moving from understanding tokens to embeddings, and delving into the mathematics of vectors and matrices. She highlights the concept of “attention,” explaining how it’s computed using query, key, and value vectors, and how this mechanism embeds context into each token. This allows tokens to carry their contextual meaning even when processed individually by the neural network.

Understanding the Building Blocks of LLMs

The core of Torres’s exploration revolves around demystifying the fundamental components of LLMs. She explains that LLMs utilize tokens rather than whole words, a crucial distinction for processing information efficiently. Her investigation led her to understand the transformation from tokens into embeddings, a process that required revisiting foundational concepts in linear algebra.

As Torres notes, the concept of attention is central to how LLMs process information:

“I learned about attention (like in how it’s computed with query, key, value vectors), how the attention layer embeds context into each token, so that when each token is sent through a neural net in isolation it brings context with it.”

This mechanism, she explains, is repeated for every input token and during the generation of new tokens, allowing the model to maintain a coherent understanding of the input.

The Nuances of Attention and Context Window

Torres further breaks down the complexities of attention heads, explaining why having multiple heads is beneficial and how it differs from simply increasing the dimensionality of the embedding vector. She also touches upon KV caching, clarifying its specific application in generating new tokens rather than processing initial input tokens. These detailed explanations aim to make the intricate workings of LLMs more accessible.

The Challenge of Context Rot

The initial impetus for Torres’s deep dive was to better understand “context rot,” a phenomenon where the relevance or coherence of information degrades over longer interactions with an LLM. By understanding the fundamental mechanics, including how context is embedded and processed, Torres feels better equipped to theorize about the causes of this issue.

She articulates her motivation for sharing these insights:

“And now, I can generate my own theories about why context rot happens. And that’s fun. But I also learned I just really like understanding how things work. And I like finding simple ways to explain how things work.”

Torres is considering writing an article to explain these complex concepts at a conceptual level, with a touch of basic mathematics, making advanced AI understandable to a broader audience. She is gauging interest from her network for such an endeavor.

Making Complex AI Accessible

Teresa Torres’s approach highlights a growing need for clear, accessible explanations of advanced AI technologies. By breaking down concepts like tokens, embeddings, and attention, she aims to bridge the gap between technical jargon and public understanding.

According to Torres, her goal would be:

“My goal would be to make it accessible to everyone at the conceptual level and then dive a little bit into the math at an addition/multiplication level, and then leave the more advanced math to folks who are more qualified.”

This reflects a commitment to educational outreach, empowering individuals to grasp the fundamentals of the technologies shaping their world. Her willingness to translate complex technical details into understandable insights positions her as a valuable voice in making AI more approachable.

📝 About This Content

This article is based on insights shared by Teresa Torres on LinkedIn.

📅 Originally posted on January 15, 2026 | View original post on LinkedIn →