{"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/neural-symbolic-collaborative-distillation","title":"Neural-Symbolic Collaborative Distillation: Advancing Small Language Models for Complex Reasoning Tasks","arxiv_id":"2409.13203","date":"2024-09-20","proceeding":null,"authors":["Huanxuan Liao","Shizhu He","Yao Xu","Yuanzhe Zhang","Kang Liu","Jun Zhao"],"abstract":"In this paper, we propose $\\textbf{Ne}$ural-$\\textbf{Sy}$mbolic $\\textbf{C}$ollaborative $\\textbf{D}$istillation ($\\textbf{NesyCD}$), a novel knowledge distillation method for learning the complex reasoning abilities of Large Language Models (LLMs, e.g., \\textgreater 13B). We argue that complex reasoning tasks are difficult for Small Language Models (SLMs, e.g., $\\leq$ 7B), as these tasks demand not only general cognitive abilities but also specialized knowledge, which is often sparse and difficult for these neural-based SLMs to effectively capture. Therefore, NesyCD distills the general capabilities and specialized knowledge in LLMs using different manners. On the one hand, we distill only general abilities from teacher LLMs into the student SLMs of parameterized neural networks. On the other hand, for the specialized abilities and uncommon knowledge of a complex reasoning task, we employ a symbolic knowledge distillation approach to obtain and store the specialized knowledge within a symbolic knowledge base (KB). By decoupling general and specialized capabilities, the proposed NesyCD can achieve superior performance cost-effectively, utilizing smaller models and blending parameterized neural networks with symbolic KB. Moreover, the specialized KB generalizes well and is comprehended and manipulated by humans. Our experiments show that NesyCD significantly boosts SLMs' complex reasoning performance on in-domain (BBH, GSM8K) and out-of-domain (AGIEval, ARC) datasets. Notably, our approach enabled the LLaMA3-8B and Qwen2-7B to surpass GPT-3.5-turbo in performance and come close to matching LLaMA3-70B, despite the latter having nine times more parameters. Our code will be available at https://github.com/Xnhyacinth/NesyCD.","url_abs":"https://arxiv.org/abs/2409.13203v2","url_pdf":"https://arxiv.org/pdf/2409.13203v2.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":"neural-symbolic-collaborative-distillation","repo_url":"https://github.com/xnhyacinth/nesycd","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"arc","task_name":"ARC"},{"task_slug":"gsm8k","task_name":"GSM8K"},{"task_slug":"knowledge-distillation","task_name":"Knowledge Distillation"}],"methods":[{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"attention-dropout","method_name":"Attention Dropout"},{"method_slug":"base","method_name":"BASE"},{"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":"knowledge-distillation","method_name":"Knowledge Distillation"},{"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":"softmax","method_name":"Softmax"},{"method_slug":"weight-decay","method_name":"Weight Decay"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2409.13203","atlas_url":"https://app.syntology.ai/?focus=2409.13203","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2409.13203"}},"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/xnhyacinth/nesycd","reach":{"status":"ok"}}],"summary":{"ran":2,"ran_draft_wrong":2,"unverified":3},"by_repo_kind":{"official":{"samples":7,"ran":4,"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":7,"samples":[{"code_sha256_prefix":"2d8b124f7d3e6ac5","entry":"add_prompt","repo":"xnhyacinth/nesycd","repo_kind":"official","path":"inference.py","file_url":"https://github.com/xnhyacinth/nesycd/blob/HEAD/inference.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":"2d8b124f7d3e6ac5"}},{"code_sha256_prefix":"2dfa6c5cb8089dca","entry":"clustering_prompt","repo":"xnhyacinth/nesycd","repo_kind":"official","path":"inference.py","file_url":"https://github.com/xnhyacinth/nesycd/blob/HEAD/inference.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2dfa6c5cb8089dca"}},{"code_sha256_prefix":"57583cf880d95444","entry":"jsonify","repo":"xnhyacinth/nesycd","repo_kind":"official","path":"src/llamafactory/api/common.py","file_url":"https://github.com/xnhyacinth/nesycd/blob/HEAD/src/llamafactory/api/common.py","link_basis":"harvester_set","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":"57583cf880d95444"}},{"code_sha256_prefix":"ed1a7cdd6a385a75","entry":"readfiles","repo":"xnhyacinth/nesycd","repo_kind":"official","path":"mainfunc.py","file_url":"https://github.com/xnhyacinth/nesycd/blob/HEAD/mainfunc.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ed1a7cdd6a385a75"}},{"code_sha256_prefix":"3f5cda900eb73d2b","entry":"create_score_evaluation_response","repo":"xnhyacinth/nesycd","repo_kind":"official","path":"src/llamafactory/api/chat.py","file_url":"https://github.com/xnhyacinth/nesycd/blob/HEAD/src/llamafactory/api/chat.py","link_basis":"harvester_set","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":"3f5cda900eb73d2b"}},{"code_sha256_prefix":"87aa9acaa81294f5","entry":"dictify","repo":"xnhyacinth/nesycd","repo_kind":"official","path":"src/llamafactory/api/common.py","file_url":"https://github.com/xnhyacinth/nesycd/blob/HEAD/src/llamafactory/api/common.py","link_basis":"harvester_set","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":"87aa9acaa81294f5"}},{"code_sha256_prefix":"594719226a2462d1","entry":"run_embeddings","repo":"xnhyacinth/nesycd","repo_kind":"official","path":"inference.py","file_url":"https://github.com/xnhyacinth/nesycd/blob/HEAD/inference.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":"594719226a2462d1"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}