{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/fine-tuned-small-llms-still-significantly","title":"Fine-Tuned 'Small' LLMs (Still) Significantly Outperform Zero-Shot Generative AI Models in Text Classification","arxiv_id":"2406.08660","date":"2024-06-12","proceeding":null,"authors":["Martin Juan José Bucher","Marco Martini"],"abstract":"Generative AI offers a simple, prompt-based alternative to fine-tuning smaller BERT-style LLMs for text classification tasks. This promises to eliminate the need for manually labeled training data and task-specific model training. However, it remains an open question whether tools like ChatGPT can deliver on this promise. In this paper, we show that smaller, fine-tuned LLMs (still) consistently and significantly outperform larger, zero-shot prompted models in text classification. We compare three major generative AI models (ChatGPT with GPT-3.5/GPT-4 and Claude Opus) with several fine-tuned LLMs across a diverse set of classification tasks (sentiment, approval/disapproval, emotions, party positions) and text categories (news, tweets, speeches). We find that fine-tuning with application-specific training data achieves superior performance in all cases. To make this approach more accessible to a broader audience, we provide an easy-to-use toolkit alongside this paper. Our toolkit, accompanied by non-technical step-by-step guidance, enables users to select and fine-tune BERT-like LLMs for any classification task with minimal technical and computational effort.","url_abs":"https://arxiv.org/abs/2406.08660v2","url_pdf":"https://arxiv.org/pdf/2406.08660v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"fine-tuned-small-llms-still-significantly","repo_url":"https://github.com/mnbucher/text-cls-llms","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"classification-1","task_name":"Classification"},{"task_slug":"text-classification","task_name":"Text Classification"},{"task_slug":"text-classification-1","task_name":"text-classification"}],"methods":[{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"attention-dropout","method_name":"Attention Dropout"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"cosine-annealing","method_name":"Cosine Annealing"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"gpt-3","method_name":"GPT-3"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"linear-warmup-with-cosine-annealing","method_name":"Linear Warmup With Cosine Annealing"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"set","method_name":"SET"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"weight-decay","method_name":"Weight Decay"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2406.08660","atlas_url":"https://app.syntology.ai/?focus=2406.08660","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2406.08660"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/mnbucher/text-cls-llms","reach":{"status":"ok"}}],"summary":{"ran":5,"unverified":4},"by_repo_kind":{"official":{"samples":9,"ran":5,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":9,"samples":[{"code_sha256_prefix":"a2051e248b14b503","entry":"encode_sentence","repo":"mnbucher/text-cls-llms","repo_kind":"official","path":"01-reproduction-material/src/finetuning.py","file_url":"https://github.com/mnbucher/text-cls-llms/blob/HEAD/01-reproduction-material/src/finetuning.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a2051e248b14b503"}},{"code_sha256_prefix":"9a5dd54441d4ea7a","entry":"get_model_name_from_lang_model_and_lang","repo":"mnbucher/text-cls-llms","repo_kind":"official","path":"01-reproduction-material/src/models.py","file_url":"https://github.com/mnbucher/text-cls-llms/blob/HEAD/01-reproduction-material/src/models.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"9a5dd54441d4ea7a"}},{"code_sha256_prefix":"e5b6cbb6e2b4363d","entry":"get_model_name_from_lang_model_and_lang","repo":"mnbucher/text-cls-llms","repo_kind":"official","path":"02-pipeline/src/models.py","file_url":"https://github.com/mnbucher/text-cls-llms/blob/HEAD/02-pipeline/src/models.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e5b6cbb6e2b4363d"}},{"code_sha256_prefix":"a93fafe655ef6852","entry":"get_tgseed","repo":"mnbucher/text-cls-llms","repo_kind":"official","path":"01-reproduction-material/src/finetuning.py","file_url":"https://github.com/mnbucher/text-cls-llms/blob/HEAD/01-reproduction-material/src/finetuning.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a93fafe655ef6852"}},{"code_sha256_prefix":"4c994acec255dc82","entry":"read_x_from_csv","repo":"mnbucher/text-cls-llms","repo_kind":"official","path":"01-reproduction-material/src/finetuning.py","file_url":"https://github.com/mnbucher/text-cls-llms/blob/HEAD/01-reproduction-material/src/finetuning.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4c994acec255dc82"}},{"code_sha256_prefix":"c21d6362172de95b","entry":"get_ptlm_for_classification","repo":"mnbucher/text-cls-llms","repo_kind":"official","path":"01-reproduction-material/src/models.py","file_url":"https://github.com/mnbucher/text-cls-llms/blob/HEAD/01-reproduction-material/src/models.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c21d6362172de95b"}},{"code_sha256_prefix":"87e1657db27fda53","entry":"get_ptlm_for_classification","repo":"mnbucher/text-cls-llms","repo_kind":"official","path":"02-pipeline/src/models.py","file_url":"https://github.com/mnbucher/text-cls-llms/blob/HEAD/02-pipeline/src/models.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"87e1657db27fda53"}},{"code_sha256_prefix":"34b095dba77ad66b","entry":"get_tokenizer","repo":"mnbucher/text-cls-llms","repo_kind":"official","path":"01-reproduction-material/src/models.py","file_url":"https://github.com/mnbucher/text-cls-llms/blob/HEAD/01-reproduction-material/src/models.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"34b095dba77ad66b"}},{"code_sha256_prefix":"23a49bd4b8a51c34","entry":"get_tokenizer","repo":"mnbucher/text-cls-llms","repo_kind":"official","path":"02-pipeline/src/models.py","file_url":"https://github.com/mnbucher/text-cls-llms/blob/HEAD/02-pipeline/src/models.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"23a49bd4b8a51c34"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}