references / how-to.html
VoltageVagabond's picture
Upload folder using huggingface_hub
16c0a91 verified
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Shared References — LLM Fine-Tuning Projects</title>
<style>
:root {
--bg: #fafafa;
--card: #ffffff;
--text: #1a1a1a;
--muted: #666;
--accent: #2c5aa0;
--accent-soft: #e8f0fe;
--border: #e0e0e0;
--code-bg: #f4f4f4;
}
* { box-sizing: border-box; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
background: var(--bg);
color: var(--text);
max-width: 900px;
margin: 2rem auto;
padding: 0 1.5rem;
line-height: 1.6;
}
h1 { color: var(--accent); border-bottom: 3px solid var(--accent); padding-bottom: 0.5rem; }
h2 { color: var(--accent); margin-top: 2.5rem; border-bottom: 1px solid var(--border); padding-bottom: 0.3rem; }
h3 { margin-top: 1.8rem; color: #333; }
.intro { background: var(--accent-soft); border-left: 4px solid var(--accent); padding: 1rem 1.2rem; border-radius: 4px; }
.nav { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0; }
.nav a {
background: var(--card);
border: 1px solid var(--border);
padding: 0.4rem 0.9rem;
border-radius: 20px;
text-decoration: none;
color: var(--accent);
font-size: 0.9rem;
}
.nav a:hover { background: var(--accent-soft); }
.item {
background: var(--card);
border: 1px solid var(--border);
border-radius: 6px;
padding: 1rem 1.2rem;
margin: 0.8rem 0;
}
.item .title { font-weight: 600; font-size: 1.05rem; }
.item .title a { color: var(--accent); text-decoration: none; }
.item .title a:hover { text-decoration: underline; }
.item .meta { color: var(--muted); font-size: 0.85rem; margin-top: 0.2rem; }
.item .desc { margin-top: 0.5rem; font-size: 0.95rem; }
.tag {
display: inline-block;
font-size: 0.75rem;
padding: 2px 8px;
border-radius: 10px;
margin-left: 6px;
vertical-align: middle;
}
.tag-local { background: #d4edda; color: #155724; }
.tag-online { background: #fff3cd; color: #856404; }
.tag-mlx { background: #e8d4f0; color: #5a2872; }
.tag-liquid { background: #d4e6f0; color: #1a4870; }
.tag-xai { background: #fde5d4; color: #8c4820; }
code {
background: var(--code-bg);
padding: 2px 6px;
border-radius: 3px;
font-size: 0.88em;
}
pre {
background: var(--code-bg);
padding: 0.9rem 1.1rem;
border-radius: 4px;
border-left: 3px solid var(--accent);
overflow-x: auto;
}
.note { background: #fffbe6; border-left: 4px solid #f0c036; padding: 0.8rem 1rem; border-radius: 4px; margin: 1rem 0; }
footer { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.85rem; }
</style>
</head>
<body>
<h1>Shared References — LLM Fine-Tuning Projects</h1>
<div class="intro">
<strong>What this folder is:</strong> 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 <code>docs/references/</code> folder.
</div>
<div class="nav">
<a href="#papers">📄 Papers</a>
<a href="#guides">📘 Guides</a>
<a href="#projects">🗂 Projects</a>
<a href="#citing">📚 Citing</a>
</div>
<div class="note">
All local links open files on your computer (no internet needed). Online links are provided as fallbacks and for the latest versions.
</div>
<h2 id="papers">📄 Foundational Papers</h2>
<p>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.</p>
<div class="item">
<div class="title">
<a href="papers/Attention_Vaswani2017.pdf">Attention Is All You Need</a>
<span class="tag tag-local">local</span>
</div>
<div class="meta">Vaswani et al. (2017) · NeurIPS · <a href="https://arxiv.org/abs/1706.03762">arXiv:1706.03762</a></div>
<div class="desc">The original Transformer paper. Every modern LLM (Qwen, LFM2, GPT, Llama, etc.) is descended from this architecture. Read this if you want to understand <em>why</em> the models you're fine-tuning work the way they do.</div>
</div>
<div class="item">
<div class="title">
<a href="papers/LoRA_Hu2021.pdf">LoRA: Low-Rank Adaptation of Large Language Models</a>
<span class="tag tag-local">local</span>
<span class="tag tag-mlx">MLX</span>
<span class="tag tag-liquid">Liquid</span>
</div>
<div class="meta">Hu et al. (2021) · ICLR 2022 · <a href="https://arxiv.org/abs/2106.09685">arXiv:2106.09685</a></div>
<div class="desc">The LoRA paper. Introduces the trick of freezing the base model's weights and training tiny "adapter" matrices instead. This is exactly what <code>mlx_lm.lora</code> and HuggingFace PEFT do. Both the MLX and Liquid projects use this technique.</div>
</div>
<div class="item">
<div class="title">
<a href="papers/QLoRA_Dettmers2023.pdf">QLoRA: Efficient Finetuning of Quantized LLMs</a>
<span class="tag tag-local">local</span>
<span class="tag tag-mlx">MLX</span>
</div>
<div class="meta">Dettmers et al. (2023) · NeurIPS · <a href="https://arxiv.org/abs/2305.14314">arXiv:2305.14314</a></div>
<div class="desc">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.</div>
</div>
<div class="item">
<div class="title">
<a href="papers/PEFT_Survey.pdf">Parameter-Efficient Fine-Tuning for Large Models: A Comprehensive Survey</a>
<span class="tag tag-local">local</span>
</div>
<div class="meta">Han et al. (2024) · <a href="https://arxiv.org/abs/2403.14608">arXiv:2403.14608</a></div>
<div class="desc">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.</div>
</div>
<h2 id="guides">📘 Fine-Tuning Guides</h2>
<p>Official documentation and tutorials from HuggingFace and Unsloth. Downloaded as HTML so they work offline.</p>
<h3>HuggingFace Ecosystem</h3>
<div class="item">
<div class="title">
<a href="guides/HuggingFace_LLM_FullFineTune_Tutorial.html">Fully Fine-tune a Small Language Model (LearnHuggingFace)</a>
<span class="tag tag-local">local</span>
</div>
<div class="meta">LearnHuggingFace community tutorial · <a href="https://www.learnhuggingface.com/notebooks/hugging_face_llm_full_fine_tune_tutorial">online version</a></div>
<div class="desc">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.</div>
</div>
<div class="item">
<div class="title">
<a href="guides/HuggingFace_PEFT_Quicktour.html">PEFT Quicktour</a>
<span class="tag tag-local">local</span>
<span class="tag tag-liquid">Liquid</span>
</div>
<div class="meta">HuggingFace PEFT docs · <a href="https://huggingface.co/docs/peft/quicktour">online version</a></div>
<div class="desc">Official quickstart for the PEFT library, which provides <code>LoraConfig</code> and friends. This is the library the Liquid project uses for its LoRA adapters.</div>
</div>
<div class="item">
<div class="title">
<a href="guides/HuggingFace_PEFT_LoRA_Conceptual.html">PEFT Conceptual Guide: LoRA</a>
<span class="tag tag-local">local</span>
</div>
<div class="meta">HuggingFace PEFT docs · <a href="https://huggingface.co/docs/peft/main/en/conceptual_guides/lora">online version</a></div>
<div class="desc">Explains what <code>r</code>, <code>lora_alpha</code>, <code>target_modules</code>, and <code>lora_dropout</code> actually mean — the exact parameters used in the Liquid notebook's <code>LoraConfig(...)</code> call.</div>
</div>
<div class="item">
<div class="title">
<a href="guides/HuggingFace_TRL_SFTTrainer.html">TRL SFTTrainer Documentation</a>
<span class="tag tag-local">local</span>
<span class="tag tag-liquid">Liquid</span>
</div>
<div class="meta">HuggingFace TRL docs · <a href="https://huggingface.co/docs/trl/sft_trainer">online version</a></div>
<div class="desc">Reference for the <code>SFTTrainer</code> class (Supervised Fine-Tuning Trainer), which is what the Liquid notebook uses to actually run training. Explains all the <code>SFTConfig</code> options.</div>
</div>
<div class="item">
<div class="title">
<a href="guides/HuggingFace_ChatTemplates.html">Chat Templates Guide</a>
<span class="tag tag-local">local</span>
<span class="tag tag-mlx">MLX</span>
<span class="tag tag-liquid">Liquid</span>
</div>
<div class="meta">HuggingFace Transformers docs · <a href="https://huggingface.co/docs/transformers/chat_templating">online version</a></div>
<div class="desc">Critical read. Explains <code>tokenizer.apply_chat_template()</code>, 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.</div>
</div>
<h3>Unsloth (Alternative to TRL)</h3>
<div class="item">
<div class="title">
<a href="guides/Unsloth_Documentation.html">Unsloth Documentation Home</a>
<span class="tag tag-local">local</span>
</div>
<div class="meta">Unsloth docs · <a href="https://docs.unsloth.ai/">online version</a></div>
<div class="desc">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.</div>
</div>
<div class="item">
<div class="title">
<a href="guides/Unsloth_FineTune_Guide.html">Unsloth Fine-Tuning Guide</a>
<span class="tag tag-local">local</span>
</div>
<div class="meta">Unsloth docs · <a href="https://unsloth.ai/docs/get-started/fine-tuning-llms-guide">online version</a></div>
<div class="desc">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.</div>
</div>
<div class="item">
<div class="title">
<a href="guides/Unsloth_LoRA_Hyperparameters.html">Unsloth LoRA Hyperparameters Guide</a>
<span class="tag tag-local">local</span>
</div>
<div class="meta">Unsloth docs · <a href="https://unsloth.ai/docs/get-started/fine-tuning-llms-guide/lora-hyperparameters-guide">online version</a></div>
<div class="desc">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).</div>
</div>
<h2 id="projects">🗂 Projects</h2>
<p>Each project has its own <code>docs/references/how-to.html</code> with project-specific papers, guides, and quick-start commands:</p>
<div class="item">
<div class="title">
<a href="../spam-classifier-mlx/docs/references/how-to.html">MLX Spam Classifier</a>
<span class="tag tag-mlx">MLX</span>
</div>
<div class="desc">Fine-tunes Qwen3.5-0.8B on Apple Silicon using Apple's MLX framework and the <code>mlx_lm.lora</code> command. See project README for quickstart.</div>
</div>
<div class="item">
<div class="title">
<a href="../spam-classifier-liquid/docs/references/how-to.html">Liquid AI Spam Classifier</a>
<span class="tag tag-liquid">Liquid</span>
</div>
<div class="desc">Fine-tunes Liquid AI's LFM2.5-1.2B-Instruct using HuggingFace TRL + PEFT. Based on the official Liquid4All cookbook notebook.</div>
</div>
<div class="item">
<div class="title">
<a href="../spam-xai-project/docs/references/how-to.html">Spam XAI Classifier</a>
<span class="tag tag-xai">XAI</span>
</div>
<div class="desc">scikit-learn spam classifier (Random Forest + Logistic Regression + SVM ensemble) with LIME, SHAP, and ELI5 explainability. Deployed via Gradio + HuggingFace Spaces.</div>
</div>
<h2 id="citing">📚 Citing These Sources</h2>
<pre>
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., &amp; Chen, W. (2021).
LoRA: Low-Rank Adaptation of Large Language Models. arXiv:2106.09685.
Dettmers, T., Pagnoni, A., Holtzman, A., &amp; Zettlemoyer, L. (2023).
QLoRA: Efficient Finetuning of Quantized LLMs. NeurIPS 2023. arXiv:2305.14314.
Han, Z., Gao, C., Liu, J., Zhang, J., &amp; Zhang, S.Q. (2024).
Parameter-Efficient Fine-Tuning for Large Models: A Comprehensive Survey.
arXiv:2403.14608.
</pre>
<footer>
Spring 2026 · ENGT 375 Applied Machine Learning · ODU · Generated for local offline reference.
</footer>
</body>
</html>