Topics / #attention-mechanism

Attention-mechanism projects on GitHub

Attention mechanisms behind transformers and modern sequence models.

As of , the most-starred Attention-mechanism projects on GitHub are LLMs-from-scratch (109.2K stars), vllm (97.8K stars) and happy-llm (35K stars). GitHub.Locker tracks 49 Attention-mechanism repositories with 558.4K stars combined. The fastest-growing on December 1 was vllm, with +81 stars in a day.

49Projects
558.4KStars in total
+282Stars in a day

Hot right now

Most stars gained in a day · Dec 1

The all-time top

49 projects · by stars

  1. #1 · rasbt/LLMs-from-scratch

    LLMs-from-scratch

    This is the official code repository for the book 'Build a Large Language Model (From Scratch)', which teaches you to implement a GPT-like LLM in PyTorch step by step, from tokenization through pretraining and finetuning.

    109.2K
  2. #2 · vllm-project/vllm

    vllm

    vLLM is a library for fast LLM inference and serving, built around PagedAttention for efficient memory management of attention keys and values.

    97.8K
  3. #3 · datawhalechina/happy-llm

    happy-llm

    Happy-LLM is Datawhale's free open-source LLM course: a systematic tutorial that goes from NLP basics and the Transformer architecture to building and training your first large language model, then applying it with RAG and agents.

    35K
  1. 4

    deep-learning-for-image-processing

    26.5KWZMIAOMIAO/deep-learning-for-image-processing · Python

    A video-based deep learning course that walks through classic computer-vision architectures for image classification, object detection, segmentation and keypoint detection, pairing each network with a lecture and runnable code.

  2. 5

    nn-zero-to-hero

    26.1Kkarpathy/nn-zero-to-hero · Jupyter Notebook

    A course by Andrej Karpathy that teaches neural networks from the absolute basics, built around a series of YouTube lectures with accompanying Jupyter notebooks coded live in the videos.

  3. 6

    vit-pytorch

    25.6Klucidrains/vit-pytorch · Python

    A PyTorch implementation of the Vision Transformer (ViT), an image classification model that reaches SOTA results using just a single transformer encoder instead of convolutions.

  4. 7

    flash-attention

    25.3KDao-AILab/flash-attention · Python

    The official implementation of FlashAttention and FlashAttention-2 — GPU kernels that compute exact attention faster and with less memory than standard PyTorch attention.

  5. 8

    deeplearning_ai_books

    21.3Kfengdu78/deeplearning_ai_books · HTML

    A Chinese-language collection of notes covering Andrew Ng's (吴恩达) Deep Learning Specialization on Coursera — five courses on neural networks, hyperparameter tuning, structuring ML projects, CNNs, and sequence models.

  6. 9

    nndl

    19.6Knndl/nndl

    The official home of Qiu Xipeng's Chinese textbook 'Neural Network and Deep Learning': it hosts free e-book PDFs, chapter listings, learning resources and errata for the 2nd edition and the new general-audience edition.

  7. 10

    OpenMythos

    14.9Kkyegomez/OpenMythos · Python

    OpenMythos is an open-source, speculative PyTorch implementation that tries to reconstruct the internal architecture of Anthropic's Claude ('Mythos') purely from publicly available research papers, not from any leaked or official Anthropic code.

  8. 11

    RWKV-LM

    14.8KBlinkDL/RWKV-LM · Python

    RWKV (pronounced 'RwaKuv') is an RNN architecture with transformer-level LLM performance that can also be trained in parallel like GPT. The current generation, RWKV-7 'Goose', is 100% attention-free, linear-time and constant-memory (no kv-cache).

  9. 12

    train-llm-from-scratch

    13.3KFareedKhan-dev/train-llm-from-scratch · Python

    A from-scratch tutorial and codebase for training your own LLM end to end: tokenizing raw text, pretraining a GPT-style Transformer, and then post-training it with SFT, a reward model, DPO/ORPO/KTO, PPO and GRPO into an aligned, reasoning-style assistant.

  10. 13

    FlashMLA

    13.3Kdeepseek-ai/FlashMLA · C++

    FlashMLA is DeepSeek's library of highly optimized CUDA attention kernels (Multi-head Latent Attention) that power the DeepSeek-V3 and DeepSeek-V3.2 models, covering both dense and sparse attention for prefill and decoding.

  11. 14

    External-Attention-pytorch

    12.2Kxmu-xiaoma666/External-Attention-pytorch · Python

    A PyTorch collection of Attention, Backbone, MLP, Re-parameter, and Convolution implementations from research papers, meant to help you understand papers by seeing their mechanisms coded up.

  12. 15

    nlp_course

    10.8Kyandexdataschool/nlp_course · Jupyter Notebook

    This is the Yandex School of Data Analysis (YSDA) Natural Language Processing course: a full set of lecture slides, seminar notebooks, and homework assignments organized by week, covering NLP from word embeddings through modern LLM topics.

  13. 16

    xformers

    10.6Kfacebookresearch/xformers · Python

    xFormers is Meta's (Facebook Research) toolbox of hackable, optimized Transformer building blocks that you compose together — reusable pieces for your own models rather than a monolithic framework.

  14. 17

    DeepGEMM

    9.2Kdeepseek-ai/DeepGEMM · Cuda

    DeepGEMM is a unified CUDA kernel library that provides high-performance tensor core GEMM operations (FP8, FP4, BF16), fused MoE kernels, and attention-indexer kernels used in large language models such as DeepSeek.

  15. 18

    GLM-5

    7.5Kzai-org/GLM-5

    GLM-5 is a family of large open-weight language models from Z.ai built for agentic engineering and complex, long-horizon coding tasks, scaling up to 744B parameters with sparse attention for efficient long-context serving.

  16. 19

    lectures

    7.1Kgpu-mode/lectures · Jupyter Notebook

    This is the supplementary material repository for the GPU MODE lectures YouTube channel — a growing collection of notebooks, slides and code from each numbered lecture on GPU and CUDA programming.

  17. 20

    sutskever-30-implementations

    5.2Kpageman/sutskever-30-implementations · Jupyter Notebook

    It is a from-scratch NumPy implementation suite covering all 30 deep learning papers from Ilya Sutskever's famous reading list, the one he told John Carmack would teach '90% of what matters' in the field.

  18. 21

    parameter-golf

    5.2Kopenai/parameter-golf · Python

    This is OpenAI's 'Model Craft Challenge: Parameter Golf' - a competition to train the best language model that fits in a 16MB artifact and trains in under 10 minutes on 8xH100 GPUs, scored by bits-per-byte compression on the FineWeb validation set.

  19. 22

    Engram

    4.8Kdeepseek-ai/Engram · Python

    This is the official code release for the DeepSeek paper 'Conditional Memory via Scalable Lookup', introducing Engram, a module that gives Transformers a native knowledge-lookup primitive by modernizing classic N-gram embeddings for O(1) retrieval, as a complement to Mixture-of-Experts sparsity.

  20. 23

    TorchCode

    4.8Kduoan/TorchCode · Jupyter Notebook

    TorchCode is a LeetCode-style practice platform for PyTorch: it gives you 41 curated coding problems where you implement ML operators and architectures (softmax, attention, GPT-2 blocks, etc.) from scratch inside Jupyter notebooks, with an automated judge that checks correctness, gradients, and timing instantly.

    Deploy on Railway
  21. 24

    RuVector

    4.7Kruvnet/RuVector · Rust

    RuVector is a Rust-native persistent memory substrate for AI agents, combining local vector embeddings, graph relationships, feedback-driven learning, and memory lifecycle controls so agents can remember across sessions.

  22. 25

    InfraTech

    4.4KCalvinXKY/InfraTech · Jupyter Notebook

    InfraTech is a collection of Jupyter notebooks and articles sharing AI Infra knowledge: training/inference frameworks (PyTorch, vLLM/SGLang, slime/vime), performance acceleration, deep learning fundamentals and AI hardware/software basics.

  23. 26

    how-to-train-your-gpt

    4.2Kraiyanyahya/how-to-train-your-gpt · Jupyter Notebook

    A 12-chapter, 7,500+ line interactive textbook that teaches you how to build, train and run a modern GPT-style language model completely from scratch, with every line of code commented and explained in plain English.

  24. 27

    TurboDiffusion

    3.9Kthu-ml/TurboDiffusion · Python

    TurboDiffusion is a video generation acceleration framework that speeds up end-to-end video diffusion generation by 100-200x on a single RTX 5090 while keeping video quality, using SageAttention, Sparse-Linear Attention (SLA), and rCM timestep distillation.

  25. 28

    Attention-Residuals

    3.6KMoonshotAI/Attention-Residuals

    AttnRes (Attention Residuals) is a drop-in replacement for standard residual connections in Transformers, letting each layer use learned, input-dependent attention over all previous layer outputs instead of simple additive accumulation.

  26. 29

    bdh

    3.6Kpathwaycom/bdh · Python

    BDH (Dragon Hatchling) is a biologically inspired large language model architecture that connects deep learning with neuroscience, aiming to explain how reasoning and generalization emerge in AI systems at the level of individual neuron interactions.

  27. 30

    MSA

    3.5KEverMind-AI/MSA · Python

    MSA (Memory Sparse Attention) is an end-to-end trainable, scalable latent-memory framework that lets LLMs handle context windows up to 100M tokens, replacing RAG or fixed-size RNN-style memory with a differentiable sparse-attention memory bank.

  28. 31

    OpenWAM

    1.2KOpenWAM-Official/OpenWAM · Python

    OpenWAM is an open research stack for systematically building World-Action Models (WAMs) for robots, breaking the usual tightly-coupled design choices into modular, swappable components you can compare in controlled experiments.

  29. 32

    ComfyUI-Ref2VA-VSA

    1KKablex/ComfyUI-Ref2VA-VSA · Python

    It's a ComfyUI custom node that dramatically speeds up Reference-to-Video (Ref2VA) generation for the MiniMax H3 model, producing a full 5-second, 24fps character video in about 72 seconds on a single RTX 4090 instead of over 10 minutes.

  30. 33

    OpenDLSS-NR

    1KmaanHimself/OpenDLSS-NR · JavaScript

    OpenDLSS-NR is a from-scratch Vulkan reimplementation of NVIDIA's DLSS 5 Neural Rendering network, matching the original bit-exactly down to every internal block boundary, not just the final image.

  31. 34

    Evoke

    977AlayaLab/Evoke · Python

    EVOKE is a research implementation of an interactive 'world model' that generates endless, controllable video: a three-step, CFG-free system that remembers where it has already been, lets you redirect it mid-rollout, and is state-of-the-art on the WBench long-horizon benchmark.

  32. 35

    llm-architecture-from-scratch

    856YeonwooSung/llm-architecture-from-scratch · Python

    A collection of PyTorch implementations of modern LLM architectures (GPT-2, Llama 3/3.2, Llama 4, OLMo 2, Phi-4, DeepSeek v3, Gemma 3, xLSTM, Mistral 3.1) built from scratch to understand how they work internally.

  33. 36

    ML-Interview-Prep

    773jyotipmahes/ML-Interview-Prep · Jupyter Notebook

    A machine learning engineer (MLE) interview prep repository made of Jupyter notebooks with from-scratch algorithm implementations, LeetCode-style ML problems, and AI-assisted coding interview patterns.

  34. 37

    vdn-minimax-h3

    686OpenVDN/vdn-minimax-h3 · Python

    VDN-Minimax-H3 is a hybrid-attention video generation model built on MiniMax H3 that renders video faster than it plays, supporting text-to-video-audio, image-to-video-audio, first/last-frame-to-video and more from one checkpoint.

  35. 38

    llm-inference-engineering

    515amitshekhariitbhu/llm-inference-engineering · Markdown

    A free, continuously growing blog series that teaches LLM inference engineering step by step, covering KV cache, PagedAttention, continuous batching, speculative decoding, and serving engines like vLLM, SGLang, TensorRT-LLM, and GGUF.

  36. 39

    Qwen3.8-Flash-Next

    481QwenLM/Qwen3.8-Flash-Next

    Qwen3.8-Flash-Next is an open-weight multimodal Mixture-of-Experts foundation model from Alibaba's Qwen Team, also serving as an early preview of the architecture Alibaba plans to use for the upcoming Qwen4 model family.

  37. 40

    Hy4-preview

    446Tencent-Hunyuan/Hy4-preview · Python

    Hy4 preview is Tencent Hunyuan's newest open-source large language model, a 770B-parameter Mixture-of-Experts model (49B active per token) built for coding, office/data analysis, game development, and scientific research tasks.

  38. 41

    OpenArch

    428anuj0456/OpenArch · Python

    A set of hand-written PyTorch implementations of modern open-source LLM architectures (Llama, Qwen, DeepSeek, Gemma, GPT-OSS, Kimi and more), written from scratch for readability and learning.

  39. 42

    H3-World

    343Danzer1xxxxChan/H3-World · Python

    H3-World is an interactive world model built on MiniMax-H3: give it one initial frame and it generates video you steer with keyboard actions, like driving a game world with your keys.

  40. 43

    DreamX-Creator

    319AMAP-ML/DreamX-Creator · Python

    DreamX-Creator is an open-source research framework for native joint audio-video generation: it produces video and a synchronized audio track together, refined up to 2K resolution.

  41. 44

    ComfyUI-YCNodes-MiniMax-H3

    275yichengup/ComfyUI-YCNodes-MiniMax-H3 · Python

    This is a ComfyUI custom node pack built specifically for the MiniMax H3 video model, adding 6 nodes for second-pass conditioning, timed prompt control, attention-field constraints, dynamic CFG scheduling, low-noise detail refinement and tiled sampling.

  42. 45

    ESP32s3-LLM-Cluster

    262Low-Zi-Hong/ESP32s3-LLM-Cluster · C++

    This project is a distributed inference engine that runs a 0.5B-parameter LLM, quantized to 1.58-bit (BitNet) ternary weights, split across a cluster of 7 ESP32-S3 microcontrollers connected via SPI.

  43. 46

    ComfyUI-VDN-H3

    245Saganaki22/ComfyUI-VDN-H3 · Python

    Video Delta Net hybrid attention for MiniMax-H3 as a native ComfyUI node.

  44. 47

    StreamPI

    204hku-sail/StreamPI · Python

    Official code of StreamPI (NeurIPS 2026, from HKU and ACE Robotics): a streaming temporal modeling framework that gives VLA robot policies like pi0.5 memory of past frames and multi-frame perception without adding any new parameters.

  45. 48

    tpu-megakernels

    189Inferact/tpu-megakernels · Python

    A companion research repo with fused 'megakernel' decode implementations for two models on Google TPUs: Kimi K3 with DSpark speculative decoding, and Qwen3.8-27B with DFlash2 speculative decoding, written to accompany the blog post '700 TPS on Kimi K3: A Case for TPU Megakernels'.

  46. 49

    hyperflow

    179Video-Rebirth/hyperflow · Python

    An 8-step LoRA adapter for MiniMax-H3, a video+audio generation model, trained by data-free flow self-distillation. This repository holds the loader and example scripts that run it on the diffusers Modular Pipeline.

Often tagged together