{
  "source_file": "0930",
  "source_platform": "Medium",
  "author": "Maxime Labonne",
  "title_listed": "A Beginner's Guide to LLM Fine-Tuning",
  "keywords": "微调,入门",
  "domain": "大模型算法",
  "content_type": "深度技术解析",
  "is_paid_flag": "部分免费/会员墙",
  "url": "https://towardsdatascience.com/a-beginners-guide-to-llm-fine-tuning-4bae7d4da672/",
  "publish_date": "2023-08",
  "corpus_stage": "预训练/SFT",
  "notes": "",
  "id": "d04add096e5b",
  "collected_at": "2026-10-01T21:53:54",
  "title": "A Beginner's Guide to LLM Fine-Tuning | Towards Data Science",
  "body_markdown": "![Revisit consent button](https://cdn-cookieyes.com/assets/images/revisit.svg)\nWe value your privacy\nWe use cookies to enhance your browsing experience, serve personalised ads or content, and analyse our traffic. By clicking \"Accept All\", you consent to our use of cookies.\nCustomise Reject All Accept All\nCustomise Consent Preferences ![](https://cdn-cookieyes.com/assets/images/close.svg)\nWe use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.\nThe cookies that are categorised as \"Necessary\" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... Show more\nNecessaryAlways Active\nNecessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.\n  * Cookie\nBCTempID\n  * Duration\n10 minutes\n  * Description\nNo description available.\n\n\n  * Cookie\n__cf_bm\n  * Duration\n1 hour\n  * Description\nThis cookie, set by Cloudflare, is used to support Cloudflare Bot Management. \n\n\n  * Cookie\nAWSALBCORS\n  * Duration\n7 days\n  * Description\nAmazon Web Services set this cookie for load balancing.\n\n\n  * Cookie\n_cfuvid\n  * Duration\nsession\n  * Description\nCloudflare sets this cookie to track users across sessions to optimize user experience by maintaining session consistency and providing personalized services\n\n\n  * Cookie\nli_gc\n  * Duration\n6 months\n  * Description\nLinkedin set this cookie for storing visitor's consent regarding using cookies for non-essential purposes.\n\n\n  * Cookie\n__hssrc\n  * Duration\nsession\n  * Description\nThis cookie is set by Hubspot whenever it changes the session cookie. The __hssrc cookie set to 1 indicates that the user has restarted the browser, and if the cookie does not exist, it is assumed to be a new session.\n\n\n  * Cookie\n__hssc\n  * Duration\n1 hour\n  * Description\nHubSpot sets this cookie to keep track of sessions and to determine if HubSpot should increment the session number and timestamps in the __hstc cookie.\n\n\n  * Cookie\nwpEmojiSettingsSupports\n  * Duration\nsession\n  * Description\nWordPress sets this cookie when a user interacts with emojis on a WordPress site. It helps determine if the user's browser can display emojis properly.\n\n\n  * Cookie\nBCSessionID\n  * Duration\n1 year 1 month 4 days\n  * Description\nBlueconic sets this cookie as a unique identifier for the BlueConic profile.\n\n\n  * Cookie\n_octo\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nlogged_in\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\n__Secure-YEC\n  * Duration\npast\n  * Description\nYouTube sets this cookie to stores the user's video player preferences using embedded YouTube video\n\n\n  * Cookie\n__eoi\n  * Duration\n6 months\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nAWSALBTGCORS\n  * Duration\n7 days\n  * Description\nNo description available.\n\n\n  * Cookie\nlogin-status-p\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nAWSALBTG\n  * Duration\n7 days\n  * Description\nNo description available.\n\n\n  * Cookie\ncsrf_token\n  * Duration\nsession\n  * Description\nNo description available.\n\n\n  * Cookie\ntoken_v2\n  * Duration\n1 day\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nD\n  * Duration\n1 year\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nPHPSESSID\n  * Duration\nsession\n  * Description\nThis cookie is native to PHP applications. The cookie stores and identifies a user's unique session ID to manage user sessions on the website. The cookie is a session cookie and will be deleted when all the browser windows are closed.\n\n\n  * Cookie\nVISITOR_PRIVACY_METADATA\n  * Duration\n6 months\n  * Description\nYouTube sets this cookie to store the user's cookie consent state for the current domain. \n\n\n  * Cookie\ncookietest\n  * Duration\nsession\n  * Description\nThe cookietest cookie is typically used to determine whether the user's browser accepts cookies, essential for website functionality and user experience.\n\n\n  * Cookie\n__Host-airtable-session\n  * Duration\n1 year\n  * Description\nThis cookie is used to enable us to integrate the services of Airtable.\n\n\n  * Cookie\n__Host-airtable-session.sig\n  * Duration\n1 year\n  * Description\nThis cookie is used to enable us to integrate the services of Airtable.\n\n\n  * Cookie\nm\n  * Duration\n1 year 1 month 4 days\n  * Description\nStripe sets this cookie for fraud prevention purposes. It identifies the device used to access the website, allowing the website to be formatted accordingly.\n\n\n  * Cookie\nBIGipServer*\n  * Duration\nsession\n  * Description\nMarketo sets this cookie to collect information about the user's online activity and build a profile about their interests to provide advertisements relevant to the user. \n\n\n  * Cookie\n__cfruid\n  * Duration\nsession\n  * Description\nCloudflare sets this cookie to identify trusted web traffic.\n\n\n  * Cookie\n_GRECAPTCHA\n  * Duration\n6 months\n  * Description\nGoogle Recaptcha service sets this cookie to identify bots to protect the website against malicious spam attacks.\n\n\n  * Cookie\n__Secure-YNID\n  * Duration\n6 months\n  * Description\nGoogle cookie used to protect user security and prevent fraud, especially during the login process.\n\n\n  * Cookie\ncookieyes-consent\n  * Duration\n1 year\n  * Description\nCookieYes sets this cookie to remember users' consent preferences so that their preferences are respected on subsequent visits to this site. It does not collect or store any personal information about the site visitors.\n\n\nFunctional\nFunctional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.\n  * Cookie\nlidc\n  * Duration\n1 day\n  * Description\nLinkedIn sets the lidc cookie to facilitate data center selection.\n\n\n  * Cookie\nbrw\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nbrwConsent\n  * Duration\n5 minutes\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nWMF-Uniq\n  * Duration\n1 year\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nloom_anon_comment\n  * Duration\n1 year\n  * Description\nNo description available.\n\n\n  * Cookie\nloom_referral_video\n  * Duration\nsession\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nVISITOR_INFO1_LIVE\n  * Duration\n6 months\n  * Description\nA cookie set by YouTube to measure bandwidth that determines whether the user gets the new or old player interface.\n\n\n  * Cookie\nyt-remote-connected-devices\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to store the user's video preferences using embedded YouTube videos.\n\n\n  * Cookie\nytidb::LAST_RESULT_ENTRY_KEY\n  * Duration\nNever Expires\n  * Description\nThe cookie ytidb::LAST_RESULT_ENTRY_KEY is used by YouTube to store the last search result entry that was clicked by the user. This information is used to improve the user experience by providing more relevant search results in the future.\n\n\n  * Cookie\nyt-remote-device-id\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to store the user's video preferences using embedded YouTube videos.\n\n\n  * Cookie\nyt-remote-session-name\n  * Duration\nsession\n  * Description\nThe yt-remote-session-name cookie is used by YouTube to store the user's video player preferences using embedded YouTube video.\n\n\n  * Cookie\nyt-remote-fast-check-period\n  * Duration\nsession\n  * Description\nThe yt-remote-fast-check-period cookie is used by YouTube to store the user's video player preferences for embedded YouTube videos.\n\n\n  * Cookie\nyt-remote-session-app\n  * Duration\nsession\n  * Description\nThe yt-remote-session-app cookie is used by YouTube to store user preferences and information about the interface of the embedded YouTube video player.\n\n\n  * Cookie\nyt-remote-cast-available\n  * Duration\nsession\n  * Description\nThe yt-remote-cast-available cookie is used to store the user's preferences regarding whether casting is available on their YouTube video player.\n\n\n  * Cookie\nyt-remote-cast-installed\n  * Duration\nsession\n  * Description\nThe yt-remote-cast-installed cookie is used to store the user's video player preferences using embedded YouTube video.\n\n\n  * Cookie\ncp_session\n  * Duration\n3 months\n  * Description\nCodepen sets this cookie for Help systems found in the website.\n\n\n  * Cookie\nloid\n  * Duration\n1 year 1 month 4 days\n  * Description\nThis cookie is set by the Reddit. The cookie enables the sharing of content from the website onto the social media platform.\n\n\nAnalytics\nAnalytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.\n  * Cookie\n__hstc\n  * Duration\n6 months\n  * Description\nHubspot set this main cookie for tracking visitors. It contains the domain, initial timestamp (first visit), last timestamp (last visit), current timestamp (this visit), and session number (increments for each subsequent session).\n\n\n  * Cookie\nhubspotutk\n  * Duration\n6 months\n  * Description\nHubSpot sets this cookie to keep track of the visitors to the website. This cookie is passed to HubSpot on form submission and used when deduplicating contacts.\n\n\n  * Cookie\n_ga\n  * Duration\n1 year 1 month 4 days\n  * Description\nGoogle Analytics sets this cookie to calculate visitor, session and campaign data and track site usage for the site's analytics report. The cookie stores information anonymously and assigns a randomly generated number to recognise unique visitors.\n\n\n  * Cookie\n_ga_*\n  * Duration\n1 year 1 month 4 days\n  * Description\nGoogle Analytics sets this cookie to store and count page views.\n\n\n  * Cookie\n__Host-psifi.analyticsTrace\n  * Duration\n6 hours\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\n__Host-psifi.analyticsTraceV2\n  * Duration\n6 hours\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\n_gh_sess\n  * Duration\nsession\n  * Description\nGitHub sets this cookie for temporary application and framework state between pages like what step the user is on in a multiple step form.\n\n\n  * Cookie\nYSC\n  * Duration\nsession\n  * Description\nYSC cookie is set by Youtube and is used to track the views of embedded videos on Youtube pages.\n\n\n  * Cookie\najs_anonymous_id\n  * Duration\n1 year\n  * Description\nThis cookie is set by Segment to count the number of people who visit a certain site by tracking if they have visited before.\n\n\n  * Cookie\nvuid\n  * Duration\n1 year 1 month 4 days\n  * Description\nVimeo installs this cookie to collect tracking information by setting a unique ID to embed videos on the website. \n\n\nPerformance\nPerformance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.\n  * Cookie\nAWSALB\n  * Duration\n7 days\n  * Description\nAWSALB is an application load balancer cookie set by Amazon Web Services to map the session to the target.\n\n\n  * Cookie\nacq\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nacq.sig\n  * Duration\npast\n  * Description\nDescription is currently not available.\n\n\n  * Cookie\nptc\n  * Duration\n2 years\n  * Description\nNo description available.\n\n\nAdvertisement\nAdvertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.\n  * Cookie\nmuc_ads\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to collect user behaviour and interaction data to optimize the website.\n\n\n  * Cookie\nguest_id_marketing\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor.\n\n\n  * Cookie\nguest_id_ads\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor.\n\n\n  * Cookie\npersonalization_id\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to integrate and share features for social media and also store information about how the user uses the website, for tracking and targeting.\n\n\n  * Cookie\nguest_id\n  * Duration\n1 year 1 month 4 days\n  * Description\nTwitter sets this cookie to identify and track the website visitor. It registers if a user is signed in to the Twitter platform and collects information about ad preferences.\n\n\n  * Cookie\nbcookie\n  * Duration\n1 year\n  * Description\nLinkedIn sets this cookie from LinkedIn share buttons and ad tags to recognize browser IDs.\n\n\n  * Cookie\n__Secure-ROLLOUT_TOKEN\n  * Duration\n6 months\n  * Description\nYouTube sets this cookie to manage feature rollout and experimentation. It helps Google control which new features or interface changes are shown to users as part of testing and staged rollouts, ensuring consistent experience for a given user during an experiment.\n\n\n  * Cookie\nyt.innertube::nextId\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen.\n\n\n  * Cookie\nyt.innertube::requests\n  * Duration\nNever Expires\n  * Description\nYouTube sets this cookie to register a unique ID to store data on what videos from YouTube the user has seen.\n\n\n  * Cookie\nsession_tracker\n  * Duration\nsession\n  * Description\nThis cookie is set by the Reddit. This cookie is used to identify trusted web traffic. It also helps in adverstising on the website.\n\n\n  * Cookie\nedgebucket\n  * Duration\nsession\n  * Description\nReddit sets this cookie to save the information about a log-on Reddit user, for the purpose of advertisement recommendations and updating the content.\n\n\n  * Cookie\ndid\n  * Duration\n1 year\n  * Description\nArbor sets this cookie to show targeted ads to site visitors.This cookie expires after 2 months or 1 year.\n\n\nUncategorised\nOther uncategorised cookies are those that are being analysed and have not been classified into a category as yet.\nNo cookies to display.\nReject All Save My Preferences Accept All\nToggle Search[](https://towardsdatascience.com/)Toggle Mobile Navigation\n[](https://towardsdatascience.com/)\nPublish AI, ML & data-science insights to a global community of data professionals.\nSign in[Submit an Article](https://write.insightmediagroup.io)\n[Latest](https://towardsdatascience.com/latest/)[Editor's Picks](https://towardsdatascience.com/tag/editors-pick/)[Newsletter](https://towardsdatascience.com/tag/the-variable/)[ShipAI](https://towardsdatascience.com/shipai/)\n* * *\n[Write For TDS](https://towardsdatascience.com/submissions/)\n[LinkedIn](https://www.linkedin.com/company/towards-data-science/)[X](https://x.com/TDataScience)Toggle Search\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\n# A Beginner's Guide to LLM Fine-Tuning\nHow to fine-tune Llama and other LLMs with one tool\n[Maxime Labonne](https://towardsdatascience.com/author/mlabonne/)\nAugust 30, 20238 min read\n![Image by author](https://assets.insightmediagroup.io/media/wp-content/uploads/2023/08/1LVIFTTCmYWQw8nyiuKOA9g.jpeg)\nImage by author\nThe growing interest in Large Language Models (LLMs) has led to a surge in **tools and wrappers designed to streamline their training process**.\nPopular options include [FastChat ](https://github.com/lm-sys/FastChat)from LMSYS (used to train [Vicuna](https://huggingface.co/lmsys/vicuna-13b-v1.5)) and Hugging Face's [transformers](https://github.com/huggingface/transformers)/[trl](https://github.com/huggingface/trl) libraries (used in [my previous article](https://towardsdatascience.com/fine-tune-your-own-llama-2-model-in-a-colab-notebook-df9823a04a32)). In addition, each big LLM project, like [WizardLM](https://github.com/nlpxucan/WizardLM/tree/main), tends to have its own training script, inspired by the original [Alpaca](https://github.com/tatsu-lab/stanford_alpaca) implementation.\nIn this article, we will use [**Axolotl**](https://github.com/OpenAccess-AI-Collective/axolotl), a tool created by the OpenAccess AI Collective. We will use it to fine-tune a [**Code Llama 7b**](https://github.com/OpenAccess-AI-Collective/axolotl/blob/main/examples/llama-2/qlora.yml) model on an evol-instruct dataset comprised of 1,000 samples of Python code.\nLearn this step by step with the interactive [AI Engineer](https://roadmap.sh/ai-engineer), [Computer Science](https://roadmap.sh/computer-science) and [Machine Learning](https://roadmap.sh/machine-learning) roadmaps.\n## 🤔 Why Axolotl?\nThe main appeal of Axolotl is that it provides a one-stop solution, which includes numerous features, model architectures, and an active community. Here's a quick list of my favorite things about it:\n  * **Configuration** : All parameters used to train an LLM are neatly stored in a yaml config file. This makes it convenient for sharing and reproducing models. You can see an example for Llama 2 [here](https://github.com/OpenAccess-AI-Collective/axolotl/tree/main/examples/llama-2).\n  * **Dataset Flexibility** : Axolotl allows the specification of multiple datasets with varied prompt formats such as alpaca (`{\"instruction\": \"...\", \"input\": \"...\", \"output\": \"...\"}`), sharegpt:chat (`{\"conversations\": [{\"from\": \"...\", \"value\": \"...\"}]}`), and raw completion (`{\"text\": \"...\"}`). Combining datasets is seamless, and the hassle of unifying the prompt format is eliminated.\n  * **Features** : Axolotl is packed with SOTA techniques such as FSDP, deepspeed, LoRA, QLoRA, ReLoRA, sample packing, GPTQ, FlashAttention, xformers, and rope scaling.\n  * **Utilities** : There are numerous user-friendly utilities integrated, including the addition or alteration of special tokens, or a custom wandb configuration.\n\n\nSome well-known models trained using this tool are [Manticore-13b](https://huggingface.co/openaccess-ai-collective/manticore-13b) from the OpenAccess AI Collective and [Samantha-1.11–70b](https://huggingface.co/ehartford/Samantha-1.11-70b) from Eric Hartford. Like other wrappers, it is built on top of the transformers library and uses many of its features.\n## ⚙️ Create your own config file\nBefore anything, we need a configuration file. You can reuse an existing configuration from the `[examples](https://github.com/OpenAccess-AI-Collective/axolotl/tree/main/examples)` folder. In our case, we will tweak the [QLoRA config](https://github.com/OpenAccess-AI-Collective/axolotl/blob/main/examples/llama-2/qlora.yml) for Llama 2 to create our own **Code Llama** model. The model will be trained on a subset of 1,000 Python samples from the `[nickrosh/Evol-Instruct-Code-80k-v1](https://huggingface.co/datasets/nickrosh/Evol-Instruct-Code-80k-v1)` dataset.\nFirst, we must change the `base_model` and `base_model_config` fields to \"codellama/CodeLlama-7b-hf\". To push our trained adapter to the Hugging Face Hub, let's add a new field `hub_model_id`, which corresponds to the name of our model, \"EvolCodeLlama-7b\". Now, we have to update the dataset to `[mlabonne/Evol-Instruct-Python-1k](https://huggingface.co/datasets/mlabonne/Evol-Instruct-Python-1k)` and set `type` to \"alpaca\".\nThere's no sample bigger than 2048 tokens in this dataset, so we can reduce the `sequence_len` to \"2048\" and save some VRAM. Talking about VRAM, we're going to use a `micro_batch_size` of 10 and a `gradient_accumulation_steps` of 1 to maximize its use. In practice, you try different values until you use >95% of the available VRAM.\nFor convenience, I'm going to add the name \"axolotl\" to the `wandb_project` field so it's easier to track on my account. I'm also setting the `warmup_steps` to \"100\" (personal preference) and the `eval_steps` to 0.01 so we'll end up with 100 evaluations.\nHere's how the final config file should look:\nyaml\n\n```\nbase_model: codellama/CodeLlama-7b-hf\nbase_model_config: codellama/CodeLlama-7b-hf\nmodel_type: LlamaForCausalLM\ntokenizer_type: LlamaTokenizer\nis_llama_derived_model: true\nhub_model_id: EvolCodeLlama-7b\n\nload_in_8bit: false\nload_in_4bit: true\nstrict: false\n\ndatasets:\n  - path: mlabonne/Evol-Instruct-Python-1k\n    type: alpaca\ndataset_prepared_path: last_run_prepared\nval_set_size: 0.02\noutput_dir: ./qlora-out\n\nadapter: qlora\nlora_model_dir:\n\nsequence_len: 2048\nsample_packing: true\n\nlora_r: 32\nlora_alpha: 16\nlora_dropout: 0.05\nlora_target_modules:\nlora_target_linear: true\nlora_fan_in_fan_out:\n\nwandb_project: axolotl\nwandb_entity:\nwandb_watch:\nwandb_run_id:\nwandb_log_model:\n\ngradient_accumulation_steps: 1\nmicro_batch_size: 10\nnum_epochs: 3\noptimizer: paged_adamw_32bit\nlr_scheduler: cosine\nlearning_rate: 0.0002\n\ntrain_on_inputs: false\ngroup_by_length: false\nbf16: true\nfp16: false\ntf32: false\n\ngradient_checkpointing: true\nearly_stopping_patience:\nresume_from_checkpoint:\nlocal_rank:\nlogging_steps: 1\nxformers_attention:\nflash_attention: true\n\nwarmup_steps: 100\neval_steps: 0.01\nsave_strategy: epoch\nsave_steps:\ndebug:\ndeepspeed:\nweight_decay: 0.0\nfsdp:\nfsdp_config:\nspecial_tokens:\n  bos_token: \"<s>\"\n  eos_token: \"</s>\"\n  unk_token: \"<unk>\"\n```\n\nYou can also find this config file [here](https://gist.github.com/mlabonne/8055f6335e2b85f082c8c75561321a66) as a GitHub gist.\nBefore we start training our model, I want to introduce a few parameters that are important to understand:\n  * **QLoRA** : We're using QLoRA for fine-tuning, which is why we're loading the base model in 4-bit precision (NF4 format). You can check [this article](https://medium.com/towards-data-science/qlora-fine-tune-a-large-language-model-on-your-gpu-27bed5a03e2b) from [Benjamin Marie](https://towardsdatascience.com/a-beginners-guide-to-llm-fine-tuning-4bae7d4da672/None) to know more about QLoRA.\n  * **Gradient checkpointing** : It lowers the VRAM requirements by removing some activations that are re-computed on demand during the backward pass. It also slows down training by about 20%, according to Hugging Face's [documentation](https://huggingface.co/docs/transformers/v4.18.0/en/performance).\n  * **FlashAttention** : This implements the [FlashAttention ](https://github.com/Dao-AILab/flash-attention)mechanism, which improves the speed and memory efficiency of our model thanks to a clever fusion of GPU operations (learn more about it in [this article](https://gordicaleksa.medium.com/eli5-flash-attention-5c44017022ad) from [Aleksa Gordić](https://towardsdatascience.com/a-beginners-guide-to-llm-fine-tuning-4bae7d4da672/None)).\n  * **Sample packing** : Smart way of creating batches with as little padding as possible, by reorganizing the order of the samples ([bin packing problem](https://en.wikipedia.org/wiki/Bin_packing_problem)). As a result, we need fewer batches to train the model on the same dataset. It was inspired by the [Multipack Sampler](https://github.com/imoneoi/multipack_sampler/tree/master) (see [my note](https://mlabonne.github.io/blog/notes/Large%20Language%20Models/multipack_sampler.html)) and [Krell et al.](https://arxiv.org/pdf/2107.02027.pdf)\n\n\nYou can find FlashAttention in some other tools, but sample packing is relatively new. As far as I know, [OpenChat ](https://github.com/imoneoi/openchat)was the first project to use sample packing during fine-tuning. Thanks to Axolotl, we'll use these techniques for free.\n## 🦙 Fine-tune Code Llama\nHaving the config file ready, it's time to get our hands dirty with the actual fine-tuning. You might consider running the training on a Colab notebook. However, for those without access to a high-performance GPU, a more cost-effective solution consists of renting **cloud-based GPU services** , like AWS, [Lambda Labs](https://lambdalabs.com/), [Vast.ai](https://vast.ai/), [Banana](https://www.banana.dev/), or [RunPod](https://www.runpod.io/).\nPersonally, I use RunPod, which is a popular option in the fine-tuning community. It's not the cheapest service but it hits a good tradeoff with a clean UI. You can easily replicate the following steps using your favorite service.\nWhen your RunPod account is set up, go to Manage > Templates and click on \"New Template\". Here is a simple template:\n![Image by author](https://assets.insightmediagroup.io/media/wp-content/uploads/2023/08/1HjW7YZxJUJRsIANwJuOQKg.png)\nImage by author\nLet's review the different fields and their corresponding values:\n  * **Template Name** : Axolotl (you can choose whatever you want)\n  * **Container Image** : winglian/axolotl-runpod:main-py3.10-cu118–2.0.1\n  * **Container Disk** : 100 GB\n  * **Volume Disk** : 0 GB\n  * **Volume Mount Path** : /workspace\n\n\nIn addition, there are two handy environment variables can include:\n  * **HUGGING_FACE_HUB_TOKEN** : you can find your token on [this page](https://huggingface.co/settings/tokens) (requires an account)\n  * **WANDB_API_KEY** : you can find your key on [this page](https://wandb.ai/authorize) (requires an account)\n\n\nAlternatively, you can simply log in the terminal later (using huggingface-cli login and wandb login). Once you're set-up, go to Community Cloud and deploy an RTX 3090. Here you can search for the name of your template and select it as follows:\n![Image by author](https://assets.insightmediagroup.io/media/wp-content/uploads/2023/08/1Z0fi3i8MQdKHdjybaKh-3w.png)\nImage by author\nYou can click on \"Continue\" and RunPod will deploy your template. You can see the installation in your pod's logs (Manage > Pods). When the option becomes available, click on \"Connect\". Here, click on \"Start Web Terminal\" and then \"Connect to Web Terminal\". You are now connected to your pod!\nThe following steps are **the same no matter what service you choose** :\n  1. We install Axolotl and the PEFT library as follows:\n\n\nbash\n\n```\ngit clone https://github.com/OpenAccess-AI-Collective/axolotl\ncd axolotl\n\npip3 install -e .[flash-attn]\npip3 install -U git+https://github.com/huggingface/peft.git\n```\n\n  1. Download the config file we created:\n\n\nbash\n\n```\nwget https://gist.githubusercontent.com/mlabonne/8055f6335e2b85f082c8c75561321a66/raw/93915a9563fcfff8df9a81fc0cdbf63894465922/EvolCodeLlama-7b.yaml\n```\n\n  1. You can now **start fine-tuning the model** with the following command:\n\n\nbash\n\n```\naccelerate launch scripts/finetune.py EvolCodeLlama-7b.yaml\n```\n\nIf everything is configured correctly, you should be able to train the model in a little more than **one hour** (it took me 1h 11m 44s). If you check the GPU memory used, you'll see almost 100% with this config, which means we're optimizing it pretty nicely. If you're using a GPU with more VRAM (like an A100), you can increase the micro-batch size to make sure you're fully using it.\nIn the meantime, feel free to close the web terminal and check your loss on Weights & Biases. We're using tmux so the training won't stop if you close the terminal. Here are my loss curves:\n![Image by author](https://assets.insightmediagroup.io/media/wp-content/uploads/2023/08/1odtY-qvALa6F4kIyXstHzA.png)\nImage by author\nWe see a steady improvement in the eval loss, which is a good sign. However, you can also spot drops in the eval loss that are not correlated with a decrease in the quality of the outputs... The best way to evaluate your model is simply by using it: you can run it in the terminal with the command `accelerate launch scripts/finetune.py EvolCodeLlama-7b.yaml --inference --lora_model_dir=\"./qlora-out\"`.\nThe QLoRA adapter should already be uploaded to the Hugging Face Hub. However, you can also **merge the base Code Llama model with this adapter and push the merged model** there by following these steps:\n  1. Download [this script](https://gist.github.com/mlabonne/a3542b0519708b8871d0703c938bba9f):\n\n\nbash\n\n```\nwget https://gist.githubusercontent.com/mlabonne/a3542b0519708b8871d0703c938bba9f/raw/60abc5afc07f9d843bc23d56f4e0b7ab072c4a62/merge_peft.py\n```\n\n  1. Execute it with this command:\n\n\nbash\n\n```\npython merge_peft.py --base_model=codellama/CodeLlama-7b-hf --peft_model=./qlora-out --hub_id=EvolCodeLlama-7b\n```\n\nCongratulations, you should have **your own EvolCodeLlama-7b** on the Hugging Face Hub at this point! For reference, you can access my own model trained with this process here: `[mlabonne/EvolCodeLlama-7b](https://huggingface.co/mlabonne/EvolCodeLlama-7b)`\nConsidering that our EvolCodeLlama-7b is a code LLM, it would be interesting to compare its performance with other models on **standard benchmarks** , such as [HumanEval](https://github.com/openai/human-eval) and [MBPP](https://github.com/google-research/google-research/tree/master/mbpp). For reference, you can find a leaderboard at the following address: [Multilingual Code Evals](https://huggingface.co/spaces/bigcode/multilingual-code-evals).\nIf you're happy with this model, you can **quantize** it with GGML for local inference with [this free Google Colab notebook](https://colab.research.google.com/drive/1pL8k7m04mgE5jo2NrjGi8atB0j_37aDD?usp=sharing). You can also fine-tune **bigger models** (e.g., 70b parameters) thanks to [deepspeed](https://github.com/microsoft/DeepSpeed), which only requires an additional config file.\n## Conclusion\nIn this article, we've covered the essentials of **how to efficiently fine-tune LLMs**. We customized parameters to train on our Code Llama model on a small Python dataset. Finally, we merged the weights and uploaded the result on Hugging Face.\nI hope you found this guide useful. I recommend using Axolotl with a cloud-based GPU service to get some experience and upload a few models on Hugging Face. Build your own datasets, play with the parameters, and break stuff along the way. Like with every wrapper, don't hesitate to check the source code to get a good intuition of what it's actually doing. It will massively help in the long run.\nThanks to the OpenAccess AI Collective and all the contributors!\nIf you're interested in more technical content around LLMs, [follow me on Medium](https://medium.com/@mlabonne).\n## Related articles\n> [**Fine-Tune Your Own Llama 2 Model in a Colab Notebook**](https://towardsdatascience.com/fine-tune-your-own-llama-2-model-in-a-colab-notebook-df9823a04a32)\n> [**4-bit Quantization with GPTQ**](https://towardsdatascience.com/4-bit-quantization-with-gptq-36b0f4f02c34)\n* * *\n_Learn more about machine learning and support my work with one click - become a Medium member here:_\n> [**Join Medium with my referral link - Maxime Labonne**](https://medium.com/@mlabonne/membership)\n## Register Now to Continue Reading\n### Unlock Towards Data Science with a Free Account\nAll articles on Towards Data Science are available to registered users. Create a free account today to access this article and thousands more.\nRegister for freeSign in to your account\n* * *\n![](https://assets.insightmediagroup.io/media/1787657499317_sxy3ci.png)\nWritten By\n## [Maxime Labonne](https://towardsdatascience.com/author/mlabonne/)\n[See all from Maxime Labonne](https://towardsdatascience.com/author/mlabonne/)\n[Artificial Intelligence](https://towardsdatascience.com/tag/artificial-intelligence/)[Hands On Tutorials](https://towardsdatascience.com/tag/hands-on-tutorials/)[Large Language Models](https://towardsdatascience.com/tag/large-language-models/)[Machine Learning](https://towardsdatascience.com/tag/machine-learning/)[Programming](https://towardsdatascience.com/tag/programming/)\nShare This Article\n  * [](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Ftowardsdatascience.com%2Fa-beginners-guide-to-llm-fine-tuning-4bae7d4da672%2F&title=A%20Beginner's%20Guide%20to%20LLM%20Fine-Tuning)\n  * [](https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Ftowardsdatascience.com%2Fa-beginners-guide-to-llm-fine-tuning-4bae7d4da672%2F&title=A%20Beginner's%20Guide%20to%20LLM%20Fine-Tuning)\n  * [](https://x.com/share?url=https%3A%2F%2Ftowardsdatascience.com%2Fa-beginners-guide-to-llm-fine-tuning-4bae7d4da672%2F&text=A%20Beginner's%20Guide%20to%20LLM%20Fine-Tuning)\n\n\nTowards Data Science is a community publication. Submit your insights to reach our global audience and earn through the TDS Author Payment Program.\n[Write for TDS](https://towardsdatascience.com/submissions/)\n## Related Articles\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2025/03/nik-n1ccr-zVG68-unsplash-scaled-1.jpg)](https://towardsdatascience.com/ai-agents-from-zero-to-hero-part-3/)\n## [AI Agents from Scratch: Multi-Agent System](https://towardsdatascience.com/ai-agents-from-zero-to-hero-part-3/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nFrom Zero to Hero using only Python & Ollama (no GPU, no APIKEY)\n[Mauro Di Pietro](https://towardsdatascience.com/author/maurodp/)\nMarch 28, 202516 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2023/11/0MLNYX-GyxZwzEiYO.jpg)](https://towardsdatascience.com/system-design-cheatsheets-elasticsearch-673b98eebfff/)\n## [System Design Cheatsheets: ElasticSearch](https://towardsdatascience.com/system-design-cheatsheets-elasticsearch-673b98eebfff/)\n[Programming](https://towardsdatascience.com/category/programming/)\nUnderstand how and when to use ElasticSearch in systems, with three practical system design examples.\n[Sanil Khurana](https://towardsdatascience.com/author/sanilkhurana7/)\nNovember 28, 202314 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2026/01/Gemini_Generated_Image_xhy1gaxhy1gaxhy1-scaled-1.jpg)](https://towardsdatascience.com/ray-distributed-computing-for-all-part-2/)\n## [Ray: Distributed Computing For All, Part 2](https://towardsdatascience.com/ray-distributed-computing-for-all-part-2/)\n[Programming](https://towardsdatascience.com/category/programming/)\nDeploying and running Python code on cloud-based clusters\n[Thomas Reid](https://towardsdatascience.com/author/thomas_reid/)\nJanuary 26, 202610 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2021/01/01EzBZAdG1HfYaJOX-scaled.jpg)](https://towardsdatascience.com/system-design-basics-getting-started-with-caching-c2c3e934064a/)\n## [System Design Basics: Getting started with Caching](https://towardsdatascience.com/system-design-basics-getting-started-with-caching-c2c3e934064a/)\n[Programming](https://towardsdatascience.com/category/programming/)\nWhen do you use caching in a system design?\n[Ashis Chakraborty](https://towardsdatascience.com/author/ashchk/)\nJanuary 16, 20219 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2021/04/0o-03OD7r7GlUuGwx-scaled.jpg)](https://towardsdatascience.com/4-upcoming-data-science-events-you-should-consider-attending-93160bdae0ab/)\n## [4 Upcoming Data Science Events You Should Consider Attending](https://towardsdatascience.com/4-upcoming-data-science-events-you-should-consider-attending-93160bdae0ab/)\n[Machine Learning](https://towardsdatascience.com/category/artificial-intelligence/machine-learning/)\nApril has a lot of learning to offer.\n[Sara A. Metwalli](https://towardsdatascience.com/author/saraametwalli/)\nApril 6, 20215 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2019/12/1KuSGOSgSJ8RPq53ZkQjelg.jpeg)](https://towardsdatascience.com/from-chemist-to-data-scientist-2403de0a5e5e/)\n## [From Chemist to Data Scientist](https://towardsdatascience.com/from-chemist-to-data-scientist-2403de0a5e5e/)\n[Programming](https://towardsdatascience.com/category/programming/)\nGrowing up I was always interested in science. In the fifth grade I remember working on a science project that involved making homemade...\n[Sadrach Pierre, Ph.D.](https://towardsdatascience.com/author/spierre91/)\nDecember 5, 20195 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2021/06/0DH6D9kNOU5o_sm_O-scaled.jpg)](https://towardsdatascience.com/does-ai-have-politics-21145e5b5445/)\n## [Does AI have Politics?](https://towardsdatascience.com/does-ai-have-politics-21145e5b5445/)\n[Artificial Intelligence](https://towardsdatascience.com/category/artificial-intelligence/)\nAnalysis of 'Do Artifacts have Politics' by Langdon Winner, 1980 - Reflecting on current AI innovation\n[Mark Garvey](https://towardsdatascience.com/author/mark-garvey/)\nJune 29, 20215 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2024/10/0qh2rDSgO0EIJvK5g-scaled.jpg)](https://towardsdatascience.com/tsv-in-pandas-a-how-to-guide-1854b4b86c7f/)\n## [TSV in Pandas: A How-To Guide](https://towardsdatascience.com/tsv-in-pandas-a-how-to-guide-1854b4b86c7f/)\n[Programming](https://towardsdatascience.com/category/programming/)\nThe Correct Way of Loading and Writing TSV Files with Pandas\n[Michał Marcińczuk](https://towardsdatascience.com/author/czuk/)\nOctober 1, 20245 min read\n  * [![](https://assets.insightmediagroup.io/media/wp-content/uploads/2021/11/0XRfGUczSVe16Hta5-scaled.jpg)](https://towardsdatascience.com/need-help-making-decisions-ask-your-digital-twin-6e4cf328cb0/)\n## [Need Help Making Decisions? Ask Your Digital Twin!](https://towardsdatascience.com/need-help-making-decisions-ask-your-digital-twin-6e4cf328cb0/)\n[Machine Learning](https://towardsdatascience.com/category/artificial-intelligence/machine-learning/)\nBlend real-time data with simulation, machine learning, and human reasoning to elevate decision-making.\n[Wouter van Heeswijk, PhD](https://towardsdatascience.com/author/wvheeswijk/)\nNovember 2, 20218 min read\n\n\n  * [YouTube](https://www.youtube.com/c/TowardsDataScience)\n  * [X](https://x.com/TDataScience)\n  * [LinkedIn](https://www.linkedin.com/company/towards-data-science/)\n  * [Threads](https://www.threads.net/@towardsdatascience)\n  * [Bluesky](https://bsky.app/profile/towardsdatascience.com)\n\n\n[](https://towardsdatascience.com/)\nYour home for data science and AI. The world's leading publication for data science, data analytics, data engineering, machine learning, and artificial intelligence professionals.\nSubscribe to Our Newsletter[Write For TDS](https://towardsdatascience.com/submissions/)•[About](https://towardsdatascience.com/about-towards-data-science-d691af11cc2f/)•[Advertise](https://contact.towardsdatascience.com/advertise-with-towards-data-science)•[Privacy Policy](https://towardsdatascience.com/privacy-policy/)•[Terms of Use](https://towardsdatascience.com/website-terms-of-use/)\n© Insight Media Group, LLC 2026•[The New Stack](https://thenewstack.io)•[roadmap.sh](https://roadmap.sh)•[Creator Network](https://insightmediagroup.io/creator-network)\n####  Recommended Articles \nClose\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/3642/image?etag=1780830904480&width=500&height=500) Check Your Biases ](https://towardsdatascience.com/check-your-biases-ba2685a7f799/ \"Check Your Biases\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/607930/image?etag=1782124566054&width=500&height=500) The Subset Sum Problem Solved in Linear Time for Dense Enough Inputs ](https://towardsdatascience.com/subset-sum-problem-solved-in-linear-time-for-dense-enough-inputs/ \"The Subset Sum Problem Solved in Linear Time for Dense Enough Inputs\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/3660/image?etag=1780176246070&width=500&height=500) Does Your Company Have a Data Strategy? ](https://towardsdatascience.com/does-your-company-have-a-data-strategy-e8944dbec4ae/ \"Does Your Company Have a Data Strategy?\")\n  * [ ![](https://h030.towardsdatascience.com/rest/v2/contentStores/d7d3a4ab-7caf-4383-bbd2-fbf7fb4f1787/items/4973/image?etag=1782232567105&width=500&height=500) Machine Learning Tricks, Learning with ChatGPT, and Other Recent Must-Reads ](https://towardsdatascience.com/machine-learning-tricks-learning-with-chatgpt-and-other-recent-must-reads-f277648a1921/ \"Machine Learning Tricks, Learning with ChatGPT, and Other Recent Must-Reads\")\n\n\nword word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word word\n  \nmmMwWLliI0fiflO&1  \nmmMwWLliI0fiflO&1  \nmmMwWLliI0fiflO&1  \nmmMwWLliI0fiflO&1  \nmmMwWLliI0fiflO&1  \nmmMwWLliI0fiflO&1  \nmmMwWLliI0fiflO&1\n",
  "metadata": {
    "title": "A Beginner's Guide to LLM Fine-Tuning | Towards Data Science",
    "description": "How to fine-tune Llama and other LLMs with one tool",
    "keywords": null,
    "author": "Maxime Labonne",
    "og:locale": "en_US",
    "og:type": "article",
    "og:title": "A Beginner's Guide to LLM Fine-Tuning",
    "og:description": "How to fine-tune Llama and other LLMs with one tool",
    "og:url": "https://towardsdatascience.com/a-beginners-guide-to-llm-fine-tuning-4bae7d4da672/",
    "og:site_name": "Towards Data Science",
    "og:image": "https://assets.insightmediagroup.io/media/wp-content/uploads/2023/08/1LVIFTTCmYWQw8nyiuKOA9g.jpeg",
    "og:image:width": "1820",
    "og:image:height": "1024",
    "og:image:type": "image/jpeg",
    "twitter:card": "summary_large_image",
    "twitter:site": "@TDataScience",
    "twitter:creator": "@TDataScience",
    "twitter:label1": "Written by",
    "twitter:data1": "Maxime Labonne",
    "twitter:label2": "Est. reading time",
    "twitter:data2": "8 min read",
    "article:published_time": "2023-08-30T06:01:17.000Z",
    "article:modified_time": "2023-08-30T06:01:17.000Z",
    "article:author": "https://towardsdatascience.com/author/mlabonne/"
  },
  "paywall": {
    "listed_paid": true,
    "detected": false,
    "marker": "",
    "public_only": true,
    "policy": "付费/会员内容只保留页面公开可见部分，不绕过付费墙"
  },
  "crawl": {
    "success": true,
    "status_code": 200,
    "error": "",
    "retried": true
  },
  "code_blocks": [
    {
      "language": "txt",
      "file": "attachments/d04add096e5b/code/block_000.txt",
      "chars": 1251
    },
    {
      "language": "txt",
      "file": "attachments/d04add096e5b/code/block_001.txt",
      "chars": 164
    },
    {
      "language": "txt",
      "file": "attachments/d04add096e5b/code/block_002.txt",
      "chars": 149
    },
    {
      "language": "txt",
      "file": "attachments/d04add096e5b/code/block_003.txt",
      "chars": 60
    },
    {
      "language": "txt",
      "file": "attachments/d04add096e5b/code/block_004.txt",
      "chars": 141
    },
    {
      "language": "txt",
      "file": "attachments/d04add096e5b/code/block_005.txt",
      "chars": 111
    }
  ],
  "images": [
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2023/08/1LVIFTTCmYWQw8nyiuKOA9g.jpeg",
      "alt": "Image by author",
      "local_path": "attachments/d04add096e5b/images/000.jpeg",
      "bytes": 150588,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2023/08/1HjW7YZxJUJRsIANwJuOQKg.png",
      "alt": "Image by author",
      "local_path": "attachments/d04add096e5b/images/001.png",
      "bytes": 35785,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2023/08/1Z0fi3i8MQdKHdjybaKh-3w.png",
      "alt": "Image by author",
      "local_path": "attachments/d04add096e5b/images/002.png",
      "bytes": 34275,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2023/08/1odtY-qvALa6F4kIyXstHzA.png",
      "alt": "Image by author",
      "local_path": "attachments/d04add096e5b/images/003.png",
      "bytes": 176310,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2025/03/nik-n1ccr-zVG68-unsplash-scaled-1.jpg",
      "alt": "",
      "local_path": "attachments/d04add096e5b/images/004.jpg",
      "bytes": 224505,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2023/11/0MLNYX-GyxZwzEiYO.jpg",
      "alt": "",
      "local_path": "attachments/d04add096e5b/images/005.jpg",
      "bytes": 142695,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2026/01/Gemini_Generated_Image_xhy1gaxhy1gaxhy1-scaled-1.jpg",
      "alt": "",
      "local_path": "attachments/d04add096e5b/images/006.jpg",
      "bytes": 755127,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2021/01/01EzBZAdG1HfYaJOX-scaled.jpg",
      "alt": "",
      "local_path": "attachments/d04add096e5b/images/007.jpg",
      "bytes": 500032,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2021/04/0o-03OD7r7GlUuGwx-scaled.jpg",
      "alt": "",
      "local_path": "attachments/d04add096e5b/images/008.jpg",
      "bytes": 293282,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2019/12/1KuSGOSgSJ8RPq53ZkQjelg.jpeg",
      "alt": "",
      "local_path": "attachments/d04add096e5b/images/009.jpeg",
      "bytes": 157834,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2021/06/0DH6D9kNOU5o_sm_O-scaled.jpg",
      "alt": "",
      "local_path": "attachments/d04add096e5b/images/010.jpg",
      "bytes": 585025,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2024/10/0qh2rDSgO0EIJvK5g-scaled.jpg",
      "alt": "",
      "local_path": "attachments/d04add096e5b/images/011.jpg",
      "bytes": 557759,
      "downloaded": true
    },
    {
      "src": "https://assets.insightmediagroup.io/media/wp-content/uploads/2021/11/0XRfGUczSVe16Hta5-scaled.jpg",
      "alt": "",
      "local_path": "attachments/d04add096e5b/images/012.jpg",
      "bytes": 425825,
      "downloaded": true
    }
  ],
  "audio": [],
  "videos": [],
  "links": [],
  "retry_at": "2026-10-03T07:59:24",
  "repair_version": 2,
  "repaired_at": "2026-10-14T11:11:48Z",
  "source_url": "https://towardsdatascience.com/a-beginners-guide-to-llm-fine-tuning-4bae7d4da672/",
  "delivery_status": "excluded_paid",
  "discovery_status": "excluded_paid",
  "missing_reason": "按原约定排除付费/会员全文"
}