# A comprehensive, bilingual guide to Transformers: From foundations to KV-cache compression & attention dynamics

> Source: <https://discuss.huggingface.co/t/a-comprehensive-bilingual-guide-to-transformers-from-foundations-to-kv-cache-compression-attention-dynamics/177222#post_1>
> Published: 2026-06-29 03:54:17+00:00

Hi everyone,

I’d like to share an open-source resource I’ve been working on: a comprehensive, bilingual (English & Spanish) guide on Transformer architectures.

My goal was to create a bridge between the mathematical foundations of attention mechanisms and their practical implementation. The guide goes beyond the basics and dives deep into low-level mechanics, including:

**Attention Dynamics:** From scratch implementations to understanding attention collapse.

**Context & Memory:** Exploring KV-cache compression and long-context challenges.

**Advanced Concepts:** Grokking, optimization, and structural analysis.

The theoretical explanations are backed by reproducible code and interactive elements (like the TAF Agent framework I’ve been developing for browser-based LLM testing).

You can read it here: English: [https://karlesmarin.github.io/transformers-guide/en/index.html](https://www.google.com/search?q=https://karlesmarin.github.io/transformers-guide/en/index.html) *(Nota: asegúrate de que esta URL existe o cámbiala por la correcta)* Spanish: [Cómo Atienden los Transformers](https://karlesmarin.github.io/transformers-guide/es/index.html)

I’d love to hear feedback from the community, especially regarding the visualization of attention states and optimization techniques. Contributions or suggestions are more than welcome!

Cheers, Carles
