Email the Author

You can use this page to email J. Paul Liu about How to Build and Fine-Tune a Small Language Model.

Please include an email address so the author can respond to your query

This message will be sent to J. Paul Liu

This site is protected by reCAPTCHA and the Google  Privacy Policy and  Terms of Service apply.

About the Book

How to Build and Fine-Tune a Small Language Model is a practical, end-to-end guide for anyone who wants to move from AI user to AI builder. Based on real graduate courses, research workshops, and industry bootcamps, this book shows that you don’t need billion-dollar infrastructure to create powerful AI systems—you only need a laptop, curiosity, and the right roadmap.

The book demystifies modern language models by guiding you through the full pipeline:

  • understanding transformer architecture step-by-step (you build a working GPT in Chapter 2),
  • pretraining and fine-tuning small models on your own data,
  • aligning models with DPO,
  • and deploying real applications on consumer hardware.

The examples are drawn from real scientific and professional use cases—geohazard analysis, legal document processing, historical text analysis, multilingual customer support, and more—reflecting how this material was used successfully by scientists, researchers, and practitioners in workshops and production settings .

All code is provided as Google Colab notebooks, allowing readers to click, run, and learn without installation or expensive hardware .

By the end, readers will know how to build, train, align, and deploy small language models (125M–350M parameters) with confidence—and more importantly, will understand the trade-offs behind practical AI systems and how to choose the right design for their needs .

This is not a research monograph—it is a builder’s manual. A clear, hands-on path for beginners, researchers, and non-programmers who want to bring AI to their own domain.


About the Author

J. Paul Liu’s avatar J. Paul Liu

@jpliu168

Liu, J. Paul. 2025. *How to Build and Fine-Tune a Small Language Model*. Amazon Kindle Direct Publishing., 485 p. 

Logo white 96 67 2x

Publish Early, Publish Often

  • Path
  • There are many paths, but the one you're on right now on Leanpub is:
  • Howtobuildandfine-tuneasmalllanguagemodel › Email Author › New
    • READERS
    • Newsletters
    • Weekly Sale
    • Monthly Sale
    • Store
    • Home
    • Redeem a Token
    • Search
    • Support
    • Leanpub FAQ
    • Leanpub Author FAQ
    • Search our Help Center
    • How to Contact Us
    • FRONTMATTER PODCAST
    • Featured Episode
    • Episode List
    • MEMBERSHIPS
    • Reader Memberships
    • Department Reader Memberships
    • Author Memberships
    • Your Membership
    • COMPANY
    • About
    • About Leanpub
    • Blog
    • Contact
    • Press
    • Essays
    • AI Services
    • Imagine a world...
    • Manifesto
    • More
    • Partner Program
    • Causes
    • Accessibility
    • AUTHORS
    • Write and Publish on Leanpub
    • Create a Book
    • Create a Bundle
    • Create a Course
    • Create a Track
    • Testimonials
    • Why Leanpub
    • Services
    • AccessibilityPro (NEW!)
    • Author Quickstart (NEW!)
    • CourseAI
    • TranslateAI
    • GlobalAuthor
    • IndexAI
    • Launch Quickstart (NEW!)
    • Marketing Packages
    • PublishWord
    • Publish on Amazon
    • Author Newsletter
    • The Leanpub Author Update
    • Author Support
    • Author Help Center
    • Leanpub Authors Forum
    • The Leanpub Manual
    • Supported Languages
    • The LFM Manual
    • Markua Manual
    • API Docs
    • Organizations
    • Learn More
    • Sign Up
    • LEGAL
    • Terms of Service
    • Copyright Policy
    • Privacy Policy
    • Refund Policy

*   *   *

Leanpub is copyright © 2010-2025 Ruboss Technology Corp.
All rights reserved.

This site is protected by reCAPTCHA
and the Google  Privacy Policy and  Terms of Service apply.

Leanpub requires cookies in order to provide you the best experience. Dismiss