30+ Free AI & Machine Learning Classic Textbooks: All in One GitHub Repository

A GitHub repo curates 30+ legally free AI/ML classic textbooks across ten core areas with automated link validation.
The Awesome Free AI Books GitHub repository collects over 30 legally free AI and machine learning classic textbooks, organized across ten core areas including deep learning, reinforcement learning, NLP, large language models, Bayesian methods, and AI safety. All links point exclusively to official author or publisher sources, and a weekly GitHub Action automatically validates link integrity. The open-source project welcomes community contributions to keep the collection growing and reliable.
A Common Pain Point for Developers: Quality AI Textbooks Scattered Everywhere
For anyone looking to systematically learn artificial intelligence and machine learning, the process of finding quality textbooks is often filled with frustration. Many industry-recognized classics are actually legally free — the authors themselves have posted electronic versions on their personal homepages for public reading. The problem is that these free AI textbooks are scattered across authors' personal websites, university course pages, and various obscure GitHub repositories, making them difficult to discover.
The root cause lies in the traditional model of academic publishing: contracts between researchers and publishers often reserve the author's right to self-distribute electronic versions (known as "author self-archiving" rights), but publishers don't actively promote these free channels. The business model of academic publishing has long been controversial — under the traditional model, researchers (usually funded by public money) provide content and peer review for free, publishers handle typesetting and distribution, and then charge university libraries exorbitant subscription fees. Major academic publishers like Elsevier and Springer Nature consistently maintain profit margins of 30-40%, far exceeding typical industry levels. This "double-charging" problem gave rise to the open access movement: during the 2012 "Academic Spring," thousands of researchers publicly boycotted Elsevier; in 2018, a coalition of European research funding agencies launched Plan S, requiring funded research to be published in open access form. In the textbook domain, MIT Press's "MIT Press Open" initiative and some of Cambridge University Press's open access projects are gradually changing the landscape. However, academia as a whole still lacks a unified open access platform, leaving quality content scattered across corners of the internet.
A Reddit user, repeatedly frustrated by this problem, built a centralized index project — Awesome Free AI Books. This open-source repository organizes over 30 legally free AI/ML books into categories, so learners no longer need to hunt for materials everywhere. The project follows the tradition of GitHub's famous "Awesome List" ecosystem — a curation ecosystem that originated in 2014 when Sindre Sorhus created the awesome repository. It now covers virtually every tech domain including programming languages, frameworks, tools, and learning resources. The most popular Awesome Lists have over 300,000 stars and have become an important knowledge discovery mechanism in the developer community. A good Awesome List needs to meet standards including curated (not simply piled) content, clear categorical logic, active maintenance, and contribution guidelines.

Free AI Books Covering Ten Core Areas
The value of this repository lies not just in quantity, but in its systematic categorical coverage. It organizes books by major AI/ML research directions, covering a complete knowledge map from fundamentals to cutting-edge topics.
Deep Learning and Reinforcement Learning Foundations
The repository includes several works considered "bible-level" classics. For example, Ian Goodfellow's Deep Learning (the "flower book") is virtually required reading for every deep learning beginner. Co-authored by Goodfellow, Bengio, and Courville — three deep learning pioneers — the book systematically covers mathematical foundations like linear algebra and probability theory, core architectures like feedforward networks, convolutional networks, and recurrent networks, and frontier topics like generative models and representation learning. Deep learning itself is a subfield of machine learning, with the core idea of using multi-layer neural networks to automatically learn hierarchical feature representations from data, eliminating the need for manual feature engineering — a methodology that rapidly swept through nearly all AI subfields including computer vision, natural language processing, and speech recognition after the 2012 ImageNet competition. Notably, all three authors are core drivers of the deep learning renaissance: Yoshua Bengio, along with Geoffrey Hinton and Yann LeCun, received the 2018 Turing Award, and Ian Goodfellow is the inventor of Generative Adversarial Networks (GANs).
Sutton and Barto's Reinforcement Learning: An Introduction is the universally recognized authoritative textbook in reinforcement learning. Reinforcement learning is the third major paradigm of machine learning (distinct from supervised and unsupervised learning), with the core question being: how can an agent learn optimal behavior strategies through trial and error during continuous interaction with an environment to maximize long-term cumulative reward? The mathematical foundation of this framework is the Markov Decision Process (MDP), with core algorithms including dynamic programming, Monte Carlo methods, temporal-difference learning (TD Learning), and more recent deep reinforcement learning approaches combining deep learning (such as DQN, PPO, SAC, etc.). Reinforcement learning is widely applied in game AI (e.g., AlphaGo achieving superhuman performance through self-play), robotic control, autonomous driving decisions, and the recent Reinforcement Learning from Human Feedback (RLHF) for large language models — it's precisely RLHF technology that enables models like ChatGPT to generate responses more aligned with human preferences. Both of these books have long offered official free versions, but many beginners don't know where to find them.
Probability, Bayesian Methods, and Mathematical Foundations
In the probabilistic and Bayesian machine learning domain, Kevin Murphy's Probabilistic Machine Learning series and Christopher Bishop's latest work are both included. Kevin Murphy is a senior research scientist at Google Research, and his two-volume set (An Introduction and Advanced Topics) is considered the most comprehensive and up-to-date probabilistic machine learning textbook currently available, covering everything from classical probabilistic graphical models (including Bayesian networks and Markov random fields) to the latest deep generative models (such as Variational Autoencoders/VAE, normalizing flows, and diffusion models). Christopher Bishop is a Technical Fellow at Microsoft Research; his 2006 book Pattern Recognition and Machine Learning (PRML) was one of the most widely used graduate-level machine learning textbooks, and his latest work continues his rigorous and comprehensive writing style.
The core idea of Bayesian machine learning is to treat model parameters as random variables rather than fixed values, combining prior knowledge with observed data through Bayes' theorem to obtain the posterior distribution of parameters. Specifically, Bayes' theorem P(θ|D) ∝ P(D|θ)P(θ) combines the prior distribution P(θ) (our beliefs about parameters before observing data) with the likelihood function P(D|θ) (the probability of observing the data given the parameters) to yield the posterior distribution P(θ|D). Compared to traditional point estimation methods (like maximum likelihood estimation), Bayesian methods inherently possess uncertainty quantification capabilities — they tell you not only "what the most likely answer is" but also "how confident you should be in that answer." This capability is especially important in high-stakes scenarios requiring reliable decisions, such as medical diagnosis and autonomous driving. In practice, the main challenge of Bayesian inference is that the posterior distribution is usually intractable to compute analytically, requiring approximate methods such as Markov Chain Monte Carlo (MCMC) sampling or Variational Inference.
The repository also has a dedicated "Math for ML" category, helping readers fill gaps in linear algebra, probability theory, calculus, and optimization theory. For ML practitioners, linear algebra is the foundation for understanding matrix operations and eigendecomposition in neural networks — forward propagation in neural networks is essentially a composition of matrix multiplications and nonlinear transformations; probability theory provides theoretical support for understanding loss functions (e.g., cross-entropy loss is essentially an application of KL divergence), regularization (e.g., L2 regularization is equivalent to imposing a Gaussian prior on parameters), and generative models; optimization theory directly relates to how gradient descent and its variants (SGD, Adam, AdaGrad, RMSProp, etc.) work during model training, as well as understanding the geometric structure of loss surfaces, saddle point escape, and learning rate scheduling. Without these mathematical foundations, learners often remain at the API-calling level, unable to understand why models fail or make innovative improvements.
NLP, Large Models, and Frontier Directions
With the rise of large language models, natural language processing has become a hot field. NLP has undergone revolutionary changes over the past decade: from early rule-based and statistical methods (such as n-gram language models, Hidden Markov Models), to the word embedding era launched by Word2Vec in 2013 (mapping words to dense, low-dimensional vector spaces where semantically similar words are close together), to the 2017 Transformer architecture that completely changed the entire field's technical trajectory, ultimately catalyzing the flourishing development of large language models like GPT, BERT, and LLaMA.
The Transformer architecture comes from the 2017 Google team paper "Attention Is All You Need" and is one of the most important technical breakthroughs in modern AI. Its core innovation is the self-attention mechanism, which allows the model to directly attend to elements at any position in the sequence when processing each element, solving the fundamental deficiency of RNNs in long-range dependency modeling. The Transformer's parallel computation properties also enable models to efficiently leverage GPU clusters for large-scale training, directly driving the leap in parameter scale from millions to hundreds of billions. The pre-train then fine-tune paradigm based on Transformers, along with later prompt engineering and in-context learning, constitute the main technical approaches for current large language model applications.
The repository includes the draft version of Jurafsky and Martin's Speech and Language Processing (SLP3), one of the most authoritative textbooks in NLP. It has been used in NLP courses at top universities like Stanford for over twenty years, and its online draft version is continuously updated to cover the latest content on Transformers and pre-trained models. Dan Jurafsky is a jointly appointed professor of linguistics and computer science at Stanford University, and James Martin is a professor of computational linguistics at the University of Colorado — their collaboration gives the book both linguistic depth and a computer science engineering perspective.
Beyond this, the repository also covers computer vision, generative models, causal inference, Graph Neural Networks (GNN), and AI safety — all emerging and important fields. Graph Neural Networks (GNN) are an important method for extending deep learning to non-Euclidean data (such as social networks, molecular structures, and knowledge graphs), performing feature aggregation and representation learning on graph structures through message passing mechanisms. Specifically, at each layer, every node collects feature information from its neighboring nodes and updates its own representation through aggregation functions (such as summation, averaging, or attention-weighted methods). This local-to-global information propagation enables GNNs to capture topological information in graph structures, demonstrating powerful capabilities in drug discovery (predicting molecular properties and protein interactions), recommendation systems (modeling user-item interaction graphs), and traffic prediction (flow prediction on road networks). Representative models include GCN, GraphSAGE, GAT, and others.
Causal inference goes beyond the "correlation" limitations of traditional machine learning, attempting to answer counterfactual questions like "if X were changed, how would Y change" — a research direction championed by scholars like Judea Pearl. Pearl's proposed Ladder of Causation divides reasoning ability into three levels: association (what is observed), intervention (what would happen if I did something), and counterfactuals (what would have happened if different choices were made). Traditional machine learning primarily stays at the first level, while causal inference attempts to climb to the second and third levels. Specific methods include Structural Causal Models (SCM), do-calculus, instrumental variables, and difference-in-differences. This direction is crucial for policy making, medical trials, and fairness analysis — for example, correlation alone cannot answer questions like "whether a drug is truly effective" or "whether an algorithm exhibits gender discrimination."
The AI safety field focuses on ensuring that AI systems behave in accordance with human intentions, covering multiple sub-directions including alignment, robustness, interpretability, and adversarial attack defense. The core challenge of alignment is that as AI systems become more capable, ensuring their optimization objectives are consistent with true human intentions becomes increasingly difficult — this is known as the "outer alignment" and "inner alignment" problem. With the rapid improvement of large model capabilities, frontier labs like OpenAI, Anthropic, and DeepMind have all made AI safety a core research direction, with related job demand and academic paper volume growing explosively over the past two years.
Three Key Design Highlights: More Than Just a Resource Collection
This repository deserves attention not just because it's another "resource collection," but because the author designed it with long-term usability and legality in mind.
All Links Point Only to Official Sources
The author specifically emphasizes that every link points directly to the author's or publisher's official page, never using re-hosted PDFs or dubious mirror sites. This means all resources are completely legally free to access, respecting authors' copyright wishes while preventing users from downloading outdated or tampered versions.
This approach actually echoes the recent trend of the "Open Access" movement in academia. More and more researchers are choosing to freely publish electronic versions of their works through "Author Self-Archiving" on their own homepages or preprint platforms like arXiv. arXiv is a preprint server operated by Cornell University that has collected over 2 million papers since its founding in 1991 and serves as the de facto standard paper publication channel in physics, mathematics, and computer science — virtually all important AI research results are publicly released on arXiv before formal publication. In many publishing contracts, authors retain the right to distribute specific versions (usually the final manuscript or special electronic editions), known as "Green Open Access" (Green OA). Academic publishers like MIT Press and Cambridge University Press have also launched open access programs for textbooks in recent years; for example, MIT Press's Direct to Open (D2O) model shares costs through library consortia to make academic monographs freely available to the public. Therefore, this "free" is not a gray area but rather a knowledge-sharing approach that authors and publishers have deliberately chosen. This is especially valuable in an internet environment flooded with pirated resources.
Automated Link Detection Prevents Broken Links
The most common problem with resource collection projects is "Link Rot" — as time passes, original links become invalid and the entire repository gradually loses value. Research shows that internet links have an average half-life of about 2-3 years, meaning a link has about a 50% chance of becoming invalid two to three years after publication. A 2014 Harvard Law School study found that 49% of web links cited in U.S. Supreme Court decisions had already become invalid; a 2021 Pew Research Center study showed that 38% of all web pages from 2013 were no longer accessible in 2023. For academic resources pointing to personal homepages, this problem is even more severe, as links often simply disappear when researchers change institutions, domain names, or retire. The Internet Archive's Wayback Machine is the largest-scale effort to address this problem, having archived over 800 billion web page snapshots, but it can only passively save historical versions and cannot actively monitor link health.
To address this, the author has set up a weekly GitHub Action that automatically checks the validity of all links. GitHub Actions is a CI/CD service officially launched by GitHub in 2019, allowing developers to define automated workflows through YAML configuration files that execute scripts automatically when triggered by specific events (such as code pushes, Pull Requests, scheduled plans, etc.). For public repositories, GitHub provides 2,000 free minutes of runtime per month, enabling even small open-source projects to have enterprise-grade automated maintenance capabilities. In this project, a cron-based scheduled task automatically traverses all URLs in the repository weekly, using open-source tools like lychee or markdown-link-check to send HTTP requests to verify their accessibility. When anomalies like 404 errors, timeouts, or SSL certificate errors are detected, it automatically creates an Issue to alert maintainers to update. This automated maintenance mechanism ensures long-term reliability of the repository — something many similar projects lack.
Open-Source Collaboration and Community Building
The project itself is open source and welcomes community contributions. If someone knows of a legally free machine learning book that hasn't been included yet, they can supplement and improve the collection by submitting a Pull Request or Issue. A Pull Request (PR) is a collaboration mechanism in the Git version control system: contributors fork (copy) the original repository to their own account, make changes on a local branch, and then submit a merge request to the original repository for the maintainer to review and decide whether to accept. This model enables open collaboration without granting strangers direct write permissions and is the cornerstone of modern open-source software development. This open collaboration model allows the repository to continuously grow, covering more quality resources while leveraging the collective wisdom of the community for quality control.
What This Free AI Textbook Repository Means for Learners
For students, researchers, and engineers in the AI/ML field, this kind of carefully curated resource index solves a real efficiency problem. Rather than laboriously sorting through search engine results to determine which resources are legal and which links are valid, learners can start from a single verified, continuously maintained entry point. In an era of information overload, "curation" itself is a value-creating activity — good curation isn't simple information aggregation, but rather reduces learners' cognitive burden and search costs through selection, organization, and continuous maintenance.
More importantly, this project embodies a healthy knowledge-sharing philosophy: excellent academic works should be conveniently accessible to more people, and this access should be built on a foundation of respecting original authors. As more and more top researchers choose to make their works freely available, an index that effectively aggregates and maintains them is itself an important contribution to the entire learning community. This model also aligns with the concept of "Knowledge Commons" — 2009 Nobel Economics laureate Elinor Ostrom's research demonstrated that under appropriate governance mechanisms, common pool resources can be effectively maintained without falling into the "tragedy of the commons." The collaborative model of open-source communities is a vivid practice of this theory in the digital age.
Interested readers can visit the repository directly at: https://github.com/MarcosSete/awesome-free-ai-books and embark on a free and systematic AI learning journey.
Key Takeaways
Related articles

The Truth Behind Codex 'Build a Website in 5 Minutes': AI Isn't Creating Sites—It's Helping You Copy Them
Exposing the truth behind viral Codex 5-minute website videos: creators aren't building original sites with AI—they're copying shared prompts or scraping others' work. Learn AI coding tools' real limits.

Getting Started with AI Agent Development: A Complete Guide from Concept to Practice
A comprehensive guide to AI Agent architecture and development, covering automated marketing, intelligent customer service, and investment analysis scenarios with single and multi-agent collaboration.

The Truth Behind Codex 'Build a Website in 5 Minutes': AI Isn't Creating Sites — It's Helping You Copy Them
Exposing the truth behind viral Codex 5-minute website videos: creators aren't building original sites with AI — they're copying shared prompts or scraping others' work.