# nndl/llm-beginner

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/nndl-llm-beginner).**

6,421 stars · 1,316 forks · Python

## Links

- GitHub: https://github.com/nndl/llm-beginner
- awesome-repositories: https://awesome-repositories.com/repository/nndl-llm-beginner.md

## Topics

`agent` `fudannlp` `llm` `openmoss` `step-by-step`

## Description

This project is a collection of educational resources and technical guides focused on the development and implementation of large language models. It provides a comprehensive curriculum covering transformer architectures, training methods, and deployment strategies.

The materials provide detailed instructions for building autonomous agents using reasoning loops and tool integration, as well as guides for fine-tuning models through supervised learning and preference optimization. It also includes tutorials for constructing retrieval augmented generation pipelines and implementing transformer models from scratch.

The project covers a broad range of capabilities, including model architecture design, parameter-efficient tuning, and the creation of vector-based retrieval systems. It further addresses natural language processing tasks such as text classification, semantic analysis, and tokenization, alongside methods for monitoring model performance through execution tracing and attention visualization.

## Tags

### Artificial Intelligence & ML

- [Agentic LLM Frameworks](https://awesome-repositories.com/f/artificial-intelligence-ml/agentic-llm-frameworks.md) — Provides a comprehensive framework for building autonomous agents featuring reasoning loops, tool use, and memory management.
- [Reasoning-Action Loops](https://awesome-repositories.com/f/artificial-intelligence-ml/agent-architectures/orchestration-engines/ai-agent/reasoning-action-loops.md) — Implements a cycle of thought, action, and observation for tool use and autonomous self-correction.
- [Agentic Reasoning Loops](https://awesome-repositories.com/f/artificial-intelligence-ml/agentic-reasoning-loops.md) — Implements iterative reasoning and execution cycles that persist state until task completion. ([source](https://github.com/nndl/llm-beginner/blob/master/task-6-coding-agent))
- [Coding Agents](https://awesome-repositories.com/f/artificial-intelligence-ml/agentic-systems-frameworks/integration-deployment/ai-agent-tooling/coding-agents.md) — Builds agent systems that automate code modification and testing within local repositories. ([source](https://github.com/nndl/llm-beginner#readme))
- [Development Environment AI Integrations](https://awesome-repositories.com/f/artificial-intelligence-ml/ai-agent-integrations/development-environment-ai-integrations.md) — Integrates models with development environments to modify source code and verify fixes via test suites. ([source](https://github.com/nndl/llm-beginner/blob/master/task-6-coding-agent))
- [Subagent Coordination](https://awesome-repositories.com/f/artificial-intelligence-ml/ai-agent-state-coordination/subagent-coordination.md) — Deploys specialized child agents with isolated contexts to handle parallel sub-tasks efficiently. ([source](https://github.com/nndl/llm-beginner/blob/master/task-6-coding-agent))
- [Autonomous Coding Agents](https://awesome-repositories.com/f/artificial-intelligence-ml/ai-coding-assistants/autonomous-coding-agents.md) — Develops an autonomous agent that reads issues and modifies code iteratively to resolve software bugs. ([source](https://github.com/nndl/llm-beginner/tree/master/task-6-coding-agent))
- [Autonomous Agent Loops](https://awesome-repositories.com/f/artificial-intelligence-ml/autonomous-agent-loops.md) — Creates autonomous loops that enable models to use external tools for multi-step task completion. ([source](https://github.com/nndl/llm-beginner#readme))
- [Preference Alignment](https://awesome-repositories.com/f/artificial-intelligence-ml/custom-model-training/reward-modeling/preference-alignment.md) — Refines model outputs through preference alignment using pairs of chosen and rejected responses. ([source](https://github.com/nndl/llm-beginner/blob/master/task-3-sft-dpo))
- [Direct Preference Optimization](https://awesome-repositories.com/f/artificial-intelligence-ml/custom-model-training/reward-modeling/preference-alignment/direct-preference-optimization.md) — Optimizes models using direct preference optimization to align outputs with chosen and rejected response pairs. ([source](https://github.com/nndl/llm-beginner/tree/master/task-3-sft-dpo))
- [Decoder Architectures](https://awesome-repositories.com/f/artificial-intelligence-ml/decoder-architectures.md) — Implements decoder-only transformer architectures featuring rotary positional embeddings and causal attention. ([source](https://github.com/nndl/llm-beginner/blob/master/README.md))
- [Instruction Fine-tuning](https://awesome-repositories.com/f/artificial-intelligence-ml/instruction-fine-tuning.md) — Implements supervised instruction fine-tuning using low-rank adaptation to create chat-capable assistants. ([source](https://github.com/nndl/llm-beginner/blob/master/README.md))
- [KV Cache Management](https://awesome-repositories.com/f/artificial-intelligence-ml/kv-cache-management.md) — Accelerates autoregressive generation by caching previously computed key and value tensors.
- [RAG Pipelines](https://awesome-repositories.com/f/artificial-intelligence-ml/language-model-orchestration/retrieval-augmented-generation/rag-pipelines.md) — Builds retrieval pipelines using embedding models and vector stores to answer questions from external documents. ([source](https://github.com/nndl/llm-beginner#readme))
- [Alignment Techniques](https://awesome-repositories.com/f/artificial-intelligence-ml/llm-fine-tuning-toolsets/alignment-techniques.md) — Guides the adaptation of base models into assistants using supervised tuning, LoRA, and preference optimization.
- [Low-Rank Adaptation](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/model-training-and-tuning/fine-tuning-and-customization/model-fine-tuning/low-rank-adaptation.md) — Provides parameter-efficient fine-tuning by injecting trainable low-rank matrices into linear layers.
- [Language Model Training](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/model-fine-tuning-adaptation/language-model-training.md) — Implements language model training using next-token prediction and learning rate scheduling to minimize perplexity. ([source](https://github.com/nndl/llm-beginner/blob/master/task-2-mini-gpt))
- [Causal Masking](https://awesome-repositories.com/f/artificial-intelligence-ml/masked-language-modeling/causal-masking.md) — Implements upper-triangular attention masking to prevent models from attending to future tokens.
- [Rotary Positional Embeddings](https://awesome-repositories.com/f/artificial-intelligence-ml/positional-embedding-techniques/rotary-positional-embeddings.md) — Encodes token positions using rotation matrices to maintain relative distance across sequence lengths.
- [RAG Implementations](https://awesome-repositories.com/f/artificial-intelligence-ml/rag-implementations.md) — Constructs end-to-end systems that extract text, index it via embeddings, and generate grounded answers. ([source](https://github.com/nndl/llm-beginner/blob/master/README.md))
- [Retrieval Augmented Generation Pipelines](https://awesome-repositories.com/f/artificial-intelligence-ml/retrieval-augmented-generation-pipelines.md) — Constructs end-to-end pipelines that combine vector search and document indexing to provide grounded answers.
- [Supervised Fine-Tuning](https://awesome-repositories.com/f/artificial-intelligence-ml/supervised-fine-tuning.md) — Trains models on conversational datasets using next-token prediction and loss masking. ([source](https://github.com/nndl/llm-beginner/blob/master/task-3-sft-dpo))
- [Transformer Architecture Implementation](https://awesome-repositories.com/f/artificial-intelligence-ml/transformer-architecture-implementation.md) — Provides technical instructions for building generative and encoder transformer models from scratch.
- [Transformer Blocks](https://awesome-repositories.com/f/artificial-intelligence-ml/transformer-blocks.md) — Implements self-attention mechanisms and encoder blocks for text classification and language modeling. ([source](https://github.com/nndl/llm-beginner/blob/master/README.md))
- [Transformer Encoders](https://awesome-repositories.com/f/artificial-intelligence-ml/transformer-encoders.md) — Implements transformer encoder architectures from scratch to perform text classification tasks. ([source](https://github.com/nndl/llm-beginner/blob/master/task-1-transformer))
- [Vector Similarity Search](https://awesome-repositories.com/f/artificial-intelligence-ml/vector-similarity-search.md) — Implements a full pipeline for retrieving relevant external context using high-dimensional vector embeddings and similarity search.
- [Automated Skill Loading Systems](https://awesome-repositories.com/f/artificial-intelligence-ml/automated-skill-loading-systems.md) — Provides a system for dynamically discovering and loading skill definitions from markdown files into an agent's context. ([source](https://github.com/nndl/llm-beginner/tree/master/task-6-coding-agent))
- [RAG Document Retrieval](https://awesome-repositories.com/f/artificial-intelligence-ml/documentation-retrieval-engines/rag-document-retrieval.md) — Performs top-k retrieval using query embeddings and refines results with a reranker. ([source](https://github.com/nndl/llm-beginner/blob/master/task-4-rag))
- [External Tool Integrations](https://awesome-repositories.com/f/artificial-intelligence-ml/external-service-integrations/external-knowledge-integrators/external-tool-integrations.md) — Connects models to specialized functions and APIs using structured schemas to extend capabilities. ([source](https://github.com/nndl/llm-beginner/tree/master/task-5-tool-agent))
- [Grounded Answer Generation](https://awesome-repositories.com/f/artificial-intelligence-ml/generative-ai-resources/generative-ai/grounded-answer-generation.md) — Combines retrieved document segments into prompts to ensure responses are grounded in provided context. ([source](https://github.com/nndl/llm-beginner/blob/master/task-4-rag))
- [KV Cache Optimizations](https://awesome-repositories.com/f/artificial-intelligence-ml/kv-cache-optimizations.md) — Optimizes key-value caches to increase sampling speed during autoregressive generation. ([source](https://github.com/nndl/llm-beginner/tree/master/task-2-mini-gpt))
- [Faithfulness Verifiers](https://awesome-repositories.com/f/artificial-intelligence-ml/language-model-response-generators/multilingual-response-generators/faithfulness-verifiers.md) — Verifies that generated answers are strictly supported by retrieved sources to prevent hallucinations. ([source](https://github.com/nndl/llm-beginner/tree/master/task-4-rag))
- [Model Comparison Interfaces](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/model-evaluation-analysis/machine-learning-evaluation/model-comparison-interfaces.md) — Provides a framework for side-by-side comparison of outputs between base and fine-tuned model versions. ([source](https://github.com/nndl/llm-beginner/tree/master/task-3-sft-dpo))
- [Model Evaluation Metrics](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/model-evaluation-and-validation/model-evaluation-metrics.md) — Implements methods for measuring model performance through retrieval metrics, faithfulness checks, and attention visualization.
- [Model Context Protocol Servers](https://awesome-repositories.com/f/artificial-intelligence-ml/model-context-protocol-servers.md) — Implements Model Context Protocol servers to expose file manipulation and version control tools. ([source](https://github.com/nndl/llm-beginner/blob/master/task-6-coding-agent))
- [Recursive Text Splitting](https://awesome-repositories.com/f/artificial-intelligence-ml/natural-language-processing/text-tokenization/recursive-text-splitting.md) — Splits raw text into segments using recursive or semantic methods for vector search preparation. ([source](https://github.com/nndl/llm-beginner/blob/master/task-4-rag))
- [RAG Evaluation Frameworks](https://awesome-repositories.com/f/artificial-intelligence-ml/rag-evaluation-frameworks.md) — Evaluates RAG system quality using automated judges to measure recall and faithfulness. ([source](https://github.com/nndl/llm-beginner/blob/master/task-4-rag))
- [RAG Tutorials](https://awesome-repositories.com/f/artificial-intelligence-ml/rag-tutorials.md) — Provides a step-by-step guide to building RAG pipelines using vector stores, embeddings, and reranking.
- [Cross-Encoder Rerankers](https://awesome-repositories.com/f/artificial-intelligence-ml/result-reranking/cross-encoder-rerankers.md) — Refines retrieval precision by scoring document-query pairs using a cross-encoder architecture.
- [Text Model Training](https://awesome-repositories.com/f/artificial-intelligence-ml/text-model-training.md) — Trains transformer-based models on sentiment datasets for text classification tasks. ([source](https://github.com/nndl/llm-beginner/blob/master/task-1-transformer))
- [Vector Retrieval Systems](https://awesome-repositories.com/f/artificial-intelligence-ml/vector-retrieval-systems.md) — Creates searchable indices using embeddings and vector stores to retrieve relevant document chunks. ([source](https://github.com/nndl/llm-beginner/tree/master/task-4-rag))

### Part of an Awesome List

- [ReAct Agents](https://awesome-repositories.com/f/awesome-lists/ai/agent-building-frameworks/react-agents.md) — Implements the ReAct paradigm, allowing models to iteratively reason and act using external tools. ([source](https://github.com/nndl/llm-beginner/blob/master/README.md))
- [Decoder-Only Architectures](https://awesome-repositories.com/f/awesome-lists/ai/llm-development/decoder-only-architectures.md) — Guides the construction of generative models featuring tokenization, rotary embeddings, and KV-caching for autoregressive generation. ([source](https://github.com/nndl/llm-beginner#readme))
- [Model Fine-Tuning](https://awesome-repositories.com/f/awesome-lists/ai/model-training-and-fine-tuning/model-fine-tuning.md) — Transforms base models into chat assistants using supervised fine-tuning and preference optimization. ([source](https://github.com/nndl/llm-beginner#readme))
- [AI Observability and Evaluation](https://awesome-repositories.com/f/awesome-lists/ai/ai-observability-and-evaluation.md) — Provides observability and evaluation tools for monitoring agent performance through structured traces. ([source](https://github.com/nndl/llm-beginner/tree/master/task-5-tool-agent))

### Education & Learning Resources

- [LLM Education](https://awesome-repositories.com/f/education-learning-resources/llm-education.md) — Provides a comprehensive educational curriculum covering LLM architectures, training methods, and deployment strategies.
- [Agent Implementation Guides](https://awesome-repositories.com/f/education-learning-resources/agent-implementation-guides.md) — Offers a practical guide for developing ReAct loops, tool integration, and autonomous agentic workflows.
- [Fine-Tuning Guides](https://awesome-repositories.com/f/education-learning-resources/fine-tuning-guides.md) — Serves as a technical resource for implementing supervised fine-tuning and preference optimization for model alignment.
- [Transformer Tutorials](https://awesome-repositories.com/f/education-learning-resources/technical-domain-education/ai-machine-learning-education/neural-network-architectures/recurrent-neural-network-tutorials/transformer-tutorials.md) — Provides a technical walkthrough for implementing encoder and decoder transformer architectures from scratch.

### Scientific & Mathematical Computing

- [Transformer Implementations](https://awesome-repositories.com/f/scientific-mathematical-computing/from-scratch-implementations/transformer-implementations.md) — Provides pedagogical implementations of transformer models from scratch, including self-attention and encoder blocks. ([source](https://github.com/nndl/llm-beginner#readme))

### Software Engineering & Architecture

- [Autonomous Coding Agents](https://awesome-repositories.com/f/software-engineering-architecture/automated-code-quality-tools/autonomous-coding-agents.md) — Develops autonomous agents capable of reading repositories, modifying source code, and verifying fixes through test execution.
- [Agentic Error Recovery](https://awesome-repositories.com/f/software-engineering-architecture/stream-failure-recovery/agentic-error-recovery.md) — Provides mechanisms to feed tool exceptions back into the model for autonomous self-correction. ([source](https://github.com/nndl/llm-beginner/tree/master/task-5-tool-agent))

### Data & Databases

- [Vector Indexing](https://awesome-repositories.com/f/data-databases/vector-indexing.md) — Generates document embeddings and stores them in high-dimensional indexes for semantic search. ([source](https://github.com/nndl/llm-beginner/blob/master/task-4-rag))

### Development Tools & Productivity

- [Custom Tool Definitions](https://awesome-repositories.com/f/development-tools-productivity/ai-agent-development-tools/custom-tool-definitions.md) — Provides a framework for defining modular, typed tool schemas and execution logic for agents. ([source](https://github.com/nndl/llm-beginner/blob/master/task-5-tool-agent))

### System Administration & Monitoring

- [Goal Accuracy Evaluators](https://awesome-repositories.com/f/system-administration-monitoring/agent-observability/goal-accuracy-evaluators.md) — Measures agent success rates using keyword validation and trace analysis to verify goal achievement. ([source](https://github.com/nndl/llm-beginner/blob/master/task-5-tool-agent))

### Testing & Quality Assurance

- [Retrieval Metrics](https://awesome-repositories.com/f/testing-quality-assurance/performance-testing-analysis/performance-diagnostics/performance-measurement/context-recall-evaluators/retrieval-metrics.md) — Calculates retrieval quality using gold standard datasets to determine recall and mean reciprocal rank. ([source](https://github.com/nndl/llm-beginner/tree/master/task-4-rag))
