Shared References — LLM Fine-Tuning Projects

What this folder is: Papers and documentation that apply to more than one of the three spam-classifier projects (MLX, Liquid, XAI). Project-specific references live inside each project's own docs/references/ folder.
All local links open files on your computer (no internet needed). Online links are provided as fallbacks and for the latest versions.

📄 Foundational Papers

These papers apply to all three LLM-focused projects. They cover the core ideas behind modern fine-tuning: the Transformer architecture, and parameter-efficient tuning with LoRA and QLoRA.

Attention Is All You Need local
Vaswani et al. (2017) · NeurIPS · arXiv:1706.03762
The original Transformer paper. Every modern LLM (Qwen, LFM2, GPT, Llama, etc.) is descended from this architecture. Read this if you want to understand why the models you're fine-tuning work the way they do.
LoRA: Low-Rank Adaptation of Large Language Models local MLX Liquid
Hu et al. (2021) · ICLR 2022 · arXiv:2106.09685
The LoRA paper. Introduces the trick of freezing the base model's weights and training tiny "adapter" matrices instead. This is exactly what mlx_lm.lora and HuggingFace PEFT do. Both the MLX and Liquid projects use this technique.
QLoRA: Efficient Finetuning of Quantized LLMs local MLX
Dettmers et al. (2023) · NeurIPS · arXiv:2305.14314
QLoRA extends LoRA to work on quantized (compressed) base models. When the MLX project fine-tunes a 4-bit quantized Qwen model, it's automatically using QLoRA under the hood. This paper explains why that works.
Parameter-Efficient Fine-Tuning for Large Models: A Comprehensive Survey local
Han et al. (2024) · arXiv:2403.14608
A recent survey of all the different parameter-efficient fine-tuning methods (LoRA, Adapters, Prefix Tuning, Prompt Tuning, etc.). Useful background if you want to know what alternatives exist beyond LoRA.

📘 Fine-Tuning Guides

Official documentation and tutorials from HuggingFace and Unsloth. Downloaded as HTML so they work offline.

HuggingFace Ecosystem

Fully Fine-tune a Small Language Model (LearnHuggingFace) local
LearnHuggingFace community tutorial · online version
A beginner-friendly walkthrough of full fine-tuning with HuggingFace Transformers. This was one of the starting points for the MLX and Liquid projects — even though our projects use LoRA (not full fine-tuning), the tutorial is great for understanding the HuggingFace workflow.
PEFT Quicktour local Liquid
HuggingFace PEFT docs · online version
Official quickstart for the PEFT library, which provides LoraConfig and friends. This is the library the Liquid project uses for its LoRA adapters.
PEFT Conceptual Guide: LoRA local
HuggingFace PEFT docs · online version
Explains what r, lora_alpha, target_modules, and lora_dropout actually mean — the exact parameters used in the Liquid notebook's LoraConfig(...) call.
TRL SFTTrainer Documentation local Liquid
HuggingFace TRL docs · online version
Reference for the SFTTrainer class (Supervised Fine-Tuning Trainer), which is what the Liquid notebook uses to actually run training. Explains all the SFTConfig options.
Chat Templates Guide local MLX Liquid
HuggingFace Transformers docs · online version
Critical read. Explains tokenizer.apply_chat_template(), the function both MLX and Liquid notebooks call before generating text. If you forget this step, the model receives raw text instead of the chat format it was trained on and produces garbage.

Unsloth (Alternative to TRL)

Unsloth Documentation Home local
Unsloth docs · online version
Unsloth is an alternative fine-tuning library that claims 2-5x faster training and uses less memory than vanilla TRL. Liquid AI's cookbook has both a TRL version and an Unsloth version of their example notebook. This is the landing page.
Unsloth Fine-Tuning Guide local
Unsloth docs · online version
Step-by-step Unsloth fine-tuning walkthrough. A good alternative read if you want to compare the Unsloth workflow to the TRL workflow we used in the Liquid project.
Unsloth LoRA Hyperparameters Guide local
Unsloth docs · online version
Practical advice on choosing LoRA rank, alpha, dropout, target modules, and learning rate. Applies to both MLX and Liquid projects since they both use the same LoRA technique (just with different libraries).

🗂 Projects

Each project has its own docs/references/how-to.html with project-specific papers, guides, and quick-start commands:

MLX Spam Classifier MLX
Fine-tunes Qwen3.5-0.8B on Apple Silicon using Apple's MLX framework and the mlx_lm.lora command. See project README for quickstart.
Liquid AI Spam Classifier Liquid
Fine-tunes Liquid AI's LFM2.5-1.2B-Instruct using HuggingFace TRL + PEFT. Based on the official Liquid4All cookbook notebook.
Spam XAI Classifier XAI
scikit-learn spam classifier (Random Forest + Logistic Regression + SVM ensemble) with LIME, SHAP, and ELI5 explainability. Deployed via Gradio + HuggingFace Spaces.

📚 Citing These Sources

Vaswani, A., Shazeer, N., Parmar, N., et al. (2017). Attention Is All You Need.
  In Advances in Neural Information Processing Systems 30 (NeurIPS 2017).
  https://arxiv.org/abs/1706.03762

Hu, E., Shen, Y., Wallis, P., Allen-Zhu, Z., Li, Y., Wang, S., Wang, L., & Chen, W. (2021).
  LoRA: Low-Rank Adaptation of Large Language Models. arXiv:2106.09685.

Dettmers, T., Pagnoni, A., Holtzman, A., & Zettlemoyer, L. (2023).
  QLoRA: Efficient Finetuning of Quantized LLMs. NeurIPS 2023. arXiv:2305.14314.

Han, Z., Gao, C., Liu, J., Zhang, J., & Zhang, S.Q. (2024).
  Parameter-Efficient Fine-Tuning for Large Models: A Comprehensive Survey.
  arXiv:2403.14608.