{"id":"6b08c24e38c84264c2027496","slug":"fine-tuning","title":"Fine-tuning language models: when it pays off, LoRA and QLoRA in practice","summary":"How fine-tuning differs from prompting and RAG, when it really makes sense, how to prepare data, how LoRA and QLoRA work and how to measure whether the tuned model is better – with code in Python, TypeScript and C#.","servedLang":"en","availableLangs":["pl","en"],"topics":["fine-tuning","local-llms","rag","evals"],"techs":["python","typescript","dotnet"],"tags":["fine-tuning","lora","qlora","peft","trl","sft","dpo","open-weights"],"level":"advanced","kind":"article","access":"members","status":"published","cover":null,"author":{"id":"6b08bd2e80884893657cc8cf","name":"Redakcja Art of Devs","avatar":null,"handle":"redakcja","community":false},"readingMinutes":15,"stats":{"views":4,"likes":0,"bookmarks":0,"comments":0},"publishedAt":"2026-11-26T23:35:42.079Z","updatedAt":"2026-11-27T13:12:04.161Z","requestedLang":"en","theme":{"hero":"classic","heroMedia":null,"accent":"rose","background":"dots","weaveResources":true,"toc":"right"},"seoDescription":"LLM fine-tuning for developers: prompt vs RAG vs fine-tuning, JSONL data preparation, LoRA and QLoRA with PEFT and TRL, GPU memory, evaluating base vs tuned models, common mistakes.","wordCount":2828,"doc":{"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"Fine-tuning","marks":[{"type":"bold"}]},{"type":"text","text":" is further training of an existing model on your examples – you change its weights, not just its instructions. It sounds like the most powerful tool in the box, which is exactly why it gets overused: most problems teams try to solve with it are solved better and cheaper with a good prompt or "},{"type":"text","text":"RAG","marks":[{"type":"link","attrs":{"href":"/en/topics/rag"}}]},{"type":"text","text":". This article shows when fine-tuning pays off, how to do it cheaply (LoRA, QLoRA) and how to check the result honestly."}]},{"type":"stats","attrs":{"items":[{"value":"< 1%","label":"of parameters are trained by LoRA","hint":"the rest of the model stays frozen"},{"value":"48 GB","label":"one card was enough to fine-tune a 65B model","hint":"a result from the QLoRA paper (2023)"},{"value":"3","label":"levers to try before fine-tuning","hint":"prompt, examples in the prompt, RAG"}]}},{"type":"callout","attrs":{"variant":"info","title":"TL;DR"},"content":[{"type":"bulletList","content":[{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Fine-tuning changes "},{"type":"text","text":"behaviour and format","marks":[{"type":"bold"}]},{"type":"text","text":" (style, answer structure, a narrow task) and is poorly suited to adding "},{"type":"text","text":"knowledge","marks":[{"type":"bold"}]},{"type":"text","text":" – that is what RAG is for."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"LoRA trains small \"correction\" matrices instead of the whole model; QLoRA does it on a base model quantized to 4 bits, so a single GPU is enough."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Without an eval set and a comparison with the base model (and with a good prompt) you don't know whether fine-tuning achieved anything."}]}]}]}]},{"type":"heading","attrs":{"level":2,"id":"the-problem-two-ideas-one-good"},"content":[{"type":"text","text":"The problem: two ideas, one good"}]},{"type":"paragraph","content":[{"type":"text","text":"Halina's Pierogi team has two fine-tuning ideas:"}]},{"type":"orderedList","attrs":{"start":1},"content":[{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"\"Let's teach the model our menu and terms\"","marks":[{"type":"bold"}]},{"type":"text","text":" – so the assistant knows every dish, price and refund rule."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"A complaint classifier on a small local model","marks":[{"type":"bold"}]},{"type":"text","text":" – complaints contain personal data, so they must be processed on our own server (see "},{"type":"text","text":"Local LLMs","marks":[{"type":"link","attrs":{"href":"/en/topics/local-llms"}}]},{"type":"text","text":"). An 8B model with a prompt containing 40 examples works, but it is slow, and one answer in ten has broken JSON."}]}]}]},{"type":"paragraph","content":[{"type":"text","text":"The first idea is a classic mistake: the menu changes every week, and a model tuned on last week's menu will confidently quote old prices – and still hallucinate details. Knowledge that changes and must be exact belongs in the context (RAG), not in the weights. The second idea is a textbook case for fine-tuning: a narrow, repetitive task, a fixed output format and the need for a small, fast model."}]},{"type":"heading","attrs":{"level":2,"id":"prompt-rag-or-fine-tuning"},"content":[{"type":"text","text":"Prompt, RAG or fine-tuning?"}]},{"type":"table","content":[{"type":"tableRow","content":[{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Lever"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"What it changes"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Cost of a change"}]}]},{"type":"tableHeader","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"When"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Prompt and examples (few-shot)"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"instructions and format in the context"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"minutes"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"always, to start"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"RAG"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"knowledge available in a given call"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"days"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"company facts, changing data, citing sources"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Tools ("},{"type":"text","text":"tool use","marks":[{"type":"link","attrs":{"href":"/en/topics/tool-use"}}]},{"type":"text","text":")"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"access to current data and actions"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"days"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"order status, calculations, external systems"}]}]}]},{"type":"tableRow","content":[{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"Fine-tuning"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"weights: style, format, a narrow skill"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"weeks (data + training + evaluation)"}]}]},{"type":"tableCell","attrs":{"colspan":1,"rowspan":1},"content":[{"type":"paragraph","content":[{"type":"text","text":"a stable task, a small model, a long prompt to shorten"}]}]}]}]},{"type":"diagram","attrs":{"kind":"mermaid","code":"flowchart TB\n  A[\"The model doesn't do what I want\"] --> B{\"Is it missing knowledge<br/>(facts, documents)?\"}\n  B -->|\"yes\"| C[\"RAG or tools\"]\n  B -->|\"no\"| D{\"Do a better prompt<br/>and examples help?\"}\n  D -->|\"yes\"| E[\"Stay with the prompt<br/>and evals\"]\n  D -->|\"no, or too costly\"| F{\"Do you have hundreds of<br/>consistently labelled examples?\"}\n  F -->|\"no\"| G[\"Collect and label data\"]\n  F -->|\"yes\"| H[\"Fine-tuning (LoRA / QLoRA)<br/>+ comparison with the base\"]","caption":"Decision tree: fine-tuning only when cheaper levers are not enough"}},{"type":"paragraph","content":[{"type":"text","text":"It is also worth knowing where fine-tuning is available at all. Some providers offer tuning of their models through an API or cloud platforms; the Claude API does not offer self-serve fine-tuning, so for Claude models the main levers are prompts, examples, RAG and tools. Full control comes from tuning "},{"type":"text","text":"open models","marks":[{"type":"bold"}]},{"type":"text","text":" (Llama, Qwen, Gemma, Mistral) with libraries from the Hugging Face ecosystem."}]},{"type":"heading","attrs":{"level":2,"id":"how-lora-works"},"content":[{"type":"text","text":"How LoRA works"}]},{"type":"paragraph","content":[{"type":"text","text":"Full fine-tuning updates all the model's weights – for 8 billion parameters you need memory for the weights, gradients and optimizer states, which comes to well over 100 GB. "},{"type":"text","text":"LoRA","marks":[{"type":"bold"}]},{"type":"text","text":" ("},{"type":"text","text":"Low-Rank Adaptation","marks":[{"type":"italic"}]},{"type":"text","text":", Hu et al., 2021) freezes the original weights and adds to selected matrices a correction in the form of a product of two narrow matrices: "},{"type":"text","text":"W' = W + B·A","marks":[{"type":"code"}]},{"type":"text","text":", where "},{"type":"text","text":"B","marks":[{"type":"code"}]},{"type":"text","text":" is d×r and "},{"type":"text","text":"A","marks":[{"type":"code"}]},{"type":"text","text":" is r×k, with a small "},{"type":"text","text":"rank","marks":[{"type":"bold"}]},{"type":"text","text":" r (e.g. 8–64)."}]},{"type":"paragraph","content":[{"type":"text","text":"For a 4096×4096 matrix, a full update is about 16.8 million parameters, while LoRA with r = 16 is only 16·(4096 + 4096) = 131,072, or about 0.8%. The resulting "},{"type":"text","text":"adapter","marks":[{"type":"bold"}]},{"type":"text","text":" weighs a few to a few dozen megabytes; you can keep it separate, swap it per task or merge it into the base model."}]},{"type":"paragraph","content":[{"type":"text","text":"QLoRA","marks":[{"type":"bold"}]},{"type":"text","text":" (Dettmers et al., 2023) goes a step further: it loads the frozen base model in 4 bits (the NF4 format) and trains only the adapters at higher precision. This makes tuning models with several to a dozen or so billion parameters fit on a single consumer card."}]},{"type":"chart","attrs":{"type":"bar","title":"Approximate GPU memory to fine-tune an 8B model","caption":"Illustrative estimate without activations and KV cache: full fine-tuning ≈ 16 bytes/parameter (weights, gradients, Adam states), LoRA on an FP16 base ≈ weights + adapters, QLoRA ≈ 4-bit weights + adapters. Real usage depends on sequence length and batch size.","unit":"GB","data":{"labels":["Full fine-tuning","LoRA (FP16 base)","QLoRA (4-bit base)"],"series":[{"name":"GPU memory","values":[128,18,7]}]}}},{"type":"resourceRef","attrs":{"resourceId":"6b0854af1a40d7e6c24c960b"}},{"type":"heading","attrs":{"level":2,"id":"data-this-is-where-you-win-or-lose"},"content":[{"type":"text","text":"Data: this is where you win or lose"}]},{"type":"paragraph","content":[{"type":"text","text":"The model learns exactly what you show it – including label errors. A few rules:"}]},{"type":"bulletList","content":[{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Chat format (JSONL with a ","marks":[{"type":"bold"}]},{"type":"text","text":"messages","marks":[{"type":"code"}]},{"type":"text","text":" field)","marks":[{"type":"bold"}]},{"type":"text","text":" – the same role layout as in production: system prompt, user message, expected assistant answer."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Quality over quantity.","marks":[{"type":"bold"}]},{"type":"text","text":" A few hundred consistently labelled examples usually give more than a few thousand sloppy ones. Two people labelling the same sample should agree – if they don't, fix the category definitions."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"Coverage of hard cases","marks":[{"type":"bold"}]},{"type":"text","text":" – rare categories, ambiguous complaints, messages in English, \"this is not a complaint\" examples."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"No personal data.","marks":[{"type":"bold"}]},{"type":"text","text":" A model can memorize fragments of its training data and repeat them. Mask phone numbers, addresses and names before training."}]}]},{"type":"listItem","content":[{"type":"paragraph","content":[{"type":"text","text":"A control set held out before training","marks":[{"type":"bold"}]},{"type":"text","text":" – it never goes into training and is used to compare models."}]}]}]},{"type":"codeGroup","attrs":{"title":"Preparing training data"},"content":[{"type":"codeBlock","attrs":{"language":"python","filename":"prepare_data.py"},"content":[{"type":"text","text":"import json\nimport random\nimport re\n\nSYSTEM = \"Classify the complaint. Reply with JSON: {\\\"category\\\": ..., \\\"urgent\\\": true|false}.\"\nPHONE = re.compile(r\"\\b\\d{3}[ -]?\\d{3}[ -]?\\d{3}\\b\")\n\ndef to_example(row: dict) -> dict:\n    text = PHONE.sub(\"[PHONE]\", row[\"text\"])  # never train on personal data\n    answer = json.dumps({\"category\": row[\"category\"], \"urgent\": row[\"urgent\"]})\n    return {\"messages\": [\n        {\"role\": \"system\", \"content\": SYSTEM},\n        {\"role\": \"user\", \"content\": text},\n        {\"role\": \"assistant\", \"content\": answer},\n    ]}\n\nrows = [json.loads(line) for line in open(\"labeled_complaints.jsonl\", encoding=\"utf-8\")]\nunique = list({r[\"text\"].strip().lower(): r for r in rows}.values())  # drop duplicates\nrandom.seed(42)\nrandom.shuffle(unique)\n\nsplit = int(len(unique) * 0.9)  # held-out set is never used for training\nfor name, part in ((\"train.jsonl\", unique[:split]), (\"eval.jsonl\", unique[split:])):\n    with open(name, \"w\", encoding=\"utf-8\") as f:\n        for row in part:\n            f.write(json.dumps(to_example(row), ensure_ascii=False) + \"\\n\")\nprint(f\"train={split} eval={len(unique) - split}\")"}]},{"type":"codeBlock","attrs":{"language":"typescript","filename":"prepare-data.ts"},"content":[{"type":"text","text":"import { readFileSync, writeFileSync } from \"node:fs\";\n\ntype Row = { text: string; category: string; urgent: boolean };\nconst SYSTEM = 'Classify the complaint. Reply with JSON: {\"category\": ..., \"urgent\": true|false}.';\nconst PHONE = /\\b\\d{3}[ -]?\\d{3}[ -]?\\d{3}\\b/g;\n\nconst toExample = (row: Row) => ({\n  messages: [\n    { role: \"system\", content: SYSTEM },\n    { role: \"user\", content: row.text.replace(PHONE, \"[PHONE]\") }, // never train on personal data\n    { role: \"assistant\", content: JSON.stringify({ category: row.category, urgent: row.urgent }) },\n  ],\n});\n\nconst rows: Row[] = readFileSync(\"labeled_complaints.jsonl\", \"utf8\").split(\"\\n\").filter(Boolean).map((l) => JSON.parse(l));\nconst unique = [...new Map(rows.map((r) => [r.text.trim().toLowerCase(), r])).values()]; // drop duplicates\nfor (let i = unique.length - 1; i > 0; i--) { // Fisher-Yates shuffle\n  const j = Math.floor(Math.random() * (i + 1));\n  [unique[i], unique[j]] = [unique[j], unique[i]];\n}\n\nconst split = Math.floor(unique.length * 0.9); // held-out set is never used for training\nconst toJsonl = (part: Row[]) => part.map((r) => JSON.stringify(toExample(r))).join(\"\\n\") + \"\\n\";\nwriteFileSync(\"train.jsonl\", toJsonl(unique.slice(0, split)));\nwriteFileSync(\"eval.jsonl\", toJsonl(unique.slice(split)));\nconsole.log(`train=${split} eval=${unique.length - split}`);"}]},{"type":"codeBlock","attrs":{"language":"csharp","filename":"PrepareData.cs"},"content":[{"type":"text","text":"using System.Text.Json;\nusing System.Text.RegularExpressions;\n\nconst string SystemPrompt = \"Classify the complaint. Reply with JSON: {\\\"category\\\": ..., \\\"urgent\\\": true|false}.\";\nvar phone = new Regex(@\"\\b\\d{3}[ -]?\\d{3}[ -]?\\d{3}\\b\");\n\nvar unique = File.ReadLines(\"labeled_complaints.jsonl\")\n    .Where(l => l.Trim().Length > 0)\n    .Select(l => JsonSerializer.Deserialize<Row>(l, new JsonSerializerOptions(JsonSerializerDefaults.Web))!)\n    .DistinctBy(r => r.Text.Trim().ToLowerInvariant())          // drop duplicates\n    .OrderBy(_ => Random.Shared.Next())\n    .ToList();\n\nint split = (int)(unique.Count * 0.9);                            // held-out set is never used for training\nWrite(\"train.jsonl\", unique.Take(split));\nWrite(\"eval.jsonl\", unique.Skip(split));\nConsole.WriteLine($\"train={split} eval={unique.Count - split}\");\n\nvoid Write(string path, IEnumerable<Row> rows) =>\n    File.WriteAllLines(path, rows.Select(r => JsonSerializer.Serialize(new\n    {\n        messages = new object[]\n        {\n            new { role = \"system\", content = SystemPrompt },\n            new { role = \"user\", content = phone.Replace(r.Text, \"[PHONE]\") },   // never train on personal data\n            new { role = \"assistant\", content = JsonSerializer.Serialize(new { category = r.Category, urgent = r.Urgent }) },\n        },\n    })));\n\nrecord Row(string Text, string Category, bool Urgent);"}]}]}]},"toc":[{"id":"the-problem-two-ideas-one-good","text":"The problem: two ideas, one good","level":2,"locked":false},{"id":"prompt-rag-or-fine-tuning","text":"Prompt, RAG or fine-tuning?","level":2,"locked":false},{"id":"how-lora-works","text":"How LoRA works","level":2,"locked":false},{"id":"data-this-is-where-you-win-or-lose","text":"Data: this is where you win or lose","level":2,"locked":false},{"id":"training-qlora-with-peft-and-trl","text":"Training: QLoRA with PEFT and TRL","level":2,"locked":true},{"id":"evaluation-was-it-worth-it","text":"Evaluation: was it worth it?","level":2,"locked":true},{"id":"when-to-fine-tune-and-when-not-to","text":"When to fine-tune, and when not to","level":2,"locked":true},{"id":"a-short-history-of-fine-tuning","text":"A short history of fine-tuning","level":2,"locked":true},{"id":"checklist","text":"Checklist","level":2,"locked":true},{"id":"test-yourself","text":"Test yourself","level":2,"locked":true},{"id":"what-s-next","text":"What's next","level":2,"locked":true}],"locked":true,"paywall":null,"previewRatio":0.3,"totalBlocks":45,"visibleBlocks":21,"resources":[{"id":"6b0857b53c96f2d34d0b3894","type":"article","provider":"web","url":"https://magazine.sebastianraschka.com/p/practical-tips-for-finetuning-llms","embedUrl":null,"title":"Practical Tips for Finetuning LLMs Using LoRA (Low-Rank Adaptation)","description":"Things I Learned From Hundreds of Experiments","author":"Sebastian Raschka, PhD","thumbnailUrl":"https://substackcdn.com/image/fetch/$s_!i3QH!,w_1200,h_675,c_fill,f_jpg,q_auto:good,fl_progressive:steep,g_auto/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5dfbd169-eb7e-41e1-a050-556ccd6fb679_1600x672.png","durationSec":null,"lang":"en","topics":["fine-tuning"],"techs":["general"],"tags":["llm","ai","hacker-news"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"hn","publishedAt":"2023-11-19T21:54:14.000Z","popularity":73,"verifiedAt":"2026-11-26T11:18:51.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:52.228Z","updatedAt":"2026-11-26T16:00:52.228Z"},{"id":"6b0857bf3c96f2d34d0b42d5","type":"article","provider":"web","url":"https://huggingface.co/blog/peft","embedUrl":null,"title":"Parameter-Efficient Fine-Tuning using 🤗 PEFT","description":"We’re on a journey to advance and democratize artificial intelligence through open source and open science.","author":"Hugging Face","thumbnailUrl":"https://huggingface.co/blog/assets/130_peft/thumbnail.png","durationSec":null,"lang":"en","topics":["fine-tuning"],"techs":["general"],"tags":["ai"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":null,"popularity":60,"verifiedAt":"2026-11-26T11:26:43.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:02.417Z","updatedAt":"2026-11-26T16:01:02.417Z"},{"id":"6b0857b53c96f2d34d0b38b3","type":"article","provider":"web","url":"https://arxiv.org/abs/2305.14314","embedUrl":null,"title":"QLoRA: Efficient Finetuning of Quantized LLMs","description":"We present QLoRA, an efficient finetuning approach that reduces memory usage enough to finetune a 65B parameter model on a single 48GB GPU while preserving full 16-bit finetuning task performance. QLoRA backpropagates gradients through a frozen, 4-bit quantized pretrained language model into Low…","author":"arXiv.org","thumbnailUrl":null,"durationSec":null,"lang":"en","topics":["fine-tuning"],"techs":["general"],"tags":["performance","llm","ai","hacker-news"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"hn","publishedAt":"2023-05-24T22:19:39.000Z","popularity":72,"verifiedAt":"2026-11-26T11:18:53.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:52.228Z","updatedAt":"2026-11-26T16:00:52.228Z"},{"id":"6b0857bf3c96f2d34d0b4310","type":"article","provider":"web","url":"https://docs.aws.amazon.com/prescriptive-guidance/latest/retrieval-augmented-generation-options/rag-vs-fine-tuning.html","embedUrl":null,"title":"Comparing RAG and fine-tuning","description":"Learn about the advantages and disadvantages of Retrieval Augmented Generation and fine-tuning and learn about how you can combine these approaches on AWS.","author":"AWS Prescriptive Guidance","thumbnailUrl":null,"durationSec":null,"lang":"en","topics":["rag","fine-tuning"],"techs":["general"],"tags":["aws","cloud","ai"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"manual","publishedAt":null,"popularity":55,"verifiedAt":"2026-11-26T11:25:33.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:01:02.417Z","updatedAt":"2026-11-26T16:01:02.417Z"},{"id":"6b0857b53c96f2d34d0b3960","type":"article","provider":"web","url":"https://www.teachmecoolstuff.com/viewarticle/fine-tuning-a-local-llm-to-categorize-questions","embedUrl":null,"title":"Good results fine tuning a local LLM like Qwen 3:0.6B to categorize questions","description":"As a fun personal project, I have been working on a chatbot for answering general questions about my household on anything from maintenance questions to doctor’s appointments. The general idea is that the chatbot will get its household knowledge through RAG from querying a vector database, but for…","author":"teachmecoolstuff.com","thumbnailUrl":"https://www.teachmecoolstuff.com/img/tor.jpg","durationSec":null,"lang":"en","topics":["rag","embeddings-vector-db","fine-tuning","local-llms"],"techs":["general"],"tags":["databases","llm","ai","hacker-news"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"hn","publishedAt":"2026-06-21T22:55:23.000Z","popularity":67,"verifiedAt":"2026-11-26T11:18:53.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:52.228Z","updatedAt":"2026-11-26T16:00:52.228Z"},{"id":"6b0857b23c96f2d34d0b3437","type":"repo","provider":"github","url":"https://github.com/huggingface/peft","embedUrl":null,"title":"huggingface/peft","description":"🤗 PEFT: State-of-the-art Parameter-Efficient Fine-Tuning.","author":"huggingface","thumbnailUrl":"https://opengraph.githubassets.com/1/huggingface/peft","durationSec":null,"lang":"en","topics":["fine-tuning","llm-fundamentals","ai-in-python"],"techs":["python"],"tags":["adapter","diffusion","fine-tuning","llm","lora","parameter-efficient-learning","ai","peft","python","pytorch"],"price":"free","featured":false,"featuredOrder":0,"packageName":null,"source":"github","publishedAt":"2022-11-25T03:51:09.000Z","popularity":84,"verifiedAt":"2026-11-26T11:01:30.000Z","curated":false,"addedBy":"6b0857a15a2625e44ecaabe6","createdAt":"2026-11-26T16:00:49.541Z","updatedAt":"2026-11-26T16:00:49.541Z"}],"challenges":[],"attachments":[],"hasCode":true,"repoUrl":null,"series":[{"slug":"ai-path","title":"AI for developers","items":[{"slug":"llm-fundamentals","title":"LLM fundamentals: tokens, context windows and next-token prediction","current":false},{"slug":"prompt-engineering","title":"Prompt engineering: writing instructions a model will actually follow","current":false},{"slug":"embeddings-vector-db","title":"Embeddings and vector databases: searching by meaning","current":false},{"slug":"rag","title":"RAG: answers grounded in your own documents","current":false},{"slug":"tool-use","title":"Tool use: how a language model calls your application's functions","current":false},{"slug":"ai-agents","title":"AI agents: a model in a loop with tools – and when a plain workflow is enough","current":false},{"slug":"mcp","title":"MCP (Model Context Protocol): one standard for connecting AI to tools and data","current":false},{"slug":"evals","title":"Evaluating LLM applications (evals): tests for systems that are not deterministic","current":false},{"slug":"llm-ops","title":"LLMOps: model gateways, caching, limits, observability and costs in production","current":false},{"slug":"ai-guardrails","title":"Guardrails and security for LLM applications: prompt injection, data leaks and tool permissions","current":false},{"slug":"local-llms","title":"Local language models: Ollama, llama.cpp, vLLM, quantization and the real trade-offs","current":false},{"slug":"fine-tuning","title":"Fine-tuning language models: when it pays off, LoRA and QLoRA in practice","current":true},{"slug":"ai-coding-assistants","title":"AI coding assistants: from editor suggestions to an agent that opens pull requests","current":false}]}],"prev":{"slug":"local-llms","title":"Local language models: Ollama, llama.cpp, vLLM, quantization and the real trade-offs"},"next":{"slug":"ai-coding-assistants","title":"AI coding assistants: from editor suggestions to an agent that opens pull requests"},"featured":false,"authorCard":{"id":"6b08bd2e80884893657cc8cf","name":"Redakcja Art of Devs","avatar":null,"handle":"redakcja","headline":"Wzorce projektowe · Architektura · AI i LLM","community":false,"reputation":{"points":3900,"level":{"key":"mentor","label":"Mentor"}},"articles":68,"skills":[{"key":"typescript","title":"TypeScript","level":5,"levelLabel":"Authority","articles":63},{"key":"dotnet","title":".NET","level":5,"levelLabel":"Authority","articles":53},{"key":"python","title":"Python","level":5,"levelLabel":"Authority","articles":52},{"key":"java","title":"Java","level":5,"levelLabel":"Authority","articles":38}]}}